8000
Skip to content

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

Merged
Arusekk merged 3 commits intoGallopsled:devfrom
sourque:dev
Apr 20, 2022
Merged

Add the 'raw' option to SSH shell initialization#2037
Arusekk merged 3 commits intoGallopsled:devfrom
sourque:dev

Conversation

@sourque
Copy link
Copy Markdown
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 <logan.stratton@trojans.dsu.edu>
@sourque
Copy link
Copy Markdown
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 <logan.stratton@trojans.dsu.edu>

* Add changelog items

* Add assignment to self variable

Co-authored-by: LMS57 <logan.stratton@trojans.dsu.edu>
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

0