The Sulley Framework: Basics By loneferret www.kioptrix.com



Similar documents
Immotec Systems, Inc. SQL Server 2005 Installation Document

Training module 2 Installing VMware View

Reference and Troubleshooting: FTP, IIS, and Firewall Information

Configuration Backup and Restore. Dgw v2.0 May 14,

FTP Peach Pit Data Sheet

Asterisk SIP Trunk Settings - Vestalink

Secure Messaging Server Console... 2

Quick Start Guide. Cerberus FTP is distributed in Canada through C&C Software. Visit us today at

Kickstart Your Profits With. Prosper 202. Your Quickstart Guide to Profitable Tracking. By Sheldon Gray

How to Setup and Connect to an FTP Server Using FileZilla. Part I: Setting up the server

VELOCITY. Quick Start Guide. Citrix XenServer Hypervisor. Server Mode (Single-Interface Deployment) Before You Begin SUMMARY OF TASKS

FTP, IIS, and Firewall Reference and Troubleshooting

Linux FTP Server Setup

Install MS SQL Server 2012 Express Edition

File Transfer Examples. Running commands on other computers and transferring files between computers

6WRUP:DWFK. Policies for Dedicated IIS Web Servers Group. V2.1 policy module to restrict ALL network access

N-CAP Users Guide Everything You Need to Know About Using the Internet! How Firewalls Work

protocol fuzzing past, present, future

TELE 301 Network Management. Lecture 17: File Transfer & Web Caching

Network Monitoring with SNMP

SQL EXPRESS INSTALLATION...

Introduction to Operating Systems

Content Management System

IRMACS Setup. Your IRMACS is available internally by the IMAP protocol. The server settings used are:

HP Device Manager 4.6

Updating KP Learner Manager Enterprise X On Your Server

JMC Next Generation Web-based Server Install and Setup

Kaseya 2. User Guide. Version 7.0. English

Network/Floating License Installation Instructions

STABLE & SECURE BANK lab writeup. Page 1 of 21

Using Internet or Windows Explorer to Upload Your Site

Technical Support Information

FTP Server Configuration

ilaw Installation Procedure

NovaBACKUP Central Management Console

Network Monitoring with SNMP

Outlook Connector Installation & Configuration groupwaresolution.net Hosted MS Exchange Alternative On Linux

AXIS 70U - Using Scan-to-File

Installation Guide For Choic Enterprise Edition

Enterprise Remote Control 5.6 Manual

Hadoop Data Warehouse Manual

Lab Objectives & Turn In

MBA Dedicated Servers: A How-to Guide

Secure Web Development Teaching Modules 1. Security Testing. 1.1 Security Practices for Software Verification

Server & Workstation Installation of Client Profiles for Windows

How to test and debug an ASP.NET application

Basic Exchange Setup Guide

Signiant Agent installation

IMF Tune Quarantine & Reporting Running SQL behind a Firewall. WinDeveloper Software Ltd.

Download/Install IDENTD

Scheduling Automated Outlet Control Using FineSNMPSet with Sentry Switched Power Distribution Units

Setting Up Dreamweaver for FTP and Site Management

Networks and Security Lab. Network Forensics

Alteryx Predictive Analytics for Oracle R

Debug Failed to connect to server!

SNMP Peach Pit Data Sheet

Installing Certificates on Spectralink 8400 Handsets

Step-By-Step Guide to Deploying Lync Server 2010 Enterprise Edition

The easy way to a nice looking website design. By a total non-designer (Me!)

XStream Remote Control: Configuring DCOM Connectivity

Livezilla How to Install on Shared Hosting By: Jon Manning

Firewalls and Software Updates

FTP Upload instructions for Wealden Group Ltd

Spam Marshall SpamWall Step-by-Step Installation Guide for Exchange 5.5

EXTENDED FILE SYSTEM FOR F-SERIES PLC

How Do I Upgrade Firmware and Save Configurations on PowerConnect Switches?

How to Install Multiple Monitoring Agents on a Microsoft Operating System. Version StoneGate Firewall/VPN 2.6 and SMC 3.2

Chapter 6 Virtual Private Networking Using SSL Connections

Advanced Tornado TWENTYONE Advanced Tornado Accessing MySQL from Python LAB

Network setup and troubleshooting

Firewalls. Firewalls. Idea: separate local network from the Internet 2/24/15. Intranet DMZ. Trusted hosts and networks. Firewall.

Configuring MailArchiva with Insight Server

Server & Workstation Installation of Client Profiles for Windows (WAN Edition)

