Skip to content

Complete crypto documentation for learning #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/images/crypto-decrypt-schematic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/crypto-instruction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions docs/guide/2024/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ aside: false

![NewStarCTF 2024](/assets/images/banner-2024.png)

## 赛事背景

「没有网络安全,就没有国家安全。」目前我国网民规模已突破 9 亿,成为名副其实的网络大国,网络安全的重要性愈发突出。习近平总书记指出:「网络安全的本质在对抗,对抗的本质在攻防两端能力较量。」为建立高素质网络安全和信息化人才队伍,积极响应国家网络空间安全人才战略,发挥专业优势,发掘网络安全人才,特此发起本活动。

## 赛事介绍

NewStar CTF 2024 是由 13 所高校联合发起的新生入门赛事,比赛持续五周时间,每周更新赛题,以个人赛形式展现,并分设公开赛道和校内赛道。
NewStar CTF 2024 是由来自 13 所高校的战队联合发起的新生入门赛事,比赛持续五周时间,每周更新赛题,以个人赛形式展现,并分设公开赛道和校内赛道。

在此之前,NewStar 网络安全新生赛已连续举办多届,并一直为各高校提供高质量的新生选拔方案。本届赛事联手春秋杯,以新生的探索能力、知识面、网络安全素养等综合素质为培养目标,致力于挖掘和培养适应新时代新趋势的网络安全新兴力量。本届比赛将取过往之精华,优化比赛难度,使之随时间呈阶梯式上升,并通过题目逐步引导等方式,避免选手大海捞针的情况,以使其能够更专注于知识和技能水平的锻炼。

比赛采用网络安全靶场赛的形式<span style="color: #7c7c7c">(传统 Jeopardy 解题模式)</span>,动态计分。赛题涵盖 Web、Crypto、Pwn、Reverse、Misc 五大方向,题目的考察范围亦在传统的基础上增加了一些近年来新的构想和思路,做到与时俱进、不断创新。比赛期待各位选手的光临,诚邀任何有兴趣的同学参与。
比赛采用网络安全靶场赛的形式<span class='desc-text'>(传统 Jeopardy 解题模式)</span>,动态计分。赛题涵盖 Web、Crypto、Pwn、Reverse、Misc 五大方向,题目的考察范围亦在传统的基础上增加了一些近年来新的构想和思路,做到与时俱进、不断创新。比赛期待各位选手的光临,诚邀任何有兴趣的同学参与。

## 赛事时间

Expand All @@ -24,15 +28,15 @@ NewStar CTF 2024 是由 13 所高校联合发起的新生入门赛事,比赛

## 赛事群

公开赛道 QQ 群:1169651901<span style="color: #7c7c7c">(①群)</span>、806733185<span style="color: #7c7c7c">(②群)</span>
公开赛道 QQ 群:1169651901<span class='desc-text'>(①群)</span>、806733185<span class='desc-text'>(②群)</span>

校内赛道 QQ 群:<span style="color: #7c7c7c">(请联系各校赛事负责人)</span>
校内赛道 QQ 群:994951789<span class='desc-text'>(各校赛事群请联系所在院校赛事负责人)</span>

## 组织方式

### 发起方(战队)
### 主办方

西安工业大学、中国矿业大学、中国人民公安大学、东北大学秦皇岛分校、海南大学、南京理工大学、广东工业大学、江南大学、浙江师范大学、福建师范大学、中山大学、太原理工大学、中国人民警察大学<span style="color: #7c7c7c">(以上排名不分先后)</span>
西安工业大学、中国矿业大学、中国人民公安大学、东北大学秦皇岛分校、海南大学、南京理工大学、广东工业大学、江南大学、浙江师范大学、福建师范大学、中山大学、太原理工大学、中国人民警察大学<span class='desc-text'>(以上排名不分先后)</span>

### 赞助支持

Expand Down
388 changes: 246 additions & 142 deletions docs/learn/crypto.md

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions docs/learn/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,32 @@ import 'element-plus/es/components/tag/style/css'

## 什么是 CTF

CTF 是一种比赛形式,你会得到一个题面<span style="color: #7c7c7c">(可能是一段话、一个压缩包、一张图片、一个网站、一个链接、一份源码、一个程序等)</span>,你需要根据题面,通过各种手法找到或得到诸如 `flag{xxx}` 的内容,这便是此题的答案。
CTF 是一种比赛形式,你会得到一个题面<span class='desc-text'>(可能是一段话、一个压缩包、一张图片、一个网站、一个链接、一份源码、一个程序等)</span>,你需要根据题面,通过各种手法找到或得到诸如 `flag{xxx}` 的内容,这便是此题的答案。

