def reverseViaHT(website): website = addHTTP(website); webs = removeHTTP(website) url = "http://api.hackertarget.com/reverseiplookup/?q=" combo = "{url}{website}".format(url=url, website=webs) request = Request(combo, _timeout=5, _encode=True) if len(request) != 5: list = request.strip("").split("\n") for _links in list: if len(_links) != 0: write(var="#", color=c, data=_links) else: write(var="@", color=r, data="Sorry, The webserver of the website you entered have no domains other then the one you gave :')")
def manualCrawl(website): website = addHTTP(website) webs = removeHTTP(website) request = Request(website, _timeout=5, _encode=True) soup = BeautifulSoup(request, 'lxml') ### Links are in ['a', 'link', 'img', 'svg', 'iframe', 'embed', 'audio'] _links = [] a = soup.find_all("a") for links in a: _links.append(links['href']) link = soup.find_all("link") for links in a: _links.append(links['href']) img = soup.find_all("img") for links in img: _links.append(links['src']) iframe = soup.find_all("iframe") for links in iframe: _links.append(links['src']) embed = soup.find_all("embed") for links in embed: _links.append(links['src']) _links = set(_links) for __links in _links: if str(webs) in __links: write(var="~", color=c, data=__links)
def findShells(website): website = addHTTP(website) shells = Request( "https://raw.githubusercontent.com/Anon-Exploiter/Rough_Work/master/shells", _timeout=6, _encode=True).split("\n") print("{}{:<92}| {:<50}".format(c, "URL", "STATUS")) for _shells in shells: if len(_shells) != 0: combo = website + "/" + _shells try: resp = requests.get(combo, timeout=5, headers=_headers, allow_redirects=False).status_code if resp == 200: print("{}{:<92}| {:<50}".format(g, combo, resp)) elif resp == 301: print("{}{:<92}| {:<50}".format(r, combo, "404")) elif resp == 500 or resp == 502: print("{}{:<92}| {:<50}".format(c, combo, "404")) else: print("{}{:<92}| {:<50}".format(r, combo, "404")) except Exception: print("{}{:<92}| {:<50}".format(r, combo, "404"))
def whoIS(website): website = "http://api.whoapi.com/?apikey=66ca3039356c0287ff63ed472f528478&r=whois&domain={url}&ip=".format(url=website) req = Request(website, _timeout=8, _encode=True) js = json.loads(req) whois = js['whois_raw'] for result in whois.split("\n"): if len(result) != 0: write(var="~", color=c, data=result)
def cloudflare(website, _verbose=None): if _verbose != None: write(var="#", color=c, data="Checking For Cloudflare In " + website) combo = ("http://api.hackertarget.com/httpheaders/?q=" + str(website)) request = Request(combo, _timeout=3, _encode=True) if "cloudflare" in request: if _verbose != None: write(var="~", color=g, data="Cloudflare Found!\n") write(var="#", color=y, data="Trying To Bypass Cloudflare!\n") req = "http://www.crimeflare.biz/cgi-bin/cfsearch.cgi" pos = {'cfS': website} res = requests.post(req, headers=_headers, data=pos).text.encode('utf-8') real_ip = None if re.findall(r'\d+\.\d+\.\d+\.\d+', res): reg = re.findall(r'\d+\.\d+\.\d+\.\d+', res) real_ip = reg[1] else: write(var="!", color=r, data="Sorry! Cloudflare Wasn't Bypassed :')") request = Request("http://" + str(real_ip), _timeout=3, _encode=True) if not "cloudflare" in request.lower(): if _verbose != None: if real_ip != None: write(var="@", color=c, data="Cloudflare Bypassed!") write(var="~", color=g, data="Real IP --> " + fc + str(real_ip)) return (str(real_ip)) else: if _verbose != None: write(var="!", color=r, data="Sorry! Cloudflare Wasn't Bypassed :')") else: if _verbose != None: write(var="$", color=b, data=website + " Is not using Cloudflare!") # cloudflare("http://mukarramkhalid.com")
def whoIS(website): website = removeHTTP(website) url = f"https://www.whois.com/whois/{website}" try: request = Request(url, _timeout=5, _encode=None) bs = BeautifulSoup(request, 'html.parser') result = bs.find_all('pre', {'class': 'df-raw'})[0].text.encode('UTF-8') print(f"\r{c}{result.decode()}") except: write(var="!", color=r, data="Sorry, whois cannot be performed right now...!!! :[")
def cloudflare(website, _verbose=None): if _verbose != None: write(var="#", color=c, data=f"Checking for Cloudflare in {website}") combo = f"http://api.hackertarget.com/httpheaders/?q={str(website)}" request = Request(combo, _timeout=3, _encode=True).decode() if "cloudflare" in request: write(var="~", color=g, data="Cloudflare Found!\n") else: if _verbose != None: write(var="^", color=g, data=f"{website} is not using Cloudflare!")