Ejemplo n.º 1
0
def discord():
    print(u"{}[2J{}[;H".format(chr(27), chr(27)))  # Clear the terminal
    print(
        style.YELLOW(
            '--Fill the folowing credentials for Discord phishing email--'))
    username = str(
        input(style.GREEN('[+]') + style.RESET(' Displayed username: '******'[+]') + style.RESET(' Phishing URL: ')))
    country = str(input(style.GREEN('[+]') + style.RESET(' Login country: ')))
    city = str(input(style.GREEN('[+]') + style.RESET(' Login city: ')))
    ip = str(
        input(
            style.GREEN('[+]') +
            style.RESET(' Login device IP [Eg: 162.243.110.124]: ')))

    if not url.startswith('http://') or not url.startswith('http://'):
        url = f"http://{url}"
    else:
        None
    with open('Templates/Discord.html', 'r') as read_file, \
     open('Templates/Generated_Emails/DiscordTemplate.html', 'w') as write_file:
        for line in read_file:
            write_file.write(
                line.replace('#USERNAME',
                             username).replace('#URL', url).replace(
                                 '#COUNTRY',
                                 country).replace('#CITY',
                                                  city).replace('#IP', ip))
Ejemplo n.º 2
0
def info():
    print (u"{}[2J{}[;H".format(chr(27), chr(27)))     # Clear the terminal
    print(r'''
                      PyMailPhisher
----------------------------------------------------------
Version: 1.0.0
Author : Pr0xy07
Author's Email: [email protected]
Date Published: 20/5/2020''')

    print(style.GREEN('''\n◇ Info: ''') + style.RESET('''
PyMailPhisher is one of a few email phishers out there it
works by generating a phishing html page that then will be
sent as an email to your victim hoping they fall for it!''' ))


    print(style.GREEN('''\n◇ Bugs and Help: ''') + style.RESET('''
If you find any bugs, issues in PyMailPhisher feel free to
raise an issue on the GitHub repository of this tool so
me and the community can help.''' ))

    print(style.GREEN('''\n◇ Contributions and Ideas: ''') + style.RESET('''
Feel free to contact if you are interested in helping me
improve this tool.''' ))

    print(style.RED('''\n◇ Warning: ''') + style.RESET('''
You should only use this app for legal penetration testing
or educational purposes only as I am not responsible for any
damage caused by PyMailPhisher.''' ))
Ejemplo n.º 3
0
def main_function():
    if os.path.isdir('Templates/Generated_Emails') == False:
        os.mkdir('Templates/Generated_Emails')
    else:
        None

    print (u"{}[2J{}[;H".format(chr(27), chr(27)))     # Clear the terminal
    print(style.RESET("-- PyMailPhisher Main Menu --"))
    print(style.GREEN('\n[1]') + style.RESET(' Generate a phishing page.'))
    print(style.GREEN('[2]') + style.RESET(' Send a phishing email.'))
    print(style.GREEN('[3]') + style.RESET(' About PyMailPhisher'))
    print(style.GREEN('[4]') + style.RESET(' Exit PyMailPhisher'))
    try:
        mode_option = int(input(style.YELLOW('\n[+]') + style.RESET(' Enter mode ID: ')))
    except:
        print(style.RED('\n[!]') + style.RESET(' Wrong input, exiting...'))
        sys.exit()

    if mode_option == 1:
        # Generate email templates
        generate_email()
    elif mode_option == 2:
        # Send mail
        mailer()
    elif mode_option == 3:
        # Info
        info()
    elif mode_option == 4:
        #exit
        sys.exit()
