Top Banner
Andrés Riancho ariancho <at> cybsec.com w3af – A framework to own the Web Ekoparty 2007 Buenos Aires, Argentina
31

w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

Aug 31, 2019

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

Andrés Rianchoariancho <at> cybsec.com

w3af – A framework to own the Web

Ekoparty 2007Buenos Aires, Argentina

Page 2: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   2

who am i ?

Security Consultant at Cybsec Programmer Open source evangelist Web Application security enthusiast Background in networking, IPS design and

evasion

w3af. sf. net

Page 3: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   3

w3af

● w3af stands for Web Application Attack and Audit Framework● An Open Source project (GPLv2)● A script that evolved into a serious project● A vulnerability scanner● An exploitation tool

CYB SECSecur ity Syst ems

Page 4: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   4

Main features

● Finds common and uncommon web application vulnerabilities.● Cross platform ( written in python).● Uses Tactical exploitation techniques to discover new URLs and vulnerabilities● Web and console user interface

w3af. sf. ne t

Page 5: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   5

Main features

● Web Service support● Exploits [blind] SQL injections, OS commanding, remote file inclusions, local file inclusions, XSS, unsafe file uploads and more!● WML Support (WAP)● Really easy to extend● Synergy among plugins

CYB SECSecur ity Syst ems

Page 6: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   6

Main features

