eCPPTv2-PTP-Notes
HomeGitHubPortfolioTwitter/XMediumCont@ct
  • 📝eCPPTv2 / PTP - Notes
  • 1️⃣1 - ​System Security
    • 1.1 Architecture Foundamentals
    • 1.2 Assemblers and Tools
    • 1.3 Buffer Overflow
    • 1.4 Cryptography
    • 1.5 Malware
    • 1.6 Shellcoding
  • 2️⃣2 - Network Security
    • 2.1 System/Host Based Attacks
      • 2.1.1 Windows Vulnerabilities
    • 2.2 Network Based Attacks
    • 2.3 The Metasploit Framework (MSF)
      • MSF Introduction
      • Information Gathering & Enumeration
      • Vulnerability Scanning
      • Client-Side Attacks
      • Post Exploitation
      • Armitage
    • 2.4 Exploitation
    • 2.5 - Post Expolitation / Pivoting
      • 2.5.1 Pivoting Guidelines
      • 2.5.2 Pivoting Example (3 Targets)
    • 2.6 Social Engineering
  • 3️⃣3 - PowerShell for PT
    • 3.1 PowerShell
  • 4️⃣4 - Linux Exploitation
    • 4.1 Linux Vulnerabilities
    • 4.2 Linux Exploitation
    • 4.3 Linux Post-Exploitation
    • 4.4 Linux Privilege Escalation
      • 4.4.1 Kernel Exploitation
      • 4.4.2 SUID Exploitation
      • 4.4.3 CronJobs
  • 5️⃣5 - Web App Security
    • 5.1 - Web App Concepts
      • 5.1.1 HTTP/S Protocol
      • 5.1.2 Encoding
      • 5.1.3 Same Origin
      • 5.1.4 Cookies
      • 5.1.5 Session
      • 5.1.6 Web App Proxies
    • 5.2 - Information Gathering
      • 5.2.1 Gathering Information on Your Targets
      • 5.2.2 Infrastructure
      • 5.2.3 Fingerprinting Frameworks and Applications
      • 5.2.4 Fingerprinting Custom Applications
      • 5.2.5 Enumerating Resources
      • 5.2.6 Information Disclosure Through Misconfiguration
      • 5.2.7 Google Hacking
      • 5.2.8 Shodan HQ
    • 5.3 - Cross Site Scripting
      • 5.3.1 XSS Anatomy
      • 5.3.2 Reflected XSS
      • 5.3.3 Stored XSS
      • 5.3.4 DOM-Based XSS
      • 5.3.5 Identifying & Exploiting XSS with XSSer
    • 5.4 - SQL Injection
      • 5.4.1 Introduction to SQL Injection
      • 5.4.2 Finding SQL Injection
      • 5.4.3 Exploiting In-Band SQL Injection
      • 5.4.4 Exploiting Error-Based SQL Injection
      • 5.4.5 Exploiting Blind SQL Injection
      • 5.4.6 SQLMap
      • 5.4.7 Mitigation Strategies
      • 5.4.8 From SQLi to Server Takeover
    • 5.5 - Other Common Web Attacks
      • 5.5.1 Session Attacks
      • 5.5.2 CSRF
  • 6️⃣6 - ​Wi-Fi Security
    • 6.1 Traffic Analysis
  • 7️⃣7 - ​Metasploit & Ruby
    • 7.1 Metasploit
  • 📄Report
    • How to write a PT Report
  • 🛣️RoadMap & My Experience
  • 📔eCPPT Cheat Sheet
Powered by GitBook
On this page
  • Stored XSS
  • Lab
  • Exploit Stored XSS Vulnerability in MyBB Forum
  1. 5 - Web App Security
  2. 5.3 - Cross Site Scripting

5.3.3 Stored XSS

Previous5.3.2 Reflected XSSNext5.3.4 DOM-Based XSS

Last updated 1 year ago

Stored XSS

Stored cross-site scripting (also known as second-order or persistent XSS) arises when an application receives data from an untrusted source and includes that data within its later HTTP responses in an unsafe way.

Suppose a website allows users to submit comments on blog posts, which are displayed to other users. Users submit comments using an HTTP request like the following:

POST /post/comment HTTP/1.1 Host: vulnerable-website.com Content-Length: 100 postId=3&comment=This+post+was+extremely+helpful.&name=Carlos+Montoya&email=carlos%40normal-user.net

After this comment has been submitted, any user who visits the blog post will receive the following within the application's response:

<p>This post was extremely helpful.</p>

Assuming the application doesn't perform any other processing of the data, an attacker can submit a malicious comment like this:

<script>/* Bad stuff here... */</script>

Within the attacker's request, this comment would be URL-encoded as:

comment=%3Cscript%3E%2F*%2BBad%2Bstuff%2Bhere...%2B*%2F%3C%2Fscript%3E

Any user who visits the blog post will now receive the following within the application's response:

<p><script>/* Bad stuff here... */</script></p>

The script supplied by the attacker will then execute in the victim user's browser, in the context of their session with the application.

Lab

Inject a Stored XSS's payload into a Blog's comment field.

What is MyBB Forum?

MyBB, formerly known as MyBulletinBoard, is an open-source forum software written in PHP. It allows users to set up and manage their own online communities where people can post discussions, share information, ask questions, and interact with each other. MyBB provides various features such as user registration and profiles, customizable themes and templates, private messaging, moderation tools, and plugins/extensions for additional functionality. It's popular among website owners who want to create vibrant online communities without extensive programming knowledge, thanks to its user-friendly interface and extensive customization options.

  • Login into MyBB

We can exploit it following these steps:

  • Go to downloads.php page

  • Create a New Download

  • Add the following to the title <BODY ONLOAD=alert('XSS')>

  • Now when the admin goes to validate your download he will be alerted

Exploit Stored XSS Vulnerability in

Download and execute (./script.py) python script to enumerate potential

5️⃣
MyBB Forum
MyBB plugin vulnerable
What is stored XSS (cross-site scripting)? Tutorial & Examples | Web Security AcademyWebSecAcademy
Logo
DashboardOnline Labs
GitHub - 0xB9/MyBBscan: Scans plugins directory for possible vulnerable plugins.GitHub
MyBB Plugin Downloads 2.0.3 - Cross-Site ScriptingExploit Database
Logo
Logo
Logo
https://www.geeksforgeeks.org/what-is-cross-site-scripting-xss/