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
# encode from binary file to base64txt | |
powershell -C "& {$outpath = (Join-Path (pwd) 'out_base64.txt'); $inpath = (Join-Path (pwd) 'data.jpg'); [IO.File]::WriteAllText($outpath, ([convert]::ToBase64String(([IO.File]::ReadAllBytes($inpath)))))}" | |
# decode from base64txt to binary file | |
powershell -C "& {$outpath = (Join-Path (pwd) 'outdata2.jpg'); $inpath = (Join-Path (pwd) 'out_base64.txt'); [IO.File]::WriteAllBytes($outpath, ([convert]::FromBase64String(([IO.File]::ReadAllText($inpath)))))}" |
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
I'll be omitting syscalls with ellipsis. | |
The first thing that happens after you press enter is that bash resolves | |
curl to /usr/bin/curl and then forks(). The strace output is from the | |
forked process. | |
Fist execve() the /usr/bin/curl binary and pass an array of arguments to it. | |
execve("/usr/bin/curl", ["curl", "http://github.com"], [/* 8 vars */]) = 0 | |
... |