summaryrefslogtreecommitdiff
path: root/README.md
blob: d3eac86a6ccca5d4b71ec9403c1a5b979e4d7247 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# bin2sh

This converts any file to a shell script, which outputs itself.

This makes it easy to copy/paste a binary into a netcat session to
transfer a file to another system.

## Building
```
make
```

## Example
```
 % ./bin2sh Makefile
echo -ne "\x61\x6c\x6c\x3a\x0a\x09\x67\x63\x63\x20\x2d\x6f\x20\x62\x69\x6e"
echo -ne "\x32\x73\x68\x20\x62\x69\x6e\x32\x73\x68\x2e\x63\x0a\x0a\x63\x6c"
echo -ne "\x65\x61\x6e\x3a\x0a\x09\x72\x6d\x20\x2d\x72\x66\x20\x62\x69\x6e"
echo -ne "\x32\x73\x68\x0a"

 % ./bin2sh Makefile |bash > mf2

 % md5sum mf2 Makefile
2c36f087e9cc78f3a6406f89e70728db  mf2
2c36f087e9cc78f3a6406f89e70728db  Makefile
```