## 走出洞穴的第一步

如果你还没有掌握一门编程语言,建议先从编程语言入手,C 语言或者 Python,培养对编程的感觉。只要你掌握了一门语言,再学习其他语言能够触类旁通。

如果你此前从未接触过 CTF,你可能需要先了解其形式,即通过一些在线靶场或新生赛的低门槛题目进行适应。下面的一些公益新生赛事或平台或许会对你有所帮助:

- <ElTag type="primary" size="small">赛事</ElTag> <Link icon="external" theme="plain" href="https://ctf.xidian.edu.cn/">西电 MoeCTF</Link>
- <ElTag type="primary" size="small">赛事</ElTag> <Link icon="external" theme="plain" href="https://basectf.fun/">BaseCTF</Link>
- <ElTag type="info" size="small">平台</ElTag> <Link icon="external" theme="plain" href="https://www.ctfhub.com/">CTFHub</Link>
- <ElTag type="info" size="small">平台</ElTag> <Link icon="external" theme="plain" href="https://ctf.show/">CTFSHOW</Link>
- <ElTag type="info" size="small">平台</ElTag> <Link icon="external" theme="plain" href="https://buuoj.cn">BUUOJ</Link>
- <ElTag type="info" size="small">平台</ElTag> <Link icon="external" theme="plain" href="https://www.nssctf.cn">NSSCTF</Link>
- <ElTag type="primary" size="small">赛事</ElTag> <Link icon="external" theme="underline hover" href="https://ctf.xidian.edu.cn/">西电 MoeCTF</Link>
- <ElTag type="primary" size="small">赛事</ElTag> <Link icon="external" theme="underline hover" href="https://basectf.fun/">BaseCTF</Link>
- <ElTag type="info" size="small">平台</ElTag> <Link icon="external" theme="underline hover" href="https://www.ctfhub.com/">CTFHub</Link>
- <ElTag type="info" size="small">平台</ElTag> <Link icon="external" theme="underline hover" href="https://ctf.show/">CTFSHOW</Link>
- <ElTag type="info" size="small">平台</ElTag> <Link icon="external" theme="underline hover" href="https://buuoj.cn">BUUOJ</Link>
- <ElTag type="info" size="small">平台</ElTag> <Link icon="external" theme="underline hover" href="https://www.nssctf.cn">NSSCTF</Link>

随后,你应当选定一个方向,作为你主攻方向。例如,对网络感兴趣、有基础的同学可能更适合 Web 方向,而对程序运行底层逻辑、二进制感兴趣的可能更适合逆向(Reverse)和 Pwn,等等。

然后,当你接触到特定的题目时,你会遇到特定的知识点。设计得当的引导会控制好你所接触的「新事物」的量。这个时候,辅以实践,你再通过搜索、询问等各种方式学习知识细节,或许会轻松许多。

