GerbenJavado / LinkFinder

A python script that finds endpoints in JavaScript files
https://gerbenjavado.com/discovering-hidden-content-using-linkfinder
MIT License
3.64k stars 588 forks source link

Invalid input defined or SSL error: 'module' object has no attribute 'decompress' #40

Closed energiatel closed 6 years ago

energiatel commented 6 years ago

root@localhost:~/Documents/LinkFinder# python linkfinder.py -i http://www.someurl.com -d I always get this: Usage: python linkfinder.py [Options] use -h for help Error: invalid input defined or SSL error: 'module' object has no attribute 'decompress'

Is it my mistake?

dPhoeniixx commented 6 years ago

same issue

dPhoeniixx commented 6 years ago

I found that the decompression function that is used to decompress data has been added only in python => 3.2, this issue appears only in python < 3.2 If you want to fix this issue in python < 3.2, you need add this imports in linkfinder.py

from gzip import GzipFile
from StringIO import StringIO

and replace

data = gzip.decompress(response.read()) // line 152

with

data = GzipFile(fileobj=StringIO(response.read())).read()

In the end, thank you @GerbenJavado for this awesome tool <3 !

GerbenJavado commented 6 years ago

Thank you @energiatel for submitting this issue and thank you @dPhoeniixx for proposing the fix. It helps a ton. Should be fixed quickly.

GerbenJavado commented 6 years ago

I still need to test the code however pull request #41 should do the trick. The try statement is to both support Python 2 & 3.

GerbenJavado commented 6 years ago

As far as my tests are correct this issue should be fixed with commit 6149c50b7b576a4d52b43119846a59bdeb0d312f. If you notice any further problems please tell me about it. Thanks!