Fixes #3027, a set of bugs introduced during the meterpreter posix work.

git-svn-id: file:///home/svn/framework3/trunk@10773 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2010-10-21 04:43:54 +00:00
parent 6f56086df9
commit 0e04505232
3 changed files with 6 additions and 7 deletions

View File

@ -116,7 +116,7 @@ module Session
# Brief and to the point
#
def inspect
"#<Session:#{self.type} #{self.tunnel_peer} #{self.info ? "\"#{self.info.to_s}\"" : nil}>"
"#<Session:#{self.type} #{self.tunnel_peer} #{self.info ? "\"#{self.info.to_s}\"" : nil}>" # " Fixes highlighting
end
#

View File

@ -51,7 +51,7 @@ class Sniffer < Extension
request = Packet.create_request('sniffer_capture_start')
request.add_tlv(TLV_TYPE_SNIFFER_INTERFACE_ID, intf.to_i)
request.add_tlv(TLV_TYPE_SNIFFER_PACKET_COUNT, maxp.to_i)
request.add_tlv(TLV_TYPE_SNIFFER_ADDITIONAL_FILTER, filter) if filter.length
request.add_tlv(TLV_TYPE_SNIFFER_ADDITIONAL_FILTER, filter) if filter.length > 0
response = client.send_request(request)
end

View File

@ -56,16 +56,15 @@ class Console::CommandDispatcher::Sniffer
end
def cmd_sniffer_start(*args)
intf = args[0].to_i
intf = args.shift.to_i
if (intf == 0)
print_error("Usage: sniffer_start [interface-id] [packet-buffer (1-200000)] [bpf filter (posix meterpreter only)]")
return
end
maxp = args[1].to_i
maxp = 50000 if maxp == 0
filter = args[2..-1].join(" ")
maxp = (args.shift || 50000).to_i
bpf = args.join(" ")
client.sniffer.capture_start(intf, maxp, filter)
client.sniffer.capture_start(intf, maxp, bpf)
print_status("Capture started on interface #{intf} (#{maxp} packet buffer)")
return true
end