SlideShare a Scribd company logo
Wireplay: An approach to
          almost Blind Fuzzing


                   - Abhisek Datta




nullcon Goa 2010       http://nullcon.net
Agenda
                   Little Theory
                   about fuzzing

                     Problems &
                      Solution

                    Introducing
                     Wireplay

                   Field Testing


                   Wireplay Hooks

nullcon Goa 2010     http://nullcon.net
Fuzz Testing != Hacking

    Feeding random/semi-random
   valid/invalid data set to
   various input interfaces of a
   program and monitor for
   possible faults!

        Fuzzing does find expensive
       security bugs!

nullcon Goa 2010   http://nullcon.net
Fuzz Testing aka. Fuzzing

SELECT name
   FROM users WHERE id = 10

                                                    Example
SELECT                                               Server
AAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAA                            Monitored Environment
AAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAA
   FROM users WHERE id = 10




 nullcon Goa 2010         http://nullcon.net
Block Based Modeling

    A theoretical approach to
   model the problem of Fuzzing.
        Original (valid) Input Set is
       tokenized (blocks) and each token
       is fuzzed periodically.
        Better approach than blind
       fuzzing, however you need to write
       a LOT of code!
        • SPIKE, Peach, Sully etc.

nullcon Goa 2010    http://nullcon.net
Block Based Fuzzing

                    GET /index.html HTTP/1.1
                    Host: foo.com
                    User-Agent: wget/1.10.2




                   GET    Index.html        Host
                   Wget/1.10.2      User-Agent

                            foo.com


nullcon Goa 2010           http://nullcon.net
Block Based Fuzzing


for-each-token
      data.replace(token, get_random())
       target.send(data)
end




nullcon Goa 2010   http://nullcon.net
Block Based Fuzzing


             GET <BIG-RANDOM-STRING> HTTP/1.1
             Host: foo.com
             User-Agent: wget/1.10.2




nullcon Goa 2010       http://nullcon.net
Block Based Fuzzing: Problems

    Tokenization needs knowledge
   of protocol.
         Lots of protocols.
         Proprietary protocols.
         Time Consuming.
         ETC.




nullcon Goa 2010   http://nullcon.net
Introducing Wireplay

    Minimalist approach to replay
   TCP Sessions with modifications
   as required.
        Use your valid client to connect
       to the server.
        Capture the packets (Wireshark?)
        Feed them to Wireplay for replay
        Use Wireplay hooks to modify
       original packets and replay
nullcon Goa 2010   http://nullcon.net
Wireplay: Functional Flow


   Original Client          Sniffer                  Original Server



                            PCAP




                           Wireplay


                     http://code.google.com/p/wireplay

nullcon Goa 2010              http://nullcon.net
Wireplay Features
     TCP Stream replay
        TCP Session reconstruction via.
       modified libnids (bug fixes)
     Plugin Subsystem
        Ruby Interpreter Embedded as Plugin
        Supports Packet Mangling hooks written
       in Ruby
        CGEN: A ruby plugin to generate a C
       program to reproduce a TCP Session


nullcon Goa 2010        http://nullcon.net
Wireplay: Basic Usage

bash$ wireplay –r client 
        -t 172.16.0.1 
        -p 80
        -F pcap/http.pcap 
        -K # optional



nullcon Goa 2010   http://nullcon.net
Wireplay: Fuzzing

    Hook Subsystem for arbitrary
   data manipulation.
        Embedded Ruby Interpreter and API
       set for writing packet
       manipulation hooks in Ruby
    Misc. features to repeat fuzz
   sessions, ignore errors, halt
   on connection fault etc.

nullcon Goa 2010        http://nullcon.net
Wireplay: Hook System
     Connect To Target         1                      Events
                                                         1. On Start
     Read Next Packet                  Disconnect        2. On Data
                                                         3. On Stop
                         3
                                                         4. On Error

       Is Client to                 Read fromServer
       Server Data
                              2
                   2
       Send to Server




nullcon Goa 2010             http://nullcon.net
Wireplay: Packet Hook in Ruby
    Define your arbitrary class with
   the following methods:
        on_start(pkt_desc)
        on_stop(pkt_desc)
        on_data(pkt_desc, direction, data)
        on_error(pkt_desc, code)
    Register an object of your class
   with Wireplay Hook Subsystem
         Wireplay::Hooks.register(YourClass.new)

nullcon Goa 2010       http://nullcon.net
Wireplay: Sample Hooks

    Blind Byte Alternation
   (blind.rb)
        Alters each byte from the
       original payload with single or
       multiple bytes for fuzzing.
     CGEN (cgen.rb)
        Generates C program to replay a
       TCP session. Use for PoC
       generation.
nullcon Goa 2010   http://nullcon.net
Wireplay: Demo




nullcon Goa 2010      http://nullcon.net
Thank You.. 

svn co http://wireplay.googlecode.com/svn/trunk wireplay


     http://code.google.com/p/wireplay/




 nullcon Goa 2010       http://nullcon.net

More Related Content

PDF
debugging openstack neutron /w openvswitch
PPT
Stackless Python In Eve
PPTX
Docker Networking with New Ipvlan and Macvlan Drivers
PDF
Asynchronous Io Programming
PDF
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
PDF
Understanding Open vSwitch
PDF
Virtualized network with openvswitch
debugging openstack neutron /w openvswitch
Stackless Python In Eve
Docker Networking with New Ipvlan and Macvlan Drivers
Asynchronous Io Programming
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
Understanding Open vSwitch
Virtualized network with openvswitch

What's hot (20)

PDF
Web scale infrastructures with kubernetes and flannel
KEY
Distributed app development with nodejs and zeromq
PPTX
Tutorial on using CoreOS Flannel for Docker networking
PDF
netty_qcon_v4
PDF
Networking in Java with NIO and Netty
PDF
SDNDS.TW Mininet
PDF
Docker Networking
PDF
Anatomy of neutron from the eagle eyes of troubelshoorters
PDF
2015 FOSDEM - OVS Stateful Services
ODP
nftables - the evolution of Linux Firewall
PDF
Lecture set 7
PDF
Kubernetes networking-made-easy-with-open-v switch
PDF
Packet walks in_kubernetes-v4
PDF
Openv switchの使い方とか
PDF
Open vSwitch - Stateful Connection Tracking & Stateful NAT
PDF
Docker-OVS
PPT
Netty 4-based RPC System Development
PDF
LF_OVS_17_Ingress Scheduling
PPTX
Quick Start Guide using Virtuozzo 7 (β) on AWS EC2
PDF
Basic onos-tutorial
Web scale infrastructures with kubernetes and flannel
Distributed app development with nodejs and zeromq
Tutorial on using CoreOS Flannel for Docker networking
netty_qcon_v4
Networking in Java with NIO and Netty
SDNDS.TW Mininet
Docker Networking
Anatomy of neutron from the eagle eyes of troubelshoorters
2015 FOSDEM - OVS Stateful Services
nftables - the evolution of Linux Firewall
Lecture set 7
Kubernetes networking-made-easy-with-open-v switch
Packet walks in_kubernetes-v4
Openv switchの使い方とか
Open vSwitch - Stateful Connection Tracking & Stateful NAT
Docker-OVS
Netty 4-based RPC System Development
LF_OVS_17_Ingress Scheduling
Quick Start Guide using Virtuozzo 7 (β) on AWS EC2
Basic onos-tutorial
Ad

Similar to nullcon 2010 - Software Fuzzing with Wireplay (20)

PDF
nullcon 2010 - The evil karmetasploit upgrade
PDF
Muduo network library
PDF
Supercomputing by API: Connecting Modern Web Apps to HPC
PPTX
Scaling application with RabbitMQ
PPTX
WebSocket protocol
KEY
Pushing the web — WebSockets
PDF
Installation of pfSense on Soekris 6501
PDF
Installation of pfSense on Soekris 6501
PDF
XS Boston 2008 XenLoop
PDF
Import golang; struct microservice
ODP
Mcollective introduction
PDF
Tornado Web Server Internals
PPT
Docker Multi Host Networking, Rachit Arora, IBM
PDF
Docker Meetup: Docker Networking 1.11 with Madhu Venugopal
PDF
Docker 1.11 Meetup: Networking Showcase
PDF
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
PDF
SDN/OpenFlow #lspe
PDF
Linux Networking Explained
nullcon 2010 - The evil karmetasploit upgrade
Muduo network library
Supercomputing by API: Connecting Modern Web Apps to HPC
Scaling application with RabbitMQ
WebSocket protocol
Pushing the web — WebSockets
Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501
XS Boston 2008 XenLoop
Import golang; struct microservice
Mcollective introduction
Tornado Web Server Internals
Docker Multi Host Networking, Rachit Arora, IBM
Docker Meetup: Docker Networking 1.11 with Madhu Venugopal
Docker 1.11 Meetup: Networking Showcase
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
SDN/OpenFlow #lspe
Linux Networking Explained
Ad

More from n|u - The Open Security Community (20)

PDF
Hardware security testing 101 (Null - Delhi Chapter)
PPTX
SSRF exploit the trust relationship
PDF
PDF
Api security-testing
PDF
Introduction to TLS 1.3
PDF
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
PDF
Talking About SSRF,CRLF
PPTX
Building active directory lab for red teaming
PPTX
Owning a company through their logs
PPTX
Introduction to shodan
PDF
Detecting persistence in windows
PPTX
Frida - Objection Tool Usage
PDF
OSQuery - Monitoring System Process
PDF
DevSecOps Jenkins Pipeline -Security
PDF
Extensible markup language attacks
PPTX
PDF
Hardware security testing 101 (Null - Delhi Chapter)
SSRF exploit the trust relationship
Api security-testing
Introduction to TLS 1.3
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Talking About SSRF,CRLF
Building active directory lab for red teaming
Owning a company through their logs
Introduction to shodan
Detecting persistence in windows
Frida - Objection Tool Usage
OSQuery - Monitoring System Process
DevSecOps Jenkins Pipeline -Security
Extensible markup language attacks

Recently uploaded (20)

PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Getting Started with Data Integration: FME Form 101
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPT
Teaching material agriculture food technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
A Presentation on Artificial Intelligence
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
Machine Learning_overview_presentation.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
Group 1 Presentation -Planning and Decision Making .pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Getting Started with Data Integration: FME Form 101
Building Integrated photovoltaic BIPV_UPV.pdf
Machine learning based COVID-19 study performance prediction
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Teaching material agriculture food technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Big Data Technologies - Introduction.pptx
Spectroscopy.pptx food analysis technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Reach Out and Touch Someone: Haptics and Empathic Computing
A Presentation on Artificial Intelligence
Accuracy of neural networks in brain wave diagnosis of schizophrenia
The Rise and Fall of 3GPP – Time for a Sabbatical?
SOPHOS-XG Firewall Administrator PPT.pptx
Machine Learning_overview_presentation.pptx
20250228 LYD VKU AI Blended-Learning.pptx

