149 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# PwnTools
{{#include ../../../banners/hacktricks-training.md}}
```
pip3 install pwntools
```
## Pwn asm
Satırdan veya dosyadan **opcodları** al.
```
pwn asm "jmp esp"
pwn asm -i <filepath>
```
**Seçilebilir:**
- çıktı türü (ham, hex, string, elf)
- çıktı dosyası bağlamı (16, 32, 64, linux, windows...)
- baytlardan kaçın (yeni satırlar, null, bir liste)
- çıktı almak için gdb kullanarak kodlayıcı hata ayıklayıcı shellcode seç
## **Pwn checksec**
Checksec betiği
```
pwn checksec <executable>
```
## Pwn constgrep
## Pwn cyclic
Bir desen al
```
pwn cyclic 3000
pwn cyclic -l faad
```
**Seçilebilir:**
- Kullanılan alfabe (varsayılan olarak küçük harfler)
- Benzersiz desenin uzunluğu (varsayılan 4)
- bağlam (16,32,64,linux,windows...)
- Ofseti al (-l)
## Pwn debug
Bir işleme GDB ekle
```
pwn debug --exec /bin/bash
pwn debug --pid 1234
pwn debug --process bash
```
**Seçilebilir:**
- Çalıştırılabilir dosya, isim veya pid bağlamına göre (16,32,64,linux,windows...)
- Çalıştırılacak gdbscript
- sysrootpath
## Pwn disablenx
Bir ikili dosyanın nx'ini devre dışı bırakın
```
pwn disablenx <filepath>
```
## Pwn disasm
Hex opkodlarını disassemble et
```
pwn disasm ffe4
```
**Seçilebilir:**
- bağlam (16,32,64,linux,windows...)
- temel adres
- renk (varsayılan)/renksiz
## Pwn elfdiff
2 dosya arasındaki farkları yazdırır
```
pwn elfdiff <file1> <file2>
```
## Pwn hex
Onaltılık temsil al
```bash
pwn hex hola #Get hex of "hola" ascii
```
## Pwn phd
Hexdump al
```
pwn phd <file>
```
**Seçilebilir:**
- Gösterilecek byte sayısı
- Satır başına vurgulanan byte sayısı
- Başlangıçta atlanacak byte'lar
## Pwn pwnstrip
## Pwn scrable
## Pwn shellcraft
Shellcode'ları al
```
pwn shellcraft -l #List shellcodes
pwn shellcraft -l amd #Shellcode with amd in the name
pwn shellcraft -f hex amd64.linux.sh #Create in C and run
pwn shellcraft -r amd64.linux.sh #Run to test. Get shell
pwn shellcraft .r amd64.linux.bindsh 9095 #Bind SH to port
```
**Seçilebilir:**
- shellcode ve shellcode için argümanlar
- Çıktı dosyası
- çıktı formatı
- hata ayıklama (shellcode'a dbg ekle)
- önce (koddan önce hata ayıklama tuzağı)
- sonra
- opcode kullanmaktan kaçın (varsayılan: null ve yeni satır değil)
- shellcode'u çalıştır
- Renk/renksiz
- sistem çağrılarını listele
- olası shellcode'ları listele
- ELF'yi paylaşılan bir kütüphane olarak oluştur
## Pwn şablonu
Bir python şablonu al
```
pwn template
```
**Seçilebilir:** host, port, kullanıcı, şifre, yol ve sessiz
## Pwn unhex
Hex'ten string'e
```
pwn unhex 686f6c61
```
## Pwn güncellemesi
pwntools'u güncellemek için
```
pwn update
```
{{#include ../../../banners/hacktricks-training.md}}