chorsley / python-Wappalyzer

Python driver for Wappalyzer, a web application detection utility.
GNU General Public License v3.0
309 stars 122 forks source link

wappalyzer.analyze(webpage) returns a `set()` output?? #51

Closed pwnedDesal closed 2 years ago

pwnedDesal commented 3 years ago
from Wappalyzer import Wappalyzer, WebPage
import warnings
warnings.filterwarnings("ignore", message="""Caught 'unbalanced parenthesis at position 119' compiling regex""", category=UserWarning )

httpResponse="""
<!doctype html><html><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/></head><body><script src="fingerprinted/js/m-outer-fe96732da72c6a6f4c4db1ff14c37915.js"></script></body></html>
"""

webpage = WebPage("https://js.stripe.com/v3/m-outer-59cdd15d8db95826a41100f00b589171.html",httpRespone,{'test':'test'})
wappalyzer = Wappalyzer.latest()
print(wappalyzer.analyze(webpage))

I have already an HTTP response which is from this URL, and I set it into httpResponse variable then call the WebPage class like this

webpage = WebPage("https://js.stripe.com/v3/m-outer-59cdd15d8db95826a41100f00b589171.html",httpResponse,{'test':'test'})

However, the print(wappalyzer.analyze(webpage)) returns an output set()

image

BitTheByte commented 3 years ago

Solved by using CaseInsensitiveDict from requests

from requests.structures import CaseInsensitiveDict

wp = WebPage(url=response['url'], html=response['body'], headers=CaseInsensitiveDict(response['headers']))
wappalyzer = Wappalyzer.latest()
print( wappalyzer.analyze(wp) )
tristanlatr commented 3 years ago

Maybe the headers argument should be automatically converted to CaseInsensitiveDict in WebPage.init().

That would solve the issue for everyone!

Thanks,

AymanEG commented 2 years ago

@BitTheByte that solved it for me, thanks.