Command Execution
Overview
Current Progress
#
Step
Status
Node.js Command Execution
Basic One-liner
require("child_process").execSync("touch pwned");Integrate into Payload
{
"text": "'}) + require('child_process').execSync('touch pwned')//"
}Test Locally
Obtaining Command Output
Challenge
Options Analysis
Method
Feasibility
Method 1: Console Logging (Local Only)
Method 2: File Write + Read
Requirements
Options for Reading
Option
Description
This Application
Method 3: Inject Webshell into app.js
Target Code
Challenge
Exploitation Steps
Step 1: Get Admin Token
Step 2: Create Webshell File
Step 3: Inject into app.js
Step 4: Use Webshell
Complete Attack Chain
Why Base64 Encoding?
Problems with Direct Commands
Solution
Key Takeaways
Next Steps
Last updated