Advertisement
surgexc

Void Auto Claimer

Feb 29th, 2020
5,127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.64 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3.  
  4. # apt-get install python3-dev python3-pip -y
  5. # python3 -m pip install colorama readchar requests
  6.  
  7. from time import sleep
  8. from threading import Thread
  9. from colorama import init
  10.  
  11. import atexit, requests, hashlib, random
  12. import readchar, hmac, uuid, os, string
  13.  
  14. import ctypes
  15.  
  16.  
  17. class Targets:
  18. longest = 0
  19. lists = []
  20. ids = {}
  21. claimdata = {}
  22. cycle = 0
  23.  
  24. with open("targets.txt", "r") as f:
  25. targets = f.read().splitlines()
  26. for target in targets:
  27. Targets.lists.append(target.lower())
  28.  
  29. #INIT MAIN
  30. with open('pool.txt', 'r') as f:
  31. accountpool = f.read().splitlines()
  32.  
  33. BREAK = 3
  34. LINE_FEED = 13
  35. BACK_SPACE = 127 if os.name == "posix" else 8
  36.  
  37. ERROR = "[\x1b[31m-\x1b[39m]"
  38. SUCCESS = "[\x1b[32m+\x1b[39m]"
  39. INPUT = "[\x1b[33m?\x1b[39m]"
  40. INFO = "[\x1b[35m*\x1b[39m]"
  41.  
  42. RED = "\033[1;31;40m"
  43. GREEN = "\033[1;32;40m"
  44. BLUE = "\033[1;36;40m"
  45. WHITE = "\033[1;37;40m"
  46.  
  47.  
  48. IG_EDIT_PROFILE = "{{\"gender\":\"3\",\"username\":\"{}\",\"first_name\":\"Void\",\"email\":\"{}\"}}"
  49. IG_LOGIN_ACTUAL = "{{\"username\":\"{}\",\"device_id\":\"{}\",\"password\":\"{}\",\"login_attempt_count\":\"0\"}}"
  50.  
  51. IG_API_CONTENT_TYPE = "application/x-www-form-urlencoded; charset=UTF-8"
  52. IG_API_USER_AGENT = "Instagram 84.0.0.21.105 Android (24/7.0; 380dpi; 1080x1920; OnePlus; ONEPLUS A3010; OnePlus3T; qcom; en_US; 145652094)"
  53.  
  54. class Signatures(object):
  55. def __init__(self):
  56. super(Signatures, self).__init__()
  57. self.key = b"02271fcedc24c5849a7505120650925e2b4c5b041e0a0bb0f82f4d41cfcdc944"
  58.  
  59. def gen_uuid(self):
  60. return str(uuid.uuid4())
  61.  
  62. def gen_device_id(self):
  63. return "android-{}".format(hashlib.md5(self.gen_uuid().encode("utf-8")).hexdigest()[:16])
  64.  
  65. def gen_signature(self, data):
  66. return hmac.new(self.key, str.encode(data), hashlib.sha256).hexdigest()
  67.  
  68. def sign_post_data(self, data):
  69. return "signed_body={}.{}&ig_sig_key_version=4".format(self.gen_signature(data), data)
  70.  
  71. class Device(object):
  72. def __init__(self):
  73. super(Device, self).__init__()
  74. self.filepath = os.path.expanduser("~/.madara-turbo.ini")
  75.  
  76. if (os.path.isfile(self.filepath)):
  77. if (self.read_ini(self.filepath)):
  78. return
  79.  
  80. self.create_device_ini()
  81. self.write_ini(self.filepath)
  82.  
  83. def create_device_ini(self):
  84. self.adid = Signatures().gen_uuid()
  85. self.uuid = Signatures().gen_uuid()
  86. self.phone_id = Signatures().gen_uuid()
  87. self.device_id = Signatures().gen_device_id()
  88.  
  89. def read_ini(self, filename):
  90. lines = [line.rstrip("\r\n") for line in open(filename, "r")]
  91.  
  92. for line in lines:
  93. if (line.startswith("adid=")):
  94. self.adid = line.split("=")[1]
  95. elif (line.startswith("uuid=")):
  96. self.uuid = line.split("=")[1]
  97. elif (line.startswith("phoneid=")):
  98. self.phone_id = line.split("=")[1]
  99. elif (line.startswith("deviceid=")):
  100. self.device_id = line.split("=")[1]
  101.  
  102. return None not in (self.adid, self.uuid, self.phone_id, self.device_id)
  103.  
  104. def write_ini(self, filename):
  105. print("; Madara's Instagram Turbo", file=open(filename, "w"))
  106. print("; Information used for device identification\r\n", file=open(filename, "a"))
  107. print("[Device]\r\nadid={}\r\nuuid={}".format(self.adid, self.uuid), file=open(filename, "a"))
  108. print("phoneid={}\r\ndeviceid={}".format(self.phone_id, self.device_id), file=open(filename, "a"))
  109.  
  110. class Instagram(object):
  111. def __init__(self):
  112. super(Instagram, self).__init__()
  113. self.device = Device()
  114. self.url = "https://i.instagram.com/api/v1"
  115.  
  116. self.attempts = 0
  117. self.rs = 0
  118. self.running = True
  119. self.logged_in = False
  120. self.session_id = None
  121.  
  122. self.email = None
  123. self.username = None
  124. self.spam_blocked = False
  125. self.rate_limited = False
  126. self.missed_swap = False
  127. self.claimed = False
  128.  
  129. def login(self, username, password):
  130. response = requests.post(self.url + "/accounts/login/", headers={
  131. "Accept": "*/*",
  132. "Accept-Encoding": "gzip, deflate",
  133. "Accept-Language": "en-US",
  134. "User-Agent": IG_API_USER_AGENT,
  135. "Content-Type": IG_API_CONTENT_TYPE,
  136. "X-IG-Capabilities": "3brTvw==",
  137. "X-IG-Connection-Type": "WIFI"
  138. }, data=Signatures().sign_post_data(IG_LOGIN_ACTUAL.format(
  139. username, self.device.device_id, password
  140. )))
  141.  
  142. if (response.status_code == 200):
  143. self.session_id = response.cookies["sessionid"]
  144.  
  145. response = response.json()
  146.  
  147. if (response["status"] == "fail"):
  148. if (response["message"] == "challenge_required"):
  149. print("{} Please verify this login and make sure 2FA is disabled".format(ERROR))
  150. else:
  151. print("{} {}".format(ERROR, response["message"]))
  152. elif (response["status"] == "ok"):
  153. self.logged_in = True
  154.  
  155. if (self.get_profile_info()):
  156. print("{} Successfully logged in".format(SUCCESS))
  157. return self.logged_in
  158. else:
  159. print("{} Successfully logged in but failed to fetch profile information, this may be due to a rate limit".format(ERROR))
  160. else:
  161. print("{} An unknown login error occured".format(ERROR))
  162.  
  163. return False
  164.  
  165. def logout(self):
  166. if (not self.logged_in):
  167. return False
  168.  
  169. return "\"status\": \"ok\"" in requests.post(self.url + "/accounts/logout/", headers={
  170. "Accept": "*/*",
  171. "Accept-Encoding": "gzip, deflate",
  172. "Accept-Language": "en-US",
  173. "User-Agent": IG_API_USER_AGENT,
  174. "Content-Type": IG_API_CONTENT_TYPE,
  175. "X-IG-Capabilities": "3brTvw==",
  176. "X-IG-Connection-Type": "WIFI"
  177. }, cookies={
  178. "sessionid": self.session_id
  179. }).text
  180.  
  181. def update_consent(self):
  182. response = requests.post(self.url + "/consent/update_dob/", headers={
  183. "Accept": "*/*",
  184. "Accept-Encoding": "gzip, deflate",
  185. "Accept-Language": "en-US",
  186. "User-Agent": IG_API_USER_AGENT,
  187. "Content-Type": IG_API_CONTENT_TYPE,
  188. "X-IG-Capabilities": "3brTvw==",
  189. "X-IG-Connection-Type": "WIFI"
  190. }, data=Signatures().sign_post_data(
  191. "{\"current_screen_key\":\"dob\",\"day\":\"1\",\"year\":\"1998\",\"month\":\"1\"}"
  192. ), cookies={
  193. "sessionid": self.session_id
  194. })
  195.  
  196. if ("\"status\": \"ok\"" in response.text):
  197. print("{} Successfully updated consent to GDPR".format(SUCCESS))
  198. return self.get_profile_info()
  199.  
  200. print("{} Failed to consent to GDPR, use an IP that is not from Europe".format(ERROR))
  201. return False
  202.  
  203. def get_profile_info(self):
  204. response = requests.get(self.url + "/accounts/current_user/?edit=true", headers={
  205. "Accept": "*/*",
  206. "Accept-Encoding": "gzip, deflate",
  207. "Accept-Language": "en-US",
  208. "User-Agent": IG_API_USER_AGENT,
  209. "X-IG-Capabilities": "3brTvw==",
  210. "X-IG-Connection-Type": "WIFI"
  211. }, cookies={
  212. "sessionid": self.session_id
  213. })
  214.  
  215. if ("\"consent_required\"" in response.text):
  216. return self.update_consent()
  217. elif ("few minutes" in response.text):
  218. return False
  219.  
  220. response = response.json()
  221. self.email = response["user"]["email"]
  222. self.username = response["user"]["username"]
  223.  
  224. return self.email is not None and self.username is not None
  225.  
  226. def prepare_targets(self):
  227. bad = []
  228. for item in Targets.lists:
  229. try:
  230. sleep(.5)
  231. response = requests.get(self.url + "/users/{}/usernameinfo/".format(item), headers={
  232. "Accept": "*/*",
  233. "Accept-Encoding": "gzip, deflate",
  234. "Accept-Language": "en-US",
  235. "User-Agent": IG_API_USER_AGENT,
  236. "X-IG-Capabilities": "3brTvw==",
  237. "X-IG-Connection-Type": "WIFI"
  238. }, cookies={
  239. "sessionid": self.session_id
  240. })
  241. itemid = response.json()["user"]["pk"]
  242. Targets.ids[item] = itemid
  243. self.build_claim_data(item)
  244. print("User: [{}] Id: [{}] Response: [{}]".format(item, itemid, response.status_code))
  245.  
  246. except Exception as e:
  247. bad.append(item)
  248. print("User: [{}] Response: [banned]".format(item))
  249. for item in bad:
  250. Targets.lists.remove(item)
  251.  
  252. def build_claim_data(self, username):
  253. Targets.claimdata[username] = Signatures().sign_post_data(IG_EDIT_PROFILE.format(username, self.email))
  254.  
  255. def target_available(self, username, selectedid):
  256. response = requests.get("{}/feed/user/{}/reel_media/".format(self.url, selectedid), headers={
  257. "Accept": "*/*",
  258. "Accept-Encoding": "gzip, deflate",
  259. "Accept-Language": "en-US",
  260. "User-Agent": IG_API_USER_AGENT,
  261. "X-IG-Capabilities": "3brTvw==",
  262. "X-IG-Connection-Type": "WIFI"
  263. }, cookies={
  264. "sessionid": self.session_id,
  265. "ds_user_id": random_id(random.choice([9, 10, 11, 12]))
  266. }, timeout=.7).text
  267.  
  268. if ("few minutes" in response):
  269. self.rate_limited = True
  270. self.running = False
  271.  
  272. return "{" in response and "\"{}\"".format(username) not in response
  273.  
  274. def claim_target(self, username):
  275. response = requests.post(self.url + "/accounts/edit_profile/", headers={
  276. "Accept": "*/*",
  277. "Accept-Encoding": "gzip, deflate",
  278. "Accept-Language": "en-US",
  279. "User-Agent": IG_API_USER_AGENT,
  280. "Content-Type": IG_API_CONTENT_TYPE,
  281. "X-IG-Capabilities": "3brTvw==",
  282. "X-IG-Connection-Type": "WIFI"
  283. }, cookies={
  284. "sessionid": self.session_id
  285. }, data=Targets.claimdata[username])
  286. self.target = username
  287.  
  288. if ("feedback_required" in response.text):
  289. self.spam_blocked = True
  290. self.running = False
  291.  
  292. return "\"status\": \"ok\"" in response.text
  293.  
  294. class Turbo(Thread):
  295. def __init__(self, instagram):
  296. super(Turbo, self).__init__()
  297. self.instagram = instagram
  298.  
  299. def run(self):
  300. while (self.instagram.running):
  301. try:
  302. if Targets.cycle >= len(Targets.ids.keys()):
  303. Targets.cycle = 0
  304. username = Targets.lists[Targets.cycle]
  305. selectedid = Targets.ids[username]
  306. Targets.cycle += 1
  307. else:
  308. username = Targets.lists[Targets.cycle]
  309. selectedid = Targets.ids[username]
  310. Targets.cycle += 1
  311. localcycle = Targets.cycle
  312. if (self.instagram.target_available(username, selectedid)):
  313. if (self.instagram.claim_target(username)):
  314. self.instagram.claimed = True
  315. else:
  316. self.instagram.missed_swap = True
  317. Targets.lists.remove(username)
  318. del Targets.ids[username]
  319. del Targets.claimdata[username]
  320. self.instagram.running = False
  321.  
  322. self.instagram.attempts += 1
  323. m = f"@[{username}] "
  324. for _ in range(Targets.longest - len(username)):
  325. m += " "
  326. m += f"#[{self.instagram.attempts}] &[{localcycle}] *[{self.instagram.rs}]"
  327. print("\r"+m, end="")
  328.  
  329. except Exception as e:
  330. print(e)
  331. continue
  332.  
  333.  
  334.  
  335.  
  336. def random_id(length):
  337. return "".join(random.choice(string.digits) for _ in range(length))
  338.  
  339. class RequestsPS(Thread):
  340. def __init__(self, instagram):
  341. super(RequestsPS, self).__init__()
  342. self.instagram = instagram
  343.  
  344. def run(self):
  345. while self.instagram.running:
  346. before = self.instagram.attempts
  347. sleep(1) # Sleep 1 second, calc difference
  348. self.instagram.rs = self.instagram.attempts - before
  349.  
  350.  
  351.  
  352. def get_input(prompt, mask=False):
  353. ret_str = b""
  354. print(prompt, end="", flush=True)
  355.  
  356. while (True):
  357. ch = readchar.readchar()
  358.  
  359. if (os.name == "posix"):
  360. ch = str.encode(ch)
  361.  
  362. code_point = ord(ch)
  363.  
  364. if (code_point == BREAK): # Ctrl-C
  365. if (os.name == "posix"):
  366. print("\r\n", end="", flush=True)
  367.  
  368. exit(0)
  369. elif (code_point == LINE_FEED): # Linefeed
  370. break
  371. elif (code_point == BACK_SPACE): # Backspace
  372. if (len(ret_str) > 0):
  373. ret_str = ret_str[:-1]
  374. print("\b \b", end="", flush=True)
  375. else:
  376. ret_str += ch
  377. print("*" if mask else ch.decode("utf-8"), end="", flush=True)
  378.  
  379. print("\r\n", end="", flush=True)
  380. return ret_str.decode("utf-8")
  381.  
  382. def on_exit(instagram):
  383. if (instagram.logged_in):
  384. if (instagram.logout()):
  385. print("{} Successfully logged out".format(SUCCESS))
  386. else:
  387. print("{} Failed to logout :/".format(ERROR))
  388.  
  389.  
  390.  
  391.  
  392.  
  393. def main():
  394. init() # Use Colorama to make Termcolor work on Windows too
  395. print("{} {}Void Multitarget | Version 1.0\r\n".format(SUCCESS, WHITE))
  396. print("\n{} {}loaded {}{}{} sessions...".format(SUCCESS, WHITE, BLUE, len(accountpool), WHITE))
  397. print("\n{} {}banned targeting {}disabled{}".format(SUCCESS, WHITE, RED, WHITE))
  398. threads = get_input("\r\n{} Threads: ".format(INPUT)).strip()
  399. try:
  400. for account in accountpool:
  401. print(Targets.ids)
  402. print(Targets.claimdata)
  403. instagram = Instagram()
  404.  
  405. if ":" not in account:
  406. continue
  407. else:
  408. sleep(.1)
  409. username = account.split(":")[0]#get_input("{} Username: ".format(INPUT)).strip()
  410. password = account.split(":")[1]#get_input("{} Password: ".format(INPUT), True)
  411.  
  412. #print("\r\n{} Attempting to login...".format(INFO))
  413.  
  414. if (not instagram.login(username, password)):
  415. print("{} Failed to login to @{} - Check your password/account".format(ERROR, username))
  416. continue
  417.  
  418. if len(Targets.ids.keys()) == 0:
  419. instagram.prepare_targets()
  420. print(Targets.lists)
  421. print(Targets.ids)
  422. print(Targets.claimdata)
  423. for item in Targets.ids.keys():
  424. if len(item) > Targets.longest:
  425. Targets.longest = len(item)
  426.  
  427. for i in range(int(threads)):
  428. thread = Turbo(instagram)
  429. thread.setDaemon(True)
  430. thread.start()
  431. rs_thread = RequestsPS(instagram)
  432. rs_thread.setDaemon(True)
  433. rs_thread.start()
  434.  
  435. ctypes.windll.kernel32.SetConsoleTitleW(f"Void - Session: {username}")
  436. while (instagram.running):
  437. try:
  438. sleep(.1)
  439. except KeyboardInterrupt:
  440. print("\r{} Turbo stopped, exiting after {:,} attempts...\r\n".format(ERROR, instagram.attempts))
  441. break
  442.  
  443. if (instagram.spam_blocked):
  444. print("\r{} Tried to claim @{} but account is spam blocked ({:,} attempts)\r\n".format(ERROR, instagram.target, instagram.attempts))
  445. on_exit(instagram)
  446. elif (instagram.rate_limited):
  447. print("\r{} Rate limited after {:,} attempts\r\n".format(ERROR, instagram.attempts))
  448. on_exit(instagram)
  449. elif (instagram.missed_swap):
  450. print("\r{} Missed username swap on @{} after {:,} attempts\r\n".format(ERROR, instagram.target, instagram.attempts))
  451. on_exit(instagram)
  452. elif (instagram.claimed):
  453. print("\r{} {}@{}{} has entered the void\n {}{:,}{} attempts\r\n".format(SUCCESS, GREEN, instagram.target, WHITE, BLUE, instagram.attempts, WHITE))
  454. input("\npress enter to close your window....")
  455. on_exit(instagram)
  456. os._exit(0)
  457.  
  458.  
  459. except Exception as e:
  460. print("error:")
  461. print(e)
  462. input("\n press enter to exit..")
  463. os._exit(0)
  464.  
  465. if (__name__ == "__main__"):
  466. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement