Hosts: Running Script

Created on 18 Feb 2019  路  9Comments  路  Source: lightswitch05/hosts

Hello. Im having trouble running your script. Im running the latest python 3 for windows. Installed the requirements. When i try to run the update i get a error saying line 45 secrets.json file not found error.

good first issue question

Most helpful comment

Just some info on why it鈥檚 so slow. The free VirusTotal API has a rate limit of something like 4 API calls a minute so I had to introduce rate limits in the part of the code that talks to VirusTotal to ensure the script doesn鈥檛 get blocked. It鈥檚 bearable for adding new domains, but I wouldn鈥檛 want to be waiting around on a full list update

All 9 comments

Great question @eldervamp! My documentation is out of date. Also, I don鈥檛 have any error handling for that issue because I got lazy and I think you might be the first person to ever try to run it! So, here is how to get up and going, you are very close!

  1. Creat a free account with virustotal.com
  2. go to your account section and get your free API key
  3. Create a secrets.json file in this repo with these contents, be sure to set your own API key in the file
{
        "virustotal_api_key": "PUT_YOUR_API_KEY_HERE"
}

Re-run! Let me know if you have more issues

Thanks for the fast response :). Used the info your provided and now it works. TY

Glad you got it working. Just a heads up, a full list update is extremely slow, hours long. I have it setup to run weekly and I update this repo with the results.

@lightswitch05 get your things in order,more clientele is coming every day 馃槈

Just some info on why it鈥檚 so slow. The free VirusTotal API has a rate limit of something like 4 API calls a minute so I had to introduce rate limits in the part of the code that talks to VirusTotal to ensure the script doesn鈥檛 get blocked. It鈥檚 bearable for adding new domains, but I wouldn鈥檛 want to be waiting around on a full list update

Wow, yes that did take a while to run a full scan..lol. Is there a way to add / import domains from a text file rather than adding / typing them one by one in the -d command? I really like how the script puts the domain and subdomains in order.

I do not have any import features. However, you could just manually add all the domains to the list yourself and the next time you ran the script it would sort them for you. Just make sure they all have the 0.0.0.0 ip address. Also, when running the full list update, you can ctrl +C at any point and it will exit gracefully - saving any new domains it found while scanning.

you can also supply multiple domains to the list at once:

python3 update_hosts_file.py -d example1.com example2.com example3.com sub1.example1.com sub2.example1.com

As far as I know there isn't a limit - perhaps a command-line maximum args limit, but still a lot

Great. Added entries to the list and it organized them :). TY. Had some android app entries I added. Most of them facebook stuff..lol

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dnmTX picture dnmTX  路  7Comments

dnmTX picture dnmTX  路  4Comments

dnmTX picture dnmTX  路  5Comments

lightswitch05 picture lightswitch05  路  7Comments

dnmTX picture dnmTX  路  4Comments