some cleanup

git-svn-id: file:///home/svn/incoming/trunk@3191 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Miller 2005-12-08 05:55:44 +00:00
parent 07666b192e
commit 947f53518a
4 changed files with 22 additions and 8 deletions

View File

@ -573,11 +573,11 @@ protected
if (v.kind_of?(Array))
v.map { |ent|
xlate_param(ent)
}.join(',')
}.join(',,')
elsif (v.kind_of?(Hash))
v.map { |k,v|
"#{URI.escape(k)}:#{xlate_param(v)}" if (v)
}.join(',')
}.join(',,')
else
URI.escape(v.to_s)
end

View File

@ -31,10 +31,17 @@ class Client
#
# Initializes a GET request and returns it to the caller.
#
def self.get(uri = '/', proto = DefaultProtocol)
def gen_get(uri = '/', proto = DefaultProtocol)
return init_request(Request::Get.new(uri, proto))
end
#
# Initializes a POST request and returns it to the caller.
#
def gen_post(uri = '/', proto = DefaultProtocol)
return init_request(Request::Post.new(uri, proto))
end
def initialize(host, port = 80)
self.hostname = host
self.port = port.to_i

View File

@ -270,7 +270,8 @@ protected
# Extract the actual hexadecimal length value
clen = self.bufq.slice!(/.*\r*\n/)
clen.rstrip!
clen.rstrip! if (clen)
self.body_bytes_left = clen.hex
if (self.body_bytes_left == 0)

View File

@ -117,10 +117,6 @@ cmd_args =
# Extract the command
cmd = ARGV.shift
if (ARGV.length == 0)
ARGV.unshift("-h")
end
# Create the opcode client instance
client = Rex::Exploitation::OpcodeDb::Client.new
@ -161,6 +157,11 @@ case cmd
when "platforms"
client.platforms($filter).each { |p| puts "#{p.desc}" }
when "modules"
if (ARGV.length == 0)
$stderr.puts("Filter criteria required -- specify '-h' for help.")
exit
end
modules = client.modules($filter)
# If we're displaying extra information on a per-module basis, then we
@ -277,6 +278,11 @@ case cmd
puts("\n" + tbl.to_s + "\n")
end
when "search"
if (ARGV.length == 0)
$stderr.puts("Filter criteria required -- specify '-h' for help.")
exit
end
opcodes = client.search($filter)
tbl = Rex::Ui::Text::Table.new(