How to capture users' emails to ensure information security
Source: Internet
Author: User
Article Title: how to capture users' emails to ensure information security. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I. Environment
The company's Internet Mail System is Exchange 5.5. Considering the security of NT and exchange, the system is not directly connected to the Internet, but placed in the LAN, through an SMTP forwarding host (dual Nic, connected to internal and external network segments) forward the email. At the same time, through the settings of MX records in DNS, emails sent to company users are also forwarded to exchange through the SMTP host. FreeBSD 4.3-Release is used for the SMTP forwarding host operating system, and Postfix release-20010228 + pattern, 2, and 3 are used for the mail system.
Ii. Requirements
How can I capture users' emails? If you send emails to or from a company user, you can transfer them without any trace. I looked at the configuration documents of Exchange 5.5 and Postfix, and it seems that there are no such settings (if anyone knows, let me know, thank you !). Fortunately, although I am not a programmer, I still haven't lost my C skills in college. Then download release-20010228 and its pattern, 2, and 3 from www.postfix.org, and try to modify the source code.
3. Modify
The environment is in FreeBSD 4.3-Release (it should be okay in linux ). First, upload release-20010228.tar.gz to a directory in the system. Run:
# Tar zxvf releasing-20010228
The release-20010228 directory will be generated in the current directory, the patch will be uploaded to this directory, run:
# Patch <postfix-20010228-patch01.gz
# Patch <postfix-20010228-patch02.gz
# Patch <postfix-20010228-patch03.gz
A. Go to the src/pickup directory and use vi to open pickup. c. Search for copy_segment, find the copy_segment function, and add the variable Declaration: VSTRING * spy in int check_first = (* expected = REC_TYPE_CONTENT [0;
The following 10 rows show:
If (type = REC_TYPE_RCPT)
If (info-> rcpt = 0)
Info-> rcpt = mystrdup (vstring_str (buf ));
Change it:
If (type = REC_TYPE_RCPT)
If (info-> rcpt = 0)
{
Info-> rcpt = mystrdup (vstring_str (buf ));
Spy = vstring_alloc (20 );
Vstring_strcpy (spy, "xxx@xxx.xxx");/* Add the xxx@xxx.xxx to the receiver list */
REC_PUT_BUF (cleanup, type, spy );
Vstring_free (spy );
}
B. Go to the src/smtpd directory, use vi to open smtpd. c, search rcpt_cmd, find the rcpt_cmd function, and go down to thirty lines to see:
Rec_fputs (state-> cleanup, REC_TYPE_RCPT, "xxx@xxx.xxx ");
State-> rcpt_count ++;
}
Then return to the release-20010228 directory and run make; make install to re-compile and install.
· The change at A is that the local users of the postfix mail system will insert A receiver xxx@xxx.xxx in the recipient, which is not very useful in fact, because no one will use mail to send emails on UNIX terminals.
· The modification at section B is to insert a receiver xxx@xxx.xxx in the recipient for all emails transferred or transferred through the smtp protocol. In the above environment, the modification here is the key.
In this way, as long as the mail is processed by the postfix, The xxx@xxx.xxx can receive a copy!
Iv. Remarks
1. the email recipient does not see the xxx@xxx.xxx account in the recipient's column.
2. Estimate the mail traffic that the postfix processes on a daily basis to prevent the monitoring mailbox from exploding. In the above example, I used a 50 m mailbox and it took me half a day! Then send a letter to each sender, said xxx@xxx.xxx is full, then scared me, and quickly expand the mailbox to 500 M. (Remember !!!)
3. In the code, the msg_info function is a logging function, which can be customized as needed.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service