Files
metasploit-gs/modules/auxiliary/test_pcap.rb
T
HD Moore 88d3193020 Removed the old pcap mixin, replaced with Capture, updated the test_pcap module
git-svn-id: file:///home/svn/framework3/trunk@4860 4d416f70-5f16-0410-b530-b9f4589650da
2007-05-04 02:56:35 +00:00

57 lines
1.1 KiB
Ruby

##
# $Id$
##
##
# 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/
##
require 'msf/core'
module Msf
class Auxiliary::TestPcap < Msf::Auxiliary
include Auxiliary::Report
include Msf::Exploit::Capture
def initialize
super(
'Name' => 'Simple Network Capture Tester',
'Version' => '$Revision$',
'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...")
open_pcap()
print_status("Sniffing HTTP requests...")
capture.each_packet do |pkt|
next if not pkt.tcp?
next if not pkt.tcp_data
if (pkt.tcp_data =~ /^GET\s+([^\s]+)\s+HTTP/)
print_status("GET #{$1}")
end
end
end
end
end