SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
О фaззинге
  подробно и
   со вкусом
привет Зеро Найтс -- 19.20.11.2012
   атте кеттунен & мяузаебись
багс we found in 2012
атте кеттунен, оулу
  хромиум: 25
  фаерфокс: 8

мяузаебись, хельсинки
  хромиум: 50
  фаерфокс: 5
Easy to get started
Enough bugs for novices to find a proper
one before they lose interest
First bug report gets very encouraging
response from cevans and mozilla
● miaubiz started after аки хелин
   presentation on radamsa at t2 '10
● Atte Kettunen started after joining
   OUSPG in the summer of 2011
АдресcCанитаизер
●   он охуенный
●   Clang compiler plugin
●   Similar to Valgrind
●   Very fast (2x slowdown)
●   Originally made by Chromium devs
●   Came out May 2011
●   Firefox now supported quite well
●   Linux & OSX
АдресcCанитаизер аутпут
==79174== ERROR: AddressSanitizer heap-
buffer-overflow on address 0x1ab53c4c at pc
0x9eaf2ec bp 0xbff9a808 sp 0xbff9a804
READ of size 1 at 0x1ab53c4c thread T0
  #0 0x9eaf2eb (Chromium
Framework+0x8d3f2eb)
  #1 0x9f9b89e (Chromium
Framework+0x8e2b89e)
  #2 0x9f9dc24 (Chromium
Framework+0x8e2dc24)
АдресcCанитаизер аутпут
==79269== ERROR: AddressSanitizer heap-
buffer-overflow on address 0x1ab1bc4c at
pc 0x9e792ec bp 0xbffd27e8 sp 0xbffd27e4
READ of size 1 at 0x1ab1bc4c thread T0
  #0 0x9e792eb in SkA1_Blitter::blitH(int,
int, int) (in Chromium Framework) + 539
  #1 0x9f6589e in sk_fill_path(SkPath
const&, SkIRect const*, SkBlitter*, int, int,
int, SkRegion const&) (in Chromium
Framework) + 3182
АдресcCанитаизер аутпут
0x1ab1bc4c is located 0 bytes to the right of
1637388-byte region [0x1a98c040,
0x1ab1bc4c)
allocated by thread T0 here:
   #0 0x1fbbb in __asan::ASAN_OnSIGSEGV
(int, __siginfo*, void*) (in Chromium Helper)
+ 123
   #1 0x93b9954a in malloc_zone_malloc (in
libsystem_c.dylib) + 74
   #2 0x93b99f86 in malloc (in libsystem_c.
dylib) + 52
АдресcCанитаизер аутпут
==2978== ERROR: AddressSanitizer unknown-crash on
address 0x8000e033f080 at pc 0x55555f2a4310 bp
0x7fffffff7550 sp 0x7fffffff7308
READ of size 1 at 0x8000e033f080 thread T0
  #0 0x55555f2a430f in __interceptor_memcpy ??:0
  #1 0x7fffe95934c6 in ?? ??:0
==2978== AddressSanitizer CHECK failed:
/usr/local/google/chrome/src/third_party/llvm/project
s/compiler-rt/lib/asan/asan_report.cc:136 "((0 &&
"Address is not in memory and not in shadow?")) != (0)"
(0x0, 0x0)
  #0 0x55555f2a923e in __sanitizer::CheckFailed(char
const*, int, char const*, unsigned long long, unsigned
long long) ??:0
АдресcCанитаизер аутпут
==21807== ERROR: AddressSanitizer heap-use-after-
free on address 0x7ffff7ecbfa0 at pc 0x555559bf1131
bp 0x7fffffff7950 sp 0x7fffffff7948
WRITE of size 8 at 0x7ffff7ecbfa0 thread T0
  #0 0x555559bf1130 in WebCore::
BaseMultipleFieldsDateAndTimeInputType::
~BaseMultipleFieldsDateAndTimeInputType() ???:0
  #1 0x555559bfd95d in WebCore::DateInputType::
~DateInputType() ???:0
  #2 0x55555995cc6b in WebCore::
HTMLInputElement::updateType() ???:0
АдресcCанитаизер аутпут
0x7ffff7ecbfa0 is located 96 bytes inside of
184-byte region [0x7ffff7ecbf40,
0x7ffff7ecbff8)
freed by thread T0 here:
  #0 0x55555fade730 in operator delete
(void*) ??:0
  #1 0x5555589c18f5 in WebCore::
ContainerNode::removeAllChildren() ???:0
  #2 0x555559a19387 in WebCore::
InputType::destroyShadowSubtree() ???:0
  #3 0x555559a487bd in WebCore::
АдресcCанитаизер аутпут
previously allocated by thread T0 here:
  #0 0x55555fade5b0 in operator new
(unsigned long) ??:0
  #1 0x555559baf27d in WebCore::
SpinButtonElement::create(WebCore::
Document*, WebCore::SpinButtonElement::
SpinButtonOwner&) ???:0
  #2 0x555559bf1a5d in WebCore::
BaseMultipleFieldsDateAndTimeInputType::
createShadowSubtree() ???:0
  #3 0x55555995ccc4 in WebCore::
ейсан
● Makes this all possible
● Awesome with use-after-free
● Very good for buffer оверфлоу / out of
  bounds access
● Good on type confusion
● Annoying on wild pointer
  (unknown 0xffffffffebc38a68 @ pc 0x7ffff7ad9c58)
If you like sysadmining..
Fuzzing is a great way to justify your hobby
of configuring boxen!

miaubiz: 2x 3930k, 2700k, 3770k, 112 gigs of
ram, tons of ssds <3

attekett: 2600k, 2x 1055T, 6x dual-core
opterons, and more on the way
Follow the browser developers
● Follow the evolution of tools
● Follow new features that are added
● Follow build environments
● Follow testing methods


Not only to find more bugs, but to keep
your environment in a working state.
Where the bugs are
● юс афтер фри, invalid cast
  ■ DOM
  ■ Rendering
  ■ CSS
● баффер оверфлоу
  ■ Media formats
  ■ Canvas (skia)
● интежер оверфлоу
  ■ WebGL
SOME FUNNY 2012 BUGS HAHA
● wk 86531 / ff 789046 - bit flipping in gif
● CVE-2012-2806 - oob write in libjpeg-
  turbo

● CVE-2012-2896 - integer overflow in
  SafeAdd() and SafeMultiply()

● crbug 143761 - vulnerable code had just
  been rewritten to fix previous SVG bug
dumb фаззинг
●   бит флипинг still works in 2012
●   mashup repros from old bugs together
●   radamsa o/
●   feed files to браузер as fast possible...
         ...and still identify winning inputs
smarter fuzzing
1. generate inputs based on something
2. process inputs
3. погладь кота
4. погладь кота, сука
5. hope to reproduce
6. hope to minimize
smartish fuzzing:
ВебKит Rendering
● find a bug
● write a script that will randomly find that
  same bug
● wait for more bugs
some bug
2 repros 1 bug
CVE-2012-2896
smartish fuzzing: Canvas
● take W3C specification
● group together
  ■ methods
  ■ attributes
  ■ properties
● replace input values with
  getRandomValue()
radamsa
- written by Aki Helin at OUSPG
- see t2 '10 presentation
- Binary(flips, copy-paste)
- String(format-detection, more copy-paste)
- Kолмогоров-Cмирнов it just works
miaufuz
for (1..500)
  stuff = random_element_of(weird_stuff)
  stash.push(stuff())

while(x = stash.pop())
  eval(x)

dump with:
 print(x)
NodeFuzz
● Modules
  ■ e.g. canvas, gif, css
● Samples
  ■ 20+ filetypes supported by browsers
● Injection into browser via websocket
  connected to node.js server
reproducibility tips
● use asan
● don't reference global state
   ■ body.children[5].appendChild(body.children[7])
   ■ impossible to minimize
● if possible, group stuff
stareability
Q: How do you know your fuzzer is working?

A: If it looks like what you'd expect

