September 14, 2022 at 3:46 PM
[align=center][b][color=#fffa1e][size=x-large]How to scan a target country internet range with some simple OpenSource tools[/size][/color][/b][/align][align=left][align=center][b][color=#ffa339][size=large]content:[/size][/color][/b][/align][/align][hide][align=left][color=#ff56ff][b][size=large]part 1[finding the IP's][/size][size=small]:[/size][/b][/color][/align]We will be using some simple out of the box tools, what we will be using today is Python3 and masscan.now to get the IP ranges of a country, we will be using an API provided by ip2location.com.now make sure you know what country you will be scanning and know what is the 2 letter short name of it, but fortoday we will be using the US as an example target. So for our python script, make sure you have request installedand ready to use.[color=#44b8ff][b][size=medium]ip_list_generator.py[/size][/b][/color]:https://pastebin.com/NX1dJqXygenerating the ip list is gonna take some time dependent on how many ip's a country have, so yeah I recommendtargeting smaller countries. Now that we have a list of our targets, we can now scan to our hearts content, dependingon how much bandwidth you have and money to pay the internet bills >w>', well unless you are using a VPS of course[color=#ff56ff][size=large][b]part 2[scanning the IP's]:[/b][/size][/color]now to scan using masscan all we need to do is to provide masscan with our ip list using the includefilelist flag [-iL] based fromnmap, so the command will be:[color=#ffffff][b]masscan -p[i][/i] --max-rate [i][/i] -iL ip_list.txt -oJ data.json[/b][/color]you guys can scan what ever ports you like, here's some examples:-p80,8080,443and I also recommend keeping your max rate not too high since that could cause your VPS provider or ISP to be very mad >w>so I recommend around 2000 to 5000 is good enough if you have fast internet, but 1000 is pretty good if you're on a budgetand once you're done scanning, you can checkout data.json to checkout all the ip's from your target country that have the ports you desired find ^w^[/hide]for any questions or help, please leave a reply :D
