Created
October 18, 2020 23:59
-
-
Save crucesx00/752e520b03b2635d651bd6d0bbcf2417 to your computer and use it in GitHub Desktop.
get equipped with sketchy links
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
#Usage python3 suspicious-link.py bit.ly/whatever | |
import requests | |
from bs4 import BeautifulSoup | |
import re | |
import sys | |
import urllib3 | |
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
def cleanhtml(raw_html): | |
raw = re.compile('<.*?>') | |
cleaner = re.sub(raw, '\n', raw_html) | |
cleantext = cleaner.replace('\n\n','\n').split('ga(', 1)[0] | |
return cleantext | |
url = 'https://wheregoes.com/retracer.php' | |
headers = { 'Accept':None, | |
'Accept-Encoding': None, | |
'User-Agent': None, | |
'Connection':'close'} | |
payload = {'traceme':sys.argv[1]} | |
r = requests.post(url, headers = headers,data = payload,verify=False) | |
soup = BeautifulSoup(r.text, 'html.parser') | |
thing = soup.find_all(class_='tracecontent') | |
clean = cleanhtml(str(thing[0])) | |
print(clean) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment