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

When upgrading TTY to interactive its crashes after performing the fg #81

Closed
dalemazza opened this issue Jun 10, 2020 · 12 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@dalemazza
Copy link

ISSUE TYPE

  • When upgrading the pwncat --self inject to fully interactive tty upon doing the stty raw -echo then fg it crashes pwncat

unsure if this is me doing something wrong but i and a few others i know have this issue thanks

@dalemazza dalemazza added the question Further information is requested label Jun 10, 2020
@cytopia
Copy link
Owner

cytopia commented Jun 10, 2020

@dalemazza Thanks for creating this issue. I can reproduce this myself and will start looking into it.

@cytopia cytopia self-assigned this Jun 10, 2020
@cytopia cytopia added bug Something isn't working and removed question Further information is requested labels Jun 10, 2020
@dalemazza
Copy link
Author

Amazing! I'm glad it wasn't just my end. Such a fantastic tool!

@cytopia
Copy link
Owner

cytopia commented Jun 11, 2020

Some heads-up here:

It is supposedly this line which is causing the issue (I am reading line-wise): https://github.com/cytopia/pwncat/blob/master/bin/pwncat#L3072

In raw mode, it doesn't send lines, but single characters instead, so it's waiting forever until \n appears (which also doesn't work with Enter). Will need to make the following changes:

  • If raw mode: read character-wise (also ensure it works cross-platform)
  • If not raw mode: do as it does at the moment

@cytopia cytopia added this to the Release v0.1.0 milestone Jun 12, 2020
@cytopia
Copy link
Owner

cytopia commented Jun 12, 2020

@dalemazza I've created a fix that works for me (it's not yet released to PIP yet).

You can try it out via:

git clone https://github.com/cytopia/pwncat
cd pwncat
git checkout release-0.0.23
pip install .

Please let me know how that works for you.

@dalemazza
Copy link
Author

@cytopia Thanks for the quick turn around.

Have just tested my end and it is working now!

image

As you can see on the screenshot it works! Also do you have any idea why it does not pick up any python versions installed when it clearly has python installed on the box?

@cytopia
Copy link
Owner

cytopia commented Jun 12, 2020

Also do you have any idea why it does not pick up any python versions installed when it clearly has python installed on the box?

Is that the same behaviour as with the previous version?

@dalemazza
Copy link
Author

yes it is. I have never managed to get it to find a python version and use the inject function yet, despite knowing that the python is installed int the directories it probes for?

@cytopia
Copy link
Owner

cytopia commented Jun 12, 2020

Can you paste the full out when it is probing for Python versions.

@dalemazza
Copy link
Author

kali@kali:/opt/pwncat$ pwncat -l 1234 --self-inject /bin/bash:10.9.33.138:1234
[PWNCAT CnC] Probing for: /bin/python
[PWNCAT CnC] Probing for: /bin/python2
[PWNCAT CnC] Probing for: /bin/python2.7
[PWNCAT CnC] Probing for: /bin/python3
[PWNCAT CnC] Probing for: /bin/python3.5
[PWNCAT CnC] Probing for: /bin/python3.6
[PWNCAT CnC] Probing for: /bin/python3.7
[PWNCAT CnC] Probing for: /bin/python3.8
[PWNCAT CnC] Probing for: /usr/bin/python
[PWNCAT CnC] Probing for: /usr/bin/python2
[PWNCAT CnC] Probing for: /usr/bin/python2.7
[PWNCAT CnC] Probing for: /usr/bin/python3
[PWNCAT CnC] Probing for: /usr/bin/python3.5
[PWNCAT CnC] Probing for: /usr/bin/python3.6
[PWNCAT CnC] Probing for: /usr/bin/python3.7
[PWNCAT CnC] Probing for: /usr/bin/python3.8
[PWNCAT CnC] Probing for: /usr/local/bin/python
[PWNCAT CnC] Probing for: /usr/local/bin/python2
[PWNCAT CnC] Probing for: /usr/local/bin/python2.7
[PWNCAT CnC] Probing for: /usr/local/bin/python3
[PWNCAT CnC] Probing for: /usr/local/bin/python3.5
[PWNCAT CnC] Probing for: /usr/local/bin/python3.6
[PWNCAT CnC] Probing for: /usr/local/bin/python3.7
[PWNCAT CnC] Probing for: /usr/local/bin/python3.8
[PWNCAT CnC] Probing for: /usr/local/python/bin/python
[PWNCAT CnC] Probing for: /usr/local/python/bin/python2
[PWNCAT CnC] Probing for: /usr/local/python/bin/python2.7
[PWNCAT CnC] Probing for: /usr/local/python/bin/python3
[PWNCAT CnC] Probing for: /usr/local/python/bin/python3.5
[PWNCAT CnC] Probing for: /usr/local/python/bin/python3.6
[PWNCAT CnC] Probing for: /usr/local/python/bin/python3.7
[PWNCAT CnC] Probing for: /usr/local/python/bin/python3.8
[PWNCAT CnC] Probing for: /usr/local/python2/bin/python
[PWNCAT CnC] Probing for: /usr/local/python2/bin/python2
[PWNCAT CnC] Probing for: /usr/local/python2/bin/python2.7
[PWNCAT CnC] Probing for: /usr/local/python2/bin/python3
[PWNCAT CnC] Probing for: /usr/local/python2/bin/python3.5
[PWNCAT CnC] Probing for: /usr/local/python2/bin/python3.6
[PWNCAT CnC] Probing for: /usr/local/python2/bin/python3.7
[PWNCAT CnC] Probing for: /usr/local/python2/bin/python3.8
[PWNCAT CnC] Probing for: /usr/local/python2.7/bin/python
[PWNCAT CnC] Probing for: /usr/local/python2.7/bin/python2
[PWNCAT CnC] Probing for: /usr/local/python2.7/bin/python2.7
[PWNCAT CnC] Probing for: /usr/local/python2.7/bin/python3
[PWNCAT CnC] Probing for: /usr/local/python2.7/bin/python3.5
[PWNCAT CnC] Probing for: /usr/local/python2.7/bin/python3.6
[PWNCAT CnC] Probing for: /usr/local/python2.7/bin/python3.7
[PWNCAT CnC] Probing for: /usr/local/python2.7/bin/python3.8
[PWNCAT CnC] Probing for: /usr/local/python3/bin/python
[PWNCAT CnC] Probing for: /usr/local/python3/bin/python2
[PWNCAT CnC] Probing for: /usr/local/python3/bin/python2.7
[PWNCAT CnC] Probing for: /usr/local/python3/bin/python3
[PWNCAT CnC] Probing for: /usr/local/python3/bin/python3.5
[PWNCAT CnC] Probing for: /usr/local/python3/bin/python3.6
[PWNCAT CnC] Probing for: /usr/local/python3/bin/python3.7
[PWNCAT CnC] Probing for: /usr/local/python3/bin/python3.8
[PWNCAT CnC] Probing for: /usr/local/python3.5/bin/python
[PWNCAT CnC] Probing for: /usr/local/python3.5/bin/python2
[PWNCAT CnC] Probing for: /usr/local/python3.5/bin/python2.7
[PWNCAT CnC] Probing for: /usr/local/python3.5/bin/python3
[PWNCAT CnC] Probing for: /usr/local/python3.5/bin/python3.5
[PWNCAT CnC] Probing for: /usr/local/python3.5/bin/python3.6
[PWNCAT CnC] Probing for: /usr/local/python3.5/bin/python3.7
[PWNCAT CnC] Probing for: /usr/local/python3.5/bin/python3.8
[PWNCAT CnC] Probing for: /usr/local/python3.6/bin/python
[PWNCAT CnC] Probing for: /usr/local/python3.6/bin/python2
[PWNCAT CnC] Probing for: /usr/local/python3.6/bin/python2.7
[PWNCAT CnC] Probing for: /usr/local/python3.6/bin/python3
[PWNCAT CnC] Probing for: /usr/local/python3.6/bin/python3.5
[PWNCAT CnC] Probing for: /usr/local/python3.6/bin/python3.6
[PWNCAT CnC] Probing for: /usr/local/python3.6/bin/python3.7
[PWNCAT CnC] Probing for: /usr/local/python3.6/bin/python3.8
[PWNCAT CnC] Probing for: /usr/local/python3.7/bin/python
[PWNCAT CnC] Probing for: /usr/local/python3.7/bin/python2
[PWNCAT CnC] Probing for: /usr/local/python3.7/bin/python2.7
[PWNCAT CnC] Probing for: /usr/local/python3.7/bin/python3
[PWNCAT CnC] Probing for: /usr/local/python3.7/bin/python3.5
[PWNCAT CnC] Probing for: /usr/local/python3.7/bin/python3.6
[PWNCAT CnC] Probing for: /usr/local/python3.7/bin/python3.7
[PWNCAT CnC] Probing for: /usr/local/python3.7/bin/python3.8
[PWNCAT CnC] Probing for: /usr/local/python3.8/bin/python
[PWNCAT CnC] Probing for: /usr/local/python3.8/bin/python2
[PWNCAT CnC] Probing for: /usr/local/python3.8/bin/python2.7
[PWNCAT CnC] Probing for: /usr/local/python3.8/bin/python3
[PWNCAT CnC] Probing for: /usr/local/python3.8/bin/python3.5
[PWNCAT CnC] Probing for: /usr/local/python3.8/bin/python3.6
[PWNCAT CnC] Probing for: /usr/local/python3.8/bin/python3.7
[PWNCAT CnC] Probing for: /usr/local/python3.8/bin/python3.8
[PWNCAT CnC] Probing for: /opt/bin/python
[PWNCAT CnC] Probing for: /opt/bin/python2
[PWNCAT CnC] Probing for: /opt/bin/python2.7
[PWNCAT CnC] Probing for: /opt/bin/python3
[PWNCAT CnC] Probing for: /opt/bin/python3.5
[PWNCAT CnC] Probing for: /opt/bin/python3.6
[PWNCAT CnC] Probing for: /opt/bin/python3.7
[PWNCAT CnC] Probing for: /opt/bin/python3.8
[PWNCAT CnC] Probing for: /opt/python/bin/python
[PWNCAT CnC] Probing for: /opt/python/bin/python2
[PWNCAT CnC] Probing for: /opt/python/bin/python2.7
[PWNCAT CnC] Probing for: /opt/python/bin/python3
[PWNCAT CnC] Probing for: /opt/python/bin/python3.5
[PWNCAT CnC] Probing for: /opt/python/bin/python3.6
[PWNCAT CnC] Probing for: /opt/python/bin/python3.7
[PWNCAT CnC] Probing for: /opt/python/bin/python3.8
[PWNCAT CnC] Probing for: /opt/python2/bin/python
[PWNCAT CnC] Probing for: /opt/python2/bin/python2
[PWNCAT CnC] Probing for: /opt/python2/bin/python2.7
[PWNCAT CnC] Probing for: /opt/python2/bin/python3
[PWNCAT CnC] Probing for: /opt/python2/bin/python3.5
[PWNCAT CnC] Probing for: /opt/python2/bin/python3.6
[PWNCAT CnC] Probing for: /opt/python2/bin/python3.7
[PWNCAT CnC] Probing for: /opt/python2/bin/python3.8
[PWNCAT CnC] Probing for: /opt/python2.7/bin/python
[PWNCAT CnC] Probing for: /opt/python2.7/bin/python2
[PWNCAT CnC] Probing for: /opt/python2.7/bin/python2.7
[PWNCAT CnC] Probing for: /opt/python2.7/bin/python3
[PWNCAT CnC] Probing for: /opt/python2.7/bin/python3.5
[PWNCAT CnC] Probing for: /opt/python2.7/bin/python3.6
[PWNCAT CnC] Probing for: /opt/python2.7/bin/python3.7
[PWNCAT CnC] Probing for: /opt/python2.7/bin/python3.8
[PWNCAT CnC] Probing for: /opt/python3/bin/python
[PWNCAT CnC] Probing for: /opt/python3/bin/python2
[PWNCAT CnC] Probing for: /opt/python3/bin/python2.7
[PWNCAT CnC] Probing for: /opt/python3/bin/python3
[PWNCAT CnC] Probing for: /opt/python3/bin/python3.5
[PWNCAT CnC] Probing for: /opt/python3/bin/python3.6
[PWNCAT CnC] Probing for: /opt/python3/bin/python3.7
[PWNCAT CnC] Probing for: /opt/python3/bin/python3.8
[PWNCAT CnC] Probing for: /opt/python3.5/bin/python
[PWNCAT CnC] Probing for: /opt/python3.5/bin/python2
[PWNCAT CnC] Probing for: /opt/python3.5/bin/python2.7
[PWNCAT CnC] Probing for: /opt/python3.5/bin/python3
[PWNCAT CnC] Probing for: /opt/python3.5/bin/python3.5
[PWNCAT CnC] Probing for: /opt/python3.5/bin/python3.6
[PWNCAT CnC] Probing for: /opt/python3.5/bin/python3.7
[PWNCAT CnC] Probing for: /opt/python3.5/bin/python3.8
[PWNCAT CnC] Probing for: /opt/python3.6/bin/python
[PWNCAT CnC] Probing for: /opt/python3.6/bin/python2
[PWNCAT CnC] Probing for: /opt/python3.6/bin/python2.7
[PWNCAT CnC] Probing for: /opt/python3.6/bin/python3
[PWNCAT CnC] Probing for: /opt/python3.6/bin/python3.5
[PWNCAT CnC] Probing for: /opt/python3.6/bin/python3.6
[PWNCAT CnC] Probing for: /opt/python3.6/bin/python3.7
[PWNCAT CnC] Probing for: /opt/python3.6/bin/python3.8
[PWNCAT CnC] Probing for: /opt/python3.7/bin/python
[PWNCAT CnC] Probing for: /opt/python3.7/bin/python2
[PWNCAT CnC] Probing for: /opt/python3.7/bin/python2.7
[PWNCAT CnC] Probing for: /opt/python3.7/bin/python3
[PWNCAT CnC] Probing for: /opt/python3.7/bin/python3.5
[PWNCAT CnC] Probing for: /opt/python3.7/bin/python3.6
[PWNCAT CnC] Probing for: /opt/python3.7/bin/python3.7
[PWNCAT CnC] Probing for: /opt/python3.7/bin/python3.8
[PWNCAT CnC] Probing for: /opt/python3.8/bin/python
[PWNCAT CnC] Probing for: /opt/python3.8/bin/python2
[PWNCAT CnC] Probing for: /opt/python3.8/bin/python2.7
[PWNCAT CnC] Probing for: /opt/python3.8/bin/python3
[PWNCAT CnC] Probing for: /opt/python3.8/bin/python3.5
[PWNCAT CnC] Probing for: /opt/python3.8/bin/python3.6
[PWNCAT CnC] Probing for: /opt/python3.8/bin/python3.7
[PWNCAT CnC] Probing for: /opt/python3.8/bin/python3.8
[PWNCAT CnC] No Python has been found. Aborting and handing over to current shell.

$ 
$ which python
/usr/bin/python

python is installed as i used it to upgrade the shell

@cytopia
Copy link
Owner

cytopia commented Jun 12, 2020

Can you run your local command again in verbose mode (and paste the output here):

pwncat -l 1234 --self-inject /bin/bash:10.9.33.138:1234 -vvvvv

And also let me know what your python version on your system is

@cytopia
Copy link
Owner

cytopia commented Jun 12, 2020

I moved this self-inject issue over to here: #83

@dalemazza
Copy link
Author

dalemazza commented Jun 12, 2020

Moved comment here: #83

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

2 participants