---
# System prepended metadata

title: Shellcode Note 2021
tags: [pentest log]

---

# Shellcode Note 2021
###### tags: `pentest log`

## A. Automatic exploit to vulnerable program
I still not configure out how to exploit this programiing.
![](https://i.imgur.com/t21NDvT.png)


## B. Exploit to the small vulnerable program and stack smashing protection
two program which is stack-protect and non-stack-protect
![](https://i.imgur.com/BlaNXzP.png)

## C. Return to libc exploits
print the system and exit memory address to find shell memory address.
![](https://i.imgur.com/7FiRuir.png)
Somehow I cannot find "/bin/sh" in the memory, fail to exploit.
![](https://i.imgur.com/JV1wffB.png)

## D. Trying to install pwntools
install pwntools: pwndbg 
![](https://i.imgur.com/P7c0Luy.png)

install pwn and write python  with it:
bfnew_m <--compile with stack protector 
![](https://i.imgur.com/3tmv4ue.png)
bfnew_m2 <--compile with no stack protector 
![](https://i.imgur.com/bq41wOS.png)

## E. the simple CTF
obsevre the stack and calculate the shellcode length
![](https://i.imgur.com/ibWYijf.png)
![](https://i.imgur.com/uFYxFvQ.png)
![](https://i.imgur.com/osfvf9P.png)
write a pyhton code to pwn it.
![](https://i.imgur.com/reBPZWi.png)
