How to make masscan write the results in the form of necessary IP to a file, without garbage:

IP1 IP2 IP3 IP4 IP5 

Run like this

 sudo masscan -p3389 --rate 100000 --pfring -iL диапазон1 --output-format list --open-only -oL TEST 

Conclusion so right now

 open tcp 3389 68.65.143.138 1452193784 open tcp 3389 8.31.96.146 1452193784 open tcp 3389 107.47.138.99 1452193785 open tcp 3389 107.46.27.70 1452193785 
  • Can you give an example of trash? - don Rumata
  • open tcp 3389 68.65.143.138 1452193784 - 3amunyk
  • Correct the issue with an example of a raw exhaust. - don Rumata

1 answer 1

Option 1 . Through pipe:

sudo masscan -p3389 --rate 100000 --pfring -iL диапазон1 --output-format list --open-only -oL TEST | cut -d ' ' -f 4

Option 2 . Through the intermediate file:

sudo masscan -p3389 --rate 100000 --pfring -iL диапазон1 --output-format list --open-only -oL TEST > masscan.dump

cat masscan.dump | cut -d ' ' -f 4

In theory - the same thing, but in practice it sometimes helps.

  • Unfortunately the output has not changed ( - 3amunyk
  • Added 2nd option. - don Rumata
  • Yes, thanks, it looks like what you need! The truth is not quite true, but how did cat TEST | cut -d '' -f 4 >> TEST2 resulting file sparsil to another - 3amunyk
  • Well, my second variant spits out on standard output. Then you can put another 1 pipe or redirect to a file. - don Rumata