-
-
Save arbazkiraak/da9dc30650ced7b6adbece3631039842 to your computer and use it in GitHub Desktop.
Python Script to Fetch the technologies of given domain using whatruns API and Wappalyzer Web Driver
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
import requests,json,ast | |
from Wappalyzer import Wappalyzer, WebPage | |
wappalyzer = Wappalyzer.latest() | |
Results = {} | |
## We are using `skip2` function which uses wappalyzer api functionality to fetch the results: | |
## Resons : Whatruns doesnt support ip,port , Whatruns doesn't support `url path based technology ex: `hackerone.com/hacktivity` | |
def Skip2(domain): | |
webpage = WebPage.new_from_url(str(domain)) | |
res = wappalyzer.analyze(webpage) | |
Results[str(domain)] = res | |
### Reasons to like Whatruns : Accurate results, More Results compared to Wappalyzer. | |
def FetchTechnogolies(domain): | |
wappalyzer = Wappalyzer.latest() | |
session = requests.Session() | |
paramsPost = {"data":"{\"hostname\":\""+str(domain)+"\",\"url\":\""+str(domain)+"\",\"rawhostname\":\""+str(domain)+"\"}"} | |
headers = {'Content-Type': 'application/x-www-form-urlencoded'} | |
response = session.post("https://www.whatruns.com/api/v1/get_site_apps", data=paramsPost, headers=headers) | |
loaded = json.loads(response.text) | |
if loaded['status']: | |
try: | |
apps = ast.literal_eval(loaded['apps']) | |
except KeyError: | |
Skip2(domain) | |
get_key = apps.keys() | |
step_2 = apps[list(get_key)[0]] | |
all_hooks = apps[list(get_key)[0]].keys() | |
for i in all_hooks: | |
for each_inter,each_category in enumerate(step_2[i]): | |
name = (each_category['name']) | |
try: | |
version = (each_category['version']) | |
except KeyError: | |
version = None | |
Results[name] = version | |
else: | |
Skip2(domain) | |
return Results |
Author
arbazkiraak
commented
Feb 7, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment