πŸ‘¨β€πŸ’»
Jawad's Notes
  • πŸ‘¨β€πŸ«INFOSEC
    • πŸ•ΈοΈWeb
      • Burp Suite: Setting Foxyproxy
      • XSS
      • Wappalyzer
      • Directory Traversal
      • LFI
        • PHP Wrappers
        • RFI
      • Reverse Shell
        • Command Injection Quick Tips
      • File Upload
      • WPScan
      • SQL Injection
        • Schemas
        • SQLmap
        • MSSQL
        • MySQL
        • PostgreSQL
    • πŸ”§Tools
      • Whois
      • DNSRecon
      • DNSenum
      • nslookup
      • Netcat
        • Powercat
      • Nmap
        • Nmap Scripting Engine
        • Test-NetConnection
        • Grep
      • Server Message Block (SMB)
      • SNMP
      • SMTP
      • ExifTool
      • Search Engine Hacking
      • Source Control Hacking
      • Nessus
      • Canarytokens
      • Qualys SSL Server Test
      • Security Headers
      • theHarvester
      • Shodan
      • Gobuster
        • Dirb
      • Searchsploit
      • Password Cracking
        • Hashcat
        • John The Ripper
        • Hydra
        • hashID
        • CPU vs GPU
    • 🐧Linux
      • Symbols
      • cat
      • curl
      • openvpn
      • tcpdump
      • Remote Desktop
      • SmbShare
      • Tmux
      • Convert Windows-style line endings (CRLF) to Unix-style (LF)
      • SSH
    • πŸ–₯️Macros in Office
    • 🍎Enhancing Your MacOS Terminal Experience
    • 🚩CTF
      • SQL Injection
        • WHERE clause allowing retrieval of hidden data
        • Allowing login bypass
        • UNION attack, determining the number of columns returned by the query
        • UNION attack, finding a column containing text
        • UNION attack, retrieving data from other tables
        • UNION attack, retrieving multiple values in a single column
        • Querying the database type and version on Oracle
Powered by GitBook
On this page
  1. INFOSEC
  2. Web

File Upload

File Upload Vulnerabilities arise when a web application allows users to upload files without proper validation or sanitization, potentially leading to unauthorized file execution, data breaches, or server compromise.

How File Upload Vulnerabilities Work

  • Attackers exploit inadequate validation of uploaded files to upload and execute malicious scripts or overwrite critical files.

  • Commonly targeted areas include web forms allowing image, document, or media uploads.

Typical Vulnerable Scenarios

  • Lack of proper file type validation, allowing executable scripts to be uploaded.

  • Insecure file storage, where uploaded files are accessible through web browsers.

Exploitation Techniques

  • Malicious File Upload: Uploading files with scripts (PHP, JavaScript) embedded in seemingly benign files (images, PDFs).

  • Extension Tampering: Changing the file extension to bypass validation checks (e.g., evil.php.jpg).

  • Path Traversal in File Names: Using path traversal sequences (e.g., ../../) in file names to overwrite critical files.

Mitigation Strategies

  • Strict Validation: Validate file type by checking MIME types and file extensions both on client-side and server-side.

  • File Type Verification: Implement server-side checks to verify the actual type of the uploaded file (e.g., magic numbers for images).

  • Storage and Access: Store uploaded files in a directory outside of the webroot, with indirect access through a script.

  • File Execution Prevention: Configure server settings to prevent execution of files in upload directories.

  • Regular Scanning: Periodically scan upload directories for unexpected or potentially malicious files.

PreviousCommand Injection Quick TipsNextWPScan

Last updated 3 months ago

πŸ‘¨β€πŸ«
πŸ•ΈοΈ