LFI on DVWA can't open script in /tmp/
Hey guys. Right now I'm trying to do a custom exercise on DVWA where I try to execu 2025-1-19 16:7:15 Author: www.reddit.com(查看原文) 阅读量:8 收藏

Hey guys.

Right now I'm trying to do a custom exercise on DVWA where I try to execute a PHP script which has been deposited in /tmp/ via a LFI.

Unfortunately I always receive these two warnings, without much happening:

Warning: include(../../../../../../tmp/powned.php): Failed to open stream: No such file or directory in /var/www/html/DVWA/vulnerabilities/fi/index.php on line 36

Warning: include(): Failed opening '../../../../../../tmp/powned.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/DVWA/vulnerabilities/fi/index.php on line 36

The query I'm using is:

http://localhost/DVWA/vulnerabilities/fi/?page=../../../../../../tmp/powned.php

Weirdly enough I'm perfectly able to execute this, if I manually put it in /etc/. Generally I'm not able to access any file in /tmp/.

The DVWA has been set up on a kali vm according to the tutorial of Robin Wood and appears to otherwise work fine.

  • So far I tried changing permissions to 777 on all files and the directory itself as well, as changing ownership to www-data.

  • I made sure to enable allow_url_include and fopen

  • I tried adding a symlink from /etc/powned.php to /tmp/powned.php to no avail

  • Tried manually adding all directories to open_basedir and disabling this option

  • Various amounts of "../" as well as other absolute and relative paths

  • And of course double and tripple checking the spelling, file contents and php.ini

Keep in mind I want to execute the file, while it is in /tmp/

Kinda at my wits end with this, and would be really thankfull if someone could give me a hint towards the right direction.

Edit: Security Level is set to low


文章来源: https://www.reddit.com/r/netsecstudents/comments/1i51u1q/lfi_on_dvwa_cant_open_script_in_tmp/
如有侵权请联系:admin#unsafe.sh