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

Add the 'raw' option to SSH shell initialization #2037

Merged
merged 3 commits into from
Apr 20, 2022
Merged

Add the 'raw' option to SSH shell initialization #2037

merged 3 commits into from
Apr 20, 2022

Conversation

sourque
Copy link
Contributor

@sourque sourque commented Feb 18, 2022

This permits the use of the SSH shell as an arbitrary TCP tunnel by bypassing the startup environmental checks.

sourque and others added 3 commits February 18, 2022 14:00
This permits the use of the SSH shell as an arbitrary TCP tunnel by
bypassing the startup environmental checks.

Co-authored-by: LMS57 <[email protected]>
@sourque
Copy link
Contributor Author

sourque commented Mar 1, 2022

The reasoning behind this change is to allow pwntools to be used in non-standard SSH environments. For example, if SSH is configured to run a target binary with ForceCommand, or their default shell is changed, then the environment probing done by pwntools by default will cause the session to hang indefinitely.

This fails to initialize a session:

    p = ssh(user="bewilderment", host="bewilderment.hostbin.org",
            password="bewilderment").shell()

With this patch, the following now works as expected:

    p = ssh(user="bewilderment", host="bewilderment.hostbin.org",
            password="bewilderment", raw=True).shell()

@Arusekk Arusekk merged commit 6ba46d4 into Gallopsled:dev Apr 20, 2022
gogo2464 pushed a commit to gogo2464/pwntools that referenced this pull request Sep 10, 2023
* Add the 'raw' option to SSH shell initialization

This permits the use of the SSH shell as an arbitrary TCP tunnel by
bypassing the startup environmental checks.

Co-authored-by: LMS57 <[email protected]>

* Add changelog items

* Add assignment to self variable

Co-authored-by: LMS57 <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants