Archive

Posts Tagged ‘SMTP’

More on Mdutil

by .hac on January 12th, 2009

Yes, not really security related again. I think Mdutil is very useful and powerful, but there is too limited resources discussing use of it, so I want to talk a little bit more about my experience of using it. I am still working with IIS SMTP this time, because I have many test cases need to interact with SMTP server, and IIS SMTP is the “simplest” server that suit our requirement. Unfortunately, IIS virtual SMTP server is too simple that you cannot find a way to configure the advanced features in the given UI. (You can download IIS Resources Toolkit (eg. IIS6) to gain access to these configurations). This time, my task is to add some routing domains (around 30) to the virtual SMTP server. If you tried to add routing domains to virtual SMTP server through IIS Manager, you will know how painful it is if you need to add many routing domains at the same time. So we have Mdutil to modify the metabase keys, a list of routing domains that we need to add, and I am planning to write some code to generate scripts (more accurate, a list of Mdutil commands) to add these domains.

First of all, we need to know how the structure of domains stored in metabase before designing the scripts to add a routing domain. Let’s manually add a routing domain (eg. log0.onhacks.org) to the server through IIS Manager. After that, run the command to see what happened in the Domain path. Remeber the command?

mdutil enum -path:smtpsvc/<n>/Domain

Then you will see output similar to the following:

KeyType : [S] <String> “IIsSmtpDomain”
[smtpsvc/<n>/Domain/log0.onhacks.org]

Which means when adding a new routing domain, the SMTP server will create a child under Domain. Is this child contain no data? Obviously not! Because there are two types of routing domain that we can create in IIS SMTP server, Local (ie. Alias) and Remote. So, at least, there is a data stored in this child. By running the following command,

mdutil enum -path:smtpsvc/<n>/Domain/log0.onhacks.org

Since I added this domain with Alias type. You will get the result as following:

KeyType : [S] <String> “IIsSmtpDomain”
36946 : [IS] <DWORD> 0×10 = {16}

It matchs what we expect and no extra value need to be added in this branch. By the observation, we should have at least 3 mdutil commands to add a new branch under smtpsvc/<n>/Domain. We should first take a look on the operations provided by mdutil. Type in mdutil without arguments, you should see the help of mdutil. Following is the highlight of commands that may be useful for our task.

mdutil SET      path value …   – assign the new value
mdutil CREATE   path             – create given path

After a little experiment, I discover that CREATE operation is used to create a new branch, and by using SET, we can add a new variable in the node. So the steps to import a routing domain is as follow (eg. Import dotHac.onhacks.org).

Create a branch:

mdutil CREATE -path:smtpsvc/<n>/Domain/dotHac.onhacks.org

Add a variable KeyType to the branch:

mdutil SET -path:smtpsvc/<n>/Domain/dotHac.onhacks.org -prop:KeyType -utype:UT_SERVER -dtype:STRING -value:”IIsSmtpDomain”

Add a variable for the routing action (value: 16 = local domain, 2 = remote domain):

mdutil SET -path:smtpsvc/<n>/Domain/dotHac.onhacks.org -prop:36946 -utype:UT_SERVER -dtype:DWORD -value:16

When you open IIS manager, you will see the domain has been imported. Pretty cool, isn’t it? The next step is to generate a list of mdutil commands for batch import. My approach is to read list of the domains and its routing action into a program and the program will generate mdutil commands for each them. Here is an example in Python version.

Enjoy! Happy New Year!

ps. Is anyone know if we can use mdutil to access properties of DNS server? I would like to switch on/off the DNS referral feature in Windows DNS server.

Email, Windows , , ,

加密與壓縮

by .hac on January 1st, 2009

有大量的流動之間的郵件服務器每天不同的電子郵件。與此同時,在現實世界中,在大多數國家,帶寬是衡量你的帳單。如果您所在的電子郵件服務器,您可以總是希望盡量減少帶寬使用。平凡的解決辦法是使用壓縮的服務器時,提供的信息。壓縮是一個非常普遍的技術,我們使用,以盡量減少存儲容量的數據,主要有兩種不同的類別,無損和有損。當我們壓縮電子郵件,無損壓縮必須使用,以確保數據的完整的壓縮後的減壓過程。在徵求意見文檔( RFC )中,有許多著名的無損壓縮方法壓縮部署不同協議(如TLS的,按購買力平價) ,他們壓縮, gzip格式壓縮並LZW 。當然,還有一些非標準化的壓縮方法的議定書。

電子郵件服務器應當使用安全通道時,提供敏感信息。總之,我們應該使用安全通道傳輸數據時,在網絡中。為了簡化程序,傳輸層安全( TLS )是一個以提供一個安全通道在傳輸過程中。 TLS的是一種狀態密碼協議來決定非對稱密鑰的發送和接收過程中使用的通信。

最後,在你讀長期言,現在我想提一個問題。如果我想都盡量減少帶寬使用的傳輸和安全傳輸,我要壓縮和加密的數據傳送之前,之間的區別是什麼壓縮,加密(壓縮數據的安全通道)和加密壓縮(加密數據在壓縮頻道)?有哪些優點和缺點這兩個辦法?海事組織,壓縮,加密,可能會更安全的加密功能,因為包裹整個郵件。雖然加密壓縮是安全的,它可能暴露時間的長短的信息,看壓縮歷史。需要同時輸入塊大小的壓縮和加密是相同的,否則緩衝所需的傳輸。的優點是加密壓縮是我們可以保證壓縮塊大小是固定的,因為在大多數情況下,我們使用公開密鑰加密方法有塊大小為2n位。

還有一些存在的壓縮標準的加密協議(如TLS的壓縮) 。歡迎來看看,可能是你可以拿出一些想法的優點和缺點這兩個不同的方法。我期待著與您有討論這些方法。

思想,意見和建議都歡迎您!

Email , , ,