ret2text.md
参考网站:CTF Wiki ret2text 是最简单的利用栈溢出漏洞来getshell的方法,这种方法就是利用程序中已经有的敏感命令比如system('/bin/sh')来getshell 前提 程序存在栈溢出,并且溢出大小合适,能够覆盖函数返回地址。 程序中存在敏感命令的调用,我们能够获取其地址。 程序没有开启canary保护,栈溢出可以被利用。 Implementation 找到敏感命令system('/bin/sh')的地址 计算esp到返回地址的偏移量,构造payload覆盖返回地址为敏感命令的地址 运行程序,getshell Template1234567from pwn import *context.binary = elf = ELF('./vuln')context.log_level = 'debug'p = remote('ip', port)payload = <padding> + <loc of vulnerable...
Stack_Buffer_Overflow
我们平时说的栈溢出一般是指栈缓冲区溢出 (Stack Buffer Overflow)。 栈溢出的条件 程序必须向栈上写入数据。 写入的数据大小没有被很好地控制。 利用栈溢出的攻击方式直接现用 getshell若漏洞程序调用了现成的含有 systemcall 的函数,直接利用栈溢出覆盖函数返回地址为 systemcall 函数的地址 ROPROP(Return Oriented Programming)...
call_stack
IA-32 (Intel 32位) 寄存器Note: 32 位说明栈中指针偏移量以 32位(4字节)为一个基元。 EAX ~ EDX: 通用寄存器 (general purpose registers), 通用寄存器是通用的,但是有一部分指令对寄存器有特殊要求,这时它们分别有如下用途: EAX: 累加器 (“A” means Accumulator) EBX: 数据基地址暂存器 (“B” means Base) ECX: 循环计数器 (“C” means Counter) EDX: 操作数或操作结果暂存器 (“D” means Data) 为了方便存储较短的数据,通用寄存器都可以只使用低16位 ESI 和 EDI: 这两个寄存器优势也被包括在通用寄存器内,但是不能拆分,一般用作字符串操作的源指针和目的指针。 ESP 和 EBP: ESP 存储的是栈顶地址,即栈指针 (Stack Pointer),而 EBP 存储的是位于栈顶的栈帧的栈底地址,即基指针 (Base Pointer) 控制权移交 控制权是指 CPU...
Sorting Algorithm
Today, I’m learning sorting algorithm, and taking some notes in this passage. Selection SortI believe Selection Sort is the easiest sorting algorithm to understand, as it simply involves repeatedly finding the smallest elements in the unsorted portion of the array and swapping it with the first unsorted element. Let’s take a look at the implementation: Implementation12345678910111213141516/* Section Sort */void section_sort(int *nums, int numsSize) { // Outer loop: i represents the...
Configing My Arch
In the last passage, I have talked about my experience of installing the basic system of Arch Linux.
My experience using archlinux
最近安装了一个 archlinux 玩玩, 发现真的挺麻烦的。我反复安装过几次,在这里记录一下我安装和配置基本系统的经历。 关于安装 arch 的一些建议arch 有非常完善,非常强大的 wiki 文档以及社区,在其中可以找到很多很多的帮助:arch 的 wiki 系统的安装安装一个系统,首先要制作一个安装介质,比如 USB 驱动器。 制作 USB flash drive制作 archlinux 安装介质(USB 驱动器)的步骤: 准备一个大小至少 2GB 的U盘,并备份好U盘中的数据(操作过程会将U盘格式化,清空其中的数据) 在 arch 下载页面 下载 arch 的可引导 ISO 文件。 下载并安装 rufus ,按照提示将 arch 的可引导 IOS 文件刻录到 USB 安装媒介。 配置 live 环境 在计算机加电自检时快速按下某个热键,进入引导加载程序菜单,选择 Arch Linux install medium 进入安装环境,安装环境默认的 Shell 是 Zsh。 第一步是连接互联网,可以直接使用有线网络,连接网线之后会自动联网,也可以使用 iwctl...