PhEmail:基于Python的的开源网络钓鱼测试工具

桂林seo半杯酒博客

PhEmail简介

PhEmail是一款采用的Python编程语言开发的开源网络钓鱼邮件工具,它可以帮助研究人员在进行社会工程学测试的过程中自动化地给目标发送网络钓鱼邮件.PhEmail不仅可以同时向多个目标用户发送钓鱼邮件并识别出哪些用户点击了邮件,而且还可以在不利用任何浏览器漏洞或邮件客户端漏洞的前提下尽可能多地收集信息.PhEmail自带的引擎可以通过LinkedIn来收集电子邮箱地址,这些数据可以帮助测试人员完成信息采集阶段的一部分工作。

除此之外,PhEmail还支持Gmail的身份验证,这一功能在目标站点屏蔽了邮件源或IP地址的情况下会非常有用。值得一提的是,该工具还可以克隆目标组织或企业的门户网站登录界面,测试人员可以用这些伪造的页面来窃取目标用户的登录凭证。

使用样例

一般来说,第一步是收集目标企业的邮箱地址.PhEmail的搜索引擎在收集到了企业邮箱地址之后,会将它们保存在一个文件中,演示代码如下:

# phemail.py -g1@example.comGathering emails from domain:example.com10 0% Completed!test@example.comtest2@example.com […] emails.txt updated

得到了企业邮箱地址之后,接下来就要创建钓鱼邮件模板了。模板中的每一个URL必须要包含一个字符串” {0}”,因为脚本会自动将这个字符串替换成正确的URL地址。一次真实的测试场景截图如下:

接下来,我们需要在网络服务器上安装PHP环境并将PHP文件”的index.php”复制到网络服务器的根目录下。这个文件中包含的Java的代码会收集浏览器信息并将其保存到/ tmp目录目录。下的日志文件中演示实例如下:

# phemail.py -e test-emails.txt -f"Fast Holiday "-r "Fast Holiday "-s

"Last MinuteHoliday"-b body.txt -w http://YOUR-WEBSITE.comSMTP server:

mail.example.com Sent to test@example.comError: sending tonotExist-email@example.com Phishing URLs point to http: //YOUR-WEBSITE.comPhemail.py logfile saved:

phemail- log-12-07-2012_15 -42.txt

接下来,你只需要等待目标用户点击钓鱼邮件,然后你就能够收集到目标用户的某些浏览器信息了:

Email: test@example.comDate: Thu 12/ 07/ 201211: 00: 13IP: 192.168.0.123User Agent: Mozilla/ 5.0(Windows NT 6.1;WOW64; rv: 13.0) Gecko/ 20100101

Firefox/ 13.0.1appCodeName: Mozilla appName:Netscape appVersion: 5.0(Windows)

appMinorVersion: undefinedproduct: GeckocookieEnabled: truecpuClass: undefined

onLine: trueopsProfile: undefineduserProfile: undefinedlanguage: en-US platform:

Win32 systemLanguage: undefineduserLanguage: undefinedflash: Enabled Plugins:

Google UpdateShockwave Flash 11.3r300 Google Talk Plugin Video Acceleratorversion:

0.1.44.16Version 3.1.4.81405.1.10411.0Adobe PDF Plug-In For Firefoxand Netscape

10.1.3NPRuntime Plug- inLibrary forJava? Deploy VmwareRemote Console and

Client Integration Plug- inBlackBerry WebSL Browser Plug-InBing Bar The plug- in

allows you to open andedit files using Microsoft Officeapplications Office

Authorization plug- inforNPAPI browsers PhEmail项目主页 工具下载

你可以直接通过克隆PhEmail的GitHub的代码库来完成工具的下载:

git clonehttps: //github.com/Dionach/PhEmail

工具使用 PHishing EMAIL tool v0 .13Usage: phemail.py [-e <emails>] [-m<mail_server>] [-f

<from_address>] [-r <replay_address>] [-s<subject>] [-b <body>] -e emails: File containing list ofemails(Default: emails.txt) -f from_address: Source emailaddress displayed inFROM field

of the email (Default: Name Surname<name_

surname@example.

com>) -r reply_address: Actual emailaddress used to send the emails

incase that people reply to the email

(Default: Name

Surname <name_surname@example.com>) -s subject: Subject oftheemail (Default: Newsletter) -b body: Body ofthe email(Default: body.txt) -p pages: Specifies number ofresults pages searched (Default:

10pages) -v verbose: Verbose Mode(Default: false) -l layout: Send email with noembedded pictures -B BeEF: Add the hook forBeEF -m mail_server: SMTP mailserver to connect to -g Google: Use a google accountusername:password -t Time delay: Add deleaybetween each email (Default: 3sec) -R Bunch ofemails per time(Default: 10emails) -L webserverLog: Customise thename ofthe webserver log file

(Default: Date time informat "%d_%m_%Y_%H_%M") -S Search: query onGoogle -d domain: ofemail addresses -n number: ofemails perconnection (Default: 10emails) -c clone: Clone a web page -w website: where the phishingemail link points to -o save output ina file -F Format (Default: 0): 0- firstname surname 1- firstname.surname@example.com 2- firstnamesurname@example.com 3- f.surname@example.com 4- firstname.s@example.com 5-surname.firstname@example.com 6- s.firstname@example.com 7- surname.f@example.com 8- surnamefirstname@example.com 9- firstname_

免责声明

请不要在没有得到目标用户事先同意的情况下实用PhEmail来进行测试,由使用者自身使用不当所带来的问题开发人员不承担任何责任,同时我们也对PhEmail所带来的损失概不负责,请大家妥善使用。

其他参考资料

1.https://www.dionach.com/blog/phemailpy-another-social-engineering-tool

2.https://www.dionach.com/blog/social-engineering-and-phishing-email-attacks