sex.py 2.0
Extract valid e-mail addresses from all kind of files. With sex.py you can extract a list of emails from a defaced text file or even scan recursively through a directory and all its content.
A scenario could be to download a website to your local hard-drive and use sex.py to harvest all email addresses. Once you have an output-file including some email addresses you can also use sex to verify the accounts. Works great with MetaGooFil! ;)
Highlights:
- Switch the search pattern to match valid email addresses
- Scan a single file or multiple files form a directory (including subdirectories)
- Sort the addresses of the output file
- Remove duplicated emails
- Change output mode
- exclude files by their extension
- verify email accounts
- python (tested with python 2.6.2)
- dnspython
- improved CLI
- -y verify email accounts
- -e exclude extensions
- various code improvements
- fancier output
You can set default values by editing the source file.
verbose = n
0 no output
1 print the email addresses e.g. if you want to pipe them
2 output email addresses, current file and grand total
sort = n
0 write email addresses to destination file as found
1 sort addresses in alphabetical order
remove_duplicates = n
0 capture all addresses
1 remove duplicated emails
exclude_ext = ["x","y",...]
x,y = file extensions you want to exclude
Usage:
sex.py [options] <source> <destination>
sex.py [-lqsr] [-e ext1,ext2] <source> <destination>
sex.py -y <file>
source: absolute path to a file or directory
destination: path to write the output file
file: output-file including a list of email addresses
Options:
-l display email addresses only
-q silent output mode
-s sort addresses in alphabetical order
-r remove duplicated emails
-e EXTENSION exclude files by extension
-y FILE verify emails from file
Example:
$ python metagoofil.py -d microsoft.com -l 20 -f all -o micro.html -t micro-files
...
[ 19/21 ] http://research.microsoft.com/pubs/79881/siggraph2008.ppt
[ 20/21 ] http://www.microsoft.com/hk/msdn/download/MSDN_011214.ppt
[ 21/21 ] http://research.microsoft.com/pubs/73115/wsdm09_dcm.ppt
[+] Process finished
$ python sex.py -sr -e xls micro-files/ addresses.txt
>> FILE: micro-files/03SecEnh.doc
>> FOUND: exchdocs@microsoft.com
>> FOUND: exchdocs@microsoft.com
>> FILE: micro-files/5176.cff.pdf
>> FILE: micro-files/advreport.doc
>> FILE: micro-files/Age_of_Mythology_Strategy_Sample_Chapter.pdf
!> EXCLUDE: micro-files/australia.xls
>> FILE: micro-files/Benchmarks.ppt
...
>> Extraced email addresses: 43
$ python sex.py -y addresses.txt
NSWish@microsoft.com,mail.messaging.microsoft.com,550,5.7.1 Service unavailable; Client host [86.32.184.116] blocked using Spamhaus PBL, mail from IP banned; To request removal from this list see http://www.spamhaus.org/lookup.lasso.
....
!> FAILED: 2.WV
....
$ äähhh i think they don`t like me
Download:
sex-2.0.1.tar.gz