Ejemplo n.º 4
0
def dump_ids():
    clear()
    date = datetime.now().strftime("%H:%M:%S")
    time = datetime.now().strftime("%d/%m/%Y")
    print("     --- Dump All Friends ID's ---")
    print('        --- Author: @Proxy07 ---\n')
    try:
        with open('lib/cache/facebook_token.txt', 'r') as file:
            token = file.read()
    except:
        print(
            style.RED('\n[!]') +
            style.RESET(' You must generate an access token first, exiting...')
        )
        sys.exit(0)

    try:
        print_ids = str(
            input(
                style.GREEN('[+]') +
                style.RESET(' Do you want to print all IDs on screen (y/n): '))
        )
    except KeyboardInterrupt:
        print(style.RED('\n[!]') + style.RESET(' User exit, exiting...'))
        sys.exit(0)

    try:
        i = 0
        while os.path.exists("Logs/IDs - %s.txt" % i):
            i += 1

        req = requests.get(
            f'https://graph.facebook.com/me/friends?access_token={token}')
        json_data = json.loads(req.text)
        with io.open("Logs/IDs - %s.txt" % i, 'w', encoding='UTF-8') as f:
            f.write(
                f'FacebookHunter IDs Scan\nDate : {date}\nTime : {time}\n\n\n\n'
            )
            for x in json_data['data']:
                f.write(f'{x["name"]} : {x["id"]}\n')
                if print_ids.lower() == "y":
                    print(
                        style.YELLOW(' [-]') +
                        style.RESET(f' {x["name"]} : {x["id"]}'))
                else:
                    None

            print(
                style.GREEN('\n[+]') + style.RESET(
                    f" Saved ID's successfuly in Logs/{'Logs/IDs - %s.txt' % i}"
                ))

            print(
                style.RED('\n[!]') +
                style.RESET(' Thank you for using FacebookHunter, exiting...'))
            sys.exit(0)

    except Exception as e:
        raise
Ejemplo n.º 5
0
def facebook():
    print(u"{}[2J{}[;H".format(chr(27), chr(27)))  # Clear the terminal
    print(
        style.YELLOW(
            '--Fill the folowing credentials for Facebook phishing email--'))
    name = str(input(style.GREEN('[+]') + style.RESET(' Displayed name: ')))
    email = str(input(style.GREEN('[+]') + style.RESET(' Displayed email: ')))
    url = str(input(style.GREEN('[+]') + style.RESET(' Phishing URL: ')))
    city = str(input(style.GREEN('[+]') + style.RESET(' Login city: ')))
    country = str(input(style.GREEN('[+]') + style.RESET(' Login country: ')))
    day = str(
        input(style.GREEN('[+]') + style.RESET(' Login day [in numbers]: ')))
    year = str(input(style.GREEN('[+]') + style.RESET(' Login year: ')))
    time = str(
        input(style.GREEN('[+]') + style.RESET(' Login time [HH:MM pm/am]: ')))
    month = str(
        input(style.GREEN('[+]') + style.RESET(' Login month [eg: June]: ')))

    if not url.startswith('http://') or not url.startswith('http://'):
        url = f"http://{url}"
    else:
        None
    with open('Templates/Facebook.html', 'r') as read_file, \
     open('Templates/Generated_Emails/FacebookTemplate.html', 'w') as write_file:
        for line in read_file:
            write_file.write(
                line.replace('#NAME', name).replace('#CITY', city).replace(
                    '#URL', url).replace('#EMAIL', email).replace(
                        '#COUNTRY', country).replace('#DAY', day).replace(
                            '#YEAR',
                            year).replace('#TIME',
                                          time).replace('#MONTH', month))
Ejemplo n.º 6
0
def dump_emails():
    while True:
        clear()
        date = datetime.now().strftime("%H:%M:%S")
        time = datetime.now().strftime("%d/%m/%Y")
        print("     --- Dump All Friends Emails ---")
        print('         --- Author: @Proxy07 ---\n')
        try:
            with open('lib/cache/facebook_token.txt', 'r') as file:
                token = file.read()
        except:
            print(style.RED('\n[!]') + style.RESET(' Error: You must generate an access token first.'))
            sys.exit(0)
        try:
            print_emails = str(input(style.GREEN('[+]') + style.RESET(' Do you want to print all emails on screen (y/n): ')))
        except KeyboardInterrupt:
            print(style.RED('\n[!]') + style.RESET(' Error: User exited.'))
            sys.exit(0)
        try:
            i = 0
            while os.path.exists("Logs/emails - %s.txt" % i):
                i += 1
            req1 = requests.get(f'https://graph.facebook.com/me/friends?access_token={token}')
            data1 = json.loads(req1.text)
            with io.open("Logs/emails - %s.txt" % i, 'w', encoding = 'UTF-8') as f:
                for i in data1['data']:
                    req2 = requests.get(f'https://graph.facebook.com/{i["id"]}?access_token={token}')
                    data2 = json.loads(req2.text)

                    try:
                        f.write(f'{data2["name"]} : {data2["email"]}\n')
                        if print_emails == "y":
                            print(style.YELLOW(' [-]') + style.RESET(f'{data2["name"]} : {data2["email"]}'))
                        else:
                            None
                    except KeyError:
                        pass
                    except KeyboardInterrupt:
                        print(style.RED('\n[!]') + style.RESET(' Error: User exited.'))
                        sys.exit(0)
                print(style.GREEN('\n[+]') + style.RESET(f" Saved ID's successfuly in Logs/{'Logs/IDs - %s.txt' % i}"))
    
        except KeyboardInterrupt:
            print(style.RED('\n[!]') + style.RESET(' Error: User exited.'))
            sys.exit(0)
        except (requests.exceptions.ConnectionError, requests.exceptions.ChunkedEncodingError):
            print(style.RED('\n[!]') + style.RESET(' Error: Failed to get emails due to connection error.'))
            sys.exit(0)
        input(style.CYAN('[*]') + style.RESET(' Press any key to go back to the main menu.'))
        break