nullcon 2010 - Software Fuzzing with Wireplay

  • 1. Wireplay: An approach to almost Blind Fuzzing - Abhisek Datta nullcon Goa 2010 http://nullcon.net
  • 2. Agenda Little Theory about fuzzing Problems & Solution Introducing Wireplay Field Testing Wireplay Hooks nullcon Goa 2010 http://nullcon.net
  • 3. Fuzz Testing != Hacking Feeding random/semi-random valid/invalid data set to various input interfaces of a program and monitor for possible faults! Fuzzing does find expensive security bugs! nullcon Goa 2010 http://nullcon.net
  • 4. Fuzz Testing aka. Fuzzing SELECT name FROM users WHERE id = 10 Example SELECT Server AAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA Monitored Environment AAAAAAAAAAAAAAAAAAA AAAAAAAAAAAA FROM users WHERE id = 10 nullcon Goa 2010 http://nullcon.net
  • 5. Block Based Modeling A theoretical approach to model the problem of Fuzzing. Original (valid) Input Set is tokenized (blocks) and each token is fuzzed periodically. Better approach than blind fuzzing, however you need to write a LOT of code! • SPIKE, Peach, Sully etc. nullcon Goa 2010 http://nullcon.net
  • 6. Block Based Fuzzing GET /index.html HTTP/1.1 Host: foo.com User-Agent: wget/1.10.2 GET Index.html Host Wget/1.10.2 User-Agent foo.com nullcon Goa 2010 http://nullcon.net
  • 7. Block Based Fuzzing for-each-token data.replace(token, get_random()) target.send(data) end nullcon Goa 2010 http://nullcon.net
  • 8. Block Based Fuzzing GET <BIG-RANDOM-STRING> HTTP/1.1 Host: foo.com User-Agent: wget/1.10.2 nullcon Goa 2010 http://nullcon.net
  • 9. Block Based Fuzzing: Problems Tokenization needs knowledge of protocol. Lots of protocols. Proprietary protocols. Time Consuming. ETC. nullcon Goa 2010 http://nullcon.net
  • 10. Introducing Wireplay Minimalist approach to replay TCP Sessions with modifications as required. Use your valid client to connect to the server. Capture the packets (Wireshark?) Feed them to Wireplay for replay Use Wireplay hooks to modify original packets and replay nullcon Goa 2010 http://nullcon.net
  • 11. Wireplay: Functional Flow Original Client Sniffer Original Server PCAP Wireplay http://code.google.com/p/wireplay nullcon Goa 2010 http://nullcon.net
  • 12. Wireplay Features TCP Stream replay TCP Session reconstruction via. modified libnids (bug fixes) Plugin Subsystem Ruby Interpreter Embedded as Plugin Supports Packet Mangling hooks written in Ruby CGEN: A ruby plugin to generate a C program to reproduce a TCP Session nullcon Goa 2010 http://nullcon.net
  • 13. Wireplay: Basic Usage bash$ wireplay –r client -t 172.16.0.1 -p 80 -F pcap/http.pcap -K # optional nullcon Goa 2010 http://nullcon.net
  • 14. Wireplay: Fuzzing Hook Subsystem for arbitrary data manipulation. Embedded Ruby Interpreter and API set for writing packet manipulation hooks in Ruby Misc. features to repeat fuzz sessions, ignore errors, halt on connection fault etc. nullcon Goa 2010 http://nullcon.net
  • 15. Wireplay: Hook System Connect To Target 1 Events 1. On Start Read Next Packet Disconnect 2. On Data 3. On Stop 3 4. On Error Is Client to Read fromServer Server Data 2 2 Send to Server nullcon Goa 2010 http://nullcon.net
  • 16. Wireplay: Packet Hook in Ruby Define your arbitrary class with the following methods: on_start(pkt_desc) on_stop(pkt_desc) on_data(pkt_desc, direction, data) on_error(pkt_desc, code) Register an object of your class with Wireplay Hook Subsystem Wireplay::Hooks.register(YourClass.new) nullcon Goa 2010 http://nullcon.net
  • 17. Wireplay: Sample Hooks Blind Byte Alternation (blind.rb) Alters each byte from the original payload with single or multiple bytes for fuzzing. CGEN (cgen.rb) Generates C program to replay a TCP session. Use for PoC generation. nullcon Goa 2010 http://nullcon.net
  • 18. Wireplay: Demo nullcon Goa 2010 http://nullcon.net
  • 19. Thank You..  svn co http://wireplay.googlecode.com/svn/trunk wireplay http://code.google.com/p/wireplay/ nullcon Goa 2010 http://nullcon.net