I would like Masscan save just the found IP addresses to a .txt file. How to do that?
Asked
Active
Viewed 1,044 times
2
2 Answers
0
My personal favorite way that gives you a greppable output and the IP .txt list you are looking for is:
- To first run your Masscan with the output flags
sudo masscan -p80,8000 127.0.0.1 --output-format grepable --output-filename example.txt - Then grep the output command and awk the grep to get a more clean list of just IPs
cat example.txt | grep -o 'Host:.*' | awk {'print $2'} > example2.txt
You could chain this together (sudo masscan -p80,8000 127.0.0.1 --output-format grepable --output-filename example.txt & cat example.txt | grep -o 'Host:.*' | awk {'print $2'} > example2.txt) and afterwards you'll get an grep friendly output and the one you seek.
There are much quicker commands to getting this done (a quick Google should sort you out), or you could turn this into a script to speed up the process next time.
grepto save just what you want. – schroeder Nov 01 '22 at 20:08