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

[BUG] Error processing result packet from 'agent ID' : a bytes-like object is required, not 'str' #331

Closed
jtheanalytica opened this issue Oct 8, 2020 · 9 comments · Fixed by #396
Labels
bug Something isn't working confirmed

Comments

@jtheanalytica
Copy link

Note: Please fill out all sections (if applicable) and do not delete the below section headers, otherwise the bot will close the issue.

Empire Version

  • Empire 3.4.0

OS Information (Linux flavor, Python version)

  • OS:
    Oracle VM Virtual Box
    Host: Windows 10 pro
    VM1: Kali 2020.3
    VM2: macOS Catalina Version 10.15.5

  • Python:
    Kali:
    python3 -V
    Python 3.8.6

python -V
Python 2.7.18

macOS:
pyhton3 -V
3.8.2

python -V
2.7.16

Describe the bug

A clear and concise description of what the bug is.
When I use the Empire module: usemodule collection/osx/prompt

I get the following error:
[!] Error processing result packet from PWS7R0PW : a bytes-like object is required, not 'str'

To Reproduce

Steps to reproduce the behavior:

  1. On Kali:
    root@kali:~# cd /opt/Empire/
    root@kali:/opt/Empire# ./empire

  2. To create stager:
    (Empire) > usestager osx/applescript
    (Empire: stager/osx/applescript) > execute

  3. Go to the macOS and copy the script and compile into executable. Then save it to disk and then double click the executable file.

  4. Go back to Empire on Kali. You'll see a new agent was created (see snapshot)

(Empire) >
[] Sending PYTHON stager (stage 1) to 10.0.2.15
[
] Agent PWS7R0PW from 10.0.2.15 posted valid Python PUB key
[] New agent PWS7R0PW checked in
[+] Initial agent PWS7R0PW from 10.0.2.15 now active (Slack)
[
] Sending agent (stage 2) to PWS7R0PW at 10.0.2.15
[!] strip_python_comments is deprecated and should not be used

  1. (Empire) > agents

[*] Active agents:

Name La Internal IP Machine Name Username Process PID Delay Last Seen Listener


PWS7R0PW py 10.0.2.15
iamrichs-iMac.loc iamrich /Library/Developer 575 5/0.0 2020-10-08 11:44:24 httpAll

(Empire: agents) > interact PWS7R0PW
(Empire: PWS7R0PW) > sysinfo
[] Tasked PWS7R0PW to run TASK_SYSINFO
[
] Agent PWS7R0PW tasked with task ID 1
(Empire: PWS7R0PW) >
Listener: http://10.0.2.47:8080
Internal IP: 10.0.2.15

Username: \iamrich
Hostname: iamrichs-iMac.local
OS: Darwin,iamrichs-iMac.local,19.5.0,Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64,x86_64
High Integrity: 0
Process Name: /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python
Process ID: 575
Language: python
Language Version: 3.8

(Empire: PWS7R0PW) > usemodule collection/osx/prompt
(Empire: python/collection/osx/prompt) >

(Empire: python/collection/osx/prompt) > execute
[>] Module is not opsec safe, run? [y/N] y
[] Tasked PWS7R0PW to run TASK_CMD_WAIT
[
] Agent PWS7R0PW tasked with task ID 2
[*] Tasked agent PWS7R0PW to run module python/collection/osx/prompt

Go to macOS VM and you'll see a pop window prompting for App store password (see snapshot)

  1. I provide the password and click ok.

  2. Go to Empire on Kali and I get the following error:
    (Empire: python/collection/osx/prompt) > [!] Error processing result packet from PWS7R0PW : a bytes-like object is required, not 'str'

Expected behavior

I should get the password - I provided in the App store prompt windows - in plain text.

Screenshots

If applicable, add screenshots to help explain your problem.
Empire Git 01
Empire Git 02
Empire Git 03

Additional context

Add any other context about the problem here.

@jtheanalytica jtheanalytica added the bug Something isn't working label Oct 8, 2020
@jtheanalytica
Copy link
Author

Hi.
Any one could help please?

@Cx01N
Copy link

Cx01N commented Nov 11, 2020

This PR should fix it, can you test it out and make sure it works on your end too?
#396

@Cx01N Cx01N linked a pull request Nov 11, 2020 that will close this issue
@jtheanalytica
Copy link
Author

jtheanalytica commented Nov 14, 2020

Hi @Cx01N .
Thank you.
But I still am getting the same issue:
(Empire: python/collection/osx/prompt) > [!] Error processing result packet from 73O2V67F : a bytes-like object is required, not 'str'

I installed empire using:
apt install powershell-empire

And the version now is:
3.6.0

Empire3 6 0

Ciao

@Cx01N
Copy link

Cx01N commented Nov 14, 2020

You’ll have to install Empire through git clone and checkout the branch to test it. This change isn’t pushed to the Kali repo yet.

@jtheanalytica
Copy link
Author

Thank you @anthony.

Just to be on the same page, I'll be using the following commands:

git clone https://github.com/BC-SECURITY/Empire.git
cd Empire
./setup/install.sh

Please confirm, or suggest otherwise.

Also please explain how to checkout the branch to test it.

Thanks.

@Cx01N
Copy link

Cx01N commented Nov 14, 2020

You'll want to run:

git clone https://github.com/BC-SECURITY/Empire.git
cd Empire
git checkout python_prompt_fix
./setup/install.sh
sudo ./empire --reset
sudo ./empire

FYI, I'm @Cx01N so the notifications go to the right person next time ;)

@jtheanalytica
Copy link
Author

Thank you, @Cx01N
Surething! Lemme try that and will get back with the results.

Ciao

@jtheanalytica
Copy link
Author

Hey @Cx01N
Works like a charm.
Thanks

Anything you'd like me to do on my end before closing this?
Ciao

@Cx01N
Copy link

Cx01N commented Nov 15, 2020

Should be good to go, thanks.
I'll get it added to the new release.

@Cx01N Cx01N closed this as completed Nov 16, 2020
vinnybod added a commit that referenced this issue Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants