Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration...

98
Penetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Transcript of Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration...

Page 1: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 1 von 98

IndianZ

Penetration-Testing

Penetration Testing means to test the security of a computer system beyond it's limit.

December 2010

Page 2: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 2 von 98

Haftung + Verantwortung

● Penetration Testing kann gesetzlich als Straftat (Hacking) verfolgt werden● Exploits verursachen unvorhersehbare Zustände in Systemen (produktiv?)● Die in dieser Präsentation beschriebenen Techniken können auch für kriminelle Zwecke verwendet werden● Verantwortungsvoller Umgang mit diesem Wissen wird vorausgesetzt● IndianZ übernimmt KEINERLEI Haftung bei der legalen oder illegalen Anwendung dieses Wissens

Page 3: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 3 von 98

Agenda

● Security Testing● Begriffe, Hacking, Gesetz, Technik, Ethik,

Organisation, Methoden, Zertifizierungen● Prozess

● Kickoff, Footprinting, Portscanning, Fingerprinting, Vulnerability Research, Exploiting, Hide Traces, Documentation, Presentation, Debriefing

● ISECOM OSSTMM● Tipps und Tricks

Page 4: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 4 von 98

Security Testing

Page 5: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 5 von 98

Security Testing

● Risk Analysis● Risikoanalyse● Schätzung● Meist Interview-basiert● Eintretenswahrscheinlichkeit mal Schadenausmass

= Risiko Index● Vulnerability Scan

● Automatisierte Untersuchung auf Schwachstellen● Banner und Verwundbarkeitsdatenbank

Page 6: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 6 von 98

Security Testing

● Assessment● Manuelle Überprüfung● Stichproben● Effizienz

● Ethical Hacking● “Capture-the-Flag”● Realistisches Szenario, bestimmte Frage● Security y/n?

Page 7: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 7 von 98

Security Testing

● Penetration Test● Manuelle Überprüfung● Alle Schwachstellen● Kaum False Positives

● Onsite Audit● Überprüfung lokaler Konfigurationseinstellungen● Schwachstellen, die von aussen unsichtbar sind● Lokales Subnet (Filtering)

Page 8: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 8 von 98

Sicherheit

● Security● Militärischen Ursprungs, physikalische Sicherheit,

Separierung von Schutzobjekt und Bedrohung● Safety

● Operative Bedeutung, wenn Separierung nicht möglich, Kontrolle der gefährlichen Effekte

● Angemessen: Budget Sicherheit < Wert Assets

Page 9: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 9 von 98

Sicherheit

● Sicherheit degradiert über Zeit (ohne zutun)● neue Attacken, neue Technologien, sich ändernde

Umsysteme

Page 10: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 10 von 98

Sicherheit

● Beispiel Banktresor:● Banktresore sind nicht unknackbar● Sie haben einen Widerstandsgrad (definiert, wie lange sie

gängigen Angriffsversuchen widerstehen)

● IT- und Informationssicherheit:● Man kann nicht verhindern, dass jemand mit genügend

Ressourcen (Technik und Zeit) die Sicherheit brechen kann● Aber man kann es Angreifern sehr schwer machen ;-)

Page 11: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 11 von 98

Sicherheit

● PDCA-Zyklus (Deming-Kreis) 1982

Page 12: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 12 von 98

Security Testing

● Security-Testing-Zyklus

Page 13: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 13 von 98

Hacker's

the dark side

Page 14: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 14 von 98

Hack Methodik

● 1 Fussabdruck nehmen (Footprinting)● 2 Systeme und Ports identifizieren (Scanning)● 3 Dienste identifizieren (Fingerprinting)● 4 Verwundbarkeitsanalyse (Vulnerability Research)● 5 Verwundbarkeit(en) ausbeuten (Exploit)● 6 Zugriff ausweiten (Privilege Escalation)● 7 Zugriff sicherstellen (Backdooring)● 8 System säubern (Cleaning)● 9 Weitere Attacken (Target Network)

Page 15: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 15 von 98

Realität Hacker

● Viele Hindernisse● Firewalls, Filtering-Devices● Intrusion Detection/Prevention● Patch Management● Authentisierung und gute Passwörter● Benutzer Sensibilisierung● Hardening● Virtualisierung und Jails/Chroot● Memory Protection● Sichere Programmierung● Zeitbedarf gegenüber Auffälligkeit

Page 16: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 16 von 98

Hacker

● Was zeichnet einen Hacker aus?● Verbeisst sich in Problematik● Will “Ding” im Detail verstehen● Will “Ding” zweckentfremden

● Neugier, Geduld, Spieltrieb, Zeit...● Whitehat → Grey-/Gray-Hat → Blackhat● Vergleich mit Holzschnitzerei

● jeder kann Schnitzen lernen -● aber ein Meisterwerk aus Holz schaffen?

Page 17: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 17 von 98

Hacker

● Real-Life-Treffpunkte● http://hackerspaces.org/wiki/Hacker_Spaces

● Links & Stuff● Blackhat: http://www.blackhat.com/● Phrack: http://www.phrack.com/issues.html

● Legale Weiterbildung● Wargames: http://www.overthewire.org/wargames● Hacker Games: http://www.hackergames.net/● Hack this Site: http://www.hackthissite.org/● Hack & Learn: http://www.hackergame.ch/

Page 18: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 18 von 98

Hacker / Security Tester

Hacker Security TesterHype Ja JaHacken Ja Ja, mit EthikAuftrag Nein oder kriminell Ja, mit VertragMotiv Persönlicher Profit, politisch Für mehr SicherheitEthik/Moral Keine oder eigene Ja, Vertrag, Haftung, GesetzeBericht Kein Bericht und Präsentation

Hacking = Art Security Testing = Science(Kunst) (Wissenschaft)

Page 19: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 19 von 98

Penetration Testing

● Testen auf Durchdringung der Sicherheit● Analyse der Sicherheit eines IT-Systems● Schwachstellen gefährden Schutzziele

● Verfügbarkeit, Vertraulichkeit, Integrität und Nachvollziehbarkeit

● ALLE möglichen/ausnutzbaren Schwachstellen

Page 20: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 20 von 98

Riskmgmt / Pentest

● klassische Risikomanagement = Schätzung● Risiko = Eintrittswahrscheinlichkeit mal Schadenausmass● Nachteil: Bewertung von Risiken ist Gefühlssache

● Pentest = Messung● Analyse der Sicherheit Objekt, Stichprobe● Nachteil: Qualifikation Tester

Page 21: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 21 von 98

Recht

● Schweizer Strafgesetzbuch StGB

● DSG● Datenschutz● Art. 7 Datensicherheit

● FMG● Fernmelderecht

● URG● Urheberrecht

● ...

Artikel Bemerkung143 Datenbeschaffung bereichernd143bis Hacken144bis Datenbeschädigung147 Computerbetrug150 Leistung erschleichen179novies Beschaffen von Personendaten251-254 Urkundenfälschung135 Gewaltdarstellungen173-178 Ehrverletzungen197 Pornographie162bis Rassendiskriminierung148 Check-/Kreditkartenmissbrauch

Page 22: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 22 von 98

Law & Order

● Gemäss Obligationenrecht (Haftpflicht) und StGB● Rechtfertigungsgrund(Einwilligung des Verletzten)

● Leichte Fahrlässigkeit OR Art. 100 wegbedingen● Haftung mit Betragsbeschränkung● Haftung nur für direkte Schäden● Vier-Augen-Prinzip

● stillschweigendes Einverständnis, Restrisiko● Daten verschlüsselt austauschen/abspeichern

● DSG Artikel 7, Datensicherheit● Einhaltung Sorgfaltspflicht und Geheimhaltung

Page 23: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 23 von 98

Ethik

● Vertraulichkeit vor und nach Test● keine öffentlichen Gespräche über Kunden● Marketing verwendet keine Kundendaten

● Beispielbericht verlangen● verschlüsselte Kommunikation mit Kunden

● PGP, GnuPG oder ähnliches● verschlüsselte Speicherung von Kunden-Daten

● PGP, GnuPG oder Truecrypt● nur abgemachte Tests bewilligte Systeme● nicht durchgeführte Tests ausweisen (Begründung)

Page 24: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 24 von 98

Ethik

● Denial-of-Service braucht spezielle Bewilligung● Social-Engineering nur mit geschulten Mitarbeitern● Kommunikation und Eskalation für Notfälle● für gehostete Systeme/ISP schriftliche Bewilligung● Zertifizierung der Tester bevorzugt● keine Blackhats, einwandfreier Leumund● keine Gratis-Dienstleistungen (Werbe-Trophies)● nie nur automatisierte/kommerzielle Tools● manuelle Verifikation immer notwendig● kein Einsatz von Angst, Unsicherheit, Zweifel und Irreführung

Page 25: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 25 von 98

Methoden (2008)

HerausgeberDie Kunst des Penetration Testing 2007 Computer & LiteraturDurchführungskonzept für Penetrationstests 2006 BSIGray Hat Hacking 2005 McGraw-Hill/OsborneGuideline on Network Security Testing 2003 NISTInformation Systems Security Assessment Framework OISSGNetwork Security Assessment (Second Edition) 2007 O'ReillyOpen Source Security Testing Methodology Manual 2001 ISECOMOpen Web Application Security Project OWASP Guide OWASPPenetration Testing 2006 MITPPenetration Testing and Cisco Network Defense 2005 CISCOpressPenetration Testing Framework VulnAssessSicherheitsüberprüfung von IT-Systemen mit Hilfe von Tiger-Teams 1999 ISACA

Buch / Dokument

Page 26: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 26 von 98

Penetration Tester

● Kreativität und Jagdinstinkt eines Hackers● Umgang mit Kunden, Gepflogenheiten als IT-Berater● Knowhow OS, Anwendungen und Sicherheitslücken● Programmieren, Erstellung/Änderung Programme● Systematisches Abwickeln von Tests● Bericht schreiben und Präsentation halten● Verständlichkeit und Qualität des Berichts● Verständnis/Sprache für Technik/Management

Page 27: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 27 von 98

Certifications

● ISECOM (www.isecom.org) ● OSSTMM Professional Security Tester /Analyst (OPST/OPSA)

● ISC2 (www.isc2.org) ● Certified Information Systems Security Professional (CISSP)

● ISACA (www.isaca.ch) ● Certified Information Systems Auditor (CISA)

● EC Council (www.eccouncil.org) ● Certified Ethical Hacker/Licensed Penetration Tester (CEH/LPT)

● Offensive Security (www.offensive-security.com) ● Offensive Security Certified Professional (OSCP)

Page 28: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 28 von 98

Technik

● Betriebssystem(e)● Linux, Windows● Virtualisation ;-)

● Netzwerk● Ungefilterter Zugriff● Source-Ports spoof → kein NAT● Bandbreite (uplink)

● Knowhow und Tools

Page 29: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 29 von 98

Technik

● Knowhow Betriebssysteme● Linux (Gentoo, Debian, Slackware)● Windows (XP, Vista, 200-2008)

● Knowhow Netzwerk● Protokolle (DNS, SMB, SNMP, SMTP, FTP, SSH, SSL,

TFTP, ...), OSI-Layer● Knowhow Programmierung

● C, C#, Perl, Python, Ruby, Bash, Html, Php, Java, ...

Page 30: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 30 von 98

Technik

● Knowhow Technologien● Wireless, Bluetooth, RFID, ...● VoIP, X.25, SS7, ...● Cisco, AIX, HPUX, Solaris, …● Apache, IIS, PHP, …

● Knowhow Security, Vulnerabilities, Hardening● Knowhow Security/Hacking Tools ;-)

Page 31: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 31 von 98

Tools

● Sniffer● Tcpdump, Wireshark, Dsniff

● Scanner● Nmap, Amap, Nessus, Openvas, Unicornscan, Paketto,

Scanudp, Superscan, Scanline, Angry IP, Winfingerprint● Netzwerk

● Hping, Nemesis, Ettercap, Yersinia, Firewalk, Hunt, Juggernaut, Irpas, Nemesis, Sing, Netcat

● Web● Paros, Burp, Webscarab, Proxmon, Ratproxy, W3af, Nikto,

Grendelscan, Springenwerk, Wapiti

Page 32: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 32 von 98

Tools

● Bluetooth● BlueDiving, Blooover, BtAudit, BtScanner

● Wireless● Netstumbler, Kismet, Aircrack-ng, WellenReiter, Airsnort

● Database● Tnscmd, OAT, OAK, SQLAT, SQLping, Osql, SQLbf

● VoIP● Sivus, SIPscan, Oreka, VoIPong, RTPbreak, SIPp

● RPC● Rpcdump, Rpcinfo, Epdump

Page 33: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 33 von 98

Tools

● Password Crack● Hydra, Ophcrack, John the ripper, Brutus ae2, Lcp,

Cain&Abel, (L0phtcrack)● Exploit

● Metasploit, Inguma● SNMP

● Snmpwalk, ADMsnmp, Getif● NetBIOS/SMB

● Nbtscan, Enum, Dumpsec, Netbios Audit Tool (NAT)

Page 34: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 34 von 98

Tools

● Mehr Tools ;-)Securitytools: http://sectools.org/IndianZ: http://www.indianz.ch/Packetstorm: http://packetstormsecurity.org/Securityteam: http://www.securiteam.com/tools/Darknet: http://www.darknet.org.uk/

Page 35: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 35 von 98

Organisation

● Teamleader und Tester● Ab 5 Tester sehr hohe Komplexität● Vereinfachen mit Checklisten (Software-gestützt)● Vorsicht vor Interessenkonflikten/Politik● Budget und Ressourcen● 5d/w = 3d produktiv + 2d Research/Development● Motivation, Einsatz, Arbeit zu Randzeiten● Spezialisierung innerhalb Teams auf Technologien● Challenges, Referate, Security Conventions

Page 36: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 36 von 98

Organisation

● Lebenszyklus Systeme● Einbettung Sicherheit

● Vor Produktivstart● Zyklisch Wiederkehrend● Ablösung und Veränderungen

● Interne Kompetenzstelle für Abnahmetests● Projekt STOP-Befugnis● Beratung bei Projektstart (Anforderungen)● Stichproben-Audits

Page 37: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 37 von 98

Organisation

● Projekte nicht länger als 3 Monate, splitten● Zeit Reporting mindestens ½ Zeit Testing● Eventuell Zeit Reporting = Zeit Testing● Projektplanung (Reserven einplanen)

Objectives Days: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

•Testing

•Analysis

•Reporting

•Workshop

Page 38: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 38 von 98

Organisation

Interne Tester Externe TesterVorteile Nachteile Vorteile Nachteile

Aufbau Knowhow

Kontrollfunktion Investitionskosten Motivation Team

Weisungsbefugnis Motivation Team Training Team

Effizienz Training Team keine PolitikSteuerung Bericht Augen zudrücken Effizienz

Vertraulichkeit und Datenschutz

Nutzung aktuelles Knowhow

Verlass auf Qualität Tester

Wiederkehrende Kosten

Bericht nur bedingt beeinflussbar

IT Landschaft bekannt

Knowhow aktuell halten

IT Landschaft unbekannt

Vergleichbarkeit (unterschiedliche

Dienstleister)

Vergleichbarkeit (Trending)

interne Politik, Interessens-konflikte

Vergleichbarkeit (gleicher

Dienstleister)

Page 39: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 39 von 98

CERT/CIRT

● Computer Emergency/Incident Response Team● Ideale Team-Besetzung

● Netzwerk-Spezialist● Sicherheitsprodukt-Spezialist● Forensic-Spezialist● Rechts-Spezialist● Spezialist physische Sicherheit● Programmierer

● Organisatorische Einbettung (Stab, weit oben)● Politische Aspekte

Page 40: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 40 von 98

CERT/CIRT

● Einsatz von Honeynets/-pots ;-)● Kombination mit Monitoring (IDS)● Spezialisierung

● TELCO (SS7, X.25, VoIP), SCADA● LinksCarnegie Mellon University: http://www.cert.org/FIRST: http://www.first.org/Internet Storm Center SANS: http://isc.sans.org/ Switch: http://www.switch.ch/cert/

Page 41: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 41 von 98

Process

● 00 Kickoff● 01 Footprinting● 02 Portscanning● 03 Fingerprinting● 04 Vulnerability Research● 05 Exploiting● 06 Hide Traces● 07 Documentation● 08 Presentation● 09 Debriefing

Page 42: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 42 von 98

00 Kickoff

● Vertragverhandlungen, Vertrag● Haftung, Geheimhaltung, Gesetze/Regulationen● Ethik (Spielregeln)● Test

● Wurde der Vertrag unterschrieben?● Was ist das Ziel des Tests?● Was ist das Untersuchungsobjekt (Scope)?● Wer hat welche Verantwortung?● Wer sind die Ansprechpersonen?● Wie sieht der Testplan aus?● Was wird wie dokumentiert (Reporting)?

Page 43: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 43 von 98

00 Kickoff

Klassifikation (BSI)

Informationsbasis Blackbox Whitebox

Agressivität passiv scannend vorsichtig abwägend aggressiv

Umfang vollständig begrenzt fokussiert

Vorgehensweise verdeckt offensichtlich

Technik Netzwerkzugang physischer Zugang Social-Engineering

Ausgangspunkt von aussen von innen

sonst. Kommunikation

Page 44: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 44 von 98

01 Footprinting

● DNS, Whois● Webseiteninhalte● Bouncing Email● Traceroute(s!)● Suchmaschinen/OSINT (Open Source Intelligence)

● Newsgroups, Postings● Wayback Machine (www.webarchive.org)● EDGAR, ZEFIX (zefix.admin.ch)● Netcraft (www.netcraft.com)● Suchmachinen (Google, Microsoft Live, Boolean Logic)

Page 45: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 45 von 98

DNS

Page 46: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 46 von 98

01 Footprinting

● Traceroutes● UDP Traceroute, ICMP Traceroute, TCP Traceroute

Page 47: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 47 von 98

01 Footprinting

● Discovery oder Enumeration (Inventar)● Ping

● ARP-Ping (Layer 2)● ICMP-Ping (Layer 3)

● Netmask, Timestamp● TCP-Ping (Layer 4)

● SNMP● Netzwerkdevices, Printers● Community: public und private● UDP 161 (SNMP) / UDP 162 (TRAP)

● NetBIOS● Windows● TCP/UDP 135-139/445

Page 48: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 48 von 98

02 Portscanning

