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

Merged
merged 8 commits into from
Oct 28, 2024

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

@peace-maker peace-maker marked this pull request as ready for review October 26, 2024 11:33
@peace-maker peace-maker force-pushed the tube_upload_manually branch 3 times, most recently from 9191f13 to cea14a1 Compare October 26, 2024 13:42
@peace-maker peace-maker merged commit 6f0793e into Gallopsled:dev Oct 28, 2024
9 of 10 checks passed
@peace-maker peace-maker deleted the tube_upload_manually branch October 28, 2024 20:11
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