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

Incorrect pading error #101

Open
yurivich opened this issue Aug 17, 2021 · 14 comments
Open

Incorrect pading error #101

yurivich opened this issue Aug 17, 2021 · 14 comments
Labels
bug Something isn't working

Comments

@yurivich
Copy link

yurivich commented Aug 17, 2021

I've just installed Shad0w and fired up the application and got a working beacon, however when I try to run any commands on the beacon I keep getting the same error :

[2021-08-18 04:48:26,683] ERROR in app: Exception on /tasks [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2070, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/root/shad0w/lib/http_server.py", line 59, in web_task_beacon
return phandle.task_beacon(request)
File "/root/shad0w/lib/path_handler.py", line 40, in task_beacon
beacon_id, opcode, data = tools.get_data_from_json(jdata)
File "/root/shad0w/lib/tools.py", line 48, in get_data_from_json
data = base64.b64decode(data).decode()
File "/usr/lib/python3.9/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

@yurivich
Copy link
Author

yurivich commented Aug 17, 2021

Just found out that running the C2 using sudo python3 shad0w.py listen -e x.x.x.x actually works and does not give that error, but running it this way : sudo shad0w listen -e x.x.x.x does give the error

@kousha1999
Copy link

kousha1999 commented Aug 18, 2021

I have this problem too, and sudo python3 shad0w.py listen -e x.x.x.x didn't work for me!

@kousha1999
Copy link

I've found it root cause is lack of "=" in padding. I've printed the output (edited source code) and decoded by myself.
2021-08-18_12-25
2021-08-18_12-25_1

2021-08-18_12-24

@bats3c
Copy link
Owner

bats3c commented Aug 25, 2021

Im aware of this issue, and will get on fixing it soon

@bats3c bats3c added the bug Something isn't working label Aug 25, 2021
@eqn-group
Copy link
Contributor

Did you try running directly from latest source code?

@kousha1999
Copy link

Yes.

@Adastra-thw
Copy link

I've found the same issue but not only this, almost every command that I run don't gets executed. Only works the commands that depends on other tools like the binaries in Ghospack. For example, the meterpreter command "seems to work", but the instruction is never send to the remote server. I've tried this in Windows Server 2019 and Windows 10 Home/PRO. I think this issue is related with this, for that reason I write here, but if it's another thing I can open a new issue

@eqn-group
Copy link
Contributor

i made some pull request and closed it. check recent closed pull request.

@Adastra-thw
Copy link

Yes, I've seen the pull request, the files changed are not included in master yet but in any case I've checked that it doesn't solves the issue. Applying the changes I still get "Incorrect padding" when lunch some simple commands and in other cases it (seems) don't perform any action

@hookthieves
Copy link

Hello all,
Just wondering if anyone got this working on their end? I have the same issue as everyone else.

@Adastra-thw
Copy link

Hello all,
Just wondering if anyone got this working on their end? I have the same issue as everyone else.

No changes in the repository, issue still present.

@neil-fox
Copy link

Same issue

1 similar comment
@cr7pt0pl4gu3
Copy link

Same issue

@milldawgydawg
Copy link

Made the change to core.c as mentioned by kousha1999 and doesn't appear to solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants