Showing posts with label email hacking. Show all posts
Showing posts with label email hacking. Show all posts

Sunday, February 1, 2009

Making a mail list from all mailing addresses lying around

I was recently on a project of spreading words about my new magazine, for which I was not getting contributors. The best idea I could think of, was to mail people and let them know about it. So, I got out all mail addresses from my orkut account, my address book, and some mail list that used to email all recipients in one go, from which I got most of the addresses. Now, the problem was that, I could not make it typing 1070 email addresses in the To field of my email client. I had to get them in one csv (comma separated value) list. This article would rather be a how to on this topic. I wrote programs for that, whose source code is freely available here along with makefiles and a readme file.

  1. The first thing was to get the list in a file in some format. The mail list was the first target, which had many addresses. So, I had them in space (' ') separated format. So, I wrote a program eliminateduplication, which will also eliminate the duplication of email addresses, that is two addresses in the same list, and give the output in another file in csv format.
  2. The second source of addresses was Orkut. I pulled out all contacts in csv format. But, this time it had the names as well. So, I had to open it in a spreadsheet program. Although I used Open Office, Microsoft Excel will do fine. Then all I did, was copy the specific column containing the email addresses, and pasted in a file, where the addresses got separated by Enter. For this, I used the program crlf_to_space, which will take input from the file maillist.13 and put it in a space separated file maillist, which can be later put in maillist.csv.
  3. The last thing I did, was open the maillist.csv file in a text editor (kwrite, gedit and notepad are examples), and copied the whole list to the To field. The problem was solved.
The programs are made with standard C functions. So, the program should compile with any gnu compatible compiler, like gcc in Linux and mingw in Windows. Other compilers will also work, but one will have to compile the individual files, because the Makefile is GNU compatible.

Instructions:
  • Do not delete the maillist file, because any later additions can be done to it, and eliminateduplications will just write those in csv format to maillist.csv, overwriting any existing addresses.
  • Download your gmail contacts in csv, and copy email addresses as instructed earlier. Then use crlf_to_space, to append those addresses to the maillist file. This will not overwrite the already existing addresses in that file.
  • After this, use the eliminateduplications program to save the space separated email addresses in maillist to maillist.csv in csv format.
Application:
  • These programs can be useful in gathering various email addresses from different locations, and using them all in one go, without having to type the individual messages.
Download The Mailing List Project:

Tuesday, December 4, 2007

Tracking down an email



Email tracing has been one of the prime considerations of the authorities. It has been the most basic task of the authorities, in the tracing of a mail, down to the door. And not surprisingly, it is also, the most easy thing to do. Though the amount of information is very limited, but still, this can provide the IP of the sender at the time of the mail sending, and that's no less than an important achievement.

This is accomplished by studying the email headers. If the IP is from a registered network, then we can know the exact location of the sender, along with the street address, but is it a personal internet connection, we can only know the name of the company, which the sender is sending from, that is the ISP(Internet Service Provider).

Now, we get to the real thing. We consider an example email header, from which, we trace the mail back to the sender.

Here's a sample mail header:

This one is the header of a mail from McAfee.
Example 1

From McAfee Fri Aug 24 04:11:46 2007
X-Apparently-To: xtreme_the_great1@yahoo.co.in via 202.43.219.101; Sat, 25 Aug 2007 21:45:41 +0530
X-Originating-IP: [216.49.92.103]
Return-Path:
Authentication-Results: mta125.mail.in.yahoo.com from=mcafee.com; domainkeys=neutral (no sig)
Received: from 216.49.92.103 (HELO mcafee.com) (216.49.92.103) by mta125.mail.in.yahoo.com with SMTP; Sat, 25 Aug 2007 21:45:40 +0530
X-Mailer: UnityMail
Errors-To:
Originator:
X-Mailer-Version: 5.1.182
X-UnityID: <20070823224146.hxfcjbysebaaa3aumail4.xtreme_the_great1@yahoo.co.in@unity4.mcafee.com>
X-UnityUser: McAfee
Reply-to: "McAfee"
From:"McAfee" Add to Address BookAdd to Address Book
To:"xtreme_the_great1@yahoo.co.in"
Subject: McAfee Security Brief 08.07: Microsoft Vulnerabilities
Date: Thu, 23 Aug 2007 15:41:46 -0700
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0963_01C7E5D6.C90B46F0"
Thread-Index: AcfmEXVgCOCwhz8cS5K6y62QtMC7QQ==
Content-Class: urn:content-classes:message
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
Content-Length: 19546


The X-originating IP is the IP of the mail server, that is the smtp server used in the process. These servers, are the machines, that are used for sending mails in the Internet. In this case, it is 216.49.92.103. The sending machine's IP can also be figured out from the mail header itself. We can figure it out by examining the Received fields, which in this case reads:

