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 27 guests online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Network Pen Testingarrow Banner grabbing with netcat
EH-Net
May 23, 2013, 09:28:23 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  
Pages: [1]   Go Down
  Print  
Author Topic: Banner grabbing with netcat  (Read 12808 times)
0 Members and 1 Guest are viewing this topic.
H1t M0nk3y
Hero Member
*****
Offline Offline

Posts: 865



View Profile
« on: August 16, 2010, 08:55:20 AM »

Hey,

I am currently using netcat (but it could be telnet, sbd, etc) to do some banner grabbing. So far, I only find example for HTTP and FTP servers... But what about other services? I poked around and found some more ways of getting information with netcat:

HTTP
Code:
nc -v 192.168.1.10 80
    HEAD / HTTP/1.0
    [ENTER]
    [ENTER]

    - or -

    GET HTTP


FTP
Code:
nc -v 192.168.1.59 21

SSH
Code:
nc -v 192.168.1.59 22


MS-SQLServer
Code:
nc -v 192.168.1.59 1433

MySQL
Code:
nc -v 192.168.1.59 3306

And etc!

So my questions really is: Yes, you can use netcat to connect to every single port and get the banner of well known services. But what about other TCP ports with no obvious response without the proper prompt (like a web server)? We need to provide the service with some precise query parameters. So do you guys know about other data that could be send to a TCP port that doesn't an obvious reply?

I hope you guys understand my question...  Grin



Logged

OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
Synquell
Full Member
***
Offline Offline

Posts: 169



View Profile
« Reply #1 on: August 16, 2010, 09:37:33 AM »

Sort of, I think Smiley

The banner grabbing for versioning can, as you know, be done with an Nmap version scan.

A more 'manual' approach, but still fast enough, might be to use an Nmap script, like:
http://nmap.org/nsedoc/scripts/banner.html
http://pauldotcom.com/2008/12/banner-grabbing-with-nmap-relo.html

I suppose you can adapt the script to fuzz everything you can think off towards the ports in question, and see what comes back.

This is all just an educated guess though, don't have a lot of experience with all that personally Smiley
Logged

Twitter: https://twitter.com/dietervds
Blog: https://synquell.wordpress.com (not much there yet)

The beginning of knowledge is the discovery of something we do not understand.
ajohnson
Recruiters
Hero Member
*
Offline Offline

Posts: 1057


aka dynamik


View Profile WWW
« Reply #2 on: August 16, 2010, 11:53:07 AM »

Don't forget SMTP, IMAP, and POP with netcat. You can also use Nmap's ncat with the --ssl option to connect to ssl-based services (or use sslproxy with one of the netcat variants that don't support ssl).

Your best bet would be to perform a packet capture while establishing an legitimate connection to see what information is normally transmitted and then adjust that as necessary.

You could then use a packet crafting utilities, such as HPing, Scapy, PackEth, etc. (or hexedit and file2cable if you are feeling particularly l33t) to generate your custom packets.

Disclaimer: I don't have much hands-on experience with this, but I think that looks right in theory Wink
Logged

WIP: GCFA | www.infosiege.net | @infosiege

The day you stop learning is the day you start becoming obsolete.
sachitre
Newbie
*
Offline Offline

Posts: 22


View Profile
« Reply #3 on: August 17, 2010, 05:15:47 AM »

Hi,

You can use the triggers in the AMAP tool that can be found in the file appdefs.trig (I cant remember exactly but I think thats the one). Are you using netcat manually to rule out false positives?

cheers

Logged

CISSP, GPEN, CCNA
H1t M0nk3y
Hero Member
*****
Offline Offline

Posts: 865



View Profile
« Reply #4 on: August 17, 2010, 05:32:01 AM »

Thanks for the hints. I heard about AMAP but I never used it. Last release is January 2006, so is it too old to detect recent services?!?

My goal wasn't so much about ruling out false positive. I was more looking at an easy way to look at one or to ports on a machine. My question really was "what to do" when you see a strange port open. The answer seems to be:

1) Start a network sniffer
2) Connect to the service with telnet/netcat and see what happen
3) Launch some tools like nmap scripts or AMAP

There is not much else we can do.
Logged

OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
Synquell
Full Member
***
Offline Offline

Posts: 169



View Profile
« Reply #5 on: August 17, 2010, 08:10:31 AM »

Idd, I don't think there is.
Basicly poke at it with whatever you can and see what happens! Smiley
Logged

Twitter: https://twitter.com/dietervds
Blog: https://synquell.wordpress.com (not much there yet)

The beginning of knowledge is the discovery of something we do not understand.
Pages: [1]   Go Up
  Print  
 
Jump to:  

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.087 seconds with 23 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
 
         
Advertisement

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