the power of foca 3

91
Chema Alonso The Power of FOCA 3

Upload: chema-alonso

Post on 17-Dec-2014

1.386 views

Category:

Documents


2 download

DESCRIPTION

Presentación de funciones de FOCA 3 a lo largo de la historia.

TRANSCRIPT

Page 1: The Power of FOCA 3

Chema Alonso

The Power of FOCA 3

Page 2: The Power of FOCA 3

20/03/2013 2Chema Alonso

At the begining was the metadata

Page 3: The Power of FOCA 3

20/03/2013 3Chema Alonso

Anonym0us case

Page 4: The Power of FOCA 3

20/03/2013 4Chema Alonso

Drug Dealer

Page 5: The Power of FOCA 3

20/03/2013 5Chema Alonso

The breasts of Hacker’s girlfriend

Page 6: The Power of FOCA 3

20/03/2013 6Chema Alonso

Social Engineering Attack

Page 7: The Power of FOCA 3

20/03/2013 7Chema Alonso

• Hidden Relations–Companies–People

• Software Piracy

• History of documents

• Tactical information–Targeted Attacks

–Internal knowledge

• Ploting events–Places–Time

Metadata Risks

Page 8: The Power of FOCA 3

20/03/2013 8Chema Alonso

Forensic FOCA

http://www.elladodelmal.com/2012/02/forensic-foca-beta-trial.html

Page 9: The Power of FOCA 3

20/03/2013 9Chema Alonso

Metadata, hidden info & lost data

Metadata

Lost DataHidden

Info

Bad Format conversionBad management

New appsNew versions

EmbeddedFilesSearchers

SpydersDoc DB

Embedded Files

Bad managementEmbedded objects

Page 10: The Power of FOCA 3

20/03/2013 10Chema Alonso

Show Me Your Metadata

Page 11: The Power of FOCA 3

20/03/2013 11Chema Alonso

Targeting Malware

Page 12: The Power of FOCA 3

20/03/2013 12Chema Alonso

Targeting Malware

Page 13: The Power of FOCA 3

20/03/2013 13Chema Alonso

Hidden Info: Printers

Page 14: The Power of FOCA 3

20/03/2013 14Chema Alonso

Electing the entry point

Page 15: The Power of FOCA 3

20/03/2013 15Chema Alonso

Internal Fingerprinting

with FOCA

Page 16: The Power of FOCA 3

Chema Alonso

Phase 1: Metadata

Page 17: The Power of FOCA 3

20/03/2013 17Chema Alonso

FOCA 2

Page 18: The Power of FOCA 3

20/03/2013 18Chema Alonso

Recursive Network

Discovery• Servers• Domains• HostNames

• IP Address

• Roles

Page 19: The Power of FOCA 3

20/03/2013 19Chema Alonso

Network Discovery:

WebSearcher

Page 20: The Power of FOCA 3

20/03/2013 20Chema Alonso

Network Discovery: DNSWell Known

RecordsZone

Transfer

Diccionary Search

SOA, MX, SPF, DKIM, LDAP, VoIP, Active Directory….

AXFR

Server1, Intranet, Private, DNS, etc….

Page 21: The Power of FOCA 3

20/03/2013 21Chema Alonso

DNS Search

Page 22: The Power of FOCA 3

20/03/2013 22Chema Alonso

Primary Master

Page 23: The Power of FOCA 3

20/03/2013 23Chema Alonso

Network Discovery: Bing IP

Page 24: The Power of FOCA 3

20/03/2013 24Chema Alonso

Network Discovery: PTR Scannig

Page 25: The Power of FOCA 3

20/03/2013 25Chema Alonso

Network Discovery: Robtex

Page 26: The Power of FOCA 3

20/03/2013 26Chema Alonso

Network Discovery: Shodan

Page 27: The Power of FOCA 3

20/03/2013 27Chema Alonso

Digital Certificates

Page 28: The Power of FOCA 3

20/03/2013 28Chema Alonso

Roles View

Page 29: The Power of FOCA 3

20/03/2013 29Chema Alonso

Google Slash Trick

Page 30: The Power of FOCA 3

20/03/2013 30Chema Alonso

http://apple1.sub.domain.com/~chema/dir/fil.doc

1) http -> Web server 2) GET Banner HTTP3) domain.com is a domain4) Search NS, MX, SPF records for domain.com5) sub.domain.com is a subdomain6) Search NS, MX, SPF records for sub.domain.com7) Try all the non verified servers on all new domains

1) server01.domain.com2) server01.sub.domain.com

8) Apple1.sub.domain.com is a hostname9) Try DNS Prediction (apple1) on all domains10) Try Google Sets(apple1) on all domains

Network Discovery Algorithm

Page 31: The Power of FOCA 3

20/03/2013 31Chema Alonso

http://apple1.sub.domain.com/~chema/dir/fil.doc

11) Resolve IP Address12) Get Certificate in https://IP13) Search for domain names in it14) Get HTTP Banner of http://IP15) Use Bing Ip:IP to find all domains sharing it16) Repeat for every new domain 17) Connect to the internal NS (1 or all)18) Perform a PTR Scan searching for internal servers19) For every new IP discovered try Bing IP recursively20) ~chema -> chema is probably a user

Network Discovery Algorithm

Page 32: The Power of FOCA 3

20/03/2013 32Chema Alonso

http://apple1.sub.domain.com/~chema/dir/fil.doc

21) / , /~chema/ and /~chema/dir/ are paths22) Try directory listing in all the paths23) Search for PUT, DELETE, TRACE etc.. methods in every path24) Fingerprint software from 404 error messages25) Fingerprint software from application error messages26) Try common names on all domains (dictionary)27) Try Zone Transfer on all NS28) Search for any URL indexed by web engines related to the hostname29) Download the file30) Extract the metadata, hidden info and lost data31) Sort all this information and present it nicely32) For every new IP/URL start over again

Network Discovery Algorithm

Page 33: The Power of FOCA 3

20/03/2013 33Chema Alonso

Click & Go

Page 34: The Power of FOCA 3

20/03/2013 34Chema Alonso

How Foca found a data

Page 35: The Power of FOCA 3

20/03/2013 35Chema Alonso

Multiple Search Engines

Page 36: The Power of FOCA 3

20/03/2013 36Chema Alonso

Huge domain case

Page 37: The Power of FOCA 3

20/03/2013 37Chema Alonso

• 404 messages• Apps Error Messages• HTTP Banner

– Hostname– IP Addres

• SMTP Banner• Digital Certificates• Shodan• Version.bind

Fingerprinting Options

Page 38: The Power of FOCA 3

Chema Alonso

Phase 2: Network

Discovery

Page 39: The Power of FOCA 3

20/03/2013 39Chema Alonso

An0nymous #OpGreece

Page 40: The Power of FOCA 3

Chema Alonso

Phase 3: Vulnerabilities

Page 41: The Power of FOCA 3

20/03/2013 41Chema Alonso

Vulnerabilities

Page 42: The Power of FOCA 3

20/03/2013 42Chema Alonso

Backups

Page 43: The Power of FOCA 3

20/03/2013 43Chema Alonso

Directory Listing

Page 44: The Power of FOCA 3

20/03/2013 44Chema Alonso

DNS Cache Snooping

Page 45: The Power of FOCA 3

20/03/2013 45Chema Alonso

DNS Cache Snooping

Page 46: The Power of FOCA 3

20/03/2013 46Chema Alonso

• Internal Software– Windows Update– Gtalk

• Evilgrade– Detecting vulnerable software to

Evilgrade attacks

• AV evassion– Detecting internal AV systems

• Malware driven by URL– Hacking a web site ussually visited by

internal users

DNS Cache Snooping

Page 47: The Power of FOCA 3

20/03/2013 47Chema Alonso

.DS_Store

Page 48: The Power of FOCA 3

20/03/2013 48Chema Alonso

PHP CGI CODE EXECUTION BUG

Page 49: The Power of FOCA 3

20/03/2013 49Chema Alonso

Insecure Http Methods

Page 50: The Power of FOCA 3

20/03/2013 50Chema Alonso

Search & Upload

Page 51: The Power of FOCA 3

20/03/2013 51Chema Alonso

Juicy filesWhite/black list of matches for

keywords and extensions

Page 52: The Power of FOCA 3

20/03/2013 52Chema Alonso

Juicy files

Page 53: The Power of FOCA 3

20/03/2013 53Chema Alonso

.listing

Page 54: The Power of FOCA 3

20/03/2013 54Chema Alonso

Multiple Choices

Page 55: The Power of FOCA 3

20/03/2013 55Chema Alonso

.svn/entriesA .svn/entries file looks like:

Page 56: The Power of FOCA 3

20/03/2013 56Chema Alonso

.svn/entriesThere is a plugin that parse the file

Page 57: The Power of FOCA 3

20/03/2013 57Chema Alonso

IIS Short Name bug

Page 58: The Power of FOCA 3

20/03/2013 58Chema Alonso

• Mod_proxy

• Ad-hoc–Normal

–Transparent

Proxy Server detection

Page 59: The Power of FOCA 3

20/03/2013 59Chema Alonso

Proxy Server Detection

Page 60: The Power of FOCA 3

20/03/2013 60Chema Alonso

Leaks:modsecurity_crs_50_outb

ound.conf

Page 61: The Power of FOCA 3

20/03/2013 61Chema Alonso

Error Enforcement

Page 62: The Power of FOCA 3

20/03/2013 62Chema Alonso

Leaks

Page 63: The Power of FOCA 3

20/03/2013 63Chema Alonso

User directories

Search for ~USER in Apache webservers

Page 64: The Power of FOCA 3

20/03/2013 64Chema Alonso

• Network Discovery

• Document Search

• File parsing– Directory

Listing– Robots.txt– .Listing– .DS_Store (not

yet)

All your Foca needs is URLs• Domain

Crawling– Bing– Google

• Technology Recognition

• Custom Search

• Manual load

Page 65: The Power of FOCA 3

20/03/2013 65Chema Alonso

Domain Crawling

Page 66: The Power of FOCA 3

20/03/2013 66Chema Alonso

Custom Search

Page 67: The Power of FOCA 3

20/03/2013 67Chema Alonso

FOCA + Spidering

Page 68: The Power of FOCA 3

20/03/2013 68Chema Alonso

FOCA + Spidering

Page 69: The Power of FOCA 3

Chema Alonso

Phase 4: Plugins

Page 70: The Power of FOCA 3

20/03/2013 70Chema Alonso

Plugins: FOCA API 0.1From FOCA to plugins

(Events)- OnNewDomain - OnNewNetrange- OnNewURL - OnNewRelation- OnNewIP - OnNewProject

From Plugins to FOCA (Calls)- AddDomain - AddSQLi- AddProxy - AddIp …. And much more….

Page 71: The Power of FOCA 3

20/03/2013 71Chema Alonso

Plugins: .svn/Entries

parser

Page 72: The Power of FOCA 3

20/03/2013 72Chema Alonso

Plugins: .svn/Entries

parser

Page 73: The Power of FOCA 3

20/03/2013 73Chema Alonso

Plugins: WebFuzzer

Page 74: The Power of FOCA 3

20/03/2013 74Chema Alonso

Plugins: Auto SQLi searcher

Page 75: The Power of FOCA 3

20/03/2013 75Chema Alonso

IIS Short Name Fuzzer

Page 76: The Power of FOCA 3

Chema Alonso

Making an esay Plugin

Page 77: The Power of FOCA 3

20/03/2013 77Chema Alonso

FOCA Reporting Module

Page 78: The Power of FOCA 3

20/03/2013 78Chema Alonso

Page 79: The Power of FOCA 3

20/03/2013 79Chema Alonso

Threat Analisys & Modeling

Page 80: The Power of FOCA 3

20/03/2013 80Chema Alonso

Reporting OSSTMM 3.0:

STAR

Page 81: The Power of FOCA 3

20/03/2013 81Chema Alonso

OWASP Report Generator

Page 82: The Power of FOCA 3

20/03/2013 82Chema Alonso

“i64” Web Audit Report

Page 83: The Power of FOCA 3

20/03/2013 83Chema Alonso

Fear The FOCA

Page 84: The Power of FOCA 3

20/03/2013 84Chema Alonso

FOCA Online

Page 85: The Power of FOCA 3

20/03/2013 85Chema Alonso

Cleaning ODF: OOMetaExtractor

http://www.codeplex.org/oometaextractor

Page 86: The Power of FOCA 3

20/03/2013 86Chema Alonso

IIS MetaShield Protector

http://www.metashieldprotector.com

Page 87: The Power of FOCA 3

20/03/2013 87Chema Alonso

Evil FOCA

Page 88: The Power of FOCA 3

20/03/2013 88Chema Alonso

Thanks to Apple

Page 89: The Power of FOCA 3

20/03/2013 89Chema Alonso

Thanks to Apple (2)

Page 90: The Power of FOCA 3

20/03/2013 90Chema Alonso

Chema Alonso

[email protected]

• @chemaalonso• http://elladodel

mal.com• http://www.info

rmatica64.com

Page 91: The Power of FOCA 3

20/03/2013 91Chema Alonso

FOCA

http://www.informatica64.com/[email protected]