● Analyse ALLER offenen Ports TCP und UDP● 0-1023, --top-ports 100, -F, 0-65535 (-p-), ...

● Portnummern● http://www.iana.org/assignments/port-numbers● http://www.isecom.info/cgi-local/protocoldb/browse.dsp

● Port-Sweep ;-)

● Abfrage eines Ports auf mehreren Systemen● Portscan :-(

● Abfrage mehrerer Ports auf einem System

Page 49: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 49 von 98

02 Portscanning

Page 50: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 50 von 98

02 Portscanning

● Tcp Three-Way-Handshake● Syn → Syn/Ack → Ack

● UDP unzuverlässig und langsam (ICMP-Errors)● Payloads (Protokolle)● Beschränkung Range (nmap --top-ports 100, -F)

● Verifikation Resultate mit zweitem, unabhängigen Tool● Timing und Parallelität● Spoofed Source-Ports → no NAT!

Page 51: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 51 von 98

03 Fingerprinting

● Analyse ALLER offenen Ports UDP/TCP + Protokolle● Analyse der Banner● Analyse von Fehlermeldungen und Anmeldungsmaske● Analyse der Lowlevel-Informationen des Netzwerkes

● TCP-Sequenznummer, IP-ID, Window-Size, TTL● Vergleich der Netzwerkantwort mit einer Datenbank

Page 52: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 52 von 98

04 Vulnerability Research

● Automatisiert: Nessus, OpenVAS, ATK● Manuell: Internet ResearchCVE: http://cve.mitre.org/NVD: http://nvd.nist.gov/OSVDB: http://osvdb.org Secunia: http://secunia.com/Securityfocus: http://www.securityfocus.com/vulnerabilities/Archives Neohapsis: http://archives.neohapsis.com/Security Tracker: http://www.securitytracker.com/

● Information Auftraggeber bei kritischen Risiken● Gewichtung, Kategorisierung, Priorisierung

Page 53: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 53 von 98

04 Vulnerability Research

● OSSTMM● Vulnerability

(Verwundbarkeit)● Weakness (Schwäche)● Concern (Bedenken)● Exposure

(Informationspreisgabe)● Anomaly (Anomalie)

● Nessus● Critical (Kritisch)● High (Hoch)● Medium (Mittel)● Low (Tief)● Info (Information)

Page 54: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 54 von 98

05 Exploiting

● Exploits existieren seit den 70ern● Exploit vulnerability = Verwundbarkeit ausbeuten

● Ein Computer unterscheidet bei der Eingabe nicht zwischen Programminstruktionen und Daten

● Wenn ein Prozessor Programminstruktionen sieht, versucht er, diese auszuführen

● Exploits sind plattform-abhängig● Exploit/Shellcode vorgängig testen (<rm -rf />?)● Hohes Risiko Exploit auf produktive Systeme

Page 55: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 55 von 98

05 Exploiting

● Exploit selber suchen und programmieren● Höchste Disziplin ;-), aber...

● C, Perl, Python, Assembler, …● Speicher, Architektur (32/64-bit), Testumgebung● Debugger, Fuzzer, …● Erfahrung, Zeit (>1w search/develop)

● Benutzung eines Frameworks● Metasploit: www.metasploit.com● Inguma: http://inguma.sourceforge.net

Page 56: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 56 von 98

05 Exploiting

● Download Internet Exploit Search: http://exploitsearch.com/ Securityvulns: http://securityvulns.com/exploits/ Milw0rm: http://www.milw0rm.com/ Packetstorm: http://packetstormsecurity.org/assess/exploits/ Archives Neohapsis: http://archives.neohapsis.com/ BugReport: http://www.bugreport.ir/ VuPenSecurity: http://www.vupen.com/exploits/ Shellcode: http://shellcode.org/

Page 57: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 57 von 98

Vuln/Exploit Tools kommerziell

● Nessus Vulnerability Scanner● Tenable Security● $1200/y, Home Use ;-)

● Core Impact Exploit Framework● Core Security Technologies● ~$30'000/y

● CANVAS Exploit Framework● Immunity Inc● $1450 (+2920/y Upd/Supp, 35'980/y Early)

Page 58: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 58 von 98

Vuln/Exploit Tools Open Source

● Attack Toolkit (ATK win32)● Vulnerability Scanner● Seit 2004

● OpenVAS● Vulnerability Scanner● Seit 2007 aktiv :-)

● Metasploit● Exploitation Framework● Seit 2003

Page 59: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 59 von 98

05 Exploiting

● Password Cracking● Online: Hydra, Brutus AE2● Lokal: LCP, Ophrack, Cain&Abel, John the Ripper● Passwort-Dateien

● Active Directory (%windir%\ntds\ntds.dit)● Lokale SAM (%windir%\repair\SAM)● *NIX: /etc/passwd und /etc/shadow

