1

After masscan scanning ip ranges it outputs ip's in such awfull format. Can somebody help me changing the output format or change it using grep or awk command?

open tcp 3389 77.239.225.198 1485353988
open tcp 3389 85.202.4.94 1485353988
open tcp 3389 217.14.53.187 1485353988
open tcp 3389 85.26.253.50 1485353988
open tcp 3389 87.238.96.58 1485353988
open tcp 3389 91.218.45.9 1485353988
open tcp 3389 178.46.167.147 1485353988

And i want it look like

77.239.225.19
85.202.4.94
217.14.53.187
85.26.253.50
87.238.96.58
91.218.45.9
178.46.167.147
Inian
  • 80,270
  • 14
  • 142
  • 161

2 Answers2

3

Just use Awk as

masscan -iL ipp.txt --open --rate 60000 -p3389 | awk '{print $4}'

write it a new file using the re-direct operator,

masscan -iL ipp.txt --open --rate 60000 -p3389 | awk '{print $4}' > ipList.txt
Inian
  • 80,270
  • 14
  • 142
  • 161
0

In this way you do not save anything and do everything on the fly.

masscan -p<port> <subnet> --rate=600 --open-only --wait 0 2>&1 | grep ^Discovered | awk '{print $6}'