Skip to content

Instantly share code, notes, and snippets.

@Duncaen
Created November 5, 2017 19:50
Show Gist options
  • Select an option

  • Save Duncaen/6f8eb88bb362afa61adfbd80fcf63876 to your computer and use it in GitHub Desktop.

Select an option

Save Duncaen/6f8eb88bb362afa61adfbd80fcf63876 to your computer and use it in GitHub Desktop.
tmp@pi$ cat >test.sh
echo hi
tmp@pi$ chmod +x te
term.p9 test.sh
tmp@pi$ chmod +x test.sh
tmp@pi$ cat >test.c
#include <unistd.h>
int
main(){
return execve("test.sh",0,0);
}
tmp@pi$ make test
cc test.c -o test
tmp@pi$ ./test
tmp@pi?255$ cat >test.sh
#/bin/sh
echo hi
tmp@pi$ ./test
hi
tmp@pi$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment