0%

欢迎来到f1ow的博客

这里是一个分享技术文章、生活随笔以及各种有趣内容的个人博客。希望你能在这里找到有用的信息,享受阅读的乐趣。

[TOC] fromhex,十六进制字符串转换为字节对象互相转化 >>> bytes([0,1,2,3,4,5]).hex() '000102030405' #fromhex这个中间有空格也不影响 >>> bytes.fromhex('000102030405') b'\x00\x01\x02\x03\x04\x05' >>> b'abcde'.hex() '6162636465' >>> a = bytes.fromhex('6162636465') b'abcde' 切片操作,这个很常用

[TOC] 常用指令 lspci ls /sys/devices/pci0000\:00/0000\:00\:04.0/ -monitor telnet:127.0.0.1:4444,server,nowait 后 nc 127.0.0.1 4444可以info pci看的更清楚,这个技巧仅限于qemu,发现内核不好使 qemu到底在pwn什么 主要是pwn q

注意realloc_hook就在malloc_hook-8的位置 # __malloc_hook -> realloc+8 # __realloc_hook -> one_gadget realloc = libc_base + libc.sym['realloc'] one_gadget = [0x4527a, 0xf03a4, 0xf1247] add(4, 0x68, b'p' * 11 + p64(libc_base + one_gadget[0]) + p64(realloc + 8))

[TOC] 参考博客 适用于NO RELRO, Partial RELRO,在64位中一般都是打linkmap结构体,板子题 攻击模板 总结地说,我们需要 st_other != 0 l -> l_addr = system_libc - a_libc

[TOC] sandbox sandbox检测工具 seccomp-tools dump ./file 有时候直接用这个指令没有检测到沙盒,一般是因为程序还没有执行到沙盒,随便输入执行到沙盒就行 prctl函数 可以

最近做了一个题执行了system("/bin/sh")后发现flag只有root才有read权限,这里要提权 可以参考此篇

常用系统调用号 syscall 64位 0->read 1->write 2->open 5->fstat 9->mmap 0xa->mprotect 0xf->rt_sigreturn 0x3b->execve 0x5a->chmod int 0x80 32位 3->read 4->write 5->open 0xb->execve 有时候受字长限制可以考虑eax,ax,al这种寄存器,让shellcode变短 cd

有read函数最好用send,scanf和gets必须用sendline init函数也要查看,有时候一些变量的初始化就在其中 strlen的绕

[TOC] 这篇文章生动详细地讲清楚了socket到底是什么 相关知识 一些关键理解 注意这里和反弹shell不太一样,反弹shell创建了套间字后直接co