Matt Wood & Billy Hoffman
matt.wood@hp.com billy.hoffman@hp.com
Web Security Research Group -- HP Software
Veiled
A Browser Darknet
Veiled A Browser Darknet Matt Wood & Billy Hoffman - - PowerPoint PPT Presentation
Veiled A Browser Darknet Matt Wood & Billy Hoffman matt.wood@hp.com billy.hoffman@hp.com Web Security Research Group -- HP Software What is a Darknet? A private network where users can freely exchange ideas and content.
matt.wood@hp.com billy.hoffman@hp.com
Web Security Research Group -- HP Software
A Browser Darknet
2
What is a Darknet?
3
Innovation and Turmoil Abound!
New Set of Browser Wars Desktop App <-> Web App Server/Client <-> Peer-2-Peer Browser Platform + Traditional Darknet + ??? = Profit
4
Original Darknets
− Yokel with floppy
− Strong Crypto − Shared Storage
− Private/sharing
− P2P qualities
5
Tor is *not* a Darknet!
6
Barriers to Darknet Adoption
− Installing/Configuring
− Not for Joe the Plumber
− People are unaware they exist − Freenet/Gnutella/Kazaa are basically open networks
7
Web Ecosystem
− Browser Storage − CORS/XDomainRequest
− V8/TraceMonkey
libraries
− UI/DOM − AES/RSA
− Everyone has it − Everyone can use it
8
A Browser Based Darknet
− Distributed Redundant File Storage − Some anonymity − Web in the Web − Communication entirely over HTTP
− Zero-footprint Install − Web Clients are the new Web Server
− Simple to create/destroy/join − Focused on small to medium sized network/mesh
9
WHY?
10
Veiled : Agenda
− Tech Overview
− Private Chat − Redundant Distributed File Storage − Web in the Web − Distributed JS Computation − Server Failover
11
High Level Architecture
server script file
− Routers can peer
JS and HTML
− Clients connect to Routers
traverse whole network
12
13
Veiled Router
Client
Routers
(server memory)
14
Veiled Client
− Whatwg_db/LocalStorage/Cookies/GlobalStorage
15
COMET?
− faster than long polling for lots of messages
16
Messaging in Veiled
17
Client-Client Messaging
− Multicast − Routed
− Type − Action − Origin ID − Target ID − Data − Distance − Unique ID
18
Router-Client Communication
− Hidden iframe
− Times out after 2-5 minutes, refreshes
Router
19
Router-Router Peering
− Comet-y − No need for JS Tricks − Uses JSON for interop − PHP’s fsockopen
− to prevent vagabonds
20
Routing with Modified AODV
− Ad-hoc On-demand Distance Vector − Used for mesh networks
advantage of protocol between clients
− Reduces Traffic − Minimizes clients receiving traffic not meant for them
21
Veiled Features
− More of a debugging mechanism
22
Private Chat
− Keys generated by OpenSSL − Uses PidCrypt JS Library − Exchange AES 256 Key using RSA
− AES Key generated from
− Verify public keys
23
− Can opt-out
− Initiator generates AES Key − Encrypt with Remote Client’s public key − Send
Private Chat Protocol
24
Redundant Distributed File Storage
− Survive Clients leaving the network − Secure Upload/Download of content − Utilize browser storage
− JS has no access to local files − Two Options
25
− Select file and Submit HTML form − Router slices into 1k chunks − Multicast request for storage on darknet − Wait for slices to be “registered” − Send registered clients routed data packed
− Multicast file identifier for retrieval − Client’s check if their data store contains file identifier − Send routed data packet if found
RDFS Protocol
26
Web in the Web
− Embedded Images − Embedded (i)Frames − Rewriting Links to Magnet Hash
27
Distributed JS Computation
− Receiving jobs − Reporting results
− Dangerous JavaScript/XSS − Threading/Blocking the UI
− Execute jobs in sandbox
28
Server Failover
− Publicize connect-back details to local clients − Inform clients if peer goes down
− Retry − Connect to router peer
29
Challenges
− COMET, distributes PHP files, “threading,” multiple clients − Pretty much left with printf() style debugging!
− “Untrusted” Router
− Domain restrictions
30
Threading in PHP
− In transient Memory − PHP’s shmop
31
Veiled Threat Analysis
32
Veiled External Threats
− Disrupt/Inject faulty communications
− Rogue PHP script (since all are run by apache) − Modify Shared Memory
− Not sure if there is a better was to secure shared mem…
− Mitigated with use of HTTPS
33
Veiled Internal Threats
− Advertise false routes by sending spoofed packets − Saturate Network with Multicast Traffic − Send Bogus File slices during retrieval
− Can MITM Private Chat RSA Key Exchange − Compromise Clients IP’s connected to it
34
Advances/Next Steps
− Very low bandwidth
XDomainRequest
35
NAT Busting with HTTP Request
− Connection #1
− Connection #2
− Perl has this built in
36
File Storage with Browser Cache
Store File Slices
− Make hash from file hash and slice # − Router serves up page, client caches it
− Make hash from file hash − Ajax Request to router
37
Using Clients as Routers
− Link inaccessible routers with a client
− Requires constant browser session/tab − Easier to MITM a network
38
Persistent-XSS as Shared Storage/Queue
− Hundreds of online notepads, lots are vulnerable to pxss
− Create JavaScript API to abstract PXSS as storage device − Use iframe communication from pxss to local window − JSONP if possible
39
Multiple Client-Router Connections
− Redundant connection to Darknet − Increased bandwidth − Stronger connected Mesh
− Reduce/Identify duplicate traffic
40
Others…
− Use strong encryption on top of all messages − However still allow routing somehow
− Google App Engine Router
41
Server to avoid the collection of any user data
Sorry Wikileaks!
42
Ask Questions!
− Matt Wood -- matt.wood@hp.com − Billy Hoffman -- billy.hoffman@hp.com
− http://twitter.com/HP_AppSecurity