CTF Primer
CTF Primer
Primer
2013-‐09-‐24
Agenda
☼ CTF?
☼ CTF!
CTF?
CTF?
What
is
CTF?
☼ Hacker
Jeopardy
☼ Solve
challenges
to
collect
flags
☼ Different
disciplines
☼ Various
complexity
levels
☼ Often:
First
solver
receives
a
bonus
☼ More
popular
version
CTF?
What
is
a
flag?
CTF
Trivia
CTF?
What
are
these
disciplines?
☼ Web
☼ (In)Security
of
web
applications
☼ SQL
injection
☼ directory
traversal
☼ exploiting
logical
flaws
☼ ...
☼ Forensics
☼ Needle
in
a
haystack
☼ „Broken“
data
/
files
☼ Image
recovery
CTF?
What
are
these
disciplines?
☼ Reverse
Engineering
☼ Understanding
algorithms
☼ Defeating
anti-‐analysis
mechanisms
☼ „crackmes“
☼ Crypto
☼ Implementation
flaws
☼ Efficient
attacks
CTF?
What
are
these
disciplines?
☼ Pwning
☼ Exploitation
of
services
☼ Remote
Code
Execution
(RCE)
☼ Finding
the
vector
+
planting
a
shell
☼ Trivia
☼ Guessing
/
inference
☼ Recognizing
network
protocols,
file
formats,
...
CTF!
CTF!
Why
should
I
play?
☼ Meet
nice
people
&
have
a
good
time
:)
☼ Great
opportunity
to
learn
☼ Extend
your
horizon
☼ Fame
&
Glory
CTF!
Skills
needed.
☼ Creativity!
☼ Endurance!!
☼ Communication!
☼ DEX2JAR!
CTF!
A
challenge
example.
☼ JAR
=
Java?
☼ Yes,
but
only
(bytecode-‐compiled)
class
files
„4556494c“.decode(„Hex“)
=>
EVIL
CTF!
A
challenge
example.
☼ Solution
(Python):
import
hmac
import
hashlib
key
=
„D1mV4“
data
=
„EVIL“
digestmod
=
hashlib.sha256
hashed
=
hmac.new(key,
data,
digestmod).digest()
result
=
hashed.encode(„base64“)
print
result
Result: vqwYfONxkebWk4SUsmpQenN6ik3uvvoJw3/oq7hQQYg=
☼ Expected
Skills:
☼ Motivation!
Rest
will
come
by
itself!
☼ Time
commitment:
☼ One
meeting
per
week
+
optional
„homework“
+
CTF
participation
☼ Homework?
☼ Voluntary
tasks
from
old
CTFs
as
practice
☼ Long-‐Run:
☼ A
platform
to
publish
CTF
Resources.
☼ CTFtime.org
☼ Archive
/
Scores
/
Write-‐Ups
☼ Captf.com/practice-‐ctf
☼ Collection
of
write-‐ups,
challenges,
etc.
☼ Blog.dragonsector.pl
☼ Very
active
write-‐up
blog
of
a
leading
team
CTF
Homework!
:)
☼ Dimva
CTF,
crypto100
☼ A
bunch
of
images
☼ ...
that
look
the
same
☼ ...
but
have
a
secret
☼ Hints:
https://dl.dropboxusercontent.com/u/1346415/dimva_crypto100.zip