syselement's Blog
🏠 Home BlogXGitHub📚 Buy Me a Book📧 Contact
  • 🏠Home
  • 🔳Operating Systems
    • 🐧Linux
      • 📃Everything Linux
      • Linux Distros
        • Kali Linux - VM
        • ParrotOS - VM
        • Rocky Linux
        • Ubuntu Desktop - VM
        • Ubuntu Server - VM
      • Linux Tools
        • BookStack
        • Nessus Essentials
        • SysReptor
        • Terminator
        • UniFi
        • Zsh & Oh-My-Zsh
    • 🪟Windows
      • 📃Everything Windows
      • Windows Tools
        • Hashcat
        • Vagrant
      • Windows Virtual Machines
        • Windows 11 - VM
        • Windows Server 2025 - VM
  • 📝Courses Notes
    • eLearnSecurity / INE
      • eJPT - PTSv2
      • eMAPT
      • ICCA
    • Practical Networking
      • Practical TLS
        • TLS/SSL Overview
        • Cryptography
        • x509 Certificates and Keys
        • Security through Certificates
        • Cipher Suites
        • TLS/SSL Handshake
        • TLS Defenses
        • TLS Attacks & Vulnerabilities
        • What's new in TLS 1.3?
        • TLS 1.3 Under the Hood
        • TLS 1.3 Extensions
        • 🌐Practical TLS References
    • TCM Security
      • Linux101
      • MAPT
      • PEH
  • 🖥️Cyber Everything
    • 📌Generic Resources
      • Cryptography
      • CVSS 3.1
      • Cyber Threat Intelligence (CTI)
    • 📱Mobile
      • Apps Lab
        • Android Rooting Guide
        • iOS Jailbreak Guide
        • Intercepting Android App Traffic
      • OWASP MAS
        • MASTG Techniques
        • MASTG Tests
        • MASTG Theory
        • MASVS Notes
      • Tools
        • MobSF
    • 🧬Network
      • Commands
        • Linux Privesc Commands
        • Networking Commands
    • 🌐Web
      • API
        • API Sec Fundamentals
        • API Penetration Testing
      • PortSwigger Academy
        • Server-Side Topics
        • Client-Side Topics
        • Advanced topics
        • 🔬Vulnerability Labs
    • ✍️Writeups & Walkthroughs
      • 🌩️TryHackMe
        • 📖Learn
          • Cyber Threat Intelligence
          • Intro to Defensive Security
          • Juice Shop
          • Upload Vulnerabilities
        • 🎯Practice
          • Easy
            • Blaster
            • Blue
            • Bolt
            • Chill Hack
            • Ice
            • Ignite
            • Retro
            • Startup
          • Medium
            • Blog
      • 📦HackTheBox
      • 🚩Capture The Flag
  • ♾️DevOps Everything
    • 🔗DevOps Resources
      • Introduction to DevOps
      • Ansible
      • Docker
      • Git
      • Kubernetes
      • Terraform
      • Vim
  • 🔬Home Lab
    • 🖥️Hypervisors
      • Hyper-V
        • Windows WSL
      • Proxmox
        • Proxmox VE
        • Proxmox Upgrade 7 to 8
      • VMware
        • VMware Workstation Pro
    • 🔴Offensive Labs
      • Hashcat Password Cracking
      • Metasploitable3
    • 🔵Defensive Labs
      • Detection Lab
    • ⚪Misc Labs
      • Bitwarden On-Premise
      • OpenWrt & WiFi Exploitation
      • Passbolt CE - Ubuntu Server
Powered by GitBook
On this page
  • Access control
  • 🎯 Attack
  • 🛡️ Prevention
  • 🔬 Labs
  • 📝 CheatSheet
  • API testing
  • Authentication
  • Business logic vulnerabilities
  • File upload vulnerabilities
  • Information disclosure
  • NoSQL Injection
  • OS command injection
  • Path traversal
  • 🎯 Attack
  • 🛡️ Prevention
  • 🔬 Labs
  • 📝 CheatSheet
  • Race conditions
  • Server-side request forgery (SSRF)
  • SQL injection
  • XML external entity (XXE) injection

Was this helpful?

Edit on GitHub
  1. Cyber Everything
  2. Web
  3. PortSwigger Academy

Server-Side Topics

PreviousPortSwigger AcademyNextClient-Side Topics

Last updated 11 months ago

Was this helpful?


🔬

🔗

Access control - authorize users/processes to perform actions and access resources.

  • Authentication - the users is who they say they are

  • Session management - identify the subsequent HTTP requests made by that user

  • Access control - the user's action is allowed or not

Broken access control are common critical security vulnerabilities:

  • Vertical - restrict access to application sensitive functions to specific types of users (e.g. An admin can modify/delete any user's data/account; An ordinary user cannot)

  • Horizontal - restrict access to resources to specific users (e.g. Different users have access to resources of the same type)

  • Context-dependent - restrict access to functionality and resources base upon the app's state and user's interaction with it (e.g. A user cannot perform actions in the wrong order)

Vertical privilege escalation - a user gains access to functionalities that are not permitted to access.

e.g.

The admin page can be accessed by browsing to the relevant admin URL. In some cases the admin URL is disclosed in locations such as /robots.txt file, or by using a wordlist brute-force attack.

  • Obscuring sensitive features with unpredictable URLs, often termed security by obscurity is not reliable for access control. Users can still find these URLs through various means, like inadvertent disclosure in role-based JavaScript.

  • Access control decisions in certain applications are based on user access rights or roles determined at login, stored in user-controllable locations such as hidden fields, cookies, or preset query string parameters. These parameters can be easily modified.

  • Platform misconfiguration can cause broken access control, where applications restrict access to URLs and HTTP methods based on user roles.

    • Overriding URLs with non-standard HTTP headers such as X-Original-URL and X-Rewrite-URL, can lead to bypassing access controls. Rule e.g. - DENY: POST, /admin/deleteUser, managers

    • The flexibility of HTTP methods can be exploited, such as using GET instead of the restricted method, to bypass platform-level access controls enforced based on URLs and methods.

    • Websites may interpret request paths differently, potentially causing access control URL-matching discrepancies, like treating /admin/deleteUser and /admin/deleteUser/ as separate endpoints, which can be exploited to bypass controls.

Horizontal privilege escalation - a user gains access to resources belonging to another user.

e.g.

A user can access another user's account and associated data and functions, with attack similar to vertical privilege escalation.

  • Manipulating parameters like id in URLs exploiting a IDOR (insecure direct object reference) vulnerability, can expose other's data.

  • While some apps use unpredictable parameters like GUIDs to prevent guessing attacks, these unique identifiers might still be accessible through other app areas (such as user messages or reviews).

  • Sometimes, an app detects unauthorized access attempts and redirects users to the login page. However, the redirected response may still leak sensitive user data.

Horizontal to Vertical privilege escalation - a user gain access to more privileged user functions (admin).

e.g.

The admin page can be accessed using horizontal privesc tampering techniques from an unprivileged user and then perform vertical privesc.

  • Targeting the app's administrator, might disclose admin password or provide access to privileged functionalities.

🎯 Attack

https://insecure-website.com/robots.txt
https://insecure-website.com/admin

# Parameter-based access control
https://insecure-website.com/login/home.jsp?admin=true
https://insecure-website.com/login/home.jsp?role=1

# Platform misconfiguration broken access control
POST / HTTP/1.1
X-Original-URL: /admin/deleteUser

# Horizontal privesc - User-ID Parameter vulnerability (IDOR)
https://insecure-website.com/myaccount?id=123

# Horizontal to Vertical privesc
https://insecure-website.com/myaccount?id=1 # where 1 is and admin id

🛡️ Prevention

🔬 Labs

📝 CheatSheet









Path traversal (directory traversal) - read arbitrary files on a server running an application.

  • Read/Write arbitrary files on the server

  • Modify the app

  • Take full control of the server

e.g.

Loading an image on a HTML website with <img src="/loadImage?filename=218.png"> means the server reads the file 218.png from the /var/www/images/ directory.

🎯 Attack

# Linux
https://insecure-website.com/loadImage?filename=../../../etc/passwd

# Win
https://insecure-website.com/loadImage?filename=..\..\..\windows\win.ini
  • This will make the app read the /var/www/images/../../../etc/passwd path that means /etc/passwd will be actually read.

Defenses like stripping or blocking directory traversal sequences, can be bypassed with:

  • an absolute path (direct reference to a file) from the filesystem root directory - filename=/etc/passwd

  • nested traversal sequences - ....//, ....\/

  • (double) URL encoding the ../ characters - %2e%2e%2f, %252e%252e%252f

  • base folder followed by traversal sequences - filename=/var/www/images/../../../etc/passwd

  • extension at the end, with URL encoded null byte to terminate string - filename=../../../etc/passwd%00.png

🛡️ Prevention

  • Avoid passing user-supplied input to filesystem APIs or

    1. Validate user input (for permitted content/values, whitelist)

🔬 Labs

📝 CheatSheet

# Path Traversal Cheatsheet
../../../etc/passwd
../../../../../../etc/passwd
....//....//....//etc/passwd
....\/....\/....\/etc/passwd
%2e%2e/%2e%2e/%2e%2e{FILE}
%252e%252e%252f{FILE}
%252e%252e%252f%252e%252e%252f%252e%252e%252f{FILE}

../../../windows\win.ini
..\..\..\windows\win.ini





🔬

🔗

📌

📌

Append the input to the base directory. and verify it starts with the expected directory

🔬

🔬

🔬

🔬

🔬

🔬

🖥️
🌐
Access control
Labs - Access control vulnerabilities
Access control security models
Access control Security models
API testing
Authentication
Business logic vulnerabilities
File upload vulnerabilities
Information disclosure
NoSQL Injection
OS command injection
Path traversal
Labs - Path Traversal
HackTricks - File Inclusion/Path traversal
PayloadsAllTheThing - Directory Traversal
omurugur - Path_Travelsal_Payload_List
Canonicalize the path
Race conditions
Server-side request forgery (SSRF)
SQL injection
XML external entity (XXE) injection
Lab: File path traversal, simple case
Lab: File path traversal, traversal sequences blocked with absolute path bypass
Lab: File path traversal, traversal sequences stripped non-recursively
Lab: File path traversal, traversal sequences stripped with superfluous URL-decode
Lab: File path traversal, validation of start of path
Lab: File path traversal, validation of file extension with null byte bypass