Ejemplo n.º 7
0
def generate_token(data):
    while True:
        print(
            style.YELLOW('\n[*]') + style.RESET(' Generating access token...'))
        try:
            req = requests.get('https://api.facebook.com/restserver.php',
                               params=data)
            json_token = json.loads(req.text)
            with open('lib/cache/facebook_token.txt', 'w') as json_file:
                json_file.write(json_token['access_token'])
            print(
                style.GREEN('[+]') + style.RESET(
                    ' Saved token successfuly in lib/cache/facebook_token.txt')
            )
        except KeyError:
            print(
                style.RED('\n[!]') + style.RESET(
                    ' Error: Login failed, make sure the credentials you used are right and 2FA is turned off.'
                ))
            sys.exit(0)
        except KeyboardInterrupt:
            print(style.RED('\n[!]') + style.RESET(' Error: User exited.'))
            sys.exit(0)
        except requests.ConnectionError:
            print(
                style.RED('\n[!]') + style.RESET(
                    ' Error: Failed to generate access token due to connection error.'
                ))
            sys.exit(0)
        input(
            style.CYAN('[*]') +
            style.RESET(' Press any key to go back to the main menu.'))
        break
Ejemplo n.º 8
0
def instagram():
    print (u"{}[2J{}[;H".format(chr(27), chr(27)))   # Clear the terminal
    print(style.YELLOW('--Fill the folowing credentials for Instagram phishing email--'))
    name = str(input(style.GREEN('[+]') + style.RESET(' Displayed name: ')))
    username = str(input(style.GREEN('[+]') + style.RESET(' Displayed username: '******'[+]') + style.RESET(' Displayed email: ')))
    url = str(input(style.GREEN('[+]') + style.RESET(' Phishing URL: ')))

    if not url.startswith('http://') or not url.startswith('http://'):
        url = f"http://{url}"
    else:
        None
    with open('Templates/Instagram.html', 'r') as read_file, \
     open('Templates/Generated_Emails/InstagramTemplate.html', 'w') as write_file:
     for line in read_file:
         write_file.write(line.replace('#NAME', name).replace('#USERNAME', username).replace('#EMAIL', email).replace('#URL', url))
Ejemplo n.º 9
0
def snapchat():
    print(u"{}[2J{}[;H".format(chr(27), chr(27)))  # Clear the terminal
    print(
        style.YELLOW(
            '--Fill the folowing credentials for Snapchat phishing email--'))
    username = str(
        input(style.GREEN('[+]') + style.RESET(' Displayed username: '******'[+]') + style.RESET(' Phishing URL: ')))
    device = str(
        input(
            style.GREEN('[+]') +
            style.RESET(' Login device [Eg: Windows, Iphone...]: ')))
    ip = str(
        input(
            style.GREEN('[+]') +
            style.RESET(' Login device IP [Eg: 162.243.110.124]: ')))
    country = str(input(style.GREEN('[+]') + style.RESET(' Login country: ')))
    day = str(
        input(style.GREEN('[+]') + style.RESET(' Login day [in numbers]: ')))
    year = str(input(style.GREEN('[+]') + style.RESET(' Login year: ')))
    time = str(
        input(style.GREEN('[+]') + style.RESET(' Login time [HH:MM]: ')))
    timezone = str(
        input(
            style.GREEN('[+]') +
            style.RESET(' Login timezone [Eg: GMT, ETC...]: ')))
    month = str(
        input(style.GREEN('[+]') + style.RESET(' Login month [eg: June]: ')))

    if not url.startswith('http://') or not url.startswith('http://'):
        url = f"http://{url}"
    else:
        None
    with open('Templates/Snapchat.html', 'r') as read_file, \
     open('Templates/Generated_Emails/SnapchatTemplate.html', 'w') as write_file:
        for line in read_file:
            write_file.write(
                line.replace('#USERNAME', username).replace(
                    '#URL',
                    url).replace('#DEVICE', device).replace('#IP', ip).replace(
                        '#COUNTRY', country).replace('#DAY', day).replace(
                            '#YEAR', year).replace('#TIME', time).replace(
                                '#ZONE', timezone).replace('#MONTH', month))