SecureAssess Local. Install Guide. Release 9.0

for Networks Installation Guide for the application on a server September 2015 (GUIDE 2) Memory Booster version 1.3-N and later

ShadowControl ShadowStream

Basic Exchange Setup Guide

IIS, FTP Server and Windows

Introduction Connecting Via FTP Where do I upload my website? What to call your home page? Troubleshooting FTP...

How To Enable A Websphere To Communicate With Ssl On An Ipad From Aaya One X Portal On A Pc Or Macbook Or Ipad (For Acedo) On A Network With A Password Protected (

Integrated Virtual Debugger for Visual Studio Developer s Guide VMware Workstation 8.0

Setting Up Scan to SMB on TaskALFA series MFP s.

Project 2: Penetration Testing (Phase II)

Using Nessus In Web Application Vulnerability Assessments

NovaBACKUP xsp Version 15.0 Upgrade Guide

Q&A. DEMO Version

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

Getting started. Symantec AntiVirus Corporate Edition. About Symantec AntiVirus. How to get started

DocAve Upgrade Guide. From Version 4.1 to 4.5

How To Test The Bandwidth Meter For Hyperv On Windows V (Windows) On A Hyperv Server (Windows V2) On An Uniden V2 (Amd64) Or V2A (Windows 2

for Networks Installation Guide for the application on the server July 2014 (GUIDE 2) Lucid Rapid Version 6.05-N and later

for Networks Installation Guide for the application on the server August 2014 (GUIDE 2) Lucid Exact Version 1.7-N and later

DISCOVERY OF WEB-APPLICATION VULNERABILITIES USING FUZZING TECHNIQUES

Integrating with BarTender Integration Builder

Web Application Firewall

Jim2 ebusiness Framework Installation Notes

Installing the ASP.NET VETtrak APIs onto IIS 5 or 6

Device Log Export ENGLISH

Transcription:

The Sulley Framework: Basics By loneferret www.kioptrix.com Entirely coded using Python, The Sulley Framework was developed by Tipping-Point s Pedram Amini and Aaron Portmoy. Sulley is a fuzzer packed with interesting capabilities. Such as packet-capturing, crash reporting and VMware automation. It also has the capability to restart the target application in the event of a crash and continue on with the fuzzing process. For data generation, Sulley uses a block-based fuzzing, the same method used by Dave Aitel s SPIKE. So if you re familiar with SPIKE, you shouldn t have much trouble with this fuzzer. In block based fuzzing, you build up a general skeleton for the protocol or file you are fuzzing. One great feature this fuzzer has over others is the ability to show the CPU s registers at the moment of the crash. Sulley comes with PyDBG, and once the framework installed it uses this to monitor the process you are fuzzing. Another one is Sulley s ability to monitor the network (using pcapy), capturing every fuzz sent to the target. This way you can follow your progress, or review your fuzzing session. Lastly, you can even see the fuzzing progress via an HTML page. The page shows you which variable it s currently fuzzing and its progress. Sulley Primitives Strings: Sulley uses the s_strings() directive to denote that the data contained is a fuzzable string. So if we wanted to fuzz an email address, we d declare it like this in our skeleton: s_string( fuzzing@sulley.com ) This tells Sulley it s a valid value, so it will fuzz that string and exhaust all reasonable possibilities. Once it s finished, it will revert to its original value and continue fuzzing the rest of the declared values down the file. Delimiters: This is just a small string that helps break up larger ones. If we take our email example from above, the delimiter would be the @ sign. This is how we d pass this primitive on to Sulley: s_string( fuzzing ) s_delim( @ ) s_string( sulley ) s_delim(. ) s_string( com ). Like the s_string() primitive, the delimiter is also fuzzed. If we don t need to fuzz a particular delimiter, we can tell Sulley to not fuzz it like so: s_delim(., fuzzable=false )

Static: The values passed to a static string, remain unchanged (or un-fuzzed I suppose). So let s examine a complete yet small and simple skeleton file. In this example, we ll look at the FTP protocol. # import all of Sulley s functionality # We ll call this file ftp_ability.py from sulley import * s_initialize( user ) s_static( USER ) s_static( ftp ) s_initialize( pass ) s_static( PASS ) s_static( ftp ) s_initialize( stor ) s_static( STOR ) s_string( AAAA ) You can see it s pretty simple. This file basically feeds Sulley with valid starting values and it takes it from there. Fuzzing the fields you denoted as fuzzable. In this case; the username, password and the STOR command. Depending on the target FTP server, you ll add and/or remove commands. Not every FTP server will have STOR, and not all of them have LIST So this is where you d supply a valid list of commands.

Now that we ve seen our blocks, let s take a look at the session file. This file starts the whole fuzzing process. from sulley import * # import everything from Sulley from requests import ftp_ability # this is our ftp_ability.py file from requests folder def receive_ftp_banner(sock): sock.recv(1024) sess = sessions.session(session_filename= audits/ability.session ) #Target IP xxx.xxx.xxx.xxx target = sessions.target( xxx.xxx.xxx.xxx, 21) target.netmon = pedrpc.client( xxx.xxx.xxx.xxx, 26001) target.procmon = pedrpc.client( xxx.xxx.xxx.xxx, 26002) target.procmon_options = { proc_name : Ability Server.exe } sess.pre_send = receive_ftp_banner #grab the banner sess.add_target(target) sess.connect(s_get( user )) # Notice our commands from the previous file sess.connect(s_get( user ),s_get( pass )) # This tells Sulley user must be authenticated to use this command sess.connect(s_get( pass ),s_get( stor )) sess.fuzz() Because most FTP servers send a banner, we tell Sulley to wait for it before fuzzing any data. The next thing is the session file which keeps track of our overall session. This allows us to stop and restart our fuzzing where we had previously left off. After that we define our target with the appropriate IP and port number. In this case port 21. After defining the target, we tell our network sniffer on the same host and listening on 26001. Last we tell our debugger is listening on the same host and that is listening on 26002. We chain in the authentication commands and tell Sulley to start fuzzing. To start the fuzzing process, we need to have Sulley installed on 2 machines (I find it less confusing this way and it just works better), the attacking and victim machine. From the target machine: 1: start the process we want to fuzz (this case Ability Server) 2: attach the process monitor to our server. C:\sulley>python process_monitor.py -c c:\ability.crash -p Ability Server.exe 3: attach the network monitor to our network card and have it sniff for specific traffic. The -P parameter is to store your pcaps file. You must create this folder first. You can use a mapped drive too. C:\sulley>python network_monitor.py -d 1 -f src or dst port 21 -P z:\

From our attacking machine: 1: execute the session file from Sulley s root directory C:\sulley>python ftp_session_ability.py Once the process has started, you can point your browser to the attacking machine s IP on port 26000 to get a progress report. You need to manually refresh the page, or you can easily modify the code to refresh automatically. Once the application crashes, you ll be able to see the report on the page. Enabling you to see what/where was overwritten in the CPU s registry. You can get the install executable here And the PDF here Here s a link to a video on kioptix.com demonstrating all of this. Using the same files and vulnerable application mentioned above. Thanks to dookie for pointing out a few mistakes of mine while I was setting up Sulley for the first time.

Let s move on and look at fuzzing a TFTP server. The big difference is one uses the TCP protocol and the other UDP. By default Sulley will connect to TCP ports. We need to specify that we are trying to fuzz UDP. This is specified in our session file. from sulley import * # import everything from Sulley from requests import tftp sess = sessions.session(session_filename= audits/tftpserver.session,proto= udp ) #Target IP xxx.xxx.xxx.xxx target = sessions.target( xxx.xxx.xxx.xxx, <PORT#>) target.netmon = pedrpc.client( xxx.xxx.xxx.xxx, 26001) target.procmon = pedrpc.client( xxx.xxx.xxx.xxx, 26002) target.procmon_options = { proc_name : <PROCESS NAME> } sess.add_target(target) sess.connect(s_get( tftp )) sess.fuzz() Once you ve specified the proto parameter, the rest of the session file is pretty much the same as fuzzing any other protocol. Now that you have your session file configured for UDP connections, you ll need a request file. I found this basic file TFTP request file on the Internet here. You can also find a few more examples here: http://sulley.kioptrix.com/request.php Now that we have our session and request file, there s one more change that needs to be done before we can appreciate all of this. When fuzzing a TCP protocol, you would run the network_monitor script like so: c:\sulley>python network_monitor.py -d X -f src or dst port XX -P \\path Well since this is UDP and the traffic is only one way, the pcap string won t capture anything. So you ll need to enter it this way: c:\sulley>python network_monitor.py -d X -f udp dst port XX -P \\path As with anything script related, this can be improved. So know you can pretty much continue on fuzzing the TFTP server in very much the same way as the FTP example above. Try downloading a known vulnerable TFTP server and watch it fuzz Here s a nice little list from exploit-db that you can have fun with. Thanks again, hope you enjoyed this little read. Special thanks to the Exploit-DB Team @ www.exploit-db.com