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 tube.upload_manually to upload files in chunks #2410

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

peace-maker
Copy link
Member

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

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

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.
@Arusekk
Copy link
Member

Arusekk commented May 24, 2024 via email

@peace-maker
Copy link
Member Author

Lol, no. We could I guess, but maybe taking inspiration by the used shell commands only

MidnightCommander/mc@3f42309

https://en.wikipedia.org/wiki/Files_transferred_over_shell_protocol

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.

Add tube helper to upload files
2 participants