Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Unicode Decode Error in "Get Current Agents" REST API Call #821

Closed
utkusen opened this issue Nov 15, 2017 · 5 comments · Fixed by #866
Closed

Unicode Decode Error in "Get Current Agents" REST API Call #821

utkusen opened this issue Nov 15, 2017 · 5 comments · Fixed by #866
Assignees
Labels

Comments

@utkusen
Copy link
Contributor

utkusen commented Nov 15, 2017

Empire Version

2.3

OS Information (Linux flavor, Python version)

Tried under macOS and Kali Linux

Expected behavior and description of the error, including any actions taken immediately prior to the error. The more detail the better.

I got two active agents on Empire. Information regarding to these agents are listed below:
https://i.imgur.com/G4YyOkJ.png
https://i.imgur.com/3tGGSSv.png

When I execute "Get Current Agents" API call, I got following error:

UnicodeDecodeError('utf8', 'n\x91I/g\x05J\xfc\xdd\x01\xf1\xee>A\\\xeb\xe0\xe1\xee\xb9\xf537}\xa7\xb2\xfaK\xd2\x05\xc0Y', 1, 2, 'inval
id start byte')

I believe the problem is related with second agent's session_key. There are some characters shown as "?". Also, when I remove this agent and make the api call again, it works without a problem.

@xorrior xorrior self-assigned this Dec 12, 2017
@xorrior
Copy link
Contributor

xorrior commented Dec 12, 2017

@utkusen thanks for pointing this out.

@xorrior xorrior added the bug label Dec 12, 2017
@utkusen
Copy link
Contributor Author

utkusen commented Dec 14, 2017

@xorrior for your information I fixed this by changing "session_key":session_key to "session_key":session_key.decode('latin-1').encode("utf-8") on empire file line 743 (https://github.com/EmpireProject/Empire/blob/master/empire#L743)

@xorrior
Copy link
Contributor

xorrior commented Dec 15, 2017

@utkusen would you mind submitting a PR for the fix you implemented?

@utkusen
Copy link
Contributor Author

utkusen commented Dec 15, 2017

@xorrior done

@xorrior
Copy link
Contributor

xorrior commented Dec 15, 2017

@utkusen thanks!

xorrior added a commit that referenced this issue Dec 18, 2017
Fix for Unicode Error for session_key variable (Issue #821)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants