Skip to content

Instantly share code, notes, and snippets.

@chosenonehacks
Created September 12, 2017 08:47
Show Gist options
  • Save chosenonehacks/0f797376a9f7fab90161b69576a63731 to your computer and use it in GitHub Desktop.
Save chosenonehacks/0f797376a9f7fab90161b69576a63731 to your computer and use it in GitHub Desktop.
Hijack a binary's full path in bash to exec your own code
$ function /usr/bin/foo () { /usr/bin/echo "It works"; }
$ export -f /usr/bin/foo
$ /usr/bin/foo
It works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment