forked from rapid7/metasploit-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlmap_session.rb
More file actions
37 lines (32 loc) · 853 Bytes
/
sqlmap_session.rb
File metadata and controls
37 lines (32 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module Sqlmap
class Session
def initialize(host, port = 8775)
@host = host
@port = port
end
def get(uri, headers = nil, params = nil)
c = Rex::Proto::Http::Client.new(@host, @port)
args = {
'uri' => uri
}
args['headers'] = headers if headers
args['vars_get'] = params if params
res = c.request_cgi(args)
res = c.send_recv(res)
return res
end
def post(uri, headers = nil, data = nil, originator_args = nil)
c = Rex::Proto::Http::Client.new(@host, @port)
args = {
'uri' => uri,
'method' => 'POST'
}
args.merge!(originator_args) if originator_args
args['headers'] = headers if headers
args['data'] = data if data
res = c.request_cgi(args)
res = c.send_recv(res)
return res
end
end
end