Skip to content

Commit 77eac38

Browse files
committed
Pymeterpreter fix processes_via_proc for Python v3
1 parent 4f5ab2c commit 77eac38

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

data/meterpreter/ext_server_stdapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,14 +753,14 @@ def stdapi_sys_process_get_processes_via_proc(request, response):
753753
def stdapi_sys_process_get_processes_via_ps(request, response):
754754
ps_args = ['ps', 'ax', '-w', '-o', 'pid,ppid,user,command']
755755
proc_h = subprocess.Popen(ps_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
756-
ps_output = proc_h.stdout.read()
756+
ps_output = str(proc_h.stdout.read())
757757
ps_output = ps_output.split('\n')
758758
ps_output.pop(0)
759759
for process in ps_output:
760760
process = process.split()
761761
if len(process) < 4:
762762
break
763-
pgroup = ''
763+
pgroup = bytes()
764764
pgroup += tlv_pack(TLV_TYPE_PID, int(process[0]))
765765
pgroup += tlv_pack(TLV_TYPE_PARENT_PID, int(process[1]))
766766
pgroup += tlv_pack(TLV_TYPE_USER_NAME, process[2])

modules/payloads/stages/python/meterpreter.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
require 'msf/base/sessions/meterpreter_python'
99
require 'msf/base/sessions/meterpreter_options'
1010

11-
1211
module Metasploit3
1312
include Msf::Sessions::MeterpreterOptions
1413

0 commit comments

Comments
 (0)