Ejemplo n.º 10
0
def twitter():
    print(u"{}[2J{}[;H".format(chr(27), chr(27)))  # Clear the terminal
    print(
        style.YELLOW(
            '--Fill the folowing credentials for Twitter phishing email--'))
    username = str(
        input(style.GREEN('[+]') + style.RESET(' Displayed username: '******'[+]') + style.RESET(' Phishing URL: ')))
    city = str(input(style.GREEN('[+]') + style.RESET(' Login city: ')))
    country = str(input(style.GREEN('[+]') + style.RESET(' Login country: ')))
    browser = str(
        input(
            style.GREEN('[+]') +
            style.RESET(' Login browser [Eg: FireFox, Safari...]: ')))
    device = str(
        input(
            style.GREEN('[+]') +
            style.RESET(' Login device [Eg: Windows, Iphone...]: ')))

    if not url.startswith('http://') or not url.startswith('http://'):
        url = f"http://{url}"
    else:
        None
    with open('Templates/Twitter.html', 'r') as read_file, \
     open('Templates/Generated_Emails/TwitterTemplate.html', 'w') as write_file:
        for line in read_file:
            write_file.write(
                line.replace('#USERNAME',
                             username).replace('#CITY', city).replace(
                                 '#URL',
                                 url).replace('#COUNTRY', country).replace(
                                     '#DEVICE',
                                     device).replace('#BROWSER', browser))
