Skip to content

Instantly share code, notes, and snippets.

@arbazkiraak
Last active July 23, 2020 22:35
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save arbazkiraak/da9dc30650ced7b6adbece3631039842 to your computer and use it in GitHub Desktop.
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
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
Copy link
Author

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