● Netzwerk● ARP-Hijacking, ICMP-Redirect, Loose Source Routing,

Routing, Covert Channels, (Denial-of-Service)

● Applikationen (2 Benutzer, Privilege Escalation)

Page 60: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 60 von 98

05 Exploiting

● Webzugriffe / -angriffe● Referrer Attacks (webbugs, url session)● URL Redir, DIR Traversal● XSS (Cross Side Scripting)● XSRF (Cross Side Request Forgery)● XST (Cross Side Tracing)● *Inject (scripts, html, xml, sql)● *Session (guess, hijack, fix)

Page 61: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 61 von 98

05 Exploiting

● Email Spam-Check (cat relay.txt | telnet smtp.x.y 25)HELO myhost

MAIL FROM: Sender Name <[email protected]>

RCPT TO: Recipient Name <[email protected]>

DATA

From: Sender Name <[email protected]>

To: Recipient Name <[email protected]>

Subject: test

.

QUIT

Page 62: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 62 von 98

06 Hide Traces

● Nicht Hacker, der Logfiles säubert, sondern Tester, der die Spuren seines Penetration Tests säubert

● Exploited Systems, Backdoors, Logfiles● Manipulationen: Speicher, Disk

● Zeitstempel, Protokollierung Tests● Mitschnitt des Netzwerkverkehrs

● Nachvollziehbarkeit des Tests● Anschuldigungen Auftraggeber

Page 63: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 63 von 98

07 Documentation

● Fortlaufend Findings notieren● WICHTIGSTES Element eines Penetration Tests● Gewichtung von Risiken, Gefährdungspotential ausweisen● Einfach formuliert und verständlich, Zielgruppen-gerecht● Wahrheitsgetreue Fakten (nicht Vermutungen)● Neutral (nichts verstecken, beeinflussen oder beschönigen)● Verantwortliche Personen nie blossstellen● Blickwinkel Berichts immer nach vorne gerichtet● Fokus auf „wie kann es verbessert werden“● Veranschaulichung mit Grafiken, aber nicht überladen

Page 64: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 64 von 98

07 Documentation

● Aufbau Bericht● Titelseite● Management Summary (maximal 2 Seiten)● Parteien● Ausgangslage, Ziele, Randbedingungen, Methode● Durchgeführte Tests, nicht durchgeführte Tests● Gefundene Schwachstellen● Erklärung, Risiko, Gewichtung im Kontext (zu den

Aufgaben/Risiken des Systems)● Vorgeschlagene Massnahmen● Referenz auf Schwachstelle, Erklärung, Massnahme,

Zeitrahmen, Verantwortlich, Risiko● Anhang mit Rohdaten des Tests (auf CD oder DVD)

Page 65: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 65 von 98

Massnahmen

● Problem: zu viele offene Ports (zu grosse Angriffsfläche)

● Variante 1: neue Firewall, blockiert Zugriffe von aussen● Schneller, pragmatischer, reaktiv

● Variante 2: Schliessen der nicht benötigten Ports● Aufwändiger, nachhaltiger, proaktiv

● Kosten gespart (keine Neuanschaffung und kein Betrieb der Firewall notwendig)● Sicherheit wirklich erhöht (Angriffsfläche reduziert, keine Abhängigkeit von der Firewall)

Page 66: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 66 von 98

Massnahmen

● Härtung Betriebssystem● Default-Installation und Default-Passwörter entfernen● Compiler entfernen● Installationen von Softwarekomponenten auf das absolut notwendige Minimum beschränken● Schliessen von unnötig offenen Ports, Deaktivierung von unnötigen Diensten● Ersatz von unsicheren Protokollen und Diensten● Patching und Updates zeitnah (vorgängig getestet) ● Separierung kritischer Bereiche mittels eigener Zonen● Filterung ingress und egress● Zyklische Überprüfung des aktuellen Status des Systems, Alarm und Reaktion bei Veränderungen

Page 67: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 67 von 98

MassnahmenMassnahmen Liste (nicht abschliessend) Grundschutz

Organisatorisch

Technisch

Strategisch Policies, Weisungen Mitarbeiterhandbuch, Standards Baulich

Notfall

