Cool stuff you can do with netcat
en.wikipedia.org
Cool stuff you can do with netcat
1–10 of 44 posts
Re: Cool stuff you can do with netcat
#2Re: Cool stuff you can do with netcat
#3Re: Cool stuff you can do with netcat
#4Anyone want to give a few examples of cool things they actually do with netcat?
- creating quick and dirty proxies (nc > fifo > nc). (edit: you can also bridge udp->tcp this way, which makes proxying UDP through an ssh tunnel possible)
- making simple GET requests (printf "GET / HTTP/1.0\r\nHost: www\r\n\r\n" | nc host 80, or save the full request and pipe that to netcat)
- checking if a port is open (nc -p 8080 host, tends to be quicker than nmap and less to type)
- dumb file transfers ('nc -l port > file' on one machine, 'file | nc host2 port') on another (or using tar for directories). Usually I use ssh/scp, but sometimes that nc trick works just fine..
Re: Cool stuff you can do with netcat
#5ssh -oProxyCommand="ssh host1 nc host2 22" host2
Re: Cool stuff you can do with netcat
#6Anyone want to give a few examples of cool things they actually do with netcat?
echo -n "Sending SHUTDOWN\r\n" | nc localhost $REDISPORT &Re: Cool stuff you can do with netcat
#7Re: Cool stuff you can do with netcat
#8Don't forget easy ssh host hopping. ssh -oProxyCommand="ssh host1 nc host2 22" host2
http://sshmenu.sourceforge.net/articles/transparent-mulithop...
This made all the time I've spent on HN in the past week worthwhile! :)
Re: Cool stuff you can do with netcat
#9If you love nc, also check out socat ( http://www.dest-unreach.org/socat/ )
ncat -lkp 8080 --sh-exec 'echo -ne "HTTP/1.0 200 OK\r\n\r\nThe date is "; date;'Re: Cool stuff you can do with netcat
#10I actually got in trouble trying to use netcat for something quite legitimate in my former job at RandomBigCorp... Oops.
At my current place of employment, "hacking tools" are banned. On that list is netcat. It is installed on every unix desktop and server, and I use it daily. I have decided to just not point out the stupidity of this -- they might do something that's even more stupid as a response.