Stay hungry, Stay foolish.

Windows NTLM relay 攻击

NTLM Relay 攻击原理 NTLM relay攻击本质上是针对NTLM认证协议的中间人攻击,利用此攻击,攻击者可以在域内网络环境下, 伪装成认证过程中的server端并实行中间人攻击。 NTLM认证协议可以参考之前的文章,NTLM relay的流程如下图所示: 可以看出,攻击者为了响应server的chall……

Windows Pass-the-Hash 攻击

NTLM哈希及NTLM认证 NTLM哈希根据用户明文密码生成,其生成算法此处不表,而仅描述其应用。 NTLM认证过程一般被嵌入在上层协议中(比如SMB协议),在Windows中使用NTLM认证时,系统将计算明文密码的NTLM哈希,与预先保存的哈希做比较,相同则登录成功。登录之后Win……

使用Github Actions自动部署Hugo至Github Pages

生成repo的token 首先需要在个人设置中生成GitHub token,并将其添加到对应repo,在下述的Github Actions配置文件中引用,以使得自动构建能够推送生成的静态文件至repo中。 添加workflow 在hugo项目根目录中新建.github/workflows/……

JAVA Common Collections 反序列化漏洞分析

引言 Common Collections库为JAVA提供了很多常用且强大的数据结构,在JAVA开发中使用较为广泛,该库的漏洞会导致极为广泛的安全问题。在漏洞曝出伊始,WebLogic、WebSphere、JBoss、Jenkins等基于JAVA开发的各种中间件及框架均受到影响。 本文对JAVA……

OAuth 2.0 安全整理与分析

什么是OAuth? OAuth是一个得到广泛应用的关于授权(authorization)的开放网络标准,目前版本为2.0。 在传统的用户-服务器授权认证模型中,用户要获取服务器上受保护的某些资源只需向对应服务器进行认证;然而如果有第三方应用想要获取用户在服务器上的访问受限资源,就需要……

Python——变量的引用与传递

引言 研究此问题的出发点是希望在Python中传递函数参数的时候,能够像C++中的按引用传递参数的方式进行传递,函数内部对参数所做的修改能够反映到被调函数外部的传入变量本身去。 经过一番研究,发现Python中的变量与C中的变量不太一样,关键在于以下两点: 变量都是对内存中对象的引用,……

Exploit-exercises Protostar-Format-string

Format 0 源码: #include <stdlib.h>#include <unistd.h>#include <stdio.h>#include <string.h> void vuln(char *string) { volatile int target; char buffer[64]; target = 0; sprintf(buffer, string); if(target == 0xdeadbeef) { printf("you have hit the target correctly :)\n"); } } int main(int argc, char **argv) { vuln(argv[1]); } 此题的基本原理仍然是栈溢出,但是题目中要求输入字符不多于10个,所以就要利用格式化字符串中的宽度,覆盖掉target的值: Format 1 源码: #include <stdlib.h>#include <unistd.h>#include <stdio.h>#include <string.h> int target; void vuln(char *string) { printf(string); if(target) { printf("you have modified the target :)\n"); } } int main(int argc, char **argv) { vuln(argv[1]);……

Exploit-exercises Protostar-Stack

Wargame from Exploit-Exercises. Stack 0 源码: #include <stdlib.h>#include <unistd.h>#include <stdio.h> int main(int argc, char **argv) { volatile int modified; char buffer[64]; modified = 0; gets(buffer); if(modified != 0) { printf("you have changed the 'modified' variable\n"); } else { printf("Try again?\n"); } } 所以只需覆盖modified变量即可: Stack 1 源码: #include <stdlib.h>#include <unistd.h>#include <stdio.h>#include <string.h> int main(int argc, char **argv) { volatile int modified; char buffer[64]; if(argc == 1) { errx(1, "please specify an argument\n"); } modified = 0; strcpy(buffer, argv[1]); if(modified == 0x61626364) { printf("you have correctly got the variable to the right value\n"); } else { printf("Try again, you got 0x%08x\n", modified); } } 此处要修改变量modified的……

Wirteup - Junior 0ctf 2017

PWN seabreeze’s stack 栈溢出题目,直接在IDA中可以看到缓冲区相对于栈基址的偏移:bp-3FCH,然后可以看到题目中有一getshell()函数,其地址为0x080485CB。 覆盖原本的函数返回地址为getshell()的地址,利用以下脚本获取shell: from pwn import * conn = remote('202.121.178.181', '12321') print conn.recvline() conn.sendline('Yes!') print conn.recvline() conn.sendline('Yes!!') print conn.recvline() conn.sendline('Yes!!!') shell_addr = 0x080485cb……

Exploit-exercises Nebula (Level10~19)

本文是在解决Exploit-exerceses上Nebula中题目(Level10~19)时的一些思考与记录。 Level10 题目描述: The setuid binary at /home/flag10/flag10 binary will upload any file given, as long as it meets the requirements of the access() system call. 源码: #include <stdlib.h>#include <unistd.h>#include <sys/types.h>#include <stdio.h>#include <fcntl.h>#include <errno.h>#include <sys/socket.h>#include <netinet/in.h>#include <string.h> int main(int argc, char **argv) { char *file; char *host; if(argc < 3) { printf("%s file host\n\tsends file to host if you have access to it\n", argv[0]); exit(1); } file = argv[1]; host = argv[2]; if(access(argv[1], R_OK) == 0) { int fd; int……

格式化字符串漏洞

文章内容参考来源:CTF-All-In-One 格式化输出函数和格式化字符串 首先介绍一下C语言中的格式化输出函数及格式化字符串的格式。 格式化输出函数 C 标准中定义了下面的格式化输出函数(参考 man 3 printf): #include <stdio.h> int printf(const char *format, ...); int fprintf(FILE *stream, const char *format, ...); int dprintf(int fd, const char *format, ...); int sprintf(char *str, const char *format, ...); int snprintf(char *str, size_t size, const char *format, ...);……

Exploit-exercises Nebula (Level00~09)

本文是在解决Exploit-exerceses上Nebula中题目(Level00~09)时的一些思考与记录。 Level00 题目介绍: This level requires you to find a Set User ID program that will run as the “flag00” account. You could also find this by carefully looking in top level directories in / for suspicious looking directories. Alternatively, look at the find man page. 这道题目的提示非常明确,可以直接用find命令查找文件。但……