Updates/Patching, Backup, Antivirus, Antispyware, hostbasierte Firewall, Überwachung/Auditing, Protokollierung, starke Passwörter (A-Z,a-z,0-9,*#-!?_)Gesetze, aktuelles Organisationshandbuch, personifizierte Rollen, strenges und unumgehbares Rollenkonzept, Beachtung von Interessens- und Befugniskonflikten, Protokollierung, Mehr-Augen-Prinzip, need-to-see-Prinzip, need-to-know-Prinzip, Auditing und Revision, Ausbildung, SensibilisierungFiltering, Zugriffskontrolle, Verschlüsselung, digitale Unterschriften, Integritätssicherung, Safety, Authentisierung, Verkehrsflussanalysen, Routingkontrolle, Intrusion Detection/Prevention, Antimalware, Antispyware

Zugangskontrolle, Feuer- und Wasserschutz, Katastrophenplanung, Redundanzen, Evakuierungsplan, USV (unterbrechungsfreie Stromversorgung), ÜberspannungsschutzVorsorgemassnahmen, Sofortmassnahmen, Wiederanlaufsmassnahmen

Page 68: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 68 von 98

Timeline (Jeremiah Grossman)

Page 69: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 69 von 98

08 Presentation

● Bericht einige Tage vor Präsentation beim Auftraggeber ● Eventuell zwei verschiedene Präsentationen, Highlevel-Management und Lowlevel Technik● Raum für Fragen und Unklarheiten● Nie mehr Tester als Auftraggeber an der Präsentation● Vertrauliche Informationen nur mit zuständigen Verantwortlichen besprechen● Videos und Live-Demos: langsam und klar, Botschaft!● Maximal zwei Stunden

Page 70: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 70 von 98

09 Debriefing

● Lehren aus dem Projekt● Archivierung neuer Angriffstechniken und Hilfsmittel

● Tools, Checklisten, Exploits● Analyse von gemachten Fehlern● Knowhow-Transfer

● Laufende Information über Aktualitäten, Trends, Angriffstechniken und Verwundbarkeiten● Evolve or die ;-)

Page 71: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 71 von 98

OSSTMM

● ISECOM OSSTMM● Institute for Security and Open Methodologies● Open Source Security Testing Methodology Manual

● Offener Standard für Sicherheitstests● Seit 2001, aktuell Version 3.0● Rules of Engagement● Risk Assessment Values

Page 72: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 72 von 98

OSSTMM

● Attack Surface = attackable parts● Vector = from where to where● Controls = impact / loss reduction● Limitations = weaknesses, vulnerabilities● Operation = justified risk of business● Porosity = interactive points● Safety = control danger effects● Security = separate asset from threat● Target = asset + controls

Page 73: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 73 von 98

OSSTMM Channels

Page 74: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 74 von 98

OSSTMM Test

Page 75: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 75 von 98

OSSTMM CIA

Page 76: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 76 von 98

OSSTMM RAV

Page 77: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 77 von 98

OSSTMM 4PP

Page 78: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 78 von 98

OSSTMM Trifecta

● The Auditors Trifecta

1. How do current operations work?

2. How do they work differently from how management thinks they work?

3. How do they need to work?

Page 79: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 79 von 98

OSSTMM Trifecta+4PP

Page 80: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 80 von 98

OSSTMM Trust Analysis

Page 81: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 81 von 98

OSSTMM Process

Page 82: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 82 von 98

OSSTMM STAR

● Security Testing Audit Report● Standard Report mit Beilagen● ISECOM zertifiziert STAR Reports

Page 83: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 83 von 98

OSSTMM RAV

Page 84: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 84 von 98

OSSTMM RAV

Page 85: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 85 von 98

OSSTMM RAV

Page 86: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 86 von 98

OSSTMM + Risk Analysis

Page 87: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 87 von 98

Digg deeper

Pentesting, wie denn jetzt ganz genau?

Page 88: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 88 von 98

Ablauf Pentest

● IP aus Discovery oder Scope-Informationen

● 1 System Portscan● 2 offener Port● 3 Port Fingerprint● 4 Attacke(n) Dienst● 5 Report Resultate

● Attacken● Client-Software, Exploit, Password Cracking, Fuzzing, ...

Page 89: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 89 von 98

Pentest

● Reduce to the Max● Effizienz im Zeitbedarf bei qualitativen Resultaten● Scripts für Automatisation Tasks● Bash → Portierung Python

Scriptname Zweckdnsweep.sh DNS-Untersuchung einer Internet-Domänehostalyze.sh Vollständige Untersuchung eines einzelnen Systemshostsweep.sh Erkennung eines aktiven Systems auf dem Netzwerkportalyze.sh Untersuchung eines Ports auf einem Systemwebalyze.sh Vollständige Untersuchung eines einzelnen Webservers

Page 90: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 90 von 98

AutomatisierungFootprinting + Portscanning + Fingerprinting

Pentest

Page 91: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 91 von 98

Pentest

● Tools benötigt

Scriptname Programme dnsweep.sh whois, host, dig, hping2, scandns.pl

tee, echo, ifconfig, date, grep, tcpdump hostalyze.sh

hostsweep.sh arping, hping2tee, echo, ifconfig, date, grep, tcpdump

