NetCat

To do a quick port scan of another computer to see what's open, you can use nmap or, more simply type
nc -v -w 2 -z ip.address 1-65535


In a console or psudo terminal at her computer (12.34.56.78), she types
nc -l -p 1234

In a console or psudo terminal at his computer, he types
nc 12.34.56.78 1234

Now they can chat back and forth without messing up any other windows like write does.

Either one can terminate the connection with a Ctrl-C


In a console or psudo terminal at her computer (12.34.56.78), she types
nc -l -p 1234 < text-filename

In a console or psudo terminal at his computer, he types
nc 12.34.56.78 1234
and the contents of the file text-filename are displayed on his terminal. Then they proceed to chat as above

Either one can terminate the connection with a Ctrl-C


In a console or psudo terminal at her computer (12.34.56.78), she types
nc -l -p 1234 -q 1 < her-filename

In a console or psudo terminal at his computer, he types
nc 12.34.56.78 1234 > his-filename

and receives her file which is then stored on his computer. Her computer terminates the connection after the last byte leaves. (The -q parameter is the number of seconds to wait after EOF on stdin, which happens when the "< filename" redirection reaches EOF).


On her honeypot, she types
sudo nc -l -p 1234 -c sh

He types
nc honeypot-ipaddress 1234
and is handed a root shell on her machine


A caveat: The official name for the netcat utility is nc. Some jig-doo distributions like Suse, have renamed the nc binary to netcat so if you're looking for nc, you won't find it. The commands above must either be changed to netcat, or some other duct-tape like patch like alias or symbolic links need to be applied. Sort of reminds me of the old Apple-II where you had to type "catalogue" to get a file listing when every other os used something like dir or ls.


Send mail to the Webmaster

logo This site best viewed with a browser
Warning: This is a Debian centric site
Many thanks to Debra and Ian Murdock for making Debian possible
First created Dec 14, 2008 ~ Last revised November 26, 2009

Valid XHTML 1.0 Strict Valid CSS!