Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
9Activity
0 of .
Results for:
No results containing your search query
P. 1
Netcat Cheat Sheet

Netcat Cheat Sheet

Ratings: (0)|Views: 754 |Likes:
Published by b732199

More info:

Published by: b732199 on Jan 03, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/24/2012

pdf

text

original

 
 
This cheat sheet provides various tips forusing Netcat on both Linux and Unix,specifically tailored to the SANS 504, 517,and 560 courses. All syntax is designed forthe original Netcat versions, released byHobbit and Weld Pond. The syntax herecan be adapted for other Netcats, includingncat, gnu Netcat, and others.
$
nc [options] [TargetIPaddr] [port(s)]
The
[TargetIPaddr]
is simply the other side’s IPaddress or domain name. It is required in client modeof course (because we have to tell the client where toconnect), and is optional in listen mode.
 
-l: Listen mode (default is client mode)-L: Listen harder (supported only on Windowsversion of Netcat). This option makes Netcat apersistent listener which starts listening againafter a client disconnects-u: UDP mode (default is TCP)-p: Local port (In listen mode, this is port listenedon. In client mode, this is source port for allpackets sent)-e: Program to execute after connection occurs,connecting STDIN and STDOUT to theprogram-n: Don’t perform DNS lookups on names of machines on the other side-z: Zero-I/O mode (Don’t send any data, just emita packet without payload)-wN: Timeout for connects, waits for N secondsafter closure of STDIN. A Netcat client orlistener with this option will wait for N secondsto make a connection. If the connectiondoesn’t happen in that time, Netcat stopsrunning.-v: Be verbose, printing out messages onStandard Error, such as when a connectionoccurs-vv: Be very verbose, printing even more detailson Standard Error
Netcat Relays on WindowsNetcat Command FlagsPurpose
NetcatCheat Sheet
 
By Ed Skoudis
POCKET REFERENCE GUIDE
http://www.sans.org
To start, enter a temporary directory where we willcreate .bat files:
C:\> 
 
cd c:\temp
 
Listener-to-Client Relay: 
C:\> 
 
echo nc [TargetIPaddr] [port] > relay.bat
 
C:\> 
 
nc –l –p [LocalPort] –e relay.bat
Create a relay that sends packets from the local port
[LocalPort]
to a Netcat Client connected to
[TargetIPaddr]
on port
[port]
Listener-to-Listener Relay: 
C:\> 
 
echo nc –l –p [LocalPort_2] > relay.bat
 
C:\> 
 
nc –l –p [LocalPort_1] –erelay.bat
Create a relay that will send packets from anyconnection on
[LocalPort_1]
to any connectionon
[LocalPort_2]
Client-to-Client Relay: 
C:\> 
 
echo nc [NextHopIPaddr] [port2] > relay.bat
 
C:\> 
 
nc [PreviousHopIPaddr] [port] –erelay.bat
Create a relay that will send packets from theconnection to
[PreviousHopIPaddr]
on port
[port]
to a Netcat Client connected to
[NextHopIPaddr]
on port
[port2]
 
Fundamental Netcat Client: 
$
nc [TargetIPaddr] [port]
Connect to an arbitrary port
[port]
at IP Address
[TargetIPaddr]
 
Fundamental Netcat Listener: 
$
nc –l -p [LocalPort]
 Create a Netcat listener on arbitrary local port
[LocalPort]
Both the client and listener take input from STDINand send data received from the network to STDOUT
 
Fundamentals

Activity (9)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Dan liked this
Dan liked this
rodrmoreno liked this
sarheeder liked this
kd4pba liked this
Alek Orlov liked this
mevlevi.ali liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->