Skip to content

Commit 1fcbf16

Browse files
authored
Merge pull request #25 from JSREI/dev
refactor
2 parents 1ffd5bf + ec02b2e commit 1fcbf16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3217
-229
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,22 @@
99
在进行JS逆向的时候,经常碰到请求是JS类型的,实际上是使用script标签发出的请求,比如一些跨域的请求,一些jsonp请求,
1010
Chrome目前(2024-12-20)没有支持对script类型的请求打条件断点之类的,而这个脚本就是填补这块儿的空白的。
1111

12+
优势:
13+
- 支持对script类型的请求打断点
14+
- script请求之前进入断点
15+
- 直接把断点打到script jsonp回调函数里
16+
1217
## 二、安装
1318
开发中,敬请期待!
19+
20+
实战系列文章:
21+
- [潇湘书院登录](https://github.com/JSREP/www.xxsypro.com-RE)
22+
- [一淘网](https://github.com/JSREP/www.etao.com-RE)
23+
- [叮当快药sign逆向练习](https://github.com/JSREP/www.ddky.com-RE)
24+
- [365玩游戏平台](https://github.com/JSREP/minilogin.sgty.com-RE)
25+
- [G妹游戏登录](https://github.com/JSREP/www.gm99.com-RE)
26+
- [空中网登录](https://github.com/JSREP/passport.kongzhong.com-RE)
27+
1428
## 三、在script类型的请求发送之前打断点
1529
TODO
1630
## 四、在script类型的请求接收到响应之后打断点

docs/READMD.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
3+
4+
5+
案例:
6+
- https://github.com/JSREP/www.xxsypro.com-RE
7+
- https://github.com/JSREP/www.readnovel.com-RE
8+
- https://github.com/JSREP/www.37.com-RE
9+
- https://github.com/JSREP/www.hongxiu.com-RE
10+
11+
12+
13+
14+
15+
16+
17+

docs/jQuery-jsonp/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# jQuery jsonp原理分析
2+
3+
4+
5+
# 要讨论的问题是什么?
6+
7+
8+
9+
# 使用示例
10+
11+
12+
13+
```js
14+
$.getJSON(url+"?callback=?",function(data){
15+
....
16+
});
17+
```
18+
19+
20+
21+
```js
22+
$.ajax({
23+
type: "get",
24+
url: "http://examples.learningjquery.com/jsonp/g.php",
25+
dataType: "jsonp",
26+
jsonp: "callback",
27+
jsonpCallback: "hehe",
28+
success: function(json){
29+
console.log(json);
30+
}
31+
});
32+
```
33+
34+
35+
36+
37+
38+
# 代码浅读
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
219 KB
Loading
220 KB
Loading
Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,47 @@
1-
这是一个jsonp请求的响应被加密的例子。
1+
# JSONP加密通信破解靶场
2+
3+
# 一、靶场简介
4+
这是一个靶场,用于演示一个页面,通过jsonp与后端通讯,并且通讯内容是加密的,这是请求:
5+
6+
![image-20250106023428688](./README.assets/image-20250106023428688.png)
7+
8+
响应:
9+
10+
![image-20250106023534246](./README.assets/image-20250106023534246.png)
11+
12+
而我们的目标就是借助js-script-hook来分析明白前后端通讯的逻辑。
13+
14+
# 二、启动靶场
15+
16+
启动server:
17+
18+
```bash
19+
node main.js
20+
```
21+
22+
打开前端页面:
23+
24+
```bash
25+
client.html
26+
```
27+
28+
# 三、分析
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>JSONP Example</title>
7+
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
8+
</head>
9+
<body>
10+
<h1>JSONP Example</h1>
11+
<div id="result"></div>
12+
13+
<script>
14+
15+
// 加密密钥(与后端一致)
16+
const SECRET_KEY = 'CC11001100';
17+
18+
// 加密函数
19+
function encryptData(data) {
20+
return CryptoJS.AES.encrypt(JSON.stringify(data), SECRET_KEY).toString();
21+
}
22+
23+
// 解密函数
24+
function decryptData(encryptedData) {
25+
const bytes = CryptoJS.AES.decrypt(encryptedData, SECRET_KEY);
26+
return bytes.toString(CryptoJS.enc.Utf8);
27+
}
28+
29+
// JSONP 请求
30+
function fetchData() {
31+
const data = { name: 'CC11001100' };
32+
const encryptedData = encryptData(data);
33+
34+
const script = document.createElement('script');
35+
script.src = `http://localhost:3000/api/data?encryptedData=${encodeURIComponent(encryptedData)}&callback=handleResponse`;
36+
document.body.appendChild(script);
37+
}
38+
39+
// 处理 JSONP 响应
40+
function handleResponse(encryptedResponse) {
41+
const decryptedResponse = decryptData(encryptedResponse);
42+
const responseData = JSON.parse(decryptedResponse);
43+
44+
document.getElementById('result').innerText = responseData.message;
45+
}
46+
47+
// 发起请求
48+
fetchData();
49+
</script>
50+
</body>
51+
</html>

0 commit comments

Comments
 (0)