portalyze.sh hping2, nc (netcat), amaptee, echo, ifconfig, date, grep, tcpdump

webalyze.sh hping2, nc (netcat), nikto, openssl, nmaptee, echo, ifconfig, date, grep, tcpdump

nmap, traceroute, tcptraceroute, hping2, unicornscan, scanudp, host, afd, nc (netcat), ike-scan, dcetest, nbtscan, lsrscan, amap, scandns.pl, rpcdump.py, nfsping.pl, tnscmd.pltee, echo, ifconfig, date, grep, tcpdump, python, perl, smbclient (samba), snmpwalk (net-snmp), openssl, rpcinfo, showmount (nfs)

Page 92: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 92 von 98

Pentest

● Aufruf und ParameterScriptname Aufruf und Parameter dnsweep.sh

hostalyze.sh

hostsweep.sh

portalyze.sh

webalize.sh

./dnsweep.sh IP DOMAIN.XY DNSIP

./dnsweep.sh 192.168.0.10 whatever.ch 192.168.0.53

./hostalyze.sh IP

./hostalyze.sh 192.168.0.10

./hostsweep.sh IP

./hostsweep.sh 192.168.0.10

./portalyze.sh IP PORT

./portalyze.sh 192.168.0.10 80

./webalyze.sh IP

./webalyze.sh 192.168.0.10

Page 93: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 93 von 98

Pentest

● ResultateScriptname Resultate dnsweep.sh

hostalyze.sh

hostsweep.sh

portalyze.sh

webalize.sh

IP_dnsweep_DATE.txtIP_dnsweep_DATE.tgz (Tcpdump)

IP_nmap_tcp/udp_DATE.xml (Resultat im Browser ansehen, nmap.xsl benötigt)IP_hostalyze_DATE.txt (Resultate)IP_hostalyze_DATE.tgz (Tcpdump)

IP_hostsweep_DATE.txtIP_hostsweep_DATE.tgz (Tcpdump)

IP_portalyze_PORT_DATE.txtIP_portalyze_PORT_DATE.tgz (Tcpdump)

IP_webalyze_DATE.txtIP_webalyze_DATE.tgz (Tcpdump)

Page 94: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 94 von 98

Pentest

● Laufzeit

10-60 Min / 20 min1-10 Min / 1 Min1-5 Min / 5 Min1-20 Min / 20 Min

Scriptname Laufzeit LAN/Internetdnsweep.sh 1 Min (nur Internet)hostalyze.shhostsweep.shportalyze.shwebalize.sh

Page 95: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 95 von 98

Tipps und Tricks

● WYSIWYD = What you see is what you do (Tcpdump ;-)● Zwei Tools einsetzen (Verifikation von Resultaten)● Banner können gefaked werden (66% verify OSSTMM)● UDP applikativ testen (DNS, NetBIOS, TFTP, SNMP)● UDP kaum scanbar, wenn ICMP gefiltert● Low-Level-Informationen auswerten

● Window-Size, Sequenz-Nr., TTL, IPID● False Positives erkennen, IIS auf Unix, Ports = OS?● ICMP OS Fingerprinting versus TCP OS Fingerprinting● Unsicher? Nochmals testen!

Page 96: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 96 von 98

Tipps und Tricks

● Performance versus Auffälligkeit● Range begrenzen● Aggressives Timing und Parallelität● Full-Blown Nessus versus Nmap → Nessus auf open Ports

● Port Sweeps statt Port Scans● Ein Port auf mehreren Systemen statt mehrere Ports auf

einem System● Password Cracking

● Ein Passwort bei mehreren Benutzern ausprobieren statt mehrere Passwörter bei einem Benutzer (Account Lockout)

Page 97: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 97 von 98

Links

● Security Mailinglisten: http://seclists.org/● Penetration Testing Directory: http://www.penetrationtests.com/ ● Heise Security: http://www.heise.de/security/● Securityfocus: http://www.securityfocus.com/● Darknet: http://www.darknet.org.uk/● Blackhat: http://www.blackhat.com/● SANS Diary: http://isc.sans.org/diary.php● SANS Reading Room: http://www.sans.org/reading_room/● Melani: http://www.melani.admin.ch/ ● Secunia: http://secunia.com/● Phrack Magazine: http://www.textfiles.com/magazines/PHRACK/ ● IndianZ: http://www.indianz.ch/

Page 98: Penetration-TestingPenetration-Testing Seite 1 von 98 IndianZ Penetration-Testing Penetration Testing means to test the security of a computer system beyond it's limit. December 2010

Penetration-Testing Seite 98 von 98

Besten Dank...

… für Ihre Aufmerksamkeit!

Wem darf ich eine Frage beantworten? ;-)

IndianZwww.indianz.ch