-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 tube.upload_manually
to upload files in chunks
#2410
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Upload data in chunks when having a tube connected to a shell. This is useful when doing kernel or qemu challenges where you can't use the ssh tube's file upload features.
Have you heard about fish:// protocol? It is basically using shell commands in order to navigate a filesystem. We could implement a subset of it for the generic tube. And we could also add tty escaping (like with the newline), adding ^V (termios lnext) before any special character.
Email z czwartku 23 maja 2024 od peace-makera:
… Upload data in chunks when having a tube connected to a shell. This is useful when doing kernel or qemu challenges where you can't use the ssh tube's file upload features.
Basically implements
```python
exploit = read('./exploit')
for chunk in group(64, exploit):
io.sendlineafter(b'$', f'echo {b64e(chunk)} | base64 -d >> ./exploit'.encode())
io.sendlineafter(b'$', b'chmod +x ./exploit && ./exploit')
# becomes
exploit = read('./exploit')
io.upload_manually(exploit, target_path='./exploit')
io.sendlineafter(b'$', b'./exploit')
```
with optional compression if the target supports it and nicer progress output.
WIP since it needs tests.
Fixes #2367
You can view, comment on, or merge this pull request online at:
#2410
-- Commit Summary --
* Add `tube.upload_manually`
-- File Changes --
M pwnlib/tubes/tube.py (88)
-- Patch Links --
https://github.com/Gallopsled/pwntools/pull/2410.patch
https://github.com/Gallopsled/pwntools/pull/2410.diff
--
Reply to this email directly or view it on GitHub:
#2410
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
--
Wysłane z mojego urządzenia Sailfish
|
Lol, no. We could I guess, but maybe taking inspiration by the used shell commands only https://en.wikipedia.org/wiki/Files_transferred_over_shell_protocol |
9191f13
to
cea14a1
Compare
cea14a1
to
f5f8b33
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upload data in chunks when having a tube connected to a shell. This is useful when doing kernel or qemu challenges where you can't use the ssh tube's file upload features.
Basically implements
with optional compression if the target supports it and nicer progress output.
WIP since it needs tests.
Fixes #2367