From c9ee09f524465f87b3619180bf368894d251e45a Mon Sep 17 00:00:00 2001 From: Mercurio Date: Mon, 18 Dec 2023 23:32:46 +0800 Subject: [PATCH] update libprocesshider Signed-off-by: Mercurio --- content/posts/c-tips/index.md | 16 ++++++++-------- content/posts/libprocesshider/index.md | 12 ++++++------ content/posts/newbie-note/index.md | 2 +- content/posts/probability-report/index.md | 4 ++-- content/posts/python-summary/index.md | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/content/posts/c-tips/index.md b/content/posts/c-tips/index.md index cc09c6aa2..d8a8fdde7 100644 --- a/content/posts/c-tips/index.md +++ b/content/posts/c-tips/index.md @@ -1,6 +1,6 @@ --- title: 一点 C 语言的经验 -date: 2018-10-17 16:31:13 +date: 2018-10-17 tags: - C/C++ categories: @@ -29,17 +29,17 @@ A1: 答案很可能要令人失望:**多写代码**。尽管听起来老生常 > Q2: 作为萌新的我们,不知道怎么着手学习 C 语言,对于基础知识这块非常的薄弱,书上的内容感觉不是很系统,有什么好方法呢?能不能给我们推荐一些有用的参考资料呢? -A2: 老实说,我觉得学校用的 *K&R* 足够好了,并且也不太可能有什么 C 语言书籍能超越它。不过如果觉得看得很累的话,不妨试试国内的任意一本豆瓣评分较高的 C 语言书籍。虽然它可能没那么好,甚至会误导人,但至少能够帮助没有基础的同学建立一些基本概念。 +A2: 老实说,我觉得学校用的 _K&R_ 足够好了,并且也不太可能有什么 C 语言书籍能超越它。不过如果觉得看得很累的话,不妨试试国内的任意一本豆瓣评分较高的 C 语言书籍。虽然它可能没那么好,甚至会误导人,但至少能够帮助没有基础的同学建立一些基本概念。 当然,如果你不屑看国内的书籍,这两本书也可以作为参考: -0. *C Programming: A Modern Approach* K.N.King 著 +0. _C Programming: A Modern Approach_ K.N.King 著 -1. *C Traps and Pitfalls* Andrew Koenig 著 +1. _C Traps and Pitfalls_ Andrew Koenig 著 (对任何国外的专业书籍请尽可能**阅读原版**) -最重要的是,在阅读时必须**完成一部分书上的习题**(乐意的话做 OJ 也行),通过实践进步是最快的。但是如果你真的想精通 C 语言而不是为了通过考试,仅仅快还不够——在代码量达到,比如 300 行左右时,请回头**认真阅读 *K&R***。 +最重要的是,在阅读时必须**完成一部分书上的习题**(乐意的话做 OJ 也行),通过实践进步是最快的。但是如果你真的想精通 C 语言而不是为了通过考试,仅仅快还不够——在代码量达到,比如 300 行左右时,请回头**认真阅读 _K&R_**。 > Q3: 理论课上学到的知识,在实践课上不是很会操作,怎么尽快地能够应用呢? @@ -122,7 +122,7 @@ A6: 取决于你的目标。 7. 用 `&&` 时把最可能 `false` 的子表达式放左边,用 `||` 时把最可能 `true` 的子表达式放左边。(短路原则)同理,`if/else` 结构中把最可能 `true` 的条件放前面。 8. 浮点数比较不要用 `==` 和 `!=`,而是像这样: - + ```c #define EPS 1e-6 // 设置要求的精度 if (fabs(x - y) <= EPS); //x 等于 y @@ -174,7 +174,7 @@ A6: 取决于你的目标。 25. 即使你觉得自己不会忘记字符数组末尾的 `\0`,你还是会忘记。(有些库函数不会自动加 `\0`) 26. 对下面的代码,输出 `p` 和 `*p` 有什么不同? - + ```c char ch = 'a'; char *p = &ch; @@ -190,4 +190,4 @@ A6: 取决于你的目标。 --- -最后提醒大家,程序的正确性固然重要,但是一定不要轻视其可读性、可维护性、健壮性、时空效率等等。不过也不用纠结大括号换不换行,缩进用 Tab 还是空格的问题。祝大家都能写出清晰、高效的优质代码! \ No newline at end of file +最后提醒大家,程序的正确性固然重要,但是一定不要轻视其可读性、可维护性、健壮性、时空效率等等。不过也不用纠结大括号换不换行,缩进用 Tab 还是空格的问题。祝大家都能写出清晰、高效的优质代码! diff --git a/content/posts/libprocesshider/index.md b/content/posts/libprocesshider/index.md index 41a5e084a..4bcc57229 100644 --- a/content/posts/libprocesshider/index.md +++ b/content/posts/libprocesshider/index.md @@ -1,5 +1,5 @@ --- -title: "隐名匿迹:libprocesshider 处置方案" +title: "遁名匿迹:libprocesshider 处置方案" date: 2023-08-22 tags: - 应急响应 @@ -78,23 +78,23 @@ if(get_dir_name(dirp, dir_name, sizeof(dir_name)) && \ 1. 将文件或文件哈希上传到威胁情报平台,通常很容易检出: -![](0.png) +![图 1](0.png) 2. 通过 IDA 等静态分析工具对文件进行逆向,容易发现一些特征,例如在 Functions 部分内部的有效函数很少,通常只有 `get_dir_name`、`get_process_name`、`readdir64`、`readdir` 四个: -![](1.png) +![图 2](1.png) 另外对 `readdir` 自身进行分析也可以发现同样的逻辑: -![](feature.png) +![图 3](feature.png) 双击 `process_to_filter` 可以发现其字符串值: -![](2.png) +![图 4](2.png) 3. 可以通过 irtk 中的 `lph.sh` 检查文件的 .rodata 段,如果存在形如 `/proc/self/fd/%d`、`/proc/%s/stat`、`%d (%[^)]s`、`readdir64`、`readdir` 等字符串则基本可以确定属于 libprocesshider,此时第一个字符串即被隐藏的进程: -![](3.png) +![图 5](3.png) 另外,工具箱中的 unhide 也可以找出被隐藏的进程,只需运行 `unhide proc` 即可。 diff --git a/content/posts/newbie-note/index.md b/content/posts/newbie-note/index.md index 8b6cf5d22..7e57e42e3 100644 --- a/content/posts/newbie-note/index.md +++ b/content/posts/newbie-note/index.md @@ -36,6 +36,6 @@ categories: - `gets` 的不安全性 - `getline` 多次使用注意添加 `str = "\n"; getline(cin, str);` - EOJ 编译器对 `getchar(); ... gets();` 的支持似乎不太好? -- 经常把 == 写成 = +- 经常把 `==` 写成 `=` - 尽量避免使用非 C 标准库函数,如 `itoa`, `strlwr`, `strupr` 之类 - RTE 主要原因:数组越界、指针越界、除以 0、栈溢出…… diff --git a/content/posts/probability-report/index.md b/content/posts/probability-report/index.md index da5ef90a7..a4715b240 100644 --- a/content/posts/probability-report/index.md +++ b/content/posts/probability-report/index.md @@ -1,6 +1,6 @@ --- title: 概率论课程报告 -date: 2018-12-14 21:03:28 +date: 2018-12-14 tags: - 数学 categories: @@ -74,7 +74,7 @@ categories: --- > 参考资料: -> +> > - http://kskedlaya.org/putnam-archive/1992.pdf > - http://lsusmath.rickmabry.org/psisson/putnam/putnam-web.htm > - http://kskedlaya.org/putnam-archive/2005.pdf diff --git a/content/posts/python-summary/index.md b/content/posts/python-summary/index.md index 6d5717ae6..4c592df8f 100644 --- a/content/posts/python-summary/index.md +++ b/content/posts/python-summary/index.md @@ -1,6 +1,6 @@ --- title: 《Python 编程技术》期末作业 -date: 2019-01-06 16:08:24 +date: 2019-01-06 tags: - 项目 - Python