codingo / VHostScan

A virtual host scanner that performs reverse lookups, can be used with pivot tools, detect catch-all scenarios, work around wildcards, aliases and dynamic default pages.
GNU General Public License v3.0
1.19k stars 231 forks source link

Update dynamic location random user agent list #87

Closed aancw closed 6 years ago

aancw commented 6 years ago

Hi there,

While testing your program, i'm getting error for random user agent mode because you are using static file location, when installing this program with python setup.py install it get binary alias as VhostScan pointing to /usr/lib/python3.6/site-packages/VHostScan-1.21-py3.6.egg/VHostScan/VHostScan.py but your function still use static location

 with open('./lib/ua-random-list.txt') as f:

Error

[>] Random User-Agent flag set.
Traceback (most recent call last):
  File "/usr/bin/VHostScan", line 11, in <module>
    load_entry_point('VHostScan==1.21', 'console_scripts', 'VHostScan')()
  File "/usr/lib/python3.6/site-packages/VHostScan-1.21-py3.6.egg/VHostScan/VHostScan.py", line 54, in main
    user_agents = load_random_user_agents()
  File "/usr/lib/python3.6/site-packages/VHostScan-1.21-py3.6.egg/VHostScan/lib/helpers/file_helper.py", line 65, in load_random_user_agents
    with open('./lib/ua-random-list.txt') as f:
FileNotFoundError: [Errno 2] No such file or directory: './lib/ua-random-list.txt'

So, i've added dynamic file location as you used before at wordlist_helper.py and change readlines to read function, so i can use splitlines() for fixing this issue:

raise ValueError('Invalid header value %r' % (values[i],))
ValueError: Invalid header value b'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36\n'

If you don't mind, i can implementing fake/random user agent function to this project, as you can see in my project: https://github.com/aancw/Belati/blob/master/plugins/user_agents.py

Thanks!

aancw commented 6 years ago

Sorry, i'm forget about newline for codestyle.

codingo commented 6 years ago

This is grest work. Very open to any contributions! And don't stress the extra commit, just means the tests are doing their job!