如果你在寻求更细节和全面的指导,可以查看 [CTF Wiki](https://ctf-wiki.org/) 或由探姬师傅主导的 [Hello CTF](https://hello-ctf.com/) 等网站。注意,与传统的课堂教育模式不同,这些网站并不要求你立即并全部掌握其中的内容,而是充当一个手册供你速查。

对于自己无能为力的题,记得在赛后根据题解(WriteUp)进行复现。温故而知新,可以为师矣。

## 我还没有准备好

<Container type='warning'>
<Container type='tip'>
参与 CTF 赛事,是一个不断在历练中成长的过程,是对自我螺旋上升式的提升,是理论与实践相结合的又一深入尝试。请时刻铭记:<strong>充分发挥自己的主观能动性,在实践中成长。</strong>
</Container>

Expand All @@ -57,4 +61,4 @@ CTF 是一种比赛形式,你会得到一个题面<span style="color: #7c7c7c"

此外,必备的知识迁移能力和动手尝试(试错)能力是不可或缺的。

在这趟旅途中,请收藏对你帮助巨大或需要日后查阅的链接或文档。值得一提的是,偶尔的旅途记录或许将在某些时刻发挥意想不到的作用。
在这趟旅途中,请收藏对你帮助巨大或需要日后查阅的链接或文档。值得一提的是,偶尔的旅途记录或许将在某些时刻发挥意想不到的作用,例如知识速查、快速回顾等
21 changes: 9 additions & 12 deletions docs/learn/reverse.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
---
titleTemplate: ':title | 快速入门 - NewStar CTF'
---
<script setup>
import Link from '@/components/docs/Link.vue'
</script>

# Reverse
# 逆向工程

逆向工程通常是在没有源代码的情况下对软件进行分析,相对于正向的代码编程来说,逻辑通常是反过来的,需要有好的代码分析和反向思维能力。

## 0x01. 学习 C 语言代码

C 语言是逆向工程的基础,务必重点学习以下内容。

1. 流程控制: if、switch、goto、break
2. 指针操作: 引用,解引用,取地址,数组与指针转化
3. 数据类型: 熟记 char、int、int64 等类型大小
4. 可逆运算: 异或运算、算数运算、移位与循环移位运算
1. 流程控制if、switch、goto、break
2. 指针操作引用,解引用,取地址,数组与指针转化
3. 数据类型熟记 char、int、int64 等类型大小
4. 可逆运算异或运算、算数运算、移位与循环移位运算

## 0x02. 学习常见加密

加密是逆向工程对抗的核心,务必熟记加密算法原理和特征,这样在面对混淆和魔改加密时才能游刃有余。

1. TEA 系列加密: TEA、XTEA、XXTEA
2. RC4 加密
3. AES/DES加密
4. 16进制编码
5. Base64编码
3. AES/DES 加密
4. 16 进制编码
5. Base64 编码

加密特征识别可参阅:<Link icon="external" theme="underline blink" href="https://pangbai.work/IT/re/ctf_encode/">常见加密算法特征识别</Link>
加密特征识别可参阅:[常见加密算法特征识别](https://pangbai.work/IT/re/ctf_encode/)

常见加密不是一成不变的模板,死记硬背不可能通杀,请务必读懂加密过程和大致原理。

Expand Down
2 changes: 1 addition & 1 deletion docs/learn/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CTF 中的 Web 方向通常指的是通过阅读阅读网站源码,或是根

## 收拾行李

Web 方向需要有较强的代码阅读能力<span style="color: #7c7c7c">(即便是未接触过的代码,不要求会写,但需能够阅读)</span>,以及搜索能力。
Web 方向需要有较强的代码阅读能力<span class='desc-text'>(即便是未接触过的代码,不要求会写,但需能够阅读)</span>,以及搜索能力。
以下建议可能能够帮助你提升代码阅读能力,但任何事物都是循序渐进的,你也可以在做题的同时学习和成长。

- 学习和掌握 Python 语言
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"element-plus": "^2.8.1",
"markdown-it-mathjax3": "^4.3.2",
"nodemon": "^3.1.4",
"sass": "^1.77.8",
"sass": "~1.76.0",
"unplugin-element-plus": "^0.8.0",
"vitepress": "^1.3.1",
"vue": "^3.4.35",
Expand Down
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions theme-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ sidebar:
link: /learn/web
- text: Reverse
link: /learn/reverse
- text: Crypto
link: /learn/crypto

'/guide/2024/':
- text: 参考文档
Expand Down
Binary file added theme/assets/fonts/docs/font.eot
Binary file not shown.
11 changes: 11 additions & 0 deletions theme/assets/fonts/docs/font.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/assets/fonts/docs/font.ttf
Binary file not shown.
Binary file added theme/assets/fonts/docs/font.woff
Binary file not shown.
3 changes: 3 additions & 0 deletions theme/assets/fonts/docs/map.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$map: (
"external": "\1f517"
);
31 changes: 31 additions & 0 deletions theme/assets/fonts/docs/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@font-face {
font-family: "vp-docs";
src: url("./font.eot?inpve4");
src: url("./font.eot?inpve4#iefix") format("embedded-opentype"),
url("./font.ttf?inpve4") format("truetype"), url("fonts/font.woff?inpve4") format("woff"),
url("./font.svg?inpve4#icomoon") format("svg");
font-weight: normal;
font-style: normal;
font-display: block;
}

.icon--docs[class^="icon-"],
.icon--docs[class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: "vp-docs" !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
color: currentColor;

/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.icon-external:before {
content: "\1f517";
}
40 changes: 40 additions & 0 deletions theme/assets/fonts/package.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
$font-name: "example";
$font-family: "vp-example";

@mixin register-font($name: $font-name, $family: $font-family) {
@font-face {
font-family: $family;
src: url("./#{$name}/font.eot?inpve4");
src: url("./#{$name}/font.eot?inpve4#iefix") format("embedded-opentype"),
url("./#{$name}/font.ttf?inpve4") format("truetype"), url("fonts/font.woff?inpve4") format("woff"),
url("./#{$name}/font.svg?inpve4#icomoon") format("svg");
font-weight: normal;
font-style: normal;
font-display: block;
}
}

@mixin inject-font($family: $font-family) {
& {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: $family !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
color: currentColor;

/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
}

@mixin apply-font($name: $font-name, $family: $font-family) {
&.icon--#{$name}[class^="icon-"],
&.icon--#{$name}[class*=" icon-"] {
@include inject-font($family);
}
}
Loading