● Ability to find vulnerabilities in query string, post data, URL filename ( http://a/f00_injectHere_b4r.do ), headers, file content (when uploading files with forms) and web services. JSON support is almost ready!● Number of plugins: 115 and growing● w3af is smart, more on this later ;)

w3af. sf. ne t

Page 7: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   7

Architecture

● w3af is divided in two main parts, the core and the plugins.● The core coordinates the process and provides features that plugins consume.● Plugins share information with each other using a knowledge base.● Design patterns and objects everywhere !

CYB SECSecur ity Syst ems

Page 8: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   8

Architecture

● 8 different types of plugins exist:– discovery– audit– grep– attack– output– mangle– evasion– bruteforce

w3af. sf. ne t

Page 9: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   9

Plugins | Discovery

They find new URLs and create the corresponding fuzzable requests; examples of discovery plugins are:

– webSpider– urlFuzzer– googleSpider– pykto

CYB SECSecur ity Syst ems

Page 10: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   10

Plugins | Discovery

They are run in a loop, the output of one discovery plugin is sent as input to the next plugin. This process continues until all plugins fail to find a new fuzzable request.

Other discovery plugins try to fingerprint remote httpd, allowed HTTP methods, verify if the remote site has an HTTP load balancer installed, etc.

w3af. sf. ne t

Page 11: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   11

Plugins | Audit

They take the output of discovery plugins and find vulnerabilities like:

– [blind] SQL injection– XSS– Buffer overflows – Response splitting.

As vulnerabilities are found, they are saved as vuln objects in the knowledge base.

CYB SECSecur ity Syst ems

Page 12: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   12

Plugins | Grep

These plugins grep every HTTP request and response to try to find information. Examples of grep plugins are:

– findComments– passwordProfiling– privateIP– directoryIndexing– getMails– lang

w3af. sf. ne t

Page 13: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   13

Plugins | Attack

These plugins read the vuln objects from the KB and try to exploit them. Examples of attack plugins are:

– mySqlWebShell– davShell– sqlmap– xssBeef– remote file include shell

CYB SECSecur ity Syst ems

Page 14: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   14

Plugins | Others

● Output: They write messages to the console, html or text file.● Mangle: They modify requests and responses based on regexs.● Evasion: They modify the requests to try evade IDS detection.● Bruteforce: They bruteforce logins.

w3af. sf. ne t

Page 15: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   15

Tactical Exploitation

What w3af does about tactical exploitation:

– vhost search in MSN– search for mail address in Google,MSN

and MIT PKS.– password profiling– halberd– archive.org search– search Google, MSN, Yahoo

CYB SECSecur ity Syst ems

Page 16: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   16

Discovery demo

This demo will show:

– fingerPKS, fingerMSN, fingerGoogle– bruteforce using collected usernames,

and dynamically generated passwords:● username● target site ( www.domain.com ; domain.com ; domain )

● passwords generated by the password profiling plugin

w3af. sf. ne t

Page 17: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   17

Discovery demo (contd.)

Let's rock...

CYB SECSecur ity Syst ems

Page 18: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   18

Virtual daemon

● Ever dreamed about using metasploit payloads to exploit web applications ? NOW you can do it !● How it works:

– I coded a metasploit plugin, that connects to a virtual daemon and sends the payload.

– The virtual daemon is runned by a w3af attack plugin, it receives the payload and creates a tiny ELF / PE executable

w3af. sf. ne t

Page 19: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   19

Virtual daemon

● How this works (contd.):

– The attack plugin knows how to exec remote commands, and the virtual daemon knows how to upload the ELF/PE using “echo” or some other inband method.

– A new scheduled task is created to run the payload, and the metasploit plugin is ordered to wait

– The payload is run on the remote server.

CYB SECSecur ity Syst ems

Page 20: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   20

Virtual daemon

● How this works (contd.):

– Normal communication between metasploit and the exploited service follows.

w3af. sf. ne t

Page 21: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   21

Virtual daemon

w3af - Virtual daemon

payload w3af – Attack plugin

exec()

ELF / PEReverse Shell

Metasploit Framework

Web Application

CYB SECSecur ity Syst ems

Page 22: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   22

Virtual daemon

demo!

w3af. sf. ne t

Page 23: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   23

w3afAgent

● A reverse “VPN” that allows you to continue intruding into the target network.● How does it work?

– I send the w3afAgent client to the target host using a transfer handler (wget, tftp, echo)

– The client connects back to w3af, where the w3afAgent server runs a SOCKS daemon.

CYB SECSecur ity Syst ems

Page 24: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   24

w3afAgent

● How does it work? (contd.):

– Now the user can use any program that supports a SOCKS proxy to route connections through the w3afAgent Server.

– All the traffic is forwarded to the w3afAgent Client, where a new TCP connection is created.

w3af. sf. ne t

Page 25: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   25

w3afAgent

Web Applicationw3afAgent Clientw3af

w3afAgentClient

Reverse connection

w3afAgentServer

w3afAgentClientData forwarded

using reverse connection

w3afAgentServer

Socks Client SSH server in DMZ

CYB SECSecur ity Syst ems

Page 26: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   26

w3afAgent

● Things that don't work but could:

– UDP traffic

● Things that won't work:

– Raw sockets– Sniffing

w3af. sf. ne t

Page 27: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   27

import __future__

● Javascript support● More stable core● More attack plugins, refactoring of attacks.● Better webUI● Better management report generation● Long descriptions for vulnerabilities● “Endless” discovery-audit-exploit loop

CYB SECSecur ity Syst ems

Page 28: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   28

import __future__

● Replace SOAPpy with ZSI● And maybe...

– Static code analysis of scripting languages (integration with Orizon? http://orizon.sf.net/ )

– Apache / IIS log analysis

w3af. sf. ne t

Page 29: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   29

Project information

● Site

– http://w3af.sf.net/● Mailing list and sourceforge home

– http://sourceforge.net/projects/w3af/ ● It's open source, you should contribute!● Project leader contact

– andres.riancho <at> gmail.com– ariancho <at> cybsec.com

CYB SECSecur ity Syst ems

Page 30: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   30

Project sponsor

11 years experience in information security

Clients in LATAM, USA and Europe

Based in Argentina Professional

Objectivity Research friendly ;)

w3af. sf. ne t

Page 31: w3af – A framework to own the Web Riancho - w3af.pdf · 3 w3af w3af stands for Web Application Attack and Audit Framework An Open Source project (GPLv2) A script that evolved into

   31

Questions?

Feature requests ? ideas?Bug reports? contributionsRants about web2.0?i want flash support! Web Services hacking.