Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 37 guests online
 
Advertisement

You are here: Home
EH-Net
May 21, 2013, 01:07:12 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
  Home Help Calendar Login Register  
  Show Posts
Pages: [1]
1  Ethical Hacking Discussions and Related Certifications / Programming / Re: Nmap Grep Help on: May 22, 2012, 12:15:42 PM
Should have added the example beforehand:

[root@kenji ~]# more nmap.scanned
# Nmap 6.00 scan initiated Mon May 21 16:56:39 2012 as: nmap -sS -p 80,442 -oG nmap.scanned 10.4.4.72
Host: 10.4.4.72 (kenji.infiltrated.net) Status: Up
Host: 10.4.4.72 (kenji.infiltrated.net) Ports: 80/open/tcp//http///, 442/closed/tcp//cvc_hostd///
# Nmap done at Mon May 21 16:56:41 2012 -- 1 IP address (1 host up) scanned in 2.17 seconds

[root@kenji ~]# awk '/http/{print $2","$5}' nmap.scanned | awk -F / '{print $1}'
10.4.4.72,80



This worked perfectly! Thanks again guys!
2  Ethical Hacking Discussions and Related Certifications / Programming / Re: Nmap Grep Help on: May 21, 2012, 03:05:00 PM
Sweet

I'll figure it out. Just need someone to point me in the right direction.

Thanks!
3  Ethical Hacking Discussions and Related Certifications / Programming / Nmap Grep Help on: May 21, 2012, 02:27:15 PM
Hey there,

I've been doing some searching and I'm having a tough time trying to figure out what I'm trying to do.

I'm running an nmap scan with the -oG option to grep the info.

I am looking to end up with a test file with the following format:

IP,Port

I'm grepping for specific services and want to output it in that format, as the next tool I want to run needs the data that way.

I can grep the IP with:

cat logfile |grep http |cut -d" " -f2

And I can grep the port with:
cat logfile |grep http |cut -d" " -f4 |cut -d"/" -f1

I just need to figure out how to grep those two things out and put the out put on the same line with a comma separating them.

I'm doing this for an automation exercise I'm working on.

Any help would be greatly appreciated! Thanks
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.059 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Free Business and Tech Magazines and eBooks

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.