I tried to fuzz <path>, but I get white boxes
● wrong namespace for SVG elements
Instead of random strings I get 'undefined'
● [] instead of () in function call
minimizing test cases
manually in text editor

$ while true; do
 inotifywait repro.html
 && browser repro.html
done
infrastructure: first iteration
$ gzip -c /bin/bash > sample.gz
$ while true
 do
   radamsa sample.gz > fuzzed.gz
   gzip -dc fuzzed.gz > /dev/null
   test $? -gt 127 && break
 done

(http://code.google.com/p/ouspg/wiki/Radamsa)
git, rsync, redis, 2>&1
● evolve the infrastructure
● automate as much as possible
● rsync results to master node
● repros on filesystem for easy
  manipulation
● redis keeps:
    ■ metadata
    ■ input queues
    ■ crash logs
asan logs
2>&1 | grep
"inside|left|right|unknown|pc|offset|frame"

check
● page aligned EIP of crash
● offset and size reported (e.g. 8 inside 144)
● top stack frames of crash
● top stack frames of object free/allocate
infrastructure
● git push new fuzzers
● rsync new browser versions
● asan allows multiple browsers to run at
  once, no need for VMs
● Xephyr leaks memory
● browsers crash native Xorg
● Xvfb works best for many things
● monitor throughput, load, temp..
Статус: Дубликат
Inferno is fuzzing the same stuff we are,
with 20 000 Google computers. (Firefox too)

fuzzing is like high frequency arbitrage
microseconds count1"#

Atte + miaubiz => over 50 dupes in 2012
What if we run out of bugs?
● Манул идет
● Манул идет за тобой
● Browsers are continuously adding
  features
● Bounties will go up
● We will learn to write exploits
спасибо

Contenu connexe

Tendances

"Развитие ветки PHP-7"
"Развитие ветки PHP-7""Развитие ветки PHP-7"
"Развитие ветки PHP-7"Badoo Development
 
JavaScript Engines and Event Loop
JavaScript Engines and Event Loop JavaScript Engines and Event Loop
JavaScript Engines and Event Loop Tapan B.K.
 
Node.js for Rubists
Node.js for RubistsNode.js for Rubists
Node.js for RubistsSagiv Ofek
 
WordPress Plugin Unit Tests (FR - WordCamp Paris 2015)
WordPress Plugin Unit Tests (FR - WordCamp Paris 2015)WordPress Plugin Unit Tests (FR - WordCamp Paris 2015)
WordPress Plugin Unit Tests (FR - WordCamp Paris 2015)Ozh
 
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.jsFred Chien
 
syzbot and the tale of million kernel bugs
syzbot and the tale of million kernel bugssyzbot and the tale of million kernel bugs
syzbot and the tale of million kernel bugsDmitry Vyukov
 
Как мы сделали PHP 7 в два раза быстрее PHP 5 / Дмитрий Стогов (Zend Technolo...
Как мы сделали PHP 7 в два раза быстрее PHP 5 / Дмитрий Стогов (Zend Technolo...Как мы сделали PHP 7 в два раза быстрее PHP 5 / Дмитрий Стогов (Zend Technolo...
Как мы сделали PHP 7 в два раза быстрее PHP 5 / Дмитрий Стогов (Zend Technolo...Ontico
 
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015Jeongkyu Shin
 
nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry managerToshiaki Baba
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Valerii Kravchuk
 
How to Write Node.js Module
How to Write Node.js ModuleHow to Write Node.js Module
How to Write Node.js ModuleFred Chien
 
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishMagento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishYireo
 
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)Ontico
 
Varnish: Making eZ Publish sites fly
Varnish: Making eZ Publish sites flyVarnish: Making eZ Publish sites fly
Varnish: Making eZ Publish sites flyPeter Keung
 
Gdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) finalGdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) finalValeriy Kravchuk
 

Tendances (19)

"Развитие ветки PHP-7"
"Развитие ветки PHP-7""Развитие ветки PHP-7"
"Развитие ветки PHP-7"
 
JavaScript Engines and Event Loop
JavaScript Engines and Event Loop JavaScript Engines and Event Loop
JavaScript Engines and Event Loop
 
Node.js for Rubists
Node.js for RubistsNode.js for Rubists
Node.js for Rubists
 
WordPress Plugin Unit Tests (FR - WordCamp Paris 2015)
WordPress Plugin Unit Tests (FR - WordCamp Paris 2015)WordPress Plugin Unit Tests (FR - WordCamp Paris 2015)
WordPress Plugin Unit Tests (FR - WordCamp Paris 2015)
 
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.js
 
syzbot and the tale of million kernel bugs
syzbot and the tale of million kernel bugssyzbot and the tale of million kernel bugs
syzbot and the tale of million kernel bugs
 
Node.js and Ruby
Node.js and RubyNode.js and Ruby
Node.js and Ruby
 
Node.js
Node.jsNode.js
Node.js
 
Как мы сделали PHP 7 в два раза быстрее PHP 5 / Дмитрий Стогов (Zend Technolo...
Как мы сделали PHP 7 в два раза быстрее PHP 5 / Дмитрий Стогов (Zend Technolo...Как мы сделали PHP 7 в два раза быстрее PHP 5 / Дмитрий Стогов (Zend Technolo...
Как мы сделали PHP 7 в два раза быстрее PHP 5 / Дмитрий Стогов (Zend Technolo...
 
Future of NodeJS
Future of NodeJSFuture of NodeJS
Future of NodeJS
 
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015
 
nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry manager
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)
 
How to Write Node.js Module
How to Write Node.js ModuleHow to Write Node.js Module
How to Write Node.js Module
 
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishMagento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
 
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
PostgreSQL Configuration for Humans / Alvaro Hernandez (OnGres)
 
(C)NodeJS
(C)NodeJS(C)NodeJS
(C)NodeJS
 
Varnish: Making eZ Publish sites fly
Varnish: Making eZ Publish sites flyVarnish: Making eZ Publish sites fly
Varnish: Making eZ Publish sites fly
 
Gdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) finalGdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) final
 

Similaire à Kettunen, miaubiz fuzzing at scale and in style

Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013dotCloud
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Docker, Inc.
 
44 con slides (1)
44 con slides (1)44 con slides (1)
44 con slides (1)geeksec80
 
44 con slides
44 con slides44 con slides
44 con slidesgeeksec80
 
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Community
 
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo..."Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...Yandex
 
44CON 2013 - Browser bug hunting - Memoirs of a last man standing - Atte Kett...
44CON 2013 - Browser bug hunting - Memoirs of a last man standing - Atte Kett...44CON 2013 - Browser bug hunting - Memoirs of a last man standing - Atte Kett...
44CON 2013 - Browser bug hunting - Memoirs of a last man standing - Atte Kett...44CON
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Praguetomasbart
 
Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9 Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9 Jérôme Petazzoni
 
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQDocker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQJérôme Petazzoni
 
Troubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer PerspectiveTroubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer PerspectiveMarcelo Altmann
 
Масштабируемый и эффективный фаззинг Google Chrome
Масштабируемый и эффективный фаззинг Google ChromeМасштабируемый и эффективный фаззинг Google Chrome
Масштабируемый и эффективный фаззинг Google ChromePositive Hack Days
 
Troubleshooting .net core on linux
Troubleshooting .net core on linuxTroubleshooting .net core on linux
Troubleshooting .net core on linuxPavel Klimiankou
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Jian-Hong Pan
 
Defcon CTF quals
Defcon CTF qualsDefcon CTF quals
Defcon CTF qualssnyff
 
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.UA Mobile
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xrkr10
 
Introduction to Docker (as presented at December 2013 Global Hackathon)
Introduction to Docker (as presented at December 2013 Global Hackathon)Introduction to Docker (as presented at December 2013 Global Hackathon)
Introduction to Docker (as presented at December 2013 Global Hackathon)Jérôme Petazzoni
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformniyof97
 

Similaire à Kettunen, miaubiz fuzzing at scale and in style (20)

Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
44 con slides (1)
44 con slides (1)44 con slides (1)
44 con slides (1)
 
44 con slides
44 con slides44 con slides
44 con slides
 
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph
 
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo..."Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
 
44CON 2013 - Browser bug hunting - Memoirs of a last man standing - Atte Kett...
44CON 2013 - Browser bug hunting - Memoirs of a last man standing - Atte Kett...44CON 2013 - Browser bug hunting - Memoirs of a last man standing - Atte Kett...
44CON 2013 - Browser bug hunting - Memoirs of a last man standing - Atte Kett...
 
Haproxy - zastosowania
Haproxy - zastosowaniaHaproxy - zastosowania
Haproxy - zastosowania
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9 Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9
 
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQDocker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
 
Troubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer PerspectiveTroubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer Perspective
 
Масштабируемый и эффективный фаззинг Google Chrome
Масштабируемый и эффективный фаззинг Google ChromeМасштабируемый и эффективный фаззинг Google Chrome
Масштабируемый и эффективный фаззинг Google Chrome
 
Troubleshooting .net core on linux
Troubleshooting .net core on linuxTroubleshooting .net core on linux
Troubleshooting .net core on linux
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
Defcon CTF quals
Defcon CTF qualsDefcon CTF quals
Defcon CTF quals
 
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12x
 
Introduction to Docker (as presented at December 2013 Global Hackathon)
Introduction to Docker (as presented at December 2013 Global Hackathon)Introduction to Docker (as presented at December 2013 Global Hackathon)
Introduction to Docker (as presented at December 2013 Global Hackathon)
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraform
 

Plus de DefconRussia

[Defcon Russia #29] Борис Савков - Bare-metal programming на примере Raspber...
[Defcon Russia #29] Борис Савков -  Bare-metal programming на примере Raspber...[Defcon Russia #29] Борис Савков -  Bare-metal programming на примере Raspber...
[Defcon Russia #29] Борис Савков - Bare-metal programming на примере Raspber...DefconRussia
 
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...DefconRussia
 
[Defcon Russia #29] Алексей Тюрин - Spring autobinding
[Defcon Russia #29] Алексей Тюрин - Spring autobinding[Defcon Russia #29] Алексей Тюрин - Spring autobinding
[Defcon Russia #29] Алексей Тюрин - Spring autobindingDefconRussia
 
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/LinuxDefconRussia
 
Георгий Зайцев - Reversing golang
Георгий Зайцев - Reversing golangГеоргий Зайцев - Reversing golang
Георгий Зайцев - Reversing golangDefconRussia
 
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC [DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC DefconRussia
 
Cisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-oneCisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-oneDefconRussia
 
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...DefconRussia
 
HTTP HOST header attacks
HTTP HOST header attacksHTTP HOST header attacks
HTTP HOST header attacksDefconRussia
 
Attacks on tacacs - Алексей Тюрин
Attacks on tacacs - Алексей ТюринAttacks on tacacs - Алексей Тюрин
Attacks on tacacs - Алексей ТюринDefconRussia
 
Weakpass - defcon russia 23
Weakpass - defcon russia 23Weakpass - defcon russia 23
Weakpass - defcon russia 23DefconRussia
 
nosymbols - defcon russia 20
nosymbols - defcon russia 20nosymbols - defcon russia 20
nosymbols - defcon russia 20DefconRussia
 
static - defcon russia 20
static  - defcon russia 20static  - defcon russia 20
static - defcon russia 20DefconRussia
 
Zn task - defcon russia 20
Zn task  - defcon russia 20Zn task  - defcon russia 20
Zn task - defcon russia 20DefconRussia
 
Vm ware fuzzing - defcon russia 20
Vm ware fuzzing  - defcon russia 20Vm ware fuzzing  - defcon russia 20
Vm ware fuzzing - defcon russia 20DefconRussia
 
Nedospasov defcon russia 23
Nedospasov defcon russia 23Nedospasov defcon russia 23
Nedospasov defcon russia 23DefconRussia
 
Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23DefconRussia
 
Miasm defcon russia 23
Miasm defcon russia 23Miasm defcon russia 23
Miasm defcon russia 23DefconRussia
 
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...DefconRussia
 
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условияхSergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условияхDefconRussia
 

Plus de DefconRussia (20)

[Defcon Russia #29] Борис Савков - Bare-metal programming на примере Raspber...
[Defcon Russia #29] Борис Савков -  Bare-metal programming на примере Raspber...[Defcon Russia #29] Борис Савков -  Bare-metal programming на примере Raspber...
[Defcon Russia #29] Борис Савков - Bare-metal programming на примере Raspber...
 
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
 
[Defcon Russia #29] Алексей Тюрин - Spring autobinding
[Defcon Russia #29] Алексей Тюрин - Spring autobinding[Defcon Russia #29] Алексей Тюрин - Spring autobinding
[Defcon Russia #29] Алексей Тюрин - Spring autobinding
 
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
 
Георгий Зайцев - Reversing golang
Георгий Зайцев - Reversing golangГеоргий Зайцев - Reversing golang
Георгий Зайцев - Reversing golang
 
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC [DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
 
Cisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-oneCisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-one
 
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
 
HTTP HOST header attacks
HTTP HOST header attacksHTTP HOST header attacks
HTTP HOST header attacks
 
Attacks on tacacs - Алексей Тюрин
Attacks on tacacs - Алексей ТюринAttacks on tacacs - Алексей Тюрин
Attacks on tacacs - Алексей Тюрин
 
Weakpass - defcon russia 23
Weakpass - defcon russia 23Weakpass - defcon russia 23
Weakpass - defcon russia 23
 
nosymbols - defcon russia 20
nosymbols - defcon russia 20nosymbols - defcon russia 20
nosymbols - defcon russia 20
 
static - defcon russia 20
static  - defcon russia 20static  - defcon russia 20
static - defcon russia 20
 
Zn task - defcon russia 20
Zn task  - defcon russia 20Zn task  - defcon russia 20
Zn task - defcon russia 20
 
Vm ware fuzzing - defcon russia 20
Vm ware fuzzing  - defcon russia 20Vm ware fuzzing  - defcon russia 20
Vm ware fuzzing - defcon russia 20
 
Nedospasov defcon russia 23
Nedospasov defcon russia 23Nedospasov defcon russia 23
Nedospasov defcon russia 23
 
Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23
 
Miasm defcon russia 23
Miasm defcon russia 23Miasm defcon russia 23
Miasm defcon russia 23
 
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
 
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условияхSergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
 

Kettunen, miaubiz fuzzing at scale and in style

  • 1. О фaззинге подробно и со вкусом привет Зеро Найтс -- 19.20.11.2012 атте кеттунен & мяузаебись
  • 2. багс we found in 2012 атте кеттунен, оулу хромиум: 25 фаерфокс: 8 мяузаебись, хельсинки хромиум: 50 фаерфокс: 5
  • 3. Easy to get started Enough bugs for novices to find a proper one before they lose interest First bug report gets very encouraging response from cevans and mozilla ● miaubiz started after аки хелин presentation on radamsa at t2 '10 ● Atte Kettunen started after joining OUSPG in the summer of 2011
  • 4. АдресcCанитаизер ● он охуенный ● Clang compiler plugin ● Similar to Valgrind ● Very fast (2x slowdown) ● Originally made by Chromium devs ● Came out May 2011 ● Firefox now supported quite well ● Linux & OSX
  • 5. АдресcCанитаизер аутпут ==79174== ERROR: AddressSanitizer heap- buffer-overflow on address 0x1ab53c4c at pc 0x9eaf2ec bp 0xbff9a808 sp 0xbff9a804 READ of size 1 at 0x1ab53c4c thread T0 #0 0x9eaf2eb (Chromium Framework+0x8d3f2eb) #1 0x9f9b89e (Chromium Framework+0x8e2b89e) #2 0x9f9dc24 (Chromium Framework+0x8e2dc24)
  • 6. АдресcCанитаизер аутпут ==79269== ERROR: AddressSanitizer heap- buffer-overflow on address 0x1ab1bc4c at pc 0x9e792ec bp 0xbffd27e8 sp 0xbffd27e4 READ of size 1 at 0x1ab1bc4c thread T0 #0 0x9e792eb in SkA1_Blitter::blitH(int, int, int) (in Chromium Framework) + 539 #1 0x9f6589e in sk_fill_path(SkPath const&, SkIRect const*, SkBlitter*, int, int, int, SkRegion const&) (in Chromium Framework) + 3182
  • 7. АдресcCанитаизер аутпут 0x1ab1bc4c is located 0 bytes to the right of 1637388-byte region [0x1a98c040, 0x1ab1bc4c) allocated by thread T0 here: #0 0x1fbbb in __asan::ASAN_OnSIGSEGV (int, __siginfo*, void*) (in Chromium Helper) + 123 #1 0x93b9954a in malloc_zone_malloc (in libsystem_c.dylib) + 74 #2 0x93b99f86 in malloc (in libsystem_c. dylib) + 52
  • 8. АдресcCанитаизер аутпут ==2978== ERROR: AddressSanitizer unknown-crash on address 0x8000e033f080 at pc 0x55555f2a4310 bp 0x7fffffff7550 sp 0x7fffffff7308 READ of size 1 at 0x8000e033f080 thread T0 #0 0x55555f2a430f in __interceptor_memcpy ??:0 #1 0x7fffe95934c6 in ?? ??:0 ==2978== AddressSanitizer CHECK failed: /usr/local/google/chrome/src/third_party/llvm/project s/compiler-rt/lib/asan/asan_report.cc:136 "((0 && "Address is not in memory and not in shadow?")) != (0)" (0x0, 0x0) #0 0x55555f2a923e in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ??:0
  • 9. АдресcCанитаизер аутпут ==21807== ERROR: AddressSanitizer heap-use-after- free on address 0x7ffff7ecbfa0 at pc 0x555559bf1131 bp 0x7fffffff7950 sp 0x7fffffff7948 WRITE of size 8 at 0x7ffff7ecbfa0 thread T0 #0 0x555559bf1130 in WebCore:: BaseMultipleFieldsDateAndTimeInputType:: ~BaseMultipleFieldsDateAndTimeInputType() ???:0 #1 0x555559bfd95d in WebCore::DateInputType:: ~DateInputType() ???:0 #2 0x55555995cc6b in WebCore:: HTMLInputElement::updateType() ???:0
  • 10. АдресcCанитаизер аутпут 0x7ffff7ecbfa0 is located 96 bytes inside of 184-byte region [0x7ffff7ecbf40, 0x7ffff7ecbff8) freed by thread T0 here: #0 0x55555fade730 in operator delete (void*) ??:0 #1 0x5555589c18f5 in WebCore:: ContainerNode::removeAllChildren() ???:0 #2 0x555559a19387 in WebCore:: InputType::destroyShadowSubtree() ???:0 #3 0x555559a487bd in WebCore::
  • 11. АдресcCанитаизер аутпут previously allocated by thread T0 here: #0 0x55555fade5b0 in operator new (unsigned long) ??:0 #1 0x555559baf27d in WebCore:: SpinButtonElement::create(WebCore:: Document*, WebCore::SpinButtonElement:: SpinButtonOwner&) ???:0 #2 0x555559bf1a5d in WebCore:: BaseMultipleFieldsDateAndTimeInputType:: createShadowSubtree() ???:0 #3 0x55555995ccc4 in WebCore::
  • 12. ейсан ● Makes this all possible ● Awesome with use-after-free ● Very good for buffer оверфлоу / out of bounds access ● Good on type confusion ● Annoying on wild pointer (unknown 0xffffffffebc38a68 @ pc 0x7ffff7ad9c58)
  • 13. If you like sysadmining.. Fuzzing is a great way to justify your hobby of configuring boxen! miaubiz: 2x 3930k, 2700k, 3770k, 112 gigs of ram, tons of ssds <3 attekett: 2600k, 2x 1055T, 6x dual-core opterons, and more on the way
  • 14. Follow the browser developers ● Follow the evolution of tools ● Follow new features that are added ● Follow build environments ● Follow testing methods Not only to find more bugs, but to keep your environment in a working state.
  • 15. Where the bugs are ● юс афтер фри, invalid cast ■ DOM ■ Rendering ■ CSS ● баффер оверфлоу ■ Media formats ■ Canvas (skia) ● интежер оверфлоу ■ WebGL
  • 16. SOME FUNNY 2012 BUGS HAHA ● wk 86531 / ff 789046 - bit flipping in gif ● CVE-2012-2806 - oob write in libjpeg- turbo ● CVE-2012-2896 - integer overflow in SafeAdd() and SafeMultiply() ● crbug 143761 - vulnerable code had just been rewritten to fix previous SVG bug
  • 17. dumb фаззинг ● бит флипинг still works in 2012 ● mashup repros from old bugs together ● radamsa o/ ● feed files to браузер as fast possible... ...and still identify winning inputs
  • 18. smarter fuzzing 1. generate inputs based on something 2. process inputs 3. погладь кота 4. погладь кота, сука 5. hope to reproduce 6. hope to minimize
  • 19. smartish fuzzing: ВебKит Rendering ● find a bug ● write a script that will randomly find that same bug ● wait for more bugs
  • 21. 2 repros 1 bug
  • 23. smartish fuzzing: Canvas ● take W3C specification ● group together ■ methods ■ attributes ■ properties ● replace input values with getRandomValue()
  • 24. radamsa - written by Aki Helin at OUSPG - see t2 '10 presentation - Binary(flips, copy-paste) - String(format-detection, more copy-paste) - Kолмогоров-Cмирнов it just works
  • 25. miaufuz for (1..500) stuff = random_element_of(weird_stuff) stash.push(stuff()) while(x = stash.pop()) eval(x) dump with: print(x)
  • 26. NodeFuzz ● Modules ■ e.g. canvas, gif, css ● Samples ■ 20+ filetypes supported by browsers ● Injection into browser via websocket connected to node.js server
  • 27. reproducibility tips ● use asan ● don't reference global state ■ body.children[5].appendChild(body.children[7]) ■ impossible to minimize ● if possible, group stuff
  • 28. stareability Q: How do you know your fuzzer is working? A: If it looks like what you'd expect I tried to fuzz <path>, but I get white boxes ● wrong namespace for SVG elements Instead of random strings I get 'undefined' ● [] instead of () in function call
  • 29. minimizing test cases manually in text editor $ while true; do inotifywait repro.html && browser repro.html done
  • 30. infrastructure: first iteration $ gzip -c /bin/bash > sample.gz $ while true do radamsa sample.gz > fuzzed.gz gzip -dc fuzzed.gz > /dev/null test $? -gt 127 && break done (http://code.google.com/p/ouspg/wiki/Radamsa)
  • 31. git, rsync, redis, 2>&1 ● evolve the infrastructure ● automate as much as possible ● rsync results to master node ● repros on filesystem for easy manipulation ● redis keeps: ■ metadata ■ input queues ■ crash logs
  • 32. asan logs 2>&1 | grep "inside|left|right|unknown|pc|offset|frame" check ● page aligned EIP of crash ● offset and size reported (e.g. 8 inside 144) ● top stack frames of crash ● top stack frames of object free/allocate
  • 33. infrastructure ● git push new fuzzers ● rsync new browser versions ● asan allows multiple browsers to run at once, no need for VMs ● Xephyr leaks memory ● browsers crash native Xorg ● Xvfb works best for many things ● monitor throughput, load, temp..
  • 34. Статус: Дубликат Inferno is fuzzing the same stuff we are, with 20 000 Google computers. (Firefox too) fuzzing is like high frequency arbitrage microseconds count1"# Atte + miaubiz => over 50 dupes in 2012
  • 35. What if we run out of bugs? ● Манул идет ● Манул идет за тобой ● Browsers are continuously adding features ● Bounties will go up ● We will learn to write exploits