-1

I think i need a regex code to filter nmap output.txt I use a tool called: Word List Updater 2.7 so this is the output: http://pastebin.com/HwgiVHDA

I want to filter,remove duplicates and look like this, uff sorry for my bad english 5.2.128.130:3391 5.2.132.8:3389

and then without port:

1.179.133.46 1.186.40.82

This should work on Windows.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • Please stop posting answers that shouldn't even be comments. Edit your question to make it clear that you are using Windows. And install Cygwin. – Sven Jun 09 '16 at 18:54

1 Answers1

0

With port included:

cat pastebin.txt | awk '/Ports:/ { printf $2":"; print $5 } ' | sed ' s@/@#@pg ' | awk -F# '{print $1}' | uniq

5.2.128.20:3389
5.2.128.130:3389
5.2.128.138:3389
5.2.128.158:3389

Without port included:

cat pastebin.txt | awk ' {print $2 } ' | uniq

5.2.128.20
5.2.128.130
5.2.128.138
5.2.128.158

felartu
  • 16
  • 2