© Dmitry Rukhlenko, 123RF.com

© Dmitry Rukhlenko, 123RF.com

Netcat – The admin's best friend

Utile

Article from ADMIN 12/2012
By
The outstanding Netcat is often referred to as the Swiss Army Knife of networking; to say that it is versatile is the biggest understatement you will hear in a while.

With the seemingly unlimited number of Linux packages that are available today, sometimes it's easy to become distracted and miss out on the really high-quality packages – those that offer the most impressive functionality. I'm sure you could name a few ubiquitous networking packages that the majority of admins might have used in the past. I'm thinking, for example, about userland packages like ngrep, IPTraf, Tcpdump, Nmap, and iftop.

As well as these tools, however, you almost certainly will have encountered the relatively famous Netcat. Among its formidable feature set, the fantastic Netcat can be a random port-scanning hacking tool, a whitehat security tool, and a server or a client; it performs monitoring, supports tunneling, and is a simple TCP proxy server on top of that! Hard to believe, I realize, but in this article, I'll take a more detailed look at what the venerable Netcat can do.

First Things First

Netcat [1] has been around for a long time, and it's been able to do all sorts of things relating to TCP and UDP since its inception. These days, it handles IPv6 as well as IPv4 beautifully. Its astounding versatility means that integrating it with scripts is a veritable piece of cake. I have heard it said in fact that Netcat actually comes with too many features; however with a minuscule installation footprint, there's surely not much cause for complaint.

One tool that many admins have put to use in the past to test open ports is the widely used Telnet client.

For example, if you were opening a web page to test an HTTP server, you could use something along the lines of:

# telnet remotehost.tld 80

Once a connection is established, you could pull the page content down with a GET (there's no prompt inside the Telnet session):

GET /

This is a

...
Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Netcat – The Admin’s Best Friend

    With the seemingly unlimited number of Linux packages available today in repositories, sometimes it’s easy to get lost and miss out on the really high quality packages – those that offer the most impressive functionality.

  • Pen Testing with netcat

    Once you have successfully exploited a target machine, you might be faced with a dilemma common among penetration testers: Do I have shell access or terminal access? These are not the same, and careful knowledge must be used when interacting with a shell compared with a terminal.

comments powered by Disqus