You are not logged in.

#1 2010-08-17 17:59:22

raunz
Member
Registered: 2008-11-27
Posts: 36

Filter :<port> from list of IPs

Hello

I got a huge list of IPs with attached port numbers

123.21.32.54:8060
123.21.22.22:9600
22.22.12.32:81
...

and I want to filter the :<port> away to ping the whole list with nmap.
Whats the most handy method?

Offline

#2 2010-08-17 18:10:14

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Filter :<port> from list of IPs

awk -F : '{ print $1 }' <filename>

Last edited by karol (2010-08-17 18:10:43)

Offline

#3 2010-08-17 18:10:55

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: Filter :<port> from list of IPs

Remove the ports with:

sed -e 's/:[0-9]*$//' -i <filename>

Run nmap with '-iL <filename>'.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#4 2010-08-17 19:17:47

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Filter :<port> from list of IPs

cut -d ":" -f 1

also works.

Offline

Board footer

Powered by FluxBB