Ejemplo n.º 11
0
def get_credentials():
    clear()
    print('     --- Generate Facebook Access Token ---')
    print('           --- Author: @Proxy07 ---\n')
    try:
        username = str(
            input(style.GREEN('[+]') + style.RESET(' Facebook email: ')))
    except KeyboardInterrupt:
        print(style.RED('\n[!]') + style.RESET(' Error: User exited.'))
        sys.exit(0)
    try:
        password = str(
            getpass.getpass(
                style.GREEN('[+]') + style.RESET(' Facebook password: '******'\n[!]') + style.RESET(' Error: User exited.'))
        sys.exit(0)
    API_SECRET = '62f8ce9f74b12f84c123cc23437a4a32'
    API_KEY = '882a8490361da98702bf97a021ddc14d'
    data = {
        "api_key": API_KEY,
        "credentials_type": "password",
        "email": username,
        "format": "JSON",
        "generate_machine_id": "1",
        "generate_session_cookies": "1",
        "locale": "en_US",
        "method": "auth.login",
        "password": password,
        "return_ssl_resources": "0",
        "v": "1.0"
    }
    sig = 'api_key=' + API_KEY + 'credentials_type=passwordemail=' + username + 'format=JSONgenerate_machine_id=1generate_session_cookies=1locale=en_USmethod=auth.loginpassword='******'return_ssl_resources=0v=1.0' + API_SECRET

    hash = hashlib.new('md5')
    hash.update(sig.encode('utf-8'))
    data.update({'sig': hash.hexdigest()})
    generate_token(data)
Ejemplo n.º 12
0
def web_host_app():
    print(u"{}[2J{}[;H".format(chr(27), chr(27)))  # Clear the terminal
    print(
        style.YELLOW(
            '--Fill the folowing credentials for 000WebHostApp phishing email--'
        ))
    url = str(input(style.GREEN('[+]') + style.RESET(' Phishing URL: ')))

    if not url.startswith('http://') or not url.startswith('http://'):
        url = f"http://{url}"
    else:
        None
    with open('Templates/000WebHost.html', 'r') as read_file, \
     open('Templates/Generated_Emails/000WebHostTemplate.html', 'w') as write_file:
        for line in read_file:
            write_file.write(line.replace('#URL', url))
Ejemplo n.º 13
0
def main_function():
    while True:
        if os.path.isdir('Logs') == False:
            os.mkdir('Logs')
        else:
            None
        if os.path.isdir('lib/cache') == False:
            os.mkdir('lib/cache')
        else:
            None
        clear()
        print('     --- Welcome to FacebookHunter ---')
        print('        --- Author: @Proxy07 ---')

        # Menu options
        print(style.GREEN('\n[1]') + style.RESET(' Generate access token.'))
        print(style.GREEN('[2]') + style.RESET(" Dump all IDs."))
        print(style.GREEN('[3]') + style.RESET(" Dump all phone numbers."))
        print(style.GREEN('[4]') + style.RESET(' Dump all email addresses.'))
        print(
            style.GREEN('[5]') +
            style.RESET(' Full information search by ID/Username.'))
        print(style.GREEN('[6]') + style.RED(' Exit FacebookHunter.'))
        try:
            mode_option = int(
                input(
                    style.YELLOW('\n[+]') +
                    style.RESET(" Enter your option number: ")))
        except:
            print(style.RED('\n[!]') + style.RESET(' Error: User exited.'))
            sys.exit(0)

        if mode_option == 1:
            get_credentials()
        elif mode_option == 2:
            dump_ids()
        elif mode_option == 3:
            dump_phones()
        elif mode_option == 4:
            dump_emails()
        elif mode_option == 5:
            dump_info()
        elif mode_option == 6:
            print(style.RED('[!]') + style.RESET(' User exit, exiting...'))
            sys.exit(0)
Ejemplo n.º 14
0
def generate_token(data):
    print(style.YELLOW('\n[*]') + style.RESET(' Generating access token...'))
    try:
        req = requests.get('https://api.facebook.com/restserver.php',
                           params=data)
        json_token = json.loads(req.text)
        with open('lib/cache/facebook_token.txt', 'w') as json_file:
            json_file.write(json_token['access_token'])
        print(
            style.GREEN('[+]') + style.RESET(
                ' Saved token successfuly in lib/cache/facebook_token.txt'))
    except KeyboardInterrupt:
        print(style.RED('\n[!]') + style.RESET(' User exit, exiting...'))
        sys.exit(0)
    except KeyError:
        print(
            style.RED('\n[!]') +
            style.RESET(' Email or password are incorrect, exiting...'))
        sys.exit(0)
    except requests.ConnectionError:
        print(
            style.RED('\n[!]') + style.RESET(
                ' Failed to generate access token due to connection error.'))
        sys.exit(0)
Ejemplo n.º 15
0
def dump_phones():
    clear()
    date = datetime.now().strftime("%H:%M:%S")
    time = datetime.now().strftime("%d/%m/%Y")
    print("     --- Dump All Friends Phone Numbers ---")
    print('            --- Author: @Proxy07 ---\n')
    try:
        with open('lib/cache/facebook_token.txt', 'r') as file:
            token = file.read()
    except:
        print(
            style.RED('\n[!]') +
            style.RESET(' You must generate an access token first, exiting...')
        )
        sys.exit(0)
    try:
        print_numbers = str(
            input(
                style.GREEN('[+]') + style.RESET(
                    ' Do you want to print all phone numbers on screen (y/n): '
                )))
    except KeyboardInterrupt:
        print(style.RED('\n[!]') + style.RESET(' User exit, exiting...'))
        sys.exit(0)
    try:
        i = 0
        while os.path.exists("Logs/phone_numbers - %s.txt" % i):
            i += 1
        req1 = requests.get(
            f'https://graph.facebook.com/me/friends?access_token={token}')
        data1 = json.loads(req1.text)

        with io.open("Logs/phone_numbers - %s.txt" % i, 'w',
                     encoding='UTF-8') as f:
            for i in data1['data']:
                req2 = requests.get(
                    f'https://graph.facebook.com/{i["id"]}?access_token={token}'
                )
                data2 = json.loads(req2.text)
                try:
                    f.write(f'{data2["name"]} : {data2["mobile_phone"]}\n')
                    if print_numbers.lower() == "y":
                        print(
                            style.YELLOW(' [-]') + style.RESET(
                                f'{data2["name"]} : {data2["mobile_phone"]}'))
                    else:
                        None
                except KeyError:
                    pass
                except KeyboardInterrupt:
                    print(
                        style.RED('\n[!]') +
                        style.RESET(' User exit, exiting...'))
                    sys.exit(0)
            print(
                color.GREEN('\n[+]') + color.RESET(
                    ' File saved : Logs/Facebook-Data-Logs/{"Logs/phone_numbers - %s.txt" % i}'
                ))
            print(
                style.RED('\n[!]') +
                style.RESET(' Thank you for using FacebookHunter, exiting...'))
            sys.exit(0)
    except KeyboardInterrupt:
        print(style.RED('\n[!]') + style.RESET(' User exit, exiting...'))
        sys.exit(0)
    except (requests.exceptions.ConnectionError,
            requests.exceptions.ChunkedEncodingError):
        print(
            style.RED('\n[!]') + style.RESET(
                ' Failed to get phone numbers due to connection error.'))
        sys.exit(0)
Ejemplo n.º 16
0
def gmail():
    print(u"{}[2J{}[;H".format(chr(27), chr(27)))  # Clear the terminal
    print(
        style.YELLOW(
            '--Fill the folowing credentials for Google Gmail phishing email--'
        ))
    name = str(input(style.GREEN('[+]') + style.RESET(' Displayed name: ')))
    email = str(input(style.GREEN('[+]') + style.RESET(' Displayed email: ')))
    url = str(input(style.GREEN('[+]') + style.RESET(' Phishing URL: ')))
    device = str(
        input(
            style.GREEN('[+]') +
            style.RESET(' Login device [Eg: Windows, Iphone...]: ')))
    browser = str(
        input(
            style.GREEN('[+]') +
            style.RESET(' Login browser [Eg: FireFox, Safari...]: ')))
    city = str(input(style.GREEN('[+]') + style.RESET(' Login city: ')))
    country = str(input(style.GREEN('[+]') + style.RESET(' Login country: ')))
    day = str(
        input(style.GREEN('[+]') + style.RESET(' Login day [In numbers]: ')))
    day_name = str(
        input(style.GREEN('[+]') + style.RESET(' Login day of the week: ')))
    year = str(input(style.GREEN('[+]') + style.RESET(' Login year: ')))
    time = str(
        input(style.GREEN('[+]') + style.RESET(' Login time [HH:MMpm/am]: ')))
    timezone = str(
        input(
            style.GREEN('[+]') +
            style.RESET(' Login timezone [Eg: GMT, ETC...]: ')))
    month = str(
        input(style.GREEN('[+]') + style.RESET(' Login month [eg: June]: ')))

    if not url.startswith('http://') or not url.startswith('http://'):
        url = f"http://{url}"
    else:
        None
    with open('Templates/Gmail.html', 'r') as read_file, \
     open('Templates/Generated_Emails/GmailTemplate.html', 'w') as write_file:
        for line in read_file:
            write_file.write(
                line.replace('#NAME', name).replace('#EMAIL', email).replace(
                    '#URL', url).replace('#MONTH', month).replace(
                        '#DEVICE',
                        device).replace('#BROWSER', browser).replace(
                            '#CITY',
                            city).replace('#COUNTRY', country).replace(
                                '#DAY', day).replace('#YEAR', year).replace(
                                    '#TIME',
                                    time).replace('#ZONE', timezone).replace(
                                        '#ND', day_name))
Ejemplo n.º 17
0
        elif mode_option == 3:
            dump_phones()
        elif mode_option == 4:
            dump_emails()
        elif mode_option == 5:
            dump_info()
        elif mode_option == 6:
            print(style.RED('[!]') + style.RESET(' User exit, exiting...'))
            sys.exit(0)


if __name__ == "__main__":
    clear()
    print('     --- Welcome to FacebookHunter ---')
    print('        --- Author: @Proxy07 ---')
    print(style.GREEN('\n[+]') + style.RESET(' Notes:'))
    print(
        style.YELLOW('    [*]') + style.RESET(
            ' I am not responsible for any damage caused by FacebookHunter!'))
    print(
        style.YELLOW('    [*]') + style.RESET(
            " Read the readme.md page carefully before using FacebookHunter!"))
    print(
        style.YELLOW('    [*]') + style.RESET(
            " Abusing this script might end with locking up your Facebook account until you verify it again!"
        ))
    try:
        warning = str(
            input(
                style.RED('\n[!]') + style.RESET(
                    ' Do you agree to use FacebookHunter for educational purposes only (y/n): '
Ejemplo n.º 18
0
def dump_info():
    clear()
    date = datetime.now().strftime("%H:%M:%S")
    time = datetime.now().strftime("%d/%m/%Y")
    print("     --- Dump Friend Information ---")
    print('        --- Author: @Proxy07 ---\n')
    try:
        with open('lib/cache/facebook_token.txt', 'r') as file:
            token = file.read()
    except:
        print(
            style.RED('\n[!]') +
            style.RESET(' You must generate an access token first, exiting...')
        )
        sys.exit(0)
    try:
        print(
            style.YELLOW('[*]') +
            style.RESET(' Note: User profile name is case sensetive.'))
        friend_id = str(
            input(
                style.GREEN('[+]') +
                style.RESET(' Enter friend Facebook profile name or ID: ')))
    except KeyboardInterrupt:
        print(style.RED('\n[!]') + style.RESET(' User exit, exiting...'))
        sys.exit(0)
    try:
        i = 0
        while os.path.exists(f"Logs/{friend_id} - %s.txt" % i):
            i += 1
        req1 = requests.get(
            f'https://graph.facebook.com/me/friends?access_token={token}')
        data1 = json.loads(req1.text)

        with io.open(f"Logs/{friend_id} - %s.txt" % i, 'w',
                     encoding='UTF-8') as f:
            for x in data1['data']:
                if friend_id in x['name'] or friend_id in x['id']:
                    req2 = requests.get(
                        f'https://graph.facebook.com/{x["id"]}?access_token={token}'
                    )
                    data2 = json.loads(req2.text)

                    print(
                        style.GREEN('\n[+]') + style.RESET(
                            f' Getting Information on {data2["username"]}'))
                    f.write(f'Getting Information on {data2["username"]}\n')
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' ID : {x["id"]}'))
                        f.write(f' ID : {x["id"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Username : {data2["username"]}'))
                        f.write(f' Username : {data2["username"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Email : {data2["email"]}'))
                        f.write(f' Email : {data2["email"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') + style.RESET(
                                f' Mobile Phone : {data2["mobile_phone"]}'))
                        f.write(f' Mobile Phone : {data2["mobile_phone"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Name : {data2["name"]}'))
                        f.write(f' Name : {data2["name"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' First Name : {data2["first_name"]}')
                        )
                        f.write(f' First Name : {data2["first_name"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') + style.RESET(
                                f' Middle Name : {data2["middle_name"]}'))
                        f.write(f' Middle Name : {data2["middle_name"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Last Name : {data2["last_name"]}'))
                        f.write(f' Last Name : {data2["last_name"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Locale : {data2["locale"]}'))
                        f.write(f' Locale : {data2["locale"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') + style.RESET(
                                f' Location : {data2["location"]["name"]}'))
                        f.write(f' Location : {data2["location"]["name"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') + style.RESET(
                                f' Hometown : {data2["hometown"]["name"]}'))
                        f.write(f' Hometown : {data2["hometown"]["name"]}')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Gender : {data2["gender"]}'))
                        f.write(f' Gender : {data2["gender"]}')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Religion : {data2["religion"]}'))
                        f.write(f' Religion : {data2["religion"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') + style.RESET(
                                f' Relationship Status : {data2["relationship_status"]}'
                            ))
                        f.write(
                            f' Relationship Status : {data2["relationship_status"]}\n'
                        )
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Political : {data2["political"]}'))
                        f.write(f' Political : {data2["political"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') + style.RESET(f' Work :'))
                        f.write(' Work :\n')
                        for w in data2['work']:
                            try:
                                print(
                                    style.YELLOW('           [-]') +
                                    style.RESET(
                                        f' Position : {w["position"]["name"]}')
                                )
                                f.write(
                                    f'   Position : {w["position"]["name"]}\n')
                            except KeyError:
                                pass
                            try:
                                print(
                                    style.YELLOW('           [-]') +
                                    style.RESET(
                                        f' Employer : {w["employer"]["name"]}')
                                )
                                f.write(
                                    f'   Employer : {w["employer"]["name"]}\n')
                            except KeyError:
                                pass
                            try:
                                if w['start_date'] == "0000-00":
                                    print(
                                        style.YELLOW('           [-]') +
                                        style.RESET(
                                            f' Start work date is not found.'))
                                    f.write(
                                        f'   Start work date is not found.\n')
                                else:
                                    print(
                                        style.YELLOW('           [-]') +
                                        style.RESET(
                                            f' Started Working : {w["start_date"]}'
                                        ))
                                    f.write(
                                        f'   Started Working : {w["start_date"]}\n'
                                    )
                            except KeyError:
                                pass
                            try:
                                if w['end_date'] == "0000-00":
                                    print(
                                        style.YELLOW('           [-]') +
                                        style.RESET(
                                            f' End work date is not found.'))
                                    f.write(
                                        f'   End work date is not found.\n')
                                else:
                                    print(
                                        style.YELLOW('           [-]') +
                                        style.RESET(
                                            f' Stopped Working : {w["end_date"]}'
                                        ))
                                    f.write(
                                        f'   Stopped Working : {w["end_date"]}\n'
                                    )
                            except KeyError:
                                pass
                            try:
                                print(
                                    style.YELLOW('           [-]') +
                                    style.RESET(
                                        f' Work Location : {w["location"]["name"]}'
                                    ))
                                f.write(
                                    f'   Work Location : {w["location"]["name"]}\n'
                                )
                            except KeyError:
                                pass
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') + style.RESET(
                                f' Updated Time : {data2["updated_time"][:10]} {data2["updated_time"][11:19]}'
                            ))
                        f.write(
                            f' Updated Time : {data2["updated_time"][:10]} {data2["updated_time"][11:19]}\n'
                        )
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Languages :'))
                        f.write(f' Languages :')

                        for l in data2['languages']:
                            try:
                                print(
                                    style.YELLOW('           [-]') +
                                    style.RESET(f' {l["name"]}'))
                                f.write(f'   {l["name"]}\n')
                            except KeyError:
                                pass
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Bio : {data2["bio"]}'))
                        f.write(f' Bio : {data2["bio"]}\n')
                    except KeyError:
                        pass

                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Quotes : {data2["quotes"]}'))
                        f.write(f' Quotes : {data2["quotes"]}\n')
                    except KeyError:
                        pass

                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Birthday : {data2["birthday"]}'))
                        f.write(f' Birthday : {data2["birthday"]}\n')
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Link : {data2["link"]}'))
                        f.write(f' Link : {data2["link"]}\n')
                    except KeyError:
                        pass

                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Fvourite Teams :'))
                        f.write(' Fvourite Teams: \n')

                        for f in data2['favorite_teams']:
                            try:
                                print(
                                    style.YELLOW('           [-]') +
                                    style.RESET(f' {data2["name"]}'))
                                f.write(f'   {data2["name"]}\n')
                            except KeyError:
                                pass
                    except KeyError:
                        pass
                    try:
                        print(
                            style.YELLOW('    [-]') +
                            style.RESET(f' Education :'))
                        f.write(f' Education :\n')

                        for e in data2['education']:
                            try:
                                print(
                                    style.YELLOW('           [-]') +
                                    style.RESET(f' {e["school"]["name"]}'))
                                f.write(f'   {e["school"]["name"]}')
                            except KeyError:
                                pass
                    except KeyError:
                        pass

            print(
                style.GREEN('\n[+]') + style.RESET(
                    f" Saved ID's successfuly in Logs/{f'Logs/{friend_id} - %s.txt' % i}"
                ))
    except KeyError:
        pass
    except KeyboardInterrupt:
        print(style.RED('\n[!]') + style.RESET(' User exit, exiting...'))
        sys.exit(0)
    except (requests.exceptions.ConnectionError,
            requests.exceptions.ChunkedEncodingError):
        print(
            style.RED('\n[!]') + style.RESET(
                " Failed to get user's information due to connection error."))
        sys.exit(0)