Advertisement
FlyFar

HackTool.Python.Doxing.a - Source Code

Jul 6th, 2023
782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 11.19 KB | Cybersecurity | 0 0
  1. import os
  2. import requests
  3. import sys
  4. import subprocess
  5. import re
  6. import face_recognition
  7. import json
  8.  
  9. done_checks = []
  10. social_media = []
  11. usernames = []
  12. emails = []
  13. twitter = []
  14. instagram = []
  15. steam = []
  16. urls = []
  17. urls_stalk = []
  18. urls_done = []
  19. name = ""
  20. adresse = ""
  21. compare = False
  22. first_dl = False
  23.  
  24. def stalk(user):
  25.     if len(user) > 1:
  26.         global urls_stalk
  27.         pastebin_url = "https://pastebin.com/u/" + user
  28.         pastebin_str = "s Pastebin - Pastebin.com"
  29.         patreon_url = "https://www.patreon.com/" + user
  30.         patreon_str = 'created_at'
  31.         gutefrage_url = "https://www.gutefrage.net/nutzer/" + user
  32.         gutefrage_str = '<meta name="title" content="Profil von'
  33.         ebay_url = "https://www.ebay.de/usr/" + user
  34.         ebay_str = '<span>Angemeldet seit: </span>'
  35.         twitter_url = "https://twitter.com/" + user
  36.         twitter_str = '<link rel="canonical" href="https://twitter.com/' + user + '">'
  37.         facebook_url = 'https://facebook.com/' + user
  38.         facebook_str = ' hreflang="sv" href="https://sv-se.facebook.com/' + user
  39.         instagram_url = "https://www.instagram.com/" + user + "/"
  40.         instagram_str = '<link rel="alternate" href="https://www.instagram.com/' + user + '/?hl=en" hreflang="en" />'
  41.         steam_url = "https://steamcommunity.com/id/" + user
  42.         steam_str = 'https://steamcommunity-a.akamaihd.net/public/images/skin_1/arrowDn9x5.gif'
  43.         twitch_url = "https://www.twitch.tv/" + user
  44.         twitch_str = "content='twitch://stream/" + user
  45.         lachschon_url = "https://www.lachschon.de/community/user/" + user + "/"
  46.         lachschon_str = '<label>Rang</label>'
  47.  
  48.         URLS = [pastebin_url, patreon_url, gutefrage_url, ebay_url, facebook_url, twitter_url, instagram_url, steam_url, twitch_url, lachschon_url]
  49.         STRS = [pastebin_str, patreon_str, gutefrage_str, ebay_str, facebook_str, twitter_str, instagram_str, steam_str, twitch_str, lachschon_str]
  50.  
  51.         for i in range(0, len(URLS)):
  52.             html = getResponse(URLS[i])
  53.             if STRS[i].lower() in str(html).lower():
  54.                 print("\t> " + URLS[i])
  55.                 urls_stalk.append(URLS[i])
  56.  
  57. def get_twitter_img(user):
  58.     url = "https://twitter.com/" + user
  59.     html = subprocess.getoutput("phantomjs html.js " + url)
  60.     image = find_between(html, '<img class="ProfileAvatar-image " src="', '" alt="')
  61.     r = requests.get(image)
  62.     with open('Twitter.jpg', 'wb') as f:
  63.         f.write(r.content)
  64.  
  65. def get_instagram_img(user):
  66.     data = {
  67.     'username': user,
  68.     'submit': 'View DP'
  69.     }
  70.     response = requests.post('https://fullinstadp.com/index.php', data=data)
  71.     html = response.text
  72.     f = open("Out.html", "w")
  73.     f.write(html)
  74.     f.close
  75.     img_url = find_between(html, '<img class="loading img-rounded center-block img-responsive" src="', '" alt=""')
  76.     r = requests.get(img_url)
  77.     with open('Instagram.jpg', 'wb') as f:
  78.         f.write(r.content)
  79.  
  80. def check_mail(string):
  81.     EMAIL_REGEX = re.compile(r"[^@]+@[^@]+\.[^@]+")
  82.     if EMAIL_REGEX.match(string):
  83.         return True
  84.     else:
  85.         return False
  86.  
  87. def check_string_mail(string):
  88.     global emails
  89.     splitted = string.split(" ")
  90.     for word in splitted:
  91.         if check_mail(word):
  92.             emails.append(word)
  93.  
  94. def check_string_url(string):
  95.     global urls
  96.     for word in string.split(" "):
  97.         try:
  98.             url = re.search("(?P<url>https?://[^\s]+)", word).group("url")
  99.             if '//t.co/' in url:
  100.                 last = url[-1:]
  101.                 if last == ".":
  102.                     url = url.rstrip('.')
  103.                 r = requests.get(url)
  104.                 url = r.url
  105.             urls.append(url)
  106.         except:
  107.             e = ""
  108.  
  109. def check_string_socialmedia(string):
  110.     global social_media
  111.     count = 0
  112.     next = 0
  113.     for word in string.split(" "):
  114.         next = count + 2
  115.         if 'facebook' in word.lower():
  116.             print(string.split(" ")[next])
  117.         count +=1
  118.  
  119. def youtube(url):
  120.     url = url + "/about"
  121.     html = subprocess.getoutput("phantomjs html.js " + url)
  122.     tmp_str = html.split('"}},"urlEndpoint":')
  123.     for url in tmp_str:
  124.         #print(url)
  125.         url = find_between(url, '{"url":"', '","target":')
  126.         print(html)
  127.  
  128. def grab_instagram(profile):
  129.     global done_checks
  130.     global urls
  131.     global instagram
  132.     global usernames
  133.     global compare
  134.     if not "instagram: " + profile in done_checks:
  135.         if not profile in usernames:
  136.             usernames.append(profile)
  137.         url = "https://www.instagram.com/" + profile + "/"
  138.         html = subprocess.getoutput("phantomjs html.js " + url)
  139.         if '"@type":"Person","name":"' in html:
  140.             display_name = find_between(html, '"@type":"Person","name":"', '","alternateName":"')
  141.             if not display_name in usernames:
  142.                 usernames.append(display_name)
  143.             if not "instagram: " + display_name in done_checks:
  144.                 print(display_name)
  145.                 stalk(display_name)
  146.             instagram.append("Display Name: " + display_name)
  147.         description = find_between(html, '"user":{"biography":"', '","blocked_by_viewer')
  148.         follower = find_between(html, 'edge_followed_by":{"count":', '},"followed_by_viewer')
  149.         check_string_mail(description)
  150.         check_string_url(description)
  151.         instagram.append("Description: " + description)
  152.         instagram.append("Follower: " + follower)
  153.         #get_instagram_img(profile) // Buggy suche nach Alternative zu siehe Funktion
  154.         compare = True
  155.         if not "instagram: " + profile in done_checks:
  156.             done_checks.append("instagram: " + profile)
  157.    
  158. def grab_steam(url):
  159.     global done_checks
  160.     global urls
  161.     global usernames
  162.     if not "steam: " + profile in done_checks:
  163.         url = url + "/ajaxaliases/"
  164.         response = requests.get(url)
  165.         html = response.text
  166.         for item in html.split("newname"):
  167.             username = find_between(item, '":"', '","timechanged')
  168.             if not username in usernames:
  169.                 usernames.append(username)
  170.  
  171.  
  172.  
  173. def grab_twitter(profile):
  174.     global done_checks
  175.     global urls
  176.     global adresse
  177.     global usernames
  178.     global twitter
  179.     global first_dl
  180.     if not "twitter: " + profile in done_checks:
  181.         url = "https://twitter.com/" + profile
  182.         urls.append(url)
  183.         html = subprocess.getoutput("phantomjs html.js " + url)
  184.         #variables
  185.         display_name = find_between(html, '<title>', ' (@')
  186.         if not profile in usernames:
  187.             usernames.append(profile)
  188.         if not display_name in usernames:
  189.             usernames.append(display_name)
  190.         if not "twitter: " + display_name in done_checks:
  191.             print(display_name)
  192.             stalk(display_name)
  193.         join_date = find_between(html, 'ProfileHeaderCard-joinDateText js-tooltip u-dir" dir="ltr" title="', '">Beigetreten')
  194.         description = ""
  195.         url = ""
  196.         location = ""
  197.         #if
  198.         if '<meta name="description"' in html:
  199.             description = find_between(html, '<meta name="description" content="', '">')
  200.             description = description.replace("&quot", "")
  201.             check_string_mail(description)
  202.             check_string_url(description)
  203.         if '<span class="ProfileHeaderCard-urlText u-dir">  <a class="u-textUserColor"' in html:
  204.             tmp = find_between(html, '<span class="ProfileHeaderCard-urlText u-dir">', '</a>')
  205.             url = find_between(tmp, '" title="', '">')
  206.             urls.append(url)
  207.         if 'location&quot;:&quot;' in html:
  208.             location = find_between(html, '&quot;location&quot;:&quot;', '&quot;,&quot;url')
  209.             if len(location) > 0:
  210.                 adresse = location
  211.         twitter.append("Display Name: " + display_name)
  212.         twitter.append("Join Date: " + join_date)
  213.         twitter.append("Description: " + description)
  214.         twitter.append("URL: " + url)
  215.         twitter.append("Location: " + location)
  216.         twitter.append("                    ")
  217.         #if first_dl == False:
  218.             #get_twitter_img(profile)
  219.             #first_dl = True
  220.         if not "twitter: " + profile in done_checks:
  221.             done_checks.append("twitter: " + profile)
  222.  
  223.  
  224.  
  225. def handle():
  226.     try:
  227.         if sys.argv[1]:
  228.             social_media = sys.argv[1].lower()
  229.         if sys.argv[2]:
  230.             info_type = sys.argv[2].lower()
  231.         if sys.argv[3]:
  232.             infos = sys.argv[3].lower()
  233.         if info_type == "url":
  234.             if social_media == "youtube":
  235.                 youtube(infos)
  236.         elif info_type == "profile":
  237.             if social_media == "twitter":
  238.                 grab_twitter(infos)
  239.         elif info_type == "user":
  240.             if social_media == "stalk":
  241.                 stalk(infos)
  242.     except Exception as e:
  243.         print(e)
  244.  
  245. def find_between( s, first, last ):
  246.     try:
  247.         start = s.index( first ) + len( first )
  248.         end = s.index( last, start )
  249.         return s[start:end]
  250.     except ValueError:
  251.         return ""
  252.  
  253. def getResponse(url):
  254.     response = requests.get(url)
  255.     #response.raise_for_status()
  256.     data = response.content
  257.     return data
  258.  
  259.  
  260. handle()
  261.  
  262. for url in urls_stalk:
  263.     #print(url)
  264.     if 'twitter.com' in url:
  265.         checked = False
  266.         profile = url.split("/")[3]
  267.         for check in done_checks:
  268.             if check == "twitter: " + profile:
  269.                 checked = True
  270.         if not checked:
  271.             grab_twitter(profile)
  272.             done_checks.append("twitter:" + profile)
  273.            
  274.     if 'instagram.com' in url:
  275.         checked = False
  276.         profile = url.split("/")[3]
  277.         for check in done_checks:
  278.             if check == "instagram: " + profile:
  279.                 checked = True
  280.         if not checked:
  281.             grab_instagram(profile)
  282.             #print("Download Profile Picture")
  283.             done_checks.append("instagram: " + profile)
  284.     #Steam Check direkt in der Stalk Funktion
  285.     if 'steamcommunity.com' in url:
  286.         checked = False
  287.         profile = url.split("/")[4]
  288.         for check in done_checks:
  289.             if check == "steam: " + profile:
  290.                 checked = True
  291.         if not checked:
  292.             grab_steam(url)
  293.             done_checks.append("steam: " + profile)
  294.            
  295.  
  296. print("------------------")
  297. print("Usernames:")
  298. print("------------------")
  299. for user in usernames:
  300.     print(user)
  301.     stalk(user)
  302.  
  303. if len(urls) > 0:
  304.     print("------------------")
  305.     print("URLs:")
  306.     print("------------------")
  307.     for url in urls:
  308.         print(url)
  309.  
  310. if len(twitter) > 0:
  311.     print("------------------")
  312.     print("Twitter:")
  313.     print("------------------")
  314.     for item in twitter:
  315.         print(item)
  316.  
  317. if len(instagram) > 0:
  318.     print("------------------")
  319.     print("Instagram:")
  320.     print("------------------")
  321.     for item in instagram:
  322.         print(item)
  323.  
  324. if len(steam) > 0:
  325.     print("------------------")
  326.     print("Steam:")
  327.     print("------------------")
  328.     for item in steam:
  329.         print(item)
  330.  
  331. print("------------------")
  332. print("Sites checked:")
  333. print("------------------")
  334. for check in done_checks:
  335.     print(check)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement