web applications - the next hacker frontiermedia.techtarget.com/searchsecurity/downloads/web...w afs...

30
Web Applications - The next hacker frontier

Upload: others

Post on 20-Jun-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

Web Applications - The next hacker frontier

Page 2: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

About Me

R b t H CEORobert Hansen - CEOSecTheory Ltd

Bespoke Boutique Internet SecurityBespoke Boutique Internet SecurityWeb Application/Browser SecurityNetwork/OS Securityhttp://www.sectheory.com/

FallingRock NetworksAdvisory capacity to start-upsFounded the web application Founded the web application security lab

http://ha.ckers.org/ - the labhtt // l k / th fhttp://sla.ckers.org/ - the forum

Page 3: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

Going For It Anyway?

Page 4: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE
Page 5: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

Overview

• Should be titled, “Why you’ll fail any realt k/ b t t ”network/webappsec pen-test.”

• Web assessments are just like every other assessment – except they’re different. ☺p y• What are the REAL risks of a determined adversary – and do I care about any other type?• Let’s overcome some bad misconceptions we• Let s overcome some bad misconceptions we hear all the time.

Page 6: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

“We only have one website. That’s all th t h ld b i Ri ht?”that should be in scope. Right?”

Answer: No. Absolutely, in no way is y, ythat correct… Not in a REAL pen test.

Page 7: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

DNS

DB

WWW

?

?

Page 8: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

DB

DNSWWW

DNS

? ?

?

? ?

?

?

Page 9: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

DB

CDNS

Shared hosting

Company HQ WWW

DNS

? ??

?

? ??

?

?

Page 10: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

XDOMAIN

DB

C

Admin

DNSShared hosting

Company HQ WWW

DNS

?

Switch

?

Switch

SwitchSwitch

?

FW

?

FWFW

FW?

FW

Page 11: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

“We don’t use shared hosting, so ’ k W j t i t li tiwe’re okay. We just use virtualization

for our own sites.”

Answer: Fine, but all your other sites are now in scope too – no cheating.

Page 12: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

AdminNetwork?

tem

ngion

uth

rver

sncer

s

eslls

OS

File

Sys

t

Logg

in

DB

App

licat

Aut

h/A

u

Web

Ser

WA

Fs

adB

alan

Sw

itche

Fire

wal

FAAW

Loa

Backups?

Page 13: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

“No, okay, wait, we wont host our own t ff ft ll O h ti id illstuff after all. Our hosting provider will handle security for us. Do we really

need to worry at that point?”y p

Answer: Yes – brute force alone is reason enough to worryreason enough to worry.

Page 14: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

Vertical = many passwords & 1passwords & 1 username

Horizontal = many

Ve

usernames & 1 passDiagonal = many

usernames & rtical

passwords3D = Many IPs4D = Over long4D = Over long

period of timeCredential

HorizontalSolutions?

Page 15: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

“This sounds hard. Can’t we just offload this whole thing to the cloud?offload this whole thing to the cloud? Everyone has this problem. Surely

‘the cloud’ is up to speed on security.”

Answer: No. Most likely they’re just as bad as you are & actually add evenbad as you are & actually add even

more attack points.

Page 16: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

Please assess “mysite.com”http://www mysite comhttp://www.mysite.comhttps://admin.mysite.comhtt // it k d thttp://mysite.akadns.nethttp://mobile.mysite.comhttp://mysite-api.partner.comhttp://marcom-mysite.provider.comhttp://www.google.comdns1-mysite.provider.comhttp://64.136.24.162/ (www.mysite.com)Virtual hosts? Eg: http://www.yoursite.com

Page 17: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

APICompany

blog

WWW ISP

NTPCDN

Google

DNS

SSL

BackupCO.What do all of

these rely on?

Page 18: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

APICompany

blog

WWW ISP

NTPCDN

Google

DNS

SSL

BackupCO.

Page 19: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

“We use XYZ port scanner We alreadyWe use XYZ port scanner. We already know what we’re running. Running it

again is pointless. What can you tell me that I don’t already know?”

Answer: There’s a good chance youAnswer: There s a good chance you have no idea what you’re really running.

http://blog.robertlee.name/2008/01/port-scanner-challenge-revisited-nmap.html

Page 20: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

Visible Externally Invisible Externally

API 8181 FW/Switch 22, 23, 161, 443

443 DB 22, 1521www

81 - adminwww 22www

80www 21www

Page 21: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

“But wait. We do IP based protections d i t b ’on our admin port because we’re

clever and awesome. How can you possibly get our IP? And forget about p y g g

ARP spoofing.”

Answer: CSRF + DNS RebindingAnswer: CSRF + DNS Rebinding, duh.

Page 22: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

•DNS responds with intranet

•Request www site com with intranet.

•Browser connects to

www.site.com•Responds with TTL (1 sec) and IP

intranet•Browser can send data back

•Browser requests content from IP•Site responds with

out to the internet.•Rebinding

pJS saying connect back to me in 2 sec.•Site firewalls off •Rebinding

sends wrong host header or

•Site firewalls off browser•Browser re-

correct cookiesrequests DNS

Page 23: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

Session Fixation

rers

OS

Sys

tem

DB

plic

atio

n

th/A

uth

b S

erve

r

WA

Fs

Bal

ance

witc

hes

ewal

ls

O

File

S

AppAut

WebW

Load

B

SwFire

GET POSTGET POSTPUT DELETE

XSS, CSRF, Clickjacking SQLi RFI/LFI, Command injection

Page 24: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

This doesn’t take into account:•Mail issues (Apache.org)

Phi hi•Phishing•Spear Phishing

•MITM•Fraud

•User Community•Logic flawsLogic flaws•Read “Detecting Malice”

•Etc… Etc…

Page 25: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

“You can’t hack our main site, that’s just our blog. Who cares about that?”

Answer: RFC1918 Cache Poisoning

Page 26: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

tem

ion

uth

rver

sncer

s

esls

OS

ile S

yst

DB

App

licat

i

Aut

h/A

u

Web

Ser

WA

Fs

adB

alan

Sw

itche

Fire

wal

FAAW

Loa

VPN

users

Other machines Shared Hosting

Page 27: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

“You can’t hack our main site, that’s just our blog/forum/dev

environment/vendor/something we can pretend isn’t a big deal. Who

cares about that?”cares about that?

Answer: If you ignore the fact that the passwords are probably the samepasswords are probably the same,

and cookies may be shared, RFC1918 Cache Poisoning

Page 28: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE
Page 29: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

“I wasn’t paying attention What should I have learned?”I wasn t paying attention. What should I have learned?

• Everything is in scope (in a real pen-test)• Don’t assume anyone is better at security (they aren’t)

• Assume you’ll get hacked and then protect from that• Browsers, networks, applications, DBs, etc…Browsers, networks, applications, DBs, etc…• Learn these two words, “least privilege”

• Check and sanitize input and output before use• Forklift upgrades are expensive! Build it right first it’s• Forklift upgrades are expensive! Build it right first – it s cheaper! It’s also more stable!• You’re insecure. Now, go find yourself a good architect.

Page 30: Web Applications - The next hacker frontiermedia.techtarget.com/searchSecurity/downloads/Web...W AFs B alanc w ewalls itches Fir S Load We Au Ap File e GET POSTGET POST PUT DELETE

Thank you!

• Robert Hansenhttp://www sectheory com the companyhttp://www.sectheory.com – the companyhttp://ha.ckers.org – the labhttp://sla.ckers.org – the forump // gDetecting Malice – the eBookXSS Exploits – the book

b @ h h [email protected] – the email