Received: from 216.49.92.103 (HELO mcafee.com) (216.49.92.103) by mta125.mail.in.yahoo.com with SMTP; Sat, 25 Aug 2007 21:45:40 +0530

The sending IP here is thus, the same as that of the first mail server used in the process. That is: 216.49.92.103.

But, cases may not be like this.

We consider another case, where there are multiple mail servers used in the process.


Example 2

X-Apparently-To: xtreme_the_great1@yahoo.co.in via 202.43.219.149; Sun, 25 Mar 2007 18:02:32 +0530
X-Originating-IP: [202.43.219.31]
Return-Path:
Authentication-Results: mta135.mail.in.yahoo.com from=yahoo.co.in; domainkeys=pass (ok)
Received: from 202.43.219.31 (HELO web8316.mail.in.yahoo.com) (202.43.219.31) by mta135.mail.in.yahoo.com with SMTP; Sun, 25 Mar 2007 18:02:32 +0530
Received: (qmail 84649 invoked by uid 60001); 25 Mar 2007 12:32:32 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=0s8bAtp2vC7RFSCYSfLno7bSWfAP6ebccb/weUTLZiw/rWfNuCgFdZvZUc9iMyUkgYuxqjz7WX3LqbMS8L8Qpyg4sM+M+BR2YQt50I330raEEFk5kuAjjGCNOZBe8zFphRNtIeAsOFJ8keIEQ+0kzbPdJQ0xuon7g7mDTyJv0Tw=;
X-YMail-OSG: jC_yrKkVM1n7FtpNbkqEXJdYRgDvi3PDe0HUOmSPKTBwyHwm_1crZ.fBVw6xODaYBudsxpwFsOtmkF6_lYfGUTo.FBDkKgfTLsoHun6qK.irkJFE.QqhNsPs2JfHOpVQDVVdACQ4HUZ7A9SFDqR7KA6pTw--
Received: from [122.168.69.140] by web8316.mail.in.yahoo.com via HTTP; Sun, 25 Mar 2007 13:32:31 BST
Date: Sun, 25 Mar 2007 13:32:31 +0100 (BST)
From:Send an Instant Message "sooraj elamana" Add to Address BookAdd to Address Book
Yahoo! DomainKeys has confirmed that this message was sent by yahoo.co.in. Learn more
Subject: Proxy Lists by Sooraj E
To:xtreme_the_great1@yahoo.co.in
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="0-575879626-1174825951=:84636"
Content-Transfer-Encoding: 8bit
Message-ID: <34533.84636.qm@web8316.mail.in.yahoo.com>
Content-Length: 58637

Here, we see the Received fields, and deduce, what we are supposed to deduce.: The IP of the sender, at the time of sending the message. The X-Originating IP is 202.43.219.31, which is the IP of the first mail server in the path. Then we come to the point.

The first Received field says, that the message was obtained from 202.43.219.31 a.k.a. web8316.mail.in.yahoo.com, that is, the computer introduced itself to the mail server mta135.mail.in.yahoo.com as web8316.mail.in.yahoo.com.

The second one says, that the message was obtained from 122.168.69.140 by web8316.mail.in.yahoo.com via HTTP, that is, the sender used a web browser, to send the email.

Then, to find more information about the sender, we lookup the obtained IP 122.168.69.140 with the nslookup command, which returns the following:

Name: ABTS-MP-dynamic-140.69.168.122.airtelbroadband.in
Address: 122.168.69.140

That is the sender's ISP is Airtel broadband, and he is situated in India, in the state Madhya Pradesh (Deduced from the ABTS-MP) and the IP is a dynamic IP address, that is the next time the sender logs on to the ISP, he'll have a new IP.

In the next post, I'll demonstrate how I traced down a sender to his college, and got a phone number, so that I could talk to him! Keep checking. :)

Wednesday, November 14, 2007

Email forging




Email forging has always been one of the easiest forms of email hacking ever used. It has been well known in the hacking community for quite a long time.

All one needs to know while forging email, is the basic knowledge of how the SMTP works. SMTP stands for Simple Mail Transfer Protocol - The protocol(set of instructions and rules) used to send email in the Internetwork. The total set of the step by step instructions from client to server can easily be found in any rfc database. Click here for the rfc relating to the SMTP. This link is for those, who are real PUJARIES of ultimate knowledge. Not for dummies...

A tutorial on how to forge email through any command prompt, can be very easily found in the Internet. So, I will not reinvent the wheel by redescribing the whole process here. The following link will show the simple tutorial on how to forge a simple email. Advanced email forging including attaching files in the mail will be posted soon in this blog. Keep checking.

The tutorial
.