2

I would like Masscan save just the found IP addresses to a .txt file. How to do that?

Glorfindel
  • 4,099
fdku
  • 31
  • 1
    This looks more like a scripting issue, if the tool doesn't do it natively.. Use grep to save just what you want. – schroeder Nov 01 '22 at 20:08

2 Answers2

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.

0

you just need use -oH example.txt in your command

hamid
  • 1