2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-05-04 02:56:35 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/projects/Framework/
|
|
|
|
##
|
|
|
|
|
|
|
|
|
2006-11-06 05:29:56 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Auxiliary
|
2006-11-06 05:29:56 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Auxiliary::Report
|
2007-05-04 02:56:35 +00:00
|
|
|
include Msf::Exploit::Capture
|
2006-11-06 05:29:56 +00:00
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Simple Network Capture Tester',
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-11-06 05:29:56 +00:00
|
|
|
'Description' => 'This module sniffs HTTP GET requests from the network',
|
|
|
|
'Author' => 'hdm',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Actions' =>
|
|
|
|
[
|
|
|
|
[ 'Sniffer' ]
|
|
|
|
],
|
|
|
|
'PassiveActions' =>
|
|
|
|
[
|
|
|
|
'Sniffer'
|
|
|
|
],
|
|
|
|
'DefaultAction' => 'Sniffer'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
print_status("Opening the network interface...")
|
2007-05-04 02:56:35 +00:00
|
|
|
open_pcap()
|
2008-10-10 02:26:05 +00:00
|
|
|
|
2007-05-04 02:56:35 +00:00
|
|
|
print_status("Sniffing HTTP requests...")
|
2008-10-10 02:26:05 +00:00
|
|
|
each_packet() do |pkt|
|
|
|
|
next if not pkt.tcp?
|
2008-01-25 05:59:06 +00:00
|
|
|
|
2008-10-10 02:26:05 +00:00
|
|
|
if (pkt.payload =~ /GET\s+([^\s]+)\s+HTTP/smi)
|
2006-11-06 05:29:56 +00:00
|
|
|
print_status("GET #{$1}")
|
2008-10-10 02:26:05 +00:00
|
|
|
p pkt.payload
|
2006-11-06 05:29:56 +00:00
|
|
|
end
|
2008-01-25 05:59:06 +00:00
|
|
|
|
|
|
|
true
|
2006-11-06 05:29:56 +00:00
|
|
|
end
|
2008-10-10 02:26:05 +00:00
|
|
|
|
|
|
|
print_status("Finished sniffing")
|
2006-11-06 05:29:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
|