Skip to content

Instantly share code, notes, and snippets.

@arbazkiraak arbazkiraak/whatruns.py Secret
Last active Feb 18, 2019

Embed
What would you like to do?
Python Script to Fetch the technologies of given domain using whatruns API and Wappalyzer Web Driver
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
@arbazkiraak

This comment has been minimized.

Copy link
Owner Author

commented Feb 7, 2019

FetchTechnogolies('facebook.com')
{'Modernizr': '2.6.2',
 'jQuery': None,
 'Jquery Easing': None,
 'LazyLoad': None,
 'Jquery Waypoints': None,
 'Bootstrap': None,
 'Nginx': '1.14.1'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.