iSEC Research Labs iSEC's engineers often release open-source tools, whitepapers, and research presentations as part of our work. This is where we keep them. https://isecpartners.github.io/ Introducing opinel: Scout2's favorite tool <p>With boto3 being stable and generally available<sup><a href="https://aws.amazon.com/about-aws/whats-new/2015/06/boto3-aws-sdk-for-python-version-3-is-now-generally-available">1</a></sup>, NCC took the opportunity to migrate Scout2 and AWS-recipes to boto3. As part of that migration effort, we decided to publish the formerly-known-as AWSUtils repository – used by Scout2 and AWS-recipes – as a python package required by these tools, rather than requiring users to work with Git submodules. We’ve also added more flexibility when working with MFA-protected API calls and improved versioning across the project.</p> <h3 id="opinel">opinel</h3> <p>To avoid name conflicts, we decided to rename the shared AWSUtils code to a less misleading name: opinel. The opinel package is published on <a href="https://pypi.python.org/pypi/opinel">PyPI</a>, and thus can be installed using pip and easy_install. The corresponding source code is still open-sourced on Github at <a href="https://github.com/iSECPartners/opinel">https://github.com/iSECPartners/opinel</a>. As a result, Scout2 and AWS-recipes have been modified to list opinel as a requirement, which significantly simplifies installation and management of this shared code.</p> <h3 id="support-for-python-27-and-3x">Support for Python 2.7 and 3.x</h3> <p>Because boto3 supports both Python2 and Python3, we decided to make sure that the code we build on top of that package has similar properties. As a result, the latest versions of Scout2 and AWS-recipes support Python 2.7 and 3.x. Note that opinel will <strong>NOT</strong> work with Python 2.6.</p> <h3 id="modification-of-the-mfa-workflow">Modification of the MFA workflow</h3> <p>As requested by a user of AWS-recipes<sup><a href="https://github.com/iSECPartners/opinel/issues/4">2</a></sup>, we modified the workflow when using MFA-protected API access to no longer store the long-lived credentials in a separate file. As a result, the <em>.aws/credentials.no-mfa</em> file is no longer supported and all credentials are stored in the standard AWS credentials file under <em>.aws/credentials</em>. Usage of the existing tools remains unchanged, but the long-lived credentials are now accessible via a new profile name: <em>profile_name-nomfa</em>. This allows users to work with both STS and long-lived credentials if need be.</p> <p>If you already had configured your environment to work with MFA-protected API access, you will need to copy your long-lived credentials back to the <em>.aws/credentials</em> file. This can be done with a simple command such as the following:</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cat ~/.aws/credentials.no-mfa | sed -e 's/]$/-nomfa]/g' &gt;&gt; ~/.aws/credentials </code></pre></div></div> <h3 id="support-to-use-assumed-role-credentials">Support to use assumed-role credentials</h3> <p>With this new workflow implemented, we created a new recipe that allows configuration of role-credentials in the <em>.aws/credentials</em> file. When the following command is run, it uses the credentials associated with the <em>isecpartners</em> profile to request role credentials for the IAM-Scout2 role. The role credentials are then written in the <em>.aws/credentials</em> file in a new profile named <em>isecpartners-Scout2</em>, which is the profile name appended by the role session name.</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ./aws_recipes_assume_role.py --profile isecpartners --role-arn arn:aws:iam::AWS_ACCOUNT_ID:role/IAM-Scout2 --role-session-name Scout2 </code></pre></div></div> <p>Users can then use their favorite tools that support profiles. For example, Scout2 could be run with the following command line:</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ./Scout2.py --profile isecpartners-Scout2 </code></pre></div></div> <p>Note that this recipe supports MFA if the assumed role requires it:</p> <ul> <li>If you never configured your environment to work with MFA, you can provide your MFA serial number (ARN) and current token code as arguments.</li> <li>If you already configured your environment to work with MFA and stored your MFA serial in the <em>.aws/credentials</em> file, you just need to pass your token code as an additional argument.</li> <li>Finally, if you already initiated an STS session, you do not need to provide a new token code and can run the command as above.</li> </ul> <h3 id="conclusion">Conclusion</h3> <p>With the release of opinel, we hope to simplify distribution and management of the code shared between Scout2 and AWS-recipes. Additionally, we significantly modified the workflow and credentials storage when working with MFA-protected API calls, which allows users to use both their long-lived and STS credentials.</p> Mon, 03 Aug 2015 11:08:00 +0000 https://isecpartners.github.io//aws/2015/08/03/boto3_opinel_scout_recipes.html https://isecpartners.github.io//aws/2015/08/03/boto3_opinel_scout_recipes.html IAM user management strategy (part 2) <p>The previous [IAM user management strategy] (/aws/2015/02/24/iam_user_management.html) post discussed how usage of IAM groups enables AWS administrators to consistently grant privileges and enforce a number of security rules (such as MFA-protected API access). This blog post will build on this idea by introducing category groups and documenting new tools to improve IAM user management.</p> <h3 id="categorize-your-iam-users">Categorize your IAM users</h3> <p>For a variety of reasons, applying a single set of security rules to all IAM users is not always practical. For example, because many applications running in AWS predate IAM roles, numerous environments still rely on the existence of headless IAM users. Additionally, third parties may be granted access to an AWS account for a number of reasons but may not be able to comply with the same set of security rules that employees follow. For this reason, NCC recommends using category groups to sort IAM users and reliably enforce appropriate security measures. For example, one group for all human users and a second for all headless users may be created: MFA-protected API access and password management are not relevant for headless users. Furthermore, human users may be categorized into several groups such as employees and contractors: API access can be restricted to the corporate IP range for employees but might not be achievable for contractors.</p> <p><em>Note 1:</em> The set of category groups should define all types of IAM users that may exist in your AWS account and each IAM user should belong to one – and only one – category group (they may belong to other groups though).</p> <p><em>Note 2:</em> The common group and category groups should be used to enable enforcing security in one’s AWS environment. Policies attached to these groups should be carefully reviewed and grant the minimum set of privileges necessary for this type of IAM user (<em>e.g.</em> credential management for humans).</p> <h3 id="example-of-category-groups">Example of category groups</h3> <p>The rest of this article describes a number of tools developed and used by NCC to help implement this IAM user management strategy. These tools can be found in the <a href="https://github.com/iSECPartners/AWS-recipes">AWS-Recipes</a> repository. We will use our test AWS environment as an example, in which we use three category groups in addition to the <em>AllUsers</em> common group:</p> <ol> <li><em>AllHumans</em>, the group all employees must belong to.</li> <li><em>AllHeadlessUsers</em>, the group all headless IAM users must belong to.</li> <li><em>AllMisconfiguredUsers</em>, a placeholder for sample misconfigured users.</li> </ol> <p>We also have an IAM user naming convention that requires usernames to match the following schema:</p> <ol> <li>Employees: firstname initial appended with lastname</li> <li>Headless user: name of the service prefixed with <em>HeadlessUser-</em></li> <li>Misconfigured: description of the misconfiguration prefixed with <em>MisconfiguredUser-</em></li> </ol> <p>Based on these rules, we created a configuration file stored under <em>.aws/recipes/isecpartners.json</em>, with <em>isecpartners</em> matching the profile’s name. If you do not use profiles, the configuration will be under <em>.aws/recipes/default.json</em>.</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{ "common_groups": [ "AllUsers" ], "category_groups": [ "AllHumanUsers", "AllHeadlessUsers", "AllMisconfiguredUsers" ], "category_regex": [ "", "^Headless-(.*)", "^MisconfiguredUser-(.*)" ], "profile_name": [ "isecpartners" ] } </code></pre></div></div> <p>This configuration file declares the name of the common IAM group and two lists related to the categorization of IAM users:</p> <ol> <li>A list of category groups.</li> <li>A list of regular expressions matching our naming convention.</li> </ol> <p><em>Note 1:</em> If you do not have a naming convention in place to distinguish the type of user, remove the <em>category_regex</em> attribute from your configuration file.</p> <p><em>Note 2:</em> If a regular expression is only applicable to a subset of category groups, you must ensure that both lists have the same length and use an empty string for groups that cannot be automatically associated (see the <em>AllHumanUsers</em> group in our example).</p> <p><em>Note 3:</em> Use of a configuration file is not necessary as all values may be passed as command line arguments. If a configuration file exists and a value is passed as an argument, the value passed via the command line will be used.</p> <h3 id="create-your-default-groups-with-aws_iam_create_default_groupspy">Create your default groups with <em><a href="https://github.com/iSECPartners/AWS-recipes/blob/master/Python/aws_iam_create_default_groups.py">aws_iam_create_default_groups.py</a></em></h3> <p>The purpose of this tool is to create IAM groups whose name matches the common and category groups specified in the above configuration file. Running the following command results in four new groups being created if they did not already exist.</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./aws_iam_create_default_groups.py --profile isecpartners </code></pre></div></div> <h3 id="automatically-sort-iam-users-with-aws_iam_sort_userspy">(Automatically) sort IAM users with <em><a href="https://github.com/iSECPartners/AWS-recipes/blob/master/Python/aws_iam_sort_users.py">aws_iam_sort_users.py</a>.</em></h3> <p>This tool iterates through all IAM users and attempts to automatically detect the IAM groups each user should belong to. For convenience, we recommend adding the following to your AWS recipes configuration files:</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>"aws_sort_users.py": { "create_groups": false, }, "force_common_group": true </code></pre></div></div> <p>This specifies default values for additional arguments to be set when running <em>aws_iam_sort_users.py</em>. Specifically, with these values, running this tool will automatically add all IAM users to the common group <em>AllUsers</em> and will not attempt to create the default groups (not necessary as we already did this). Additionally, this tool checks that each IAM user belongs to one of the category groups. If this is not the case and the username matches a regular expression, the user is automatically added to the matching category group. Otherwise, a multi-choice prompt appears to allow manual selection of the appropriate category group.</p> <h3 id="additional-advantages-of-configuration-files">Additional advantages of configuration files</h3> <p>Besides helping with simplification of these tools’ usage, this new AWS-recipe configuration file can be used across tools, allowing for more consistent rule enforcement. For example, the <em><a href="https://github.com/iSECPartners/AWS-recipes/blob/master/Python/aws_iam_create_user.py">aws_iam_create_user.py</a>.</em> tool uses this configuration file and applies the same business logic to add users to the common group and appropriate category group at user creation time. In our test environment, for example, running the following command automatically added the new user to the <em>MisconfiguredUser</em> group:</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ./aws_iam_create_user.py --profile isecpartners --users MisconfiguredUser-BlogPostExample Creating user MisconfiguredUser-BlogPostExample... Save unencrypted value (y/n)? y User 'MisconfiguredUser-BlogPostExample' does not belong to the mandatory common group 'AllUsers'. Do you want to remediate this now (y/n)? y User 'MisconfiguredUser-BlogPostExample' does not belong to any of the category group (AllHumanUsers, AllHeadlessUsers, AllMisconfiguredUsers). Automatically adding... Enabling MFA for user MisconfiguredUser-BlogPostExample... </code></pre></div></div> <h3 id="conclusion">Conclusion</h3> <p>While efficient and reliable management of IAM users can be challenging, using the right strategy and tools significantly simplifies this process. Creation and use of a naming convention for IAM users enables automated user management and enforcement of security rules.</p> Tue, 09 Jun 2015 09:20:00 +0000 https://isecpartners.github.io//aws/2015/06/09/iam_user_management_2.html https://isecpartners.github.io//aws/2015/06/09/iam_user_management_2.html iSEC audit of MediaWiki <p>iSEC Partners is happy to announce the public release of our latest project with the <a href="https://www.opentechfund.org/">Open Technology Fund</a>: the review of <a href="https://www.mediawiki.org/">Wikimedia Foundation’s MediaWiki</a>. The Open Technology Fund engaged iSEC Partners to perform a source-code assisted security review of MediaWiki, the wiki engine behind Wikipedia, for a duration of two weeks at the very beginning of this year.</p> <p>MediaWiki is a PHP application that evolved through a long history of <a href="http://www.aosabook.org/en/mediawiki.html">patches and code rewrites</a>. The MediaWiki engine not only drives public wikis such as Wikipedia, but it also powers many private or corporate wikis, where only a limited set of users can read and edit, therefore page content must be protected securely. The Wikimedia Foundation also seeks to ensure that their readers cannot be de-anonymized, including controls such as preventing an attacker from correlating which articles a victim reads or whether or not the victim has registered.</p> <p>Most of the outward-facing attack surfaces have already been reviewed for security flaws due to the exposure of Wikipedia to the Internet. iSEC focused on traditional web vulnerabilities and on eight areas of concern prioritized by the Wikimedia Foundation. The iSEC consultants were able to find a total of fourteen issues, including two of high severity. Most of the high and medium severity vulnerabilities are related to data validation and allow for various common attacks including XSS, DoS, and CSRF. Detailed descriptions of the vulnerabilities, including proof-of-concepts, can be found in the <a href="https://github.com/iSECPartners/publications/raw/master/reports/iSEC_Wikimedia.pdf">complete report</a>.</p> <p>The Wikimedia Foundation released <a href="https://blog.wikimedia.org/2015/04/20/improving-security-for-our-users/">an article</a> covering the research. You can also find the complete, public version of the report on our <a href="https://github.com/iSECPartners/publications/raw/master/reports/iSEC_Wikimedia.pdf">GitHub repository</a>. We would like to thank the Open Technology Fund for making this engagement possible, and the Wikimedia Foundation team for their help and support. iSEC hopes this audit will help MediaWiki continue to bring content securely to countless readers in the future.</p> Tue, 21 Apr 2015 12:00:00 +0000 https://isecpartners.github.io//news/2015/04/21/iSEC-audited-MediaWiki.html https://isecpartners.github.io//news/2015/04/21/iSEC-audited-MediaWiki.html Work daily with enforced MFA-protected API access <h3 id="aws-security-token-service">AWS Security Token Service</h3> <p>The AWS Security Token Service (STS) is the gateway used to create sessions when MFA-protected API access is enabled. This service allows IAM users to retrieve short-lived credentials (<em>i.e</em> access key ID, secret access key, and session token) in exchange for their long-lived credentials (<em>i.e.</em> AWS access key ID and secret key) and their current authentication code. When enforcing MFA-protected API access, as recommended in the previous <a href="/aws/2015/04/02/use_and_enforce_mfa.html">Use and enforce Multi-Factor Authentication</a> post, IAM users must use these short-lived credentials to access other AWS services.</p> <h3 id="challenges-with-mfa-protected-api-access">Challenges with MFA-protected API access</h3> <p>When MFA-protected API access is enforced, managing AWS access keys becomes challenging because configuration files that contain these credentials must be updated regularly. Users must also ensure that they do not lose their long-lived credentials when modifying the configuration files to write their short-lived credentials. In order to help with this workflow, iSEC wrote and released several simple tools in the <a href="https://github.com/iSECPartners/AWS-recipes">AWS-recipes</a> repository.</p> <p>The collection of tools that we will discussed below uses the “<a href="https://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs">new and standardized way to manage credentials in the AWS SDKs</a>”, meaning that SDKs are expecting to read credentials from the <em>.aws/credentials</em> file under the user’s home or profile directory.</p> <h3 id="aws_recipes_configure_iampy">aws_recipes_configure_iam.py</h3> <p>The <a href="https://github.com/iSECPartners/AWS-recipes/blob/master/Python/aws_recipes_configure_iam.py">aws_recipes_configure_iam.py</a> tool allows users to configure and store their long-lived credentials in a new, non-standard, <em>.aws/credentials.no-mfa</em> file. In addition to prompting for the AWS access key ID and secret key, this tool also prompts for the MFA device serial number because this information must be provided when making calls to the STS API. Similar to the AWS CLI and SDKs, it supports profile names. The following code snippet is an example of calling this tool to configure a new profile called <em>isecpartners</em>:</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ./aws_recipes_configure_iam.py --profile isecpartners AWS Access Key ID: AWS_KEY_ID AWS Secret Access Key: AWS_SECRET_KEY AWS MFA serial: arn:aws:iam::AWS_ACCOUNT_ID:mfa/USER_NAME </code></pre></div></div> <p>When looking at the <em>.aws</em> folder, we can see that a <em>credentials.no-mfa</em> file exists and that it contains the credentials that were just entered:</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ls -l ~/.aws total 4 -rw-r--r-- 1 loic loic 93 Apr 3 14:00 credentials.no-mfa $ cat ~/.aws/credentials.no-mfa [isecpartners] aws_access_key_id = AWS_KEY_ID aws_secret_access_key = AWS_SECRET_KEY aws_mfa_serial = arn:aws:iam::AWS_ACCOUNT_ID:mfa/USER_NAME </code></pre></div></div> <p>Now that long-lived credentials are configured, we can use the next tool to call the AWS STS API and request short-lived credentials that will be used to access other AWS services.</p> <p><strong><em>Note:</em></strong> This workflow was modified since the publication of this blog post and the <em>.aws/credentials.no-mfa</em> file is no longer used, refer to <a href="/aws/2015/08/03/boto3_opinel_scout_recipes.html">this new blog post</a> for further details.</p> <h3 id="aws_recipes_init_sts_sessionpy">aws_recipes_init_sts_session.py</h3> <p>The <a href="https://github.com/iSECPartners/AWS-recipes/blob/master/Python/aws_recipes_init_sts_session.py">aws_recipes_init_sts_session.py</a> tool reads long-lived credentials configured in the .aws/credentials.no-mfa file, prompts users for their MFA code, and retrieves STS credentials (AWS access key ID, AWS secret key, and session token). The short-lived credentials are then saved under the standardized <em>.aws/credentials</em> file to be accessible to the AWS CLI and other tools built with the AWS SDKs. The following code snippet demonstrates calling this tool to request an STS session token:</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ./aws_recipes_init_sts_session.py --profile isecpartners Enter your MFA code: 123456 Successfully configured the session token for profile 'isecpartners'. </code></pre></div></div> <p>When looking at the <em>.aws</em> folder, we can see that a standard <em>credentials</em> file now exists as well and that it contains the short-lived credentials:</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ls -l ~/.aws total 8 -rw-r--r-- 1 loic loic 576 Apr 3 14:14 credentials -rw-r--r-- 1 loic loic 179 Apr 3 14:00 credentials.no-mfa $ cat ~/.aws/credentials [isecpartners] aws_access_key_id = STS_KEY_ID aws_secret_access_key = STS_SECRET_KEY aws_mfa_serial = arn:aws:iam::AWS_ACCOUNT_ID:mfa/USER_NAME aws_session_token = AWS//////////SESSION_TOKEN </code></pre></div></div> <p>Now that the short-lived credentials are configured, we can use the AWS CLI or other tools built with the AWS SDKs that read credentials from this standard location. When the STS session expires, users just need to re-run the <a href="https://github.com/iSECPartners/AWS-recipes/blob/master/Python/aws_recipes_init_sts_session.py">aws_recipes_init_sts_session.py</a> tool and the standard <em>credentials</em> file will be updated with new valid short-lived credentials.</p> <p><strong><em>Note:</em></strong> This workflow was modified since the publication of this blog post and the <em>.aws/credentials.no-mfa</em> file is no longer used, refer to <a href="/aws/2015/08/03/boto3_opinel_scout_recipes.html">this new blog post</a> for further details.</p> <h3 id="conclusion">Conclusion</h3> <p>By using this pair of tools to manage their AWS access keys, IAM users can easily use the AWS CLI and other tools built with various AWS SDKs in environments that have been secured and enforce MFA-protected API access.</p> Fri, 03 Apr 2015 14:10:00 +0000 https://isecpartners.github.io//aws/2015/04/03/session_management_tools.html https://isecpartners.github.io//aws/2015/04/03/session_management_tools.html Use and enforce Multi-Factor Authentication <h3 id="what-is-multi-factor-authentication">What is Multi-Factor Authentication?</h3> <p>When enabled, Multi-Factor Authentication (MFA) provides strong defense-in-depth against compromises of credentials. MFA-enabled users have a device that periodically generates a new authentication code (<em>i.e.</em> one-time password); they need to enter the current authentication code along with their static credentials (<em>i.e.</em> username and password) in order to successfully authenticate. In addition to supporting MFA when accessing the web console (<em>i.e.</em> password-based authentication), AWS also offers MFA-protected API access for users who work with AWS access keys. Through the Security Token Service (STS), IAM users can request temporary credentials in exchange for their long-lived credentials (<em>i.e.</em> AWS access key ID and secret key) and their current authentication code.</p> <h3 id="why-should-one-use-and-enforce-mfa">Why should one use and enforce MFA?</h3> <p>For companies deploying their application in the cloud, a breach that results in unauthorized access to the management console — or API — is the worst-case scenario. While a number of AWS administrators have realized the importance of enabling MFA when they access the web console, a limited number of them enforce MFA-protected API access. This represents a huge gap in one’s security posture because AWS access keys do not come with as many security features as passwords do:</p> <ul> <li>AWS administrators can enforce password expiration; this is currently not possible for AWS access keys.</li> <li>While it is probably safe to assume that most AWS administrators do not store their password in plaintext, most of them use AWS access keys. By design, these keys are meant to be stored in plaintext files that are accessed by tools built with the various AWS SDKs.</li> <li>A lost password is a forgotten password; a lost key is a key stored in a lost file, which may be on an unencrypted storage device (e.g. hard drive or USB Flash drive).</li> </ul> <p>Because AWS access keys are long-lived credentials that are stored in plaintext files, they are more susceptible to compromise than passwords. It is therefore necessary to enable MFA when the AWS API is accessed using these keys and not only when users sign in using their passwords.</p> <h3 id="how-can-one-enforce-mfa">How can one enforce MFA?</h3> <p>Unfortunately, at time of writing, AWS does not offer an option to enforce MFA-protected API access via a global setting. Therefore, AWS account administrators must carefully manage their IAM users and develop a strategy to reliably achieve this. In order to enforce MFA-protected API access, iSEC recommends the following:</p> <ol> <li>Create a common IAM group that all IAM users belong to, as discussed in the previous <a href="/aws/2015/02/24/iam_user_management.html">IAM user management strategy</a> post.</li> <li>Add the following policy (also available on <a href="https://github.com/iSECPartners/AWS-recipes/blob/master/IAM-Policies/EnforceMFA-8HourSession.json">Github</a>) to enforce MFA for all users who belong to this group.</li> </ol> <p>This policy will enforce MFA regardless of how the IAM user authenticated with AWS; it will be effective whether they use password-based or key-based authentication.</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{ "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": "*", "Resource": "*", "Condition": { "Null":{"aws:MultiFactorAuthAge":"true"} } }, { "Effect": "Deny", "Action": "*", "Resource": "*", "Condition": { "NumericGreaterThan":{"aws:MultiFactorAuthAge":"28800"} } } ] } </code></pre></div></div> <p>The first statement in the above policy denies all actions if the <em>aws:MultiFactorAuthAge</em> key is not present; this key only exists if MFA is used<sup><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/AccessPolicyLanguage_ElementDescriptions.html#AvailableKeys">1</a></sup>.</p> <p>The second statement verifies that the validation of the MFA code was performed less than eight hours ago. Temporary credentials may be valid for a duration between fifteen minutes and thirty-six hours<sup><a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_GetSessionToken.html">2</a></sup>. iSEC recommends requiring users to initiate a new session at least once a day.</p> <p><strong><em>Note:</em></strong> An “explicit deny” means that, regardless of other policies granted to a user, this deny rule will prevail. More information about the IAM policy evaluation logic can be found in the AWS documentation at <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/AccessPolicyLanguage_EvaluationLogic.html">https://docs.aws.amazon.com/IAM/latest/UserGuide/AccessPolicyLanguage_EvaluationLogic.html</a>.</p> <h3 id="use-aws-scout2-to-detect-users-without-mfa">Use AWS Scout2 to detect users without MFA</h3> <p>The default ruleset used by <a href="https://github.com/iSECPartners/Scout2">AWS Scout2</a> includes a rule that checks for IAM users who have password-based authentication enabled but do not have an MFA device configured. If Scout2 detects IAM users with password-based authentication enabled and no MFA device, it will document a “Lack of MFA” security risk in the IAM menu dropdown, as illustrated in the below screenshot.</p> <p><img src="/images/aws/awsscout2-user-nomfa-1.png" alt="Screenshot: IAM menu dropdown with a &quot;Lack of MFA&quot; security risk" /></p> <p>When clicked, this “Lack of MFA” link filters the list of IAM users to display those who have password-based authentication enabled but no MFA device configured. The red “No” following “Multi-Factor enabled” indicates a danger tied to that particular IAM user.</p> <p><img src="/images/aws/awsscout2-user-nomfa-2.png" alt="Screenshot: Red &quot;No&quot; indicating that this IAM user may access the web console without MFA" /></p> <h3 id="how-can-one-use-mfa-with-command-line-tools">How can one use MFA with command line tools?</h3> <p>Users of the AWS CLI (and other command line tools) have several methods to configure their credentials, such as environment variables, configuration files, or command line arguments. However, updating these settings on a daily basis when MFA-protected API access is enabled is inconvenient. To help facilitate this work flow, iSEC has created a set of Python tools and released them in the <a href="https://github.com/iSECPartners/AWS-recipes">AWS-recipes</a> repository. Further details about these tools will be published in the next blog post.</p> <p>Additional information about MFA with AWS is available in the AWS documentation at <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingMFA.html">https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingMFA.html</a>.</p> <h3 id="conclusion">Conclusion</h3> <p>Enforcing Multi-Factor Authentication for all IAM users is extremely important in order to mitigate the risks of credentials compromise (especially the AWS access key ID and secret). This aspect of security is commonly overlooked and may result in catastrophic damages. By using a strict strategy for management of IAM users and the above IAM policy, AWS administrators may significantly reduce risks of account compromise.</p> Thu, 02 Apr 2015 14:10:00 +0000 https://isecpartners.github.io//aws/2015/04/02/use_and_enforce_mfa.html https://isecpartners.github.io//aws/2015/04/02/use_and_enforce_mfa.html iSEC reviews SecureDrop <p>As part of our projects with the <a href="https://www.opentechfund.org/">Open Technology Fund</a>, such as the <a href="https://isecpartners.github.io/news/2014/04/14/iSEC-Completes-Truecrypt-Audit.html">review of TrueCrypt</a>, iSEC Partners audited <a href="https://pressfreedomfoundation.org/securedrop">Freedom of the Press’ SecureDrop</a>.</p> <p>SecureDrop is an open-source whistleblower submission system that media organizations use to securely accept documents from anonymous sources. It allows anonymous informants to send electronic documents without fear of revealing their identity. SecureDrop was originally developed by the late <a href="https://en.wikipedia.org/wiki/Aaron_Swartz">Aaron Swartz</a>. The Freedom of the Press Foundation has since taken over development of the software.</p> <p>SecureDrop is a mature application that was built with a security mindset from the early stages. It uses <a href="https://www.torproject.org/">the Tor network</a>, segregated servers, and air-gapped <a href="https://tails.boum.org/">Tails live operating systems</a> to preserve privacy and anonymity. The design is well thought-out and SecureDrop has undergone two prior, public security penetration tests which covered most of the low-hanging fruits. We reviewed both the application stack and code base, specifically the <a href="https://securedrop.hackpad.com/0.3pre-Changes-InMzYY5bnbP">changes since the 0.2 release</a>. We also provided defense-in-depth recommendations for the web application and stack configuration.</p> <p>Freedom of the Press Foundation released <a href="https://freedom.press/blog/2015/03/announcing-securedrop-0.3">an article</a> covering the research. You can also find the complete, public version of the report on our <a href="https://github.com/iSECPartners/publications/raw/master/reports/iSEC_SecureDrop.pdf">GitHub repository</a>. We would like to thank the Open Technology Fund for making this engagement possible, and the Freedom of Press Foundation team, which was incredibly helpful. iSEC hopes that SecureDrop will continue to bring secure communication between journalists and their sources in the future.</p> Mon, 23 Mar 2015 12:00:00 +0000 https://isecpartners.github.io//news/2015/03/23/iSEC-reviews-SecureDrop.html https://isecpartners.github.io//news/2015/03/23/iSEC-reviews-SecureDrop.html Recognizing and Preventing TOCTOU Whitepaper <p>Time-Of-Check-to-Time-Of-Use (TOCTOU) vulnerabilities have been known for decades, but are still frequently discovered in modern code. This diverse class of vulnerabilities can occur on any platform or architecture, across many types of systems. These vulnerabilities are not well understood in the development industry. Even when recognized, attempts to mitigate the threat often just move it, rather that solving the issue.</p> <p>TOCTOU vulnerabilities occur where a developer has tried to avoid a security risk by checking the validity or trustworthiness of an attacker-controlled resource that, if it were malicious, could result in undesirable behavior. If the check passes, the resource is trusted and used. If an attacker is able to tamper with the resource between check and use, then whatever security the check was intended to provide can be bypassed, exposing the system to threats such as elevation of privilege. Depending on the scenario, there are a number of possible mitigations to TOCTOU vulnerabilities.</p> <p>iSEC Partners has <a href="https://github.com/iSECPartners/publications/blob/master/whitepapers/TOCTOU_whitepaper.pdf?raw=true">published a whitepaper</a> that aims to help software engineers recognize and avoid TOCTOU vulnerabilities. The paper is aimed at architects, developers, and testers, and covers identifying and mitigating TOCTOU vulnerabilities. We provide examples for a number of scenarios where TOCTOU vulnerabilities may be found, with explanations and suggested fixes. Although it is not possible to cover every possible TOCTOU scenario, we provide the knowledge necessary to recognize potential TOCTOU risks in any context, and determine the best mitigation.</p> Tue, 03 Mar 2015 12:25:55 +0000 https://isecpartners.github.io//news/research/2015/03/03/recognizing_preventing_toctou.html https://isecpartners.github.io//news/research/2015/03/03/recognizing_preventing_toctou.html IAM user management strategy <h3 id="use-iam-groups">Use IAM groups</h3> <p>When granting privileges to IAM users, AWS account administrators should avoid use of user-specific policies. Instead, create groups whose name explicitly defines the members’ job functions or responsibilities (<em>e.g.</em> AWS Administrators, Operations, Developers, Accountants), and define the permissions granted within group policies. Doing so will simplify the permissions management process as changes in group policies apply to all members.</p> <p>When performing AWS configuration reviews, iSEC often discovers IAM users whose privileges have been granted via a combination of IAM user and IAM group policies. It is not uncommon to see IAM users who are granted full administrator privileges in a redundant manner, via both user and group policies. Such configuration creates an avenue for configuration mistakes, as another administrator may believe that terminating an IAM user’s membership to the admin group is sufficient. Therefore, banning use of IAM user policies will result in making one’s AWS environment less error-prone.</p> <p><strong><em>Note</em></strong>: It is on purpose that iSEC recommends using IAM group names that reflect a job title or responsibility. IAM users who do not fit in such groups (<em>e.g.</em> headless users) should not exist. Instead, AWS account administrators should investigate use of IAM roles for EC2. Further details will be discussed in an upcoming blog post.</p> <h3 id="create-a-common-iam-group-to-apply-generic-policies">Create a common IAM group to apply generic policies</h3> <p>Because a number of policies must be applied to all users, iSEC recommends that AWS account administrators create an IAM group that all IAM users belong to. Doing so will allow AWS account administrators to consistently grant privileges and enforce a number of rules.</p> <p><strong><em>Note</em></strong>: It is important that all IAM users belong to this common IAM group to ensure that policies are consistently applied. Failure to do so will create gaps in one’s AWS environment security posture.</p> <h3 id="authorize-iam-users-to-manage-their-credentials">Authorize IAM users to manage their credentials</h3> <p>To begin with, iSEC recommends that AWS account administrators allow all of their IAM users to manage their credentials, and only theirs. With all IAM users belonging to the common IAM group, this can be achieved by applying the following IAM policy (also available on <a href="https://github.com/iSECPartners/AWS-recipes/blob/master/IAM-Policies/CredentialsSelfManagement-Minimal.json">Github</a>) to the group.</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "iam:*AccessKey*", "iam:*Password", "iam:*MFADevice*", "iam:UpdateLoginProfile" ], "Resource": "arn:aws:iam::AWS_ACCOUNT_ID:user/${aws:username}" }, { "Effect": "Allow", "Action": [ "iam:CreateVirtualMFADevice", "iam:DeleteVirtualMFADevice" ], "Resource": "arn:aws:iam::AWS_ACCOUNT_ID:mfa/${aws:username}" } ] } </code></pre></div></div> <p>While the above policy is sufficient to allow users to manage their credentials, AWS administrators may consider the following statement as an addition; it allows IAM users to know what the account’s password policy is. The complete JSON payload is <a href="https://github.com/iSECPartners/AWS-recipes/blob/master/IAM-Policies/CredentialsSelfManagement-WithGetPasswordPolicy.json">available in the AWS-recipes repository</a>.</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{ "Effect": "Allow", "Action": "iam:GetAccountPasswordPolicy", "Resource": "*" } </code></pre></div></div> <h3 id="use-aws-scout2-to-detect-user-policies">Use AWS Scout2 to detect user policies</h3> <p>The default ruleset used by <a href="https://github.com/iSECPartners/Scout2">AWS Scout2</a> includes a rule that checks for user policies and reports the use of user-specific IAM policies as a warning. Detection of user-specific IAM policies results in the IAM menu dropdown containing a “User policies” security risk, as illustrated in the below screenshot.</p> <p><img src="/images/aws/awsscout2-iam-user-policy-1.png" alt="Screenshot: IAM menu dropdown with a User policies security risk" /></p> <p>When clicked-on, this “User policies” link filters the list of IAM users to only display those who have at least one user policy attached. The orange badge indicates a warning and the count of user policies attached to this particular IAM user.</p> <p><img src="/images/aws/awsscout2-iam-user-policy-2.png" alt="Screenshot: Orange badge indicating that at least one user policy is attached to that IAM user" /></p> <h3 id="check-that-all-iam-users-belong-to-the-common-group">Check that all IAM users belong to the common group</h3> <p>AWS Scout2 comes with a tool — RulesGenerator.py — that allows AWS account administrators to generate a custom ruleset to tailor the report to their needs. An optional IAM rule requires all IAM users to belong to a common IAM group. In order to enable this rule, the following can be done:</p> <ol> <li>Run the rules generator with the following command line:</li> </ol> <pre style="margin-left: -20px; margin-top: 10px; margin-bottom: 10px"><code>./RulesGenerator.py --ruleset_name isec --services iam&lt;/pre&gt;</code> 1. Answer "yes" to the question "Would you like to ensure that all IAM users belong to a given IAM group?" 1. Enter the name of your common group (*e.g.* AllUsers) 1. Enter "yes" or "y" to confirm 1. Change the level if desired 1. Run Scout2 ***Note***: If you have already run Scout2 and do not wish to download the latest IAM configuration, use the following command to run an offline analysis: ./Scout2.py --ruleset_name isec --services iam --local The following screenshot illustrates the IAM menu dropdown containing a security risk when IAM users do not belong to the configured common group. ![Screenshot: IAM menu dropdown when IAM users do not belong to the common group](/images/aws/awsscout2-iam-user-commongroup-1.png) When clicked-on, this link filters the list of IAM users to only display those who do not belong to the common IAM group. A colored warning sign appears, warning about this issue. ![Screenshot: Orange badge indicating that at least one user policy is attached to that IAM user](/images/aws/awsscout2-iam-user-commongroup-2.png) ### Conclusion Strict management of IAM users and tight control of their privileges is key in maintaining a secure AWS environment. When followed, the above recommendations should enable AWS administrators to manage IAM users with improved efficiency and lower the chances of overly privileged users to exist. </pre> Tue, 24 Feb 2015 20:49:00 +0000 https://isecpartners.github.io//aws/2015/02/24/iam_user_management.html https://isecpartners.github.io//aws/2015/02/24/iam_user_management.html Do not use your AWS root account <h3 id="what-is-the-aws-root-account">What is the AWS root account?</h3> <p>The AWS root account is the account that was used — or created — when signing up with Amazon Web Services. This account has full access to all resources in the account and it is not possible to alter this configuration.</p> <h3 id="risks-of-using-the-aws-root-account">Risks of using the AWS root account</h3> <p>Using the AWS root account means that there is potential for its compromise. In particular, iSEC noticed that AWS customers who use the AWS root account tend to do the following:</p> <ol> <li>Share credentials between employees.</li> <li>Disable Multi-Factor Authentication (MFA) for convenience.</li> </ol> <p>Shared credentials, aside from increasing the risk of compromise during the sharing process, render credential rotation impractical due to the need for the newly-generated secret to be known by multiple parties. Sharing the AWS root account also undermines any effort towards using IAM and leveraging the fine-grained access controls it offers. Finally, shared credentials result in loss of the attribution ability, which makes auditing harder and may prevent successful investigation.</p> <h3 id="aws-identity-and-access-management-iam">AWS Identity and Access Management (IAM)</h3> <p>AWS IAM allows account administrators to create users for every employee and grant them access to a limited set of services, actions, and resources. This allows AWS account administrators to apply the principle of least privilege, which dictates that a given user should only be able to access the information and resources that are necessary for them to perform tasks they are responsible for. Additionally, use of IAM allows AWS users to rotate credentials and revoke privileges without impacting other employees.</p> <p>AWS account administrators should create an <em>Administrator</em> IAM group, grant administrator privileges to this group, and create individual IAM users for each employee in charge of administrating the AWS account. When done, the AWS root password should be rotated and stored in a safe manner. Furthermore, additional credentials such as access keys and certificates should be deleted.</p> <h3 id="important-security-consideration-about-the-root-account">Important security consideration about the root account</h3> <p>AWS users should always enable MFA on their root account, even when the password is securely stored; it is important to realize that the password reset for the root account process only requires access to the email address associated with this account. <strong>This means that, without MFA, your production environment is only as secure as an email.</strong></p> Mon, 23 Feb 2015 08:42:00 +0000 https://isecpartners.github.io//aws/2015/02/23/do_not_use_your_root_account.html https://isecpartners.github.io//aws/2015/02/23/do_not_use_your_root_account.html Announcing the AWS blog post series <p>Starting this month, iSEC Partners will start a series of blog posts related to AWS. The goal of these blog posts will be to:</p> <ul> <li>Discuss common security gaps in AWS environments</li> <li>Discuss common security gaps in the architecture of applications deployed in the cloud</li> <li>Describe methods and tools used to identify these security gaps</li> <li>Share tools and scripts that facilitate daily and secure work with AWS</li> <li>Share AWS policies that help improve the security posture of AWS environments</li> </ul> <p>To share material, iSEC created a new public <a href="https://github.com/iSECPartners/AWS-recipes">AWS-recipes</a> repository on GitHub. The tools and policies shared in this repository will be discussed and explained in dedicated blog articles.</p> <p>Because iSEC has been assessing the security of clients’ AWS environments for several years, we have a number of ideas and articles in the pipe awaiting to be written and published. Without further ado, we will start this series with articles that discuss Identity and Access Management (IAM) common issues and best practices, and will present a strategy to improve one’s security posture when using AWS.</p> Sun, 22 Feb 2015 22:24:00 +0000 https://isecpartners.github.io//aws/2015/02/22/announcing_the_aws_blog_post_series.html https://isecpartners.github.io//aws/2015/02/22/announcing_the_aws_blog_post_series.html CA Alternative Whitepapers <p>Academic co-authors Adam Bates, Joe Pletcher, Tyler Nichols, Dave Tian and iSEC engineer Braden Hollembaek had a pair of interesting papers published at the 2014 Conference on Computer and Communications Security and the 2014 Internet Measurement Conference, respectively.</p> <p>In “Securing SSL Certificate Verification through Dynamic Linking”, the paper introduces CertShim, a lightweight retrofit to existing SSL/TLS implementations that provides new mechanisms to address: vulnerabilities in legacy software, improper usage of existing libraries, and the swift bootstrapping of new enhancements. This is accomplished by dynamically hooking calls to the certificate validation entry points in the OpenSSL, PolarSSL, and GnuTLS libraries via an LD_PRELOAD shim. The paper also demonstrates CertShim’s extensibility by adapting it to work with Convergence, DANE, and Client-Based Key Pinning. CertShim imposes only a modest 20ms overhead for an SSL verification call and, by coarse estimate, hooks the SSL dependencies of 94% of Ubuntu’s most popular packages with no changes necessary to existing applications. This work creates a framework to help increase the system-wide security of SSL communications in non-browser software, while simultaneously reducing the barriers to evaluating and adopting alternative proposals to the certificate authority system.</p> <p>For context leading into the second paper, it should be pointed out that in 2011 Moxie Marlinspike proposed a CA alternative, Convergence, that extends the Network Perspectives system of multi-path probing to perform certificate verification. Unfortunately, adoption of Convergence and other SSL/TLS trust enhancements has been slow.</p> <p>Some adoption concerns are addressed in “Forced Perspectives: Evaluating an SSL Trust Enhancement at Scale”, where the question is asked “What if all certificates were validated with Convergence?” In this paper, a case study of deploying Convergence under realistic workloads with a university-wide trace of real-world HTTPS activity is performed. By synthesizing Convergence requests, it is possible to effectively simulate perspectives-based verification on an entire university. The paper demonstrates that, through local and server caching, a single Convergence deployment can meet the requirements of millions of SSL flows while imposing under 0.1% network overhead and requiring as little as 108ms to validate a certificate, making Convergence a worthwhile candidate for further deployment and adoption.</p> <p>Links to the papers and source code can be found here:</p> <p>CertShim Paper: <a href="https://github.com/iSECPartners/publications/blob/master/whitepapers/certshim_ccs14.pdf?raw=true">certshim_ccs14.pdf</a></p> <p>Source code for CertShim: <a href="https://bitbucket.org/uf_sensei/cert-shim">https://bitbucket.org/uf_sensei/cert-shim</a></p> <p>Please keep in mind that CertShim is part of an ongoing research project that relies on unstable function hooks into version-dependent libraries, and as such, should not be used as a production security resource.</p> <p>Forced Perspectives Paper: <a href="https://github.com/iSECPartners/publications/blob/master/whitepapers/forced_perspectives_imc14.pdf?raw=true">forced_perspectives_imc14.pdf</a></p> Wed, 11 Feb 2015 19:25:00 +0000 https://isecpartners.github.io//publications/2015/02/11/certshim.html https://isecpartners.github.io//publications/2015/02/11/certshim.html Calculating SQL Permissions <p>iSEC Partners is happy to announce the availability of a <a href="https://github.com/iSECPartners/sqlperms">tool</a> to help those wishing to better secure their database applications and users. It is a simple command line tool that can monitor Microsoft SQL Server for a period of query activity and then return the smallest set of permissions necessary to execute all of the <em>monitored queries</em>.</p> <p>Unnecessary permissions granted to users and applications can be a significant threat if or when those credentials can be used by an attacker. Maybe a database user who normally only queries a couple of static views leaves their password on a text file on a laptop that gets compromised. Or perhaps an application has a SQL Injection flaw allowing nefarious ne’er do wells to issue arbitrary SQL statements against the database. Both of these cases can lead to painful breaches where large data sets are exfiltrated, modified or even just wantonly deleted. The SQL Permissions tool will help determine the most restrictive set of permissions that are actually needed.</p> <p>This can be useful for developers of applications, as well as applications that already exist. The key in any case is to execute all of the logic or activities that permissions are desired for, as the tool will only calculate a permission for queries it <em>observes</em>. In some cases, an application developer could do even better by isolating high risk privileges to a different components using different database credentials, thereby segregating the risk that highly privileged operations have. Though the tool cannot help rearchitect an application, it can provide the list of permissions required and reviewing the list can provide a useful look at the necessary permissions.</p> <p>The tool is now open sourced and available on iSEC’s <a href="https://github.com/iSECPartners/sqlperms">GitHub</a> page. It does not support every kind of potential SQL Statement that can be executed, but covers the most common queries used in runtime application scenarios. The tool uses assemblies only available from SQL Server Profiler, so this will require a SQL Server version that includes Profiler installed locally, even if using trace files. Notably, that does not include the SQL Express editions. These assemblies are not included in the tool, and are not available for redistribution. It has been tested on SQL Server 2012 and 2014, though it likely works on other editions as the underlying profiling and tracing technology has not significantly changed.</p> <p>Good luck, and have fun locking down everything!</p> Mon, 09 Feb 2015 11:20:00 +0000 https://isecpartners.github.io//tools/2015/02/09/sqlperms.html https://isecpartners.github.io//tools/2015/02/09/sqlperms.html Vulnerability Overview: Ghost (CVE-2015-0235) <h2 id="executive-summary">Executive Summary</h2> <p>An alert about a severe vulnerability discovered by the Qualys security team <a href="https://www.qualys.com/research/security-advisories/GHOST-CVE-2015-0235.txt">was issued</a> on Tuesday, January 27 2015. This vulnerability allows a local or remote attacker to execute code within the context of an application linked with certain versions of the glibc library. The vulnerability is triggered by a buffer overflow in the <code class="highlighter-rouge">gethostbyname()</code> function, called when resolving a hostname to an IP.</p> <p>Immediate patches are required to fix a vulnerability in glibc that allows arbitrary code execution from unauthenticated users. It is necessary to restart computers or processes following patching.</p> <p>Ghost enables code execution, arbitrary data disclosure, and system compromise from unauthenticated remote attackers. The ways that a system could be vulnerable to this bug are numerous, and no exhaustive list could be compiled. Patching is required immediately, as a proof-of-concept is soon to be <a href="https://community.qualys.com/blogs/laws-of-vulnerabilities/2015/01/27/the-ghost-vulnerability">publicly released</a>.</p> <!-- more --> <h2 id="what-is-vulnerable">What is vulnerable?</h2> <p>This vulnerability has been in production glibc versions since November 2000, and was patched in source code since May 2013:</p> <ul> <li>glibc 2.2 through 2.17 (inclusive) are vulnerable</li> <li>glibc 2.18 through 2.20 (inclusive) are NOT vulnerable</li> <li>prior versions of glibc (&lt;= 2.1.3) are NOT vulnerable</li> </ul> <p>Even if you are not directly using the <code class="highlighter-rouge">gethostbyname()</code> function, a large number of software packages incorporate the call and are vulnerable.</p> <p>Service and software that can be exploited include, but is not limited to:</p> <ul> <li>clockdiff</li> <li>procmail</li> <li>pppd (SUID root)</li> <li>Exim Internet Mailer</li> </ul> <p>An exploit has been written against Exim, and a working PoC is soon to be publicly disclosed.</p> <h2 id="who-is-vulnerable"><a name="versions"></a>Who is vulnerable?</h2> <ul> <li>Organizations that ship applications statically linked against vulnerable versions of glibc, or ship appliances built on Linux distributions that have a vulnerable version of glibc. This includes virtual appliances/virtual machines.</li> <li>Organizations or end users that have a Linux desktop or server running with a vulnerable version of glibc, or use applications statically linked against a vulnerable version of glibc. This also extends to appliances and virtual machines. Since this vulnerability has been present in glibc for over a decade, out of date or EOL’d devices are likely to be vulnerable as well.</li> </ul> <p>The following Linux distributions contains a vulnerable version of the glibc: ***</p> <table> <tr> <td colspan="3"><h3 style="display: inline;">Ubuntu</h3></td> </tr><tr> <td>10.04 LTS</td> <td>fix available</td> <td>fixed in libc6 2.11.1-0ubuntu7.20</td> </tr><tr> <td>12.04 LTS</td> <td>fix available</td> <td>fixed in libc6 2.15-0ubuntu10.10</td> </tr><tr> <td>14 and newer</td> <td>not vulnerable</td> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />Debian</h3></td> </tr><tr> <td>6.x - squeeze</td> <td>vulnerable</td> </tr><tr> <td>6.x - squeeze (LTS)</td> <td>vulnerable</td> </tr><tr> <td>7.x - wheezy</td> <td>vulnerable &lt;/tr&gt;<tr> <td>7.x - wheezy (security)</td> <td>fix available</td> <td>fixed in glib 2.13-38+deb7u7</td> </tr><tr> <td>8.0 - jesse</td> <td>not vulnerable</td> </tr><tr> <td>dev - sid</td> <td>not vulnerable</td> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />Red Hat Enterprise</h3> <a href="https://rhn.redhat.com/errata/RHSA-2015-0092.html">fix information&lt;/td&gt; &lt;/tr&gt;<tr> <td>Desktop (v. 5)</td> <td>fix available</td> <td>fixed in glibc-2.5-123.el5_11.1</td> </tr><tr> <td>Desktop (v. 6)</td> <td>fix available</td> <td>fixed in glibc-2.12-1.149.el6_6.5</td> </tr><tr> <td>Desktop (v. 7)</td> <td>fix available</td> <td>fixed in glibc-2.17-55.el7_0.5</td> </tr><tr> <td>HPC Node (v. 6)</td> <td>fix available</td> <td>fixed in glibc-2.12-1.149.el6_6.5</td> </tr><tr> <td>HPC Node (v. 7)</td> <td>fix available</td> <td>fixed in glibc-2.17-55.el7_0.5</td> </tr><tr> <td>Server (v. 5)</td> <td>fix available</td> <td>fixed in glibc-2.5-123.el5_11.1</td> </tr><tr> <td>Server (v. 6)</td> <td>fix available</td> <td>fixed in glibc-2.12-1.149.el6_6.5</td> </tr><tr> <td>Server (v. 7)</td> <td>fix available</td> <td>fixed in glibc-2.17-55.el7_0.5</td> </tr><tr> <td>Server EUS (v. 6.6.z)</td> <td>fix available</td> <td>fixed in glibc-2.12-1.149.el6_6.5</td> </tr><tr> <td>Workstation (v. 6)</td> <td>fix available</td> <td>fixed in glibc-2.12-1.149.el6_6.5</td> </tr><tr> <td>Workstation (v. 7)</td> <td>fix available</td> <td>fixed in glibc-2.17-55.el7_0.5</td> </tr><tr> <td>RHEL 4 ELS</td> <td>fix available</td> <td>fixed in glibc-2.3.4-2.57.el4.2</td> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />Mint</h3></td> </tr><tr> <td>13 "Maya"</td> <td>fix available</td> <td>Tracks Ubuntu 12.04, should get update from Ubuntu servers</td> </tr><tr> <td>17 "Qiana"</td> <td>not vulnerable</td> </tr><tr> <td>17.1 "Rebecca"</td> <td>not vulnerable</td> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />Gentoo</h3> <a href="http://packages.gentoo.org/package/sys-libs/glibc">libc information</a></td> </tr><tr> <td>stable</td> <td>not vulnerable&nbsp;</td> <td>uses glibc 2.19-r1</td> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />Arch</h3> fixed in all releases since August 2013, <a href="https://lists.archlinux.org/pipermail/arch-security/2015-January/000221.html">discussion here</a> and <a href="https://projects.archlinux.org/svntogit/packages.git/log/trunk?h=packages/glibc">package info here</a></td> </tr><tr> <td>anything recent</td> <td>not vulnerable</td> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />Fedora</h3> <a href="https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2015-0235">discussion</a></td> </tr><tr> <td>19 and earlier</td> <td>vulnerable</td> <td>uses glibc 2.17 and earlier</td> </tr><tr> <td>20</td> <td>not vulnerable</td> <td>uses glibc 2.18</td> </tr><tr> <td>21</td> <td>not vulnerable</td> <td>uses glibc 2.20<tr> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />Mandriva Linux</h3></td> </tr><tr> <td>all</td> <td>vulnerable</td> <td><a href="http://rpmfind.net/linux/rpm2html/search.php?query=libc.so.6">appears to use glibc 2.16</a></td> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />openSUSE</h3> <a href="http://support.novell.com/security/cve/CVE-2015-0235.html">vulnerability information</a></td> </tr><tr> <td>Enterprise 11 &amp; older</td> <td>vulnerable</td> </tr><tr> <td>Enterprise 12</td> <td>not vulnerable</td> </tr><tr> <td>openSUSE 13.1 &amp; newer&nbsp;</td> <td>not vulnerable</td> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />Slackware</h3></td> </tr><tr> <td>current</td> <td>not vulnerable</td> <td>uses glibc 2.20</td> </tr><tr> <td>14.1 and earlier</td> <td>vulnerable</td> <td>uses glibc 2.17 and earlier &lt;/tr&gt;<tr> <td colspan="3"><h3 style="display: inline;"><br />Knoppix</h3> <a href="http://distrowatch.com/table.php?distribution=knoppix">information about glibc versions</a></td> </tr><tr> <td>7.2 and earlier</td> <td>vulnerable</td> <td>uses glibc 2.17 and earlier</td> </tr><tr> <td>7.4 and later</td> <td>not vulnerable</td> <td>uses glibc 2.19 and later</td> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />Slax</h3></td> </tr><tr> <td>all</td> <td>vulnerable</td> <td><a href="https://www.slax.org/en/modules.php?detail=glibc-profile&amp;category=libraries">appears to use glibc 2.15</a></td> </tr><tr> <td colspan="3"><h3 style="display: inline;"><br />CentOS</h3></td> </tr><tr> <td>CentOS-5</td> <td>fix available</td> <td>fixed in glibc-2.5-123.el5_11</td> </tr><tr> <td>CentOS-6</td> <td>fix available</td> <td>fixed in glibc-2.12-1.149.el6_6.5</td> </tr><tr> <td>CentOS-7</td> <td>fix available</td> <td>fixed in glibc-2.17-55.el7_0.5</td> </tr> &lt;/table&gt; *** ## Patching iSEC and Matasano recommend performing the following discovery and remediation steps. ### Discovery First, determine if your Linux is vulnerable. Either consult the [table above](#versions), contact your vendor, or get the version from the version from the library itself. To do the latter, run `locate libc.so.6` to find the location of your libc, then run that file, and it will print out version information. ### Fix If your distribution has patches available, install those patches. Otherwise: * Update to glibc 2.18 or newer * Restart all processes that load the glibc library * Issue new binaries for software statically linked against a vulnerable version of the glibc library. ## Technical Overview The [__nss_hostname_digits_dots()](https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=nss/digits_dots.c;h=e007ef47a41b69437655c26565689be393705a82;hp=2b862956e9a8c39bbccbea982add1d7ab2d16ab2;hb=d5dd6189d506068ed11c8bfa1e1e9bffde04decd;hpb=fef94eab0bd308d5059a2588c753bf9a4926845d) function of the GNU C Library (glibc) is vulnerable to a buffer overflow. This function incorrectly calculates the size of a buffer to allocate, and under certain circumstances, arbitrary data can overwrite adjacent memory resulting in a heap based buffer overflow. While only a maximum of four (4) bytes of memory can be overwritten, it has been demonstrated that this was enough to bypass exploitation mitigations (such as ASLR and PIE) and grant code execution. The `__nss_hostname_digits_dots()` function is usually not called directly but is called from the `gethostbyname()` and `gethostbyname2()` glibc functions. In practice, this can be exploited whenever the hostname passed is long enough (at least 1KB) and passes other sanity checks: * The hostname is composed entirely of digits and dots * The hostname starts and ends with a digit * The hostname must be of the form of `a`, `a.b`, `a.b.c` or `a.b.c.d` ## References * [CVE-2015-0235](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0235) * [https://community.qualys.com/blogs/laws-of-vulnerabilities/2015/01/27/the-ghost-vulnerability](https://community.qualys.com/blogs/laws-of-vulnerabilities/2015/01/27/the-ghost-vulnerability) * [https://www.qualys.com/research/security-advisories/GHOST-CVE-2015-0235.txt](https://www.qualys.com/research/security-advisories/GHOST-CVE-2015-0235.txt) * [http://ma.ttias.be/critical-glibc-update-cve-2015-0235-gethostbyname-calls/](http://ma.ttias.be/critical-glibc-update-cve-2015-0235-gethostbyname-calls/) * [http://www.frsag.org/pipermail/frsag/2015-January/005722.html](http://www.frsag.org/pipermail/frsag/2015-January/005722.html) * [https://sourceware.org/bugzilla/show_bug.cgi?id=15014](https://sourceware.org/bugzilla/show_bug.cgi?id=15014) * [https://rhn.redhat.com/errata/RHSA-2015-0090.html](https://rhn.redhat.com/errata/RHSA-2015-0090.html) * [https://launchpad.net/ubuntu/+source/eglibc](https://launchpad.net/ubuntu/+source/eglibc) * [https://security-tracker.debian.org/tracker/CVE-2015-0235](https://security-tracker.debian.org/tracker/CVE-2015-0235) </td></tr></td></tr></a></td></tr></td></tr></table> Tue, 27 Jan 2015 00:00:00 +0000 https://isecpartners.github.io//news/2015/01/27/ghost.html https://isecpartners.github.io//news/2015/01/27/ghost.html Jailbreak, updated and open-sourced <p>Jailbreak allows a user to export certificates from Microsoft certificate stores even if the certificate has been marked as non-exportable; this can be useful if you need to make backups of the certificates or perform some other form of testing. The utility was first released in 2007, but at that time was closed source and OS version dependent, as it patched DLLs in memory. The new 4.0 release maintains all of the previous functionality but is now <a href="https://github.com/iSECPartners/jailbreak">open source</a> (under a BSD license) and uses a function hooking approach to remove OS version dependencies. There are pre-compiled <a href="https://github.com/iSECPartners/jailbreak/tree/master/binaries">binaries</a> that should work on all versions of Windows from Windows XP up to Windows 8.1 on 32-bit and 64-bit systems.</p> Mon, 19 Jan 2015 13:37:00 +0000 https://isecpartners.github.io//tools/2015/01/19/jailbreak-release.html https://isecpartners.github.io//tools/2015/01/19/jailbreak-release.html A Simple DLL Injection Utility <p>NCLoader is a simple command-line DLL injection tool for windows. It takes a PID or process name as parameter and accounts for systems with a high number of running processes. Being single-featured, the utility aims for simplicity with its single C code file implementing the well known VirtualAllocEx+WriteProcessMemory+CreateRemoteThread method. The code aims for cleanliness (no warnings compilation on MSVC), readability and includes verbose error checking. Statically compiled binaries for x86 and x64 architectures are provided.</p> <p>Check out the ncloader <a href="https://github.com/iSECPartners/ncloader">repository</a>.</p> Wed, 29 Oct 2014 11:08:35 +0000 https://isecpartners.github.io//tools/2014/10/29/ncloader.html https://isecpartners.github.io//tools/2014/10/29/ncloader.html Shellshock Advisory <h2 id="executive-summary">Executive Summary</h2> <p>Immediate patches are required to fix a vulnerability in bash that allows arbitrary code execution from unauthenticated users.</p> <p>The full impact of vulnerable vectors may never be enumerated, so patching is required immediately, as in-the-wild attacks are being seen.</p> <p>The vulnerability is not fully resolved by the available patch, so a second round of patching will be required once the subsequent patch is available.</p> <p>It is not necessary to restart computers or processes following patching.</p> <h2 id="impact--determining-exposure">Impact &amp; Determining Exposure</h2> <p>Shellshock enables code execution, arbitrary file disclosure, and system compromise from unauthenticated remote attackers. The ways that a system could be vulnerable to this bug are numerous, and no exhaustive list could be compiled. However, some of the common scenarios are:</p> <ul> <li>Web servers using CGI scripts that are written in bash</li> <li>Web servers using CGI scripts that are written in other languages that invoke certain function calls: <ul> <li>C-based scripts calling system() or popen()</li> <li>Python-based scripts that call os.system() or os.popen()</li> <li>PHP-based scripts that call system() or exec() (when run in CGI mode)</li> <li>Perl-based scripts that invoke shell commands</li> </ul> </li> <li>Restricted SSH shells using ForceCommand can be bypassed. Some git and subversion deployments use such restricted shells.</li> <li>If an attacker is in a position to forge DHCP responses, it can enable root-level code execution in DHCP clients</li> <li>Set-UID applications may allow local escalation to root</li> <li>CUPS-based printer daemons are likely to be affected</li> <li>Mac and Linux Desktops are affected, and are likely to allow privilege escalation to a root user</li> </ul> <p>Certain common deployments are not affected:</p> <ul> <li>Regular use of SSH is not affected as users already have shell access</li> <li>PHP scripts that use mod_php are not affected, nor is mod_python or mod_perl</li> <li>Sudo by itself is not affected</li> </ul> <p>Finally, there is no need to restart services after patching. Running processes have passed the window of vulnerability and new processes will be running the new, patched code.</p> <h2 id="patching">Patching</h2> <p>Linux Operating Systems have deployed patches:</p> <ul> <li>RHEL: <a href="https://rhn.redhat.com/errata/RHSA-2014-1293.html">https://rhn.redhat.com/errata/RHSA-2014-1293.html</a></li> <li>Ubuntu: <a href="http://www.ubuntu.com/usn/usn-2362-1/">http://www.ubuntu.com/usn/usn-2362-1/</a></li> <li>Debian: <a href="https://lists.debian.org/debian-security-announce/2014/msg00220.html">https://lists.debian.org/debian-security-announce/2014/msg00220.html</a></li> <li>CentOS: <a href="http://centosnow.blogspot.com/2014/09/critical-bash-updates-for-centos-5.html">http://centosnow.blogspot.com/2014/09/critical-bash-updates-for-centos-5.html</a></li> <li>Gentoo: An updated bash package is available in portage</li> <li>OpenSUSE: <a href="http://support.novell.com/security/cve/CVE-2014-6271.html">http://support.novell.com/security/cve/CVE-2014-6271.html</a></li> </ul> <p>Mac OS X is not yet patched, but manual instructions to recompile bash from source are available at: <a href="https://apple.stackexchange.com/questions/146849/">https://apple.stackexchange.com/questions/146849/</a></p> <h2 id="an-imperfect-fix">An Imperfect Fix</h2> <p>Unfortunately, the patch supplied is incomplete. As <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1141597#c23">noted by Tavis Ormandy</a>, other vectors still exist to bypass protections and perform invalid actions, such as overwriting files. While no one has publicly demonstrated code execution for this bypass, it seems likely to be possible. A second CVE (CVE-2014-7169) has been created to track this issue.</p> <p>Red Hat has an experimental mitigation that requires many manual steps to use available at: <a href="https://access.redhat.com/articles/1200223">https://access.redhat.com/articles/1200223</a></p> <p>Red Hat and NCC both advise deploying the available patch immediately and being prepared to deploy a second patch, when one becomes stable and tested shortly.</p> <h2 id="in-the-wild-attacks">In the Wild Attacks</h2> <p>Shellshock is being actively scanned for and exploited on the Internet at-large currently.</p> <p>Robert Graham is one security researcher who has <a href="http://blog.erratasec.com/2014/09/bash-shellshock-scan-of-internet.html#.VCQXQitdVH0">initiated an Internet-wide scan</a> from the IP address 209.126.230.72. His scan, and many others, use a ping command to call back to a server, alerting them that your server is vulnerable – although this is not the only mechanism one could use.</p> <p>Besides internet scans, several Metasploit modules are available, and a few exploits have been posted online. These include exploits that <a href="http://pastebin.com/raw.php?i=166f8Rjx">provide shell access to a server</a>, read <a href="https://www.invisiblethreat.ca/2014/09/cve-2014-6271/">arbitrary files the web server has access to read</a>, and a report of a <a href="https://gist.github.com/anonymous/929d622f3b36b00c0be1">payload that exploits</a> a <a href="http://www.kernelmode.info/forum/viewtopic.php?f=16&amp;t=3505">kernel vulnerability</a>. The kernel exploit is not yet confirmed to exploit a previously known or unknown vulnerability.</p> <h2 id="ids-signatures-and-detection">IDS Signatures and Detection</h2> <p>IDS vendors are producing rules that will attempt to detect and block attempted exploitation of this issue. Rules are available for:</p> <ul> <li>mod_security: <a href="https://access.redhat.com/articles/1200223">https://access.redhat.com/articles/1200223</a></li> <li>iptables: <a href="https://access.redhat.com/articles/1200223">https://access.redhat.com/articles/1200223</a></li> <li>Snort: <a href="http://www.volexity.com/blog/?p=19">http://www.volexity.com/blog/?p=19</a></li> <li>Suricata: <a href="http://www.volexity.com/blog/?p=19">http://www.volexity.com/blog/?p=19</a></li> <li>Akamai has rules deployed in its WAF products: <a href="https://blogs.akamai.com/2014/09/environment-bashing.html">https://blogs.akamai.com/2014/09/environment-bashing.html</a></li> <li>CloudFlare has similarly deployed rules in its WAF Products: <a href="https://blog.cloudflare.com/bash-vulnerability-cve-2014-6271-patched/">https://blog.cloudflare.com/bash-vulnerability-cve-2014-6271-patched/</a></li> </ul> <h2 id="technical-details-of-the-flaw">Technical Details of the Flaw</h2> <p>The vulnerability was discovered by Stephane Chazelas and can be tested for manually using the following command:</p> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>env x='() { :;}; echo vulnerable' bash -c "echo this is a test" </code></pre></div></div> <p>If it outputs ‘vulnerable’, the system is vulnerable. This bug arises because of an unusual feature of bash that allows exporting functions as well as environment variables. This feature is specific to bash, and no other shells are known to be vulnerable. (However, on some systems, other shells will actually be symlinks to bash.)</p> <p>The actual vulnerability is in the parser for these exported functions. It does not parse the function correctly, and upon invocation will automatically execute trailing code defined after the function.</p> <p>Any variable beginning with “() {“ is automatically treated as a function – but the aspect that makes this bug so prevalent is that environment variables are populated in unexpected places from user input. For example, environment variables like HTTP_COOKIE and HTTP_USER_AGENT are often populated for CGI scripts. And PHP, Perl, Python, and other scripts are often run as CGI scripts under a web server.</p> <p>This results in a perfect storm of unexpected vectors of automatic remote code execution, most commonly on web servers. For more details, a good technical blog post is: <a href="http://lcamtuf.blogspot.co.uk/2014/09/quick-notes-about-bash-bug-its-impact.html">http://lcamtuf.blogspot.co.uk/2014/09/quick-notes-about-bash-bug-its-impact.html</a></p> <h2 id="references">References</h2> <ul> <li><a href="https://bugzilla.redhat.com/show_bug.cgi?id=1141597#c23">https://bugzilla.redhat.com/show_bug.cgi?id=1141597#c23</a></li> <li><a href="http://blog.erratasec.com/2014/09/bash-shellshock-scan-of-internet.html#.VCQXQitdVH0">http://blog.erratasec.com/2014/09/bash-shellshock-scan-of-internet.html#.VCQXQitdVH0</a></li> <li><a href="http://pastebin.com/raw.php?i=166f8Rjx">http://pastebin.com/raw.php?i=166f8Rjx</a></li> <li><a href="https://www.invisiblethreat.ca/2014/09/cve-2014-6271/">https://www.invisiblethreat.ca/2014/09/cve-2014-6271/</a></li> <li><a href="http://www.kernelmode.info/forum/viewtopic.php?f=16&amp;t=3505">http://www.kernelmode.info/forum/viewtopic.php?f=16&amp;t=3505</a></li> <li><a href="https://gist.github.com/anonymous/929d622f3b36b00c0be1">https://gist.github.com/anonymous/929d622f3b36b00c0be1</a></li> <li><a href="https://access.redhat.com/articles/1200223">https://access.redhat.com/articles/1200223</a></li> <li><a href="http://lcamtuf.blogspot.co.uk/2014/09/quick-notes-about-bash-bug-its-impact.html">http://lcamtuf.blogspot.co.uk/2014/09/quick-notes-about-bash-bug-its-impact.html</a></li> <li><a href="http://www.volexity.com/blog/?p=19">http://www.volexity.com/blog/?p=19</a></li> <li><a href="http://www.troyhunt.com/2014/09/everything-you-need-to-know-about.html?m=1">http://www.troyhunt.com/2014/09/everything-you-need-to-know-about.html?m=1</a></li> <li><a href="http://seclists.org/oss-sec/2014/q3/650">http://seclists.org/oss-sec/2014/q3/650</a></li> <li><a href="https://blog.cloudflare.com/bash-vulnerability-cve-2014-6271-patched/">https://blog.cloudflare.com/bash-vulnerability-cve-2014-6271-patched/</a></li> <li><a href="https://blogs.akamai.com/2014/09/environment-bashing.html">https://blogs.akamai.com/2014/09/environment-bashing.html</a></li> <li><a href="https://apple.stackexchange.com/questions/146849/how-do-i-recompile-bash-to-avoid-the-remote-exploit-cve-2014-6271-and-cve-2014-7">https://apple.stackexchange.com/questions/146849/how-do-i-recompile-bash-to-avoid-the-remote-exploit-cve-2014-6271-and-cve-2014-7</a></li> <li><a href="https://access.redhat.com/security/cve/CVE-2014-7169">https://access.redhat.com/security/cve/CVE-2014-7169</a></li> <li><a href="https://access.redhat.com/security/cve/CVE-2014-6271">https://access.redhat.com/security/cve/CVE-2014-6271</a></li> <li><a href="https://securityblog.redhat.com/2014/09/24/bash-specially-crafted-environment-variables-code-injection-attack/">https://securityblog.redhat.com/2014/09/24/bash-specially-crafted-environment-variables-code-injection-attack/</a></li> </ul> Thu, 25 Sep 2014 01:23:55 +0000 https://isecpartners.github.io//news/2014/09/25/shellshock.html https://isecpartners.github.io//news/2014/09/25/shellshock.html Perfect Forward Security Whitepaper <p>Encrypted communication channels were created so nobody could read confidential communications - this means not only during the conversation, but also any time after it. But adversaries have the ability to monitor, record, and attack communication retroactively. Disclosure of state sponsored monitoring of electronic communications and the threat of retroactive decryption of traffic of millions of people has created an urge for an extra layer of security and privacy for all electronic communications.</p> <p>iSEC has <a href="https://github.com/iSECPartners/publications/blob/master/whitepapers/perfect_forward_security.pdf?raw=true">published a whitepaper</a> that looks into how Forward Security can be used to protect online communication - but covering much more than just TLS. Besides explaining the groundwork, we also explore the difference between Forward Security and Perfect Forward Security and mechanisms outside any specific implementation, modeling a generic protocol and building it up showing how Forward Security can be achieved. And on the implementation level, we also cover how to enable Forward Security in protocols you have deployed in your network today - giving a simple explanation, real life applications, advantages, and implementation in protocols like Off-the-Record (OTR) Messaging, Secure Shell (SSH), Wireless Protected Access II Protocol (WPA2-EAP-PWD), Virtual Private Networks (VPN), and of course TLS.</p> Thu, 04 Sep 2014 11:25:55 +0000 https://isecpartners.github.io//news/research/2014/09/04/perfect-forward-security-whitepaper.html https://isecpartners.github.io//news/research/2014/09/04/perfect-forward-security-whitepaper.html Tor Browser Research Report Released <p>As part of our <a href="https://isecpartners.github.io/2013/10/14/open-tech-fund-report-release.html">work with the Open Technology Fund</a>, we recently worked with the <a href="https://www.torproject.org/">Tor Project</a> to see how Tor Browser stands up in terms of modern exploit mitigations, and what could be done to make it harder to develop exploits for.</p> <p>Tor Browser is based on Firefox, so it inherits the strengths and weaknesses of Firefox — but one of the things Tor Project is working on is a <a href="https://trac.torproject.org/projects/tor/ticket/9387">security slider</a> that will let people disable features of the browser depending on their security posture. If you’re extra paranoid you’ll ratchet it all the way up and disable Javascript; if you’re less paranoid, you can put it on ‘Low’ and disable things like obscure font rendering features only used in South East Asia.</p> <p>Tor Project has <a href="https://blog.torproject.org/blog/isec-partners-conducts-tor-browser-hardening-study">published a blog post</a> that summarizes the report from their point of view and links to a number of issues on their bugtracker and other documentation.</p> <p>This project was more of a research engagement than a security assessment — a lot of this engagement was identifying features that should be placed on the slider, and making recommendations for where they should land. But we looked at a lot of other more general hardening items too. We checked the status of DEP and ASLR on Windows and Mac, and found an interesting lack of exception handling on the Windows build, due to the MinGW build process (this throws SafeSEH and SEHOP out the window). We also went through, with the cooperation of the Mozilla Security team, and categorized over a hundred past security vulnerabilities in Firefox into feature category and bug type (Use-After-Free wins the latter overwhelmingly.) We analyzed a few public and private exploits, and also investigated enabling assertions in certain classes in Firefox. We have a skeleton patch for the latter, but it’s more a proof of concept than something we think they should use. One of the other major items was looking at replacing Firefox’s memory allocator (jemalloc) with a more hardened allocator (PartitionAlloc from Chrome). Fortunately, Mozilla makes this pretty easy, so most of the work is in adapting PartitionAlloc and making full use of its partition features. There are several other parts to the report, including looking at protocol handlers, media formats, and making regression tests for DOM object exposure.</p> <p>We had a ton of fun working on this project and we’d like to thank Mike Perry at Tor for working with us so closely, OTF for sponsoring the work, and all the people inside iSEC and the security community we talked about this project with who gave us ideas — especially Chris Evans from Google (the author of PartitionAlloc). The report clocks in at about 30 pages, but with the appendices (which have patch files), it balloons up to a whopping 150 pages. You can find the report, and all the patch files <a href="https://github.com/iSECPartners/publications/tree/master/reports/Tor%20Browser%20Bundle">in our publications repository</a>.</p> Wed, 13 Aug 2014 11:25:55 +0000 https://isecpartners.github.io//news/research/2014/08/13/tor-browser-research-report.html https://isecpartners.github.io//news/research/2014/08/13/tor-browser-research-report.html ZigTools: An Open Source 802.15.4 Framework <p>ZigTools is a Python framework, which was developed to reduce the complexity in writing additional functionality in communicating with a Freakduino (a low cost Arduino based 802.15.4 platform). Features such as initializing the radio, changing channels, sniffing network traffic, sending raw data and processing that data can be written in just a few lines. This allows developers to focus on writing more complex and feature rich applications without worrying about low level communications between the radio and system.</p> <h4 id="benefits">Benefits</h4> <ul> <li>Sniffed data is saved in a pcap format, which can later be dissected by popular applications</li> <li>Replay packets directly from pcap file</li> <li>All aspects of the packet can be modified, allowing developers to test Layer 2 and 3 functionality of 802.15.4 and Zigbee systems</li> </ul> <p>iSEC Partners is pleased to publicly release this version of the <a href="https://github.com/iSECPartners/ZigTools">ZigTools</a> framework at <a href="https://www.blackhat.com/us-14/arsenal.html#Warner">Black Hat USA 2014 Arsenal</a>, a tools/demos area.</p> Mon, 04 Aug 2014 08:30:00 +0000 https://isecpartners.github.io//tools/2014/08/04/ZigTools-release.html https://isecpartners.github.io//tools/2014/08/04/ZigTools-release.html Tool Release: You'll Never (Ever) Take Me Alive! <p><a href="https://isecpartners.github.io/tools/2013/03/18/yontma-release.html">A year ago</a>, we released <a href="https://github.com/iSECPartners/yontma">You’ll Never Take Me Alive</a> — a tool that helps protects Full Disk Encrypted Windows computers from DMA and cold boot attacks.</p> <p>YoNTMA runs as a background service and begins monitoring your computer any time the screen is locked. If the power cable or Ethernet cable is disconnected from the system while your laptop is locked, YoNTMA will immediately hibernate the machine to ensure that the disk encryption keys do not remain in RAM. This ensures that if a thief walks off with your powered-on laptop, your encrypted data stays protected.</p> <p>It’s been a great tool that I’ve used happily, but when I got a new Macintosh, I ran up against <a href="https://github.com/iSECPartners/yontma/issues/3">Issue #3</a> — there’s no Mac version! Until today. We’re releasing a new version of <a href="https://github.com/iSECPartners/yontma-mac">YoNTMA for Macs</a>. The source is still open and the .dmg can be downloaded from <a href="https://github.com/iSECPartners/yontma-mac/releases/download/0.9.9/yontma-0.9.9.dmg">Github</a>. Due to some tricks of how Macintoshes hibernate, you’ll need to provide your administrative password (just once) to update the power management settings to enable a secure hibernation. Or, if you’re paranoid, you can run those commands yourself and re-launch the app — don’t worry, you won’t hurt my feelings.</p> <p>The only issue we’re aware of is a <a href="https://discussions.apple.com/thread/5468637?start=0&amp;tstart=0">lingering issue in OS 10.9</a>; that said, while I’ve experienced this issue in the past, I’m currently running 10.9 and haven’t had issues in the past few months. Feel free to test and if you have problems, <a href="https://github.com/iSECPartners/yontma-mac/issues">open an issue on Github</a>.</p> Fri, 09 May 2014 11:25:55 +0000 https://isecpartners.github.io//news/tools/2014/05/09/yontma-mac-release.html https://isecpartners.github.io//news/tools/2014/05/09/yontma-mac-release.html DIBF Tool Suite <p>Introducing iSEC Partners’ Windows driver testing suite. The source, binaries and example output are available at <a href="https://github.com/iSECPartners/DIBF">https://github.com/iSECPartners/DIBF</a> under the GPLv2 license. Currently three tools are included:</p> <p>DIBF - Dynamic IOCTL Brute-Forcer (and fuzzers)</p> <p>This tool encompasses two distinct features. It guesses the IOCTL values that the driver accepts, and also their valid size limitations, and stores the results are in a file for future reuse. The second feature is composed of 3 dumb fuzzers: a pure random fuzzer, a sliding DWORD fuzzer and a fully asynchronous fuzzer. Any combination of the 3 fuzzers can be run sequentially, and numerous options can be set from the command line, including time limits for each fuzzer run, the maximum number of failed requests in a row (indicating further fuzzing might be pointless due to lack permission for instance) and the verbosity level. Any fuzzer run can be stopped cleanly with ctrl-c, and upon completion cumulative statistics are displayed. See the README and usage for more information on all options and features.</p> <p>IOSEND - sending single IOCTL to a driver</p> <p>This is a tool intended for proofing vulnerabilities and is meant to be used in conjunction with a hex editor. Once the request of interest has been crafted in the editor, this utility will send it to the driver using command line parameters. The response gets sent to stdout.</p> <p>IOCODE - simple encoding/decoding utility for IO codes</p> <p>This very simple tool encodes and decodes windows IOCTL control codes. It provides a user-friendly way to deal with IO encoding of device types, function number, transfer method and access type.</p> Wed, 16 Apr 2014 12:01:05 +0000 https://isecpartners.github.io//tools/fuzzing/2014/04/16/dibf.html https://isecpartners.github.io//tools/fuzzing/2014/04/16/dibf.html SSLyze v 0.9 released - Heartbleed edition <p>A new version of <a href="https://github.com/iSECPartners/sslyze">SSLyze</a> is now available. SSLyze is a Python tool that can analyze the SSL configuration of a server by connecting to it. This version brings a few improvements and bug fixes as well as a new plugin to identify servers affected by the <a href="https://isecpartners.github.io/advisory/ssl/2014/04/10/heartbleed-advisory.html">Heartbleed vulnerability</a>.</p> <h3 id="heartbleed-testing">Heartbleed Testing</h3> <p>To implement the Heartbleed check, I used the methodology <a href="https://blog.mozilla.org/security/2014/04/12/testing-for-heartbleed-vulnerability-without-exploiting-the-server/">described on Mozilla’s blog</a>, which has the advantage of not directly exploiting the vulnerability unlike most Hearbleed-testing scripts that have been released. Mozilla’s technique does not retrieve memory from the server, thereby avoiding server crashes or sensitive data exposure.</p> <p>Additionally, SSLyze’s implementation uses the tool’s existing networking code, allowing Heartbleed testing against multiple servers at the same time and on StartTLS services including XMPP, LDAP, SMTP, FTP and POP. Also, just like all of SSLyze’s checks, Heartbleed tests can be tunneled through an HTTPS proxy.</p> <h3 id="full-changelog">Full Changelog</h3> <ul> <li>Experimental support for Heartbleed detection; see <code class="highlighter-rouge">--heartbleed</code>. Heartbleed detection has also been added to <code class="highlighter-rouge">--regular</code> scans</li> <li>Capped the maximum number of concurrent connections to around 30 per server in order to avoid DOSing the scanned servers. Scans are slightly slower but a lot less aggressive, resulting in better scan results with less timeout and connection errors</li> <li>Support for Basic Authentication when tunneling scans through an HTTPS proxy with <code class="highlighter-rouge">--https_tunnel</code></li> <li>Bug fixes for IPv6 and XMPP support</li> <li>Updated OpenSSL to 1.0.1g</li> <li>Updated the Apple, Microsoft, Mozilla and Java trust stores</li> <li>Cleaned up the text output of PluginOpenSSLCipherSuites</li> </ul> <h3 id="download">Download</h3> <p>SSLyze requires Python 2.7; the supported platforms are Windows 7 32/64 bits, Linux 32/64 bits and OS X 64 bits. Pre-compiled packages available in the <a href="https://github.com/iSECPartners/sslyze/releases">release section</a> of the project’s page on GitHub.</p> Wed, 16 Apr 2014 10:00:00 +0000 https://isecpartners.github.io//ssl/tools/2014/04/16/SSLyze-0.9-heartbleed-edition.html https://isecpartners.github.io//ssl/tools/2014/04/16/SSLyze-0.9-heartbleed-edition.html iSEC Completes TrueCrypt Audit <p><a href="http://istruecryptauditedyet.com/">Is TrueCrypt Audited Yet?</a> Yes, in part!</p> <p>For nearly a decade, tens of millions of users have been trusting the open source encryption software, TrueCrypt. Over the past year, however, revelations about the capabilities of intelligence agencies have shaken the very foundations of much of the cryptography community. Owing to its popularity and widespread use, TrueCrypt has come under intense scrutiny with many openly asking if TrueCrypt could be trusted to function as claimed.</p> <p>The Open Crypto Audit Project (OCAP) is a new organization that is attempting to answer questions of importance to the cryptography community, including those about trust in TrueCrypt. OCAP began a grassroots campaign to raise money to answer fundamental questions about TrueCrypt. These fundamental goals were identified. First, resolve questions regarding TrueCrypt’s license status. Second, produce repeatable, deterministic builds. And third, conduct a public analysis of the code.</p> <p>As <a href="/news/2013/12/23/iSEC-Engages-In-Truecrypt-Audit.html">announced in December 2013</a>, iSEC Partners (iSEC) worked with the Open Crypto Audit Project on the final goal – conducting a methodical analysis of TrueCrypt through code review and penetration testing.</p> <p>In January 2014, iSEC Partners kicked off the engagement to audit the following portions of TrueCrypt: the Windows kernel code, the bootloader, the filesystem driver, and the areas around this code. The scope was kept narrowly focused to avoid stretching resources too thin and ensure that the review conducted was thorough and robust.</p> <p>The audit conducted by iSEC is now complete and the findings are available now. iSEC did not identify any issues considered “high severity” during this testing. iSEC found no evidence of backdoors or intentional flaws. Several weaknesses and common kernel vulnerabilities were identified, including kernel pointer disclosure, but none of them appeared to present immediate exploitation vectors. All identified findings appeared accidental. Overall, iSEC does think changes can be made to improve code quality and maintainability, and that the build process should be updated to rely on recent tools with trustworthy provenance. In sum, while TrueCrypt does not have the most polished programming style, there is nothing immediately dangerous to report.</p> <p>Given TrueCrypt’s popularity, the entire security industry benefits from knowing more about the software and how secure it is. iSEC believes in the importance of working with organizations like the Open Crypto Audit Project and the <a href="/2013/10/14/open-tech-fund-report-release.html">Open Technology Fund</a> to support the development and security of technologies that promote trust and security throughout the Internet.</p> <p>iSEC hopes both the TrueCrypt project and the larger Open Crypto Audit Project continue their work. The security community will benefit from continued review, new versions, and reproducible builds of the software in the future.</p> <p>iSEC is grateful and honored to have been a part of the TrueCrypt security audit and feels that the analysis was both productive and important. iSEC’s full report is now available to the public. It is unchanged save two items: correcting a few late-stage misspellings and redaction of the consultants’ phone numbers. It is available at <a href="https://opencryptoaudit.org/reports">https://opencryptoaudit.org/reports</a>.</p> Mon, 14 Apr 2014 10:00:00 +0000 https://isecpartners.github.io//news/2014/04/14/iSEC-Completes-Truecrypt-Audit.html https://isecpartners.github.io//news/2014/04/14/iSEC-Completes-Truecrypt-Audit.html Heartbleed (CVE-2014-0160) Advisory <p>News of a major widespread vulnerability discovered by Neel Mehta came out Monday, April 7 2014. This vulnerability allows a network attacker to read memory from programs that use certain versions of the OpenSSL library, e.g. web servers, VPN clients and servers, or mail transfer agents. Vulnerable data could include:</p> <ul> <li>Certificate private keys and session keys</li> <li>Any credentials (such as username and password) sent to the endpoint. Session cookies and similar bearer tokens are also affected.</li> <li>The actual data that was intended to be protected (such as financial data or account numbers).</li> <li>Other potentially sensitive data in memory (such as memory addresses and their contents) that could allow an attacker to more easily exploit other vulnerabilities.</li> </ul> <h3 id="what-is-vulnerable"><a name="versions"></a>What is vulnerable?</h3> <p>This vulnerability has been in source code since December 2011 and in production OpenSSL versions since March 2012:</p> <ul> <li>OpenSSL 1.0.1 through 1.0.1f (inclusive) are vulnerable</li> <li>OpenSSL 1.0.1g is NOT vulnerable</li> <li>OpenSSL 1.0.0 branch is NOT vulnerable</li> <li>OpenSSL 0.9.8 branch is NOT vulnerable</li> </ul> <p>Even if you are not directly using OpenSSL, a large number of software packages incorporate OpenSSL and are vulnerable.</p> <h3 id="who-is-vulnerable">Who is vulnerable?</h3> <p>Anyone who has run any product using OpenSSL versions 1.0.1 through 1.0.1f even if you are currently patched is vulnerable. Even if your organization does not run OpenSSL directly, it is a part of many other software packages. Additionally, appliances such as SSL/TLS terminators, mail servers, instant messaging servers, and VPN concentrators could be running OpenSSL internally. This is not limited to servers either. Any client software that uses a vulnerable version of OpenSSL can be attacked. Our investigations into the exploitability of client software are ongoing.</p> <h3 id="what-action-should-be-taken-on-the-server-side">What action should be taken on the server side?</h3> <p>iSEC recommends performing the following discovery and remediation steps:</p> <p><strong>Discovery:</strong> determine if you are running a <a href="#versions">vulnerable version</a> of OpenSSL</p> <p><strong>Fix the base issue going forward:</strong></p> <ul> <li>Update to OpenSSL 1.0.1g or newer, or recompile the current version in use with heartbeats disabled via the <code class="highlighter-rouge">–DOPENSSL_NO_HEARTBEATS</code> option.</li> <li>Restart all processes that load the OpenSSL library</li> </ul> <p><strong>Mitigate potential damage:</strong></p> <ul> <li>Generate and deploy a new public and private key pair.</li> <li>Revoke old, assumed-compromised private key. Check with the issuing Certificate Authority (CA) for details on how to revoke a compromised private key. You may wish to request a new certificate even before your production systems are fully patched so that it has a chance to age before deployment to minimize problems for clients with incorrect clocks.</li> <li>Invalidate all active sessions</li> <li>Encourage users to change passwords</li> <li>Elevate fraud detection procedures</li> <li>Notify vendors of any vulnerable commercial software or appliances.</li> </ul> <p>Due to the severity of the impacts of an exploit, if a service cannot be upgraded or recompiled, consider removing the service from the internet until fixes can be applied.</p> <h3 id="what-action-should-be-taken-with-client-software">What action should be taken with client software?</h3> <p>Currently the most active threat is to servers, however a network attacker could use this bug to attack clients as well. Depending on the functionality and use of your product, client-side attacks could steal sensitive session data, user credentials, and private keys for client certificates.</p> <p><strong>Discovery:</strong> determine if clients/products are using a <a href="#versions">vulnerable version</a> of OpenSSL.</p> <p><strong>Fix the base issue going forward:</strong></p> <ul> <li>Update to OpenSSL 1.0.1g or newer, or recompile with heartbeats disabled</li> <li>Release update/patch</li> </ul> <p><strong>Mitigate potential damage:</strong></p> <ul> <li>Notify customers</li> <li>Invalidate sessions</li> <li>Encourage users to change passwords</li> <li>Encourage users to generate new public and private key pair for client-side certificates</li> <li>Revoke old, assumed-compromised private key of client-side certificates</li> <li>Elevate fraud detection procedures</li> </ul> <h3 id="what-action-should-be-taken-by-usersconsumers">What action should be taken by users/consumers?</h3> <p>Almost every person uses some service or software that is vulnerable to Heartbleed. Although much of the burden resides on software vendors to provide prompt patches, there are a few things you can do to minimize your personal risk:</p> <ul> <li>Log out of services</li> <li>Determine if services are currently vulnerable by looking for an advisory or checking one of the available lists, such as <a href="http://mashable.com/2014/04/09/heartbleed-bug-websites-affected/">Mashable’s list</a></li> <li>Avoid using vulnerable services and notify them that they are vulnerable</li> <li>After services are no longer vulnerable, change passwords</li> </ul> <h3 id="more-information">More information</h3> <ul> <li>CVE-2014-0160</li> <li><a href="http://heartbleed.com/">http://heartbleed.com/</a></li> <li><a href="https://www.openssl.org/news/secadv_20140407.txt">https://www.openssl.org/news/secadv_20140407.txt</a></li> <li><a href="https://www.nccgroup.com/en/blog/2014/04/heartbleed-openssl-vulnerability/">https://www.nccgroup.com/en/blog/2014/04/heartbleed-openssl-vulnerability/</a></li> <li><a href="http://security.stackexchange.com/a/55250">http://security.stackexchange.com/a/55250</a> - Details on client-side attacks</li> </ul> Thu, 10 Apr 2014 11:00:00 +0000 https://isecpartners.github.io//advisory/ssl/2014/04/10/heartbleed-advisory.html https://isecpartners.github.io//advisory/ssl/2014/04/10/heartbleed-advisory.html Introducing iSEC's Smart Password Evaluation Service <p><strong>Note: This post was written as an April Fool’s Day joke; we will (fortunately) not be offering this service. We hope you enjoyed this bit of humor about the current challenges in the security industry.</strong></p> <h3 id="the-trouble-with-password-strength-meters">The Trouble with Password Strength Meters</h3> <p>One of the main downfalls of using passwords as an authentication mechanism is that it’s extremely difficult to convince users to select strong passwords. In the past few years, several web applications have begun to use “password strength meters” which show the user how resistant their chosen password is to brute force attempts.</p> <p><img src="../../../../../images/2014-04-01-meter-ebay.png" alt="eBay's password strength meter" /></p> <p>A <a href="https://madiba.encs.concordia.ca/~x_decarn/papers/password-meters-ndss2014.pdf">recent paper</a> by Carnavalet and Mannan showed that, while these meters are somewhat effective at increasing the strength of passwords, they are easily fooled. Many meters rate passwords like “password$1” as strong despite the fact that modern attack tools could easily crack such a password.</p> <h3 id="isecs-service">iSEC’s Service</h3> <p>What’s the problem here? Is your attacker a little JavaScript snippet with a pretty colored bar? No! Your attacker is a constantly evolving and adaptable human adversary. What’s the only way to defeat a human? With a human!</p> <p>With this in mind, iSEC is proud to announce iSEC Smart Password Evaluation Service, the first and only password evaluator that uses live humans to judge the strength of passwords.</p> <h4 id="how-it-works">How it Works</h4> <p>Let’s say you register a new account with XYZ Bank. They’re an iSEC customer who wisely uses our Smart Password Evaluation Service. When you enter your desired password into the XYZ Bank application, their web server makes a backend request to our service. This request includes all of your registration information and your attempted password in plaintext. (Note that this backend request takes place over leased lines. This escapes the dangers of crossing Internet infrastructure and allows us to maintain the fastest service possible by securely omitting encryption.)</p> <p><img src="../../../../../images/2014-04-01-flow-diagram.png" alt="Design Diagram" /></p> <p>iSEC’s trained specialists then evaluate the password and determine whether it meets the length and complexity requirements of XYZ Bank. We also use our human intelligence to look for weaknesses that a computer could never determine, such as:</p> <ul> <li>Is your password derived from your personal information?</li> <li>Is your password some obfuscated form of the word “password” that a computer cannot detect (e.g. “p4ssW0rd”)</li> <li>Does your password contain the letter “z”? (All passwords should contain one or more “z” because it’s always the last character that hackers attempt in brute force attacks.)</li> </ul> <h4 id="examples">Examples</h4> <p>Let’s take a look at some real life examples, taken from customers in our pilot program.</p> <h5 id="financial-services-application">Financial Services Application</h5> <p>Our first example comes to us from one of our financial services customers. Accounts on this site control millions of dollars worth of assets, so the security of these accounts is paramount. No one other than the end user should <strong>ever</strong> have access to the user’s personal details, especially not their password, so it’s critical that we evaluate the password thoroughly.</p> <p><img src="../../../../../images/2014-04-01-example1.png" alt="Example 1 - Weak Password" /></p> <p>The user’s password here demonstrates a very common password weakness: it is largely based on the customer’s personal information. If the attacker compromised the full user database (which is quite common in large data breaches), they could combine dictionary words with the user’s personal information to discover the password.</p> <p>In this case, the user’s password is simply the word “Go” followed by their favorite sports team and year of birth. iSEC’s analyst therefore rejected this password as <strong>weak</strong> and the user was required to select a new, stronger password.</p> <h5 id="message-board-application">Message Board Application</h5> <p>We want to protect all the Internet’s users, not just those of large financial services clients. There are many smaller sites in our pilot program as well. Our next example comes to us from a customer who runs a free message board where users can discuss young adult fiction:</p> <p><img src="../../../../../images/2014-04-01-example-2.png" alt="Example 2 - Strong Password" /></p> <p>This site collects fewer personal details during registration so our analysts have less to work with. What we can see is that the English word “Team” appears in the password, which is bad. However, the remainder of the password are 12 random, nonsense characters that no attacker could guess, so we mark the password as <strong>very</strong> <strong>strong</strong>.</p> <h4 id="scaling">Scaling</h4> <p>We expect that very soon, every major web site on the Internet will use iSEC Smart Password Evaluation Service to solve their password woes. How do we scale our solution to address millions of requests per second? After all, each request requires manual interaction from a trained specialist.</p> <p>Well, like most difficult problems in security, the answer is: the cloud.</p> <p>Specifically <a href="http://aws.amazon.com/mturk/">Amazon’s Mechanical Turk</a> service. For those not familiar, Amazon’s Mechanical Turk allows companies to hire temporary workers for “micro-tasks”: short jobs that can be completed within a few minutes.</p> <p>Of course, evaluating passwords is very sensitive, skilled work so we can’t allow any anonymous user on the Internet to do it. Before any Mechanical Turk worker can begin evaluating passwords, they must complete a rigorous examination that challenges their security acumen as well as their personal integrity.</p> <p><img src="../../../../../images/2014-04-01-qualification-test.png" alt="Analyst Qualification Test" /></p> <p>We’re only a few months into our pilot program, but we have already found <em>thousands</em> of Mechanical Turk workers who are extremely enthusiastic about their work. Every day they tell us, “Please send us more passwords!” At first we worried that our workers would shy away from the responsibility of evaluating passwords for high value accounts such as banks or stock exchanges, but those types of accounts are proving to be our most popular. Some of our workers have even offered to pay <em>us</em> for the opportunity to protect these accounts! Talk about passionate employees!</p> <h3 id="conclusion">Conclusion</h3> <p>After software developers and security professionals have spent decades of struggling to get password authentication right, iSEC is very proud to have solved passwords once and for all.</p> <p>We will be expanding our Smart Password Evaluation Service pilot program very soon. If you run a web site and are interested in joining the next wave of our pilot program, stay tuned to this blog over the next few weeks for instructions on how to start using our service on your site.</p> <p><strong>Note: This post was written as an April Fool’s Day joke; we will (fortunately) not be offering this service. We hope you enjoyed this bit of humor about the current challenges in the security industry.</strong></p> Tue, 01 Apr 2014 06:00:00 +0000 https://isecpartners.github.io//passwords/2014/04/01/smart-password-evaluator.html https://isecpartners.github.io//passwords/2014/04/01/smart-password-evaluator.html Cryptopocalypse Reference Paper <p>Alex Stamos, Tom Ritter and Javed Samuel presented “Preparing for the Cryptopocalypse” at Black Hat 2013, looking into the latest breakthroughs in the academic cryptography community. The original presentation can be downloaded <a href="https://github.com/iSECPartners/publications/blob/master/presentations/ritter_samuel_stamos_bh_2013_cryptopocalypse.pdf?raw=true">here</a>.</p> <p>Today we’re releasing a full whitepaper that provides additional detail and extensive references which will explain the latest breakthroughs in the academic cryptography community and look ahead at what practical issues could arise for popular cryptosystems. Specifically, it focuses on the recent major developments in discrete mathematics and their potential ability to undermine our trust in the most basic asymmetric primitives, including RSA.</p> <p>It explain the basic theories behind RSA and the state-of-the-art in large numbering factoring, and how several recent papers may point the way to massive improvements in this area. It also describes some of the mathematics of Elliptic Curve Cryptography (ECC).</p> <p>The paper then switches to the practical aspects of the doomsday scenario, and will answer the question “What happens the day after RSA is broken?” It will point out the many obvious and hidden uses of RSA and related algorithms and outline how software engineers and security teams can operate in a post-RSA world. We will also discuss the results of our survey of popular products and software, and point out the ways in which individuals can prepare for the “zombie cryptopocalypse”.</p> <p>The paper provides a detailed list of references to the latest academic papers related to asymmetric cryptography. In addition, references that discuss the current level of ECC support in various popular products and software are included.</p> <p>The paper can be downloaded <a href="https://github.com/iSECPartners/publications/blob/master/whitepapers/Cryptopocalypse_Reference_Paper.pdf?raw=true">here</a>.</p> Thu, 20 Mar 2014 04:35:05 +0000 https://isecpartners.github.io//blackhat/crypto/2014/03/20/cryptopocalypse-reference-paper.html https://isecpartners.github.io//blackhat/crypto/2014/03/20/cryptopocalypse-reference-paper.html AWS environment security assessment with Scout2 <p>Security engineers at iSEC Partners are regularly involved in projects that require assessing the security of an Amazon Web Services (AWS) environment. Thoroughly reviewing AWS configuration requires poring through dozens to hundreds of pages in the AWS console, depending on the environment’s size. In 2012, iSEC Partners released AWS Scout to help AWS administrators assess their environment’s security posture. Unfortunately, APIs have changed since then, and the tool wasn’t written in a particularly maintainable fashion.</p> <h3 id="aws-scout2">AWS Scout2</h3> <p>iSEC Partners developed a new, more comprehensive, version of AWS Scout in order to address its need for an AWS configuration review tool. AWS Scout2 is an open-source application written in Python that connects to the AWS API and downloads configuration data for the following AWS services:</p> <ul> <li>Identity and Access Management (IAM)</li> <li>Elastic Compute Cloud (EC2)</li> <li>Simple Storage Service (S3)</li> </ul> <p>The information gathered is then rendered in an offline HTML report. In addition to AWS configuration, this HTML report displays a number of security risks.</p> <h3 id="project-page">Project page</h3> <p>iSEC Partners is pleased to release AWS Scout2 to the security community. See the Github repository page for full details on how to download and use the tool:</p> <p><a href="https://github.com/iSECPartners/Scout2">https://github.com/iSECPartners/Scout2</a></p> Wed, 19 Feb 2014 07:51:00 +0000 https://isecpartners.github.io//tools/aws/2014/02/19/aws-scout.html https://isecpartners.github.io//tools/aws/2014/02/19/aws-scout.html iOS certificate pinning code updated for iOS 7 <p>We’ve updated the iOS certificate pinning code which is part of iSEC’s <a href="https://github.com/iSECPartners/ssl-conservatory/tree/master/ios">SSL Conservatory</a> project on Github. This new version brings the following changes:</p> <ul> <li>The Xcode project was re-created as a static library (instead of an iOS App) to facilitate integration. Sample code demonstrating how to use the library has been moved the project’s unit tests.</li> <li>A new convenience delegate class for <em>NSURLSession</em>, the HTTP connection framework introduced in iOS 7, was added to the project. Similarly to the existing convenience class for <em>NSURLConnection</em> this class makes it easy to add certificate pinning to connections relying on <em>NSURLSession</em>.</li> </ul> <h3 id="project-page">Project page</h3> <p>Code and instructions are available on the project’s <a href="https://github.com/iSECPartners/ssl-conservatory/tree/master/ios">Github page</a>.</p> Sat, 01 Feb 2014 07:51:00 +0000 https://isecpartners.github.io//tools/ios/ssl/2014/02/01/ios-pinning-updated.html https://isecpartners.github.io//tools/ios/ssl/2014/02/01/ios-pinning-updated.html Announcing the Release of RtspFuzzer <p>iSEC Partners is pleased to announce the release of RtspFuzzer, an open-source fuzzer for the real-time streaming protocol (RTSP). RTSP is a text-based protocol that facilitates media streaming. We have been developing this fuzzer over the past several months as we fuzz different media players. Though this protocol doesn’t receive much attention, most popular media players implement it and these implementations have previously been a source of critical security vulnerabilities (including <a href="http://cvedetails.com/cve/2007-6166">QuickTime</a> and <a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3225">Windows Media Player</a>).</p> <p>Using RtspFuzzer, we <a href="https://isecpartners.github.io/fuzzing/vulnerabilities/2013/12/30/vlc-vulnerability.html">uncovered a new, critical vulnerability</a> in the Live555 library, an open-source implementation of the RTSP protocol that several media players and servers use, including VLC. The vulnerability allowed an attacker to gain remote code execution on a victim’s system if they could induce a VLC user to visit a malicious web page or open a malicious playlist file.</p> <h3 id="using-rtspfuzzer">Using RtspFuzzer</h3> <p>See the Github repository page to download the tool and for quick start instructions:</p> <p><a href="https://github.com/iSECPartners/RtspFuzzer">https://github.com/iSECPartners/RtspFuzzer</a></p> <p>We created the fuzzer using the <a href="http://www.peachfuzzer.com">Peach fuzzing framework</a>. RtspFuzzer has built-in configurations for Windows binaries of QuickTime, VLC, and openRTSP, but users can easily adjust the configuration and use this fuzzer to test any RTSP client on any Peach-compatible platform.</p> <h3 id="advice-for-developing-fuzzers-with-peach">Advice for developing fuzzers with Peach</h3> <p>Creating RtspFuzzer was a great way to learn to use Peach. Peach is a very powerful framework for fuzzing, but many people shy away from it and instead create one-off fuzzers because they perceive Peach’s learning curve as too steep. Peach does indeed take some time to learn, but it does also save you from rolling your own implementation of a lot of things that Peach does for you, such as integrating with debuggers, mutating your data to match common attack patterns, or logging results in an organized way.</p> <p>I would like to see Peach succeed because, despite its current problems, Peach makes it easy to write fuzzers that others can reuse and adapt. As more people use Peach, more information about its use will be available and this will reduce the learning curve. The Peach development team is <a href="http://forums.peachfuzzer.com/forumdisplay.php?2-Peach-3-Beta">very responsive</a>, and as the user base increases, more people will be able to report bugs and feature suggestions. If you’re thinking of writing a fuzzer with Peach, keep the following tips in mind:</p> <ul> <li><strong>Treat your Peach pit like a regular program.</strong> Keep it under source control and use bug tracking to maintain a list of issues in your fuzzer. Debugging your fuzzer will be a <em>lot</em> easier if you can revert to a known good state.</li> <li><strong>Expect bugs in Peach.</strong> While Peach has existed since 2004, the latest 3.x version is a complete rewrite of the product in .NET and was first released in May, 2013. Peach works well for the most part, but there are definitely some rough edges, especially as your pits get more complex. You need to account for this in planning if you’re building your fuzzer on a schedule. I recommend building Peach from source so that if you suspect you’ve run into a bug in the framework itself, you can debug it more easily.</li> <li><strong>Fuzz early and fuzz often.</strong> When I started working on the RTSP fuzzer, my first task was to define the RTSP protocol as precisely as I could in Peach. What I <em>wish</em> I had done first was build a mostly dumb fuzzer that spoke just enough RTSP to do basic fuzzing of a test application such as VLC, then build up from there. Seeing how Peach works and how it interprets the data in pit files is immensely helpful in designing your fuzzer. Look at the kind of data that Peach generates and see if anything is causing iterations to run slowly or to stop.</li> </ul> Tue, 07 Jan 2014 12:13:00 +0000 https://isecpartners.github.io//tools/fuzzing/2014/01/07/rtsp-fuzzer.html https://isecpartners.github.io//tools/fuzzing/2014/01/07/rtsp-fuzzer.html iOS 7 tool updates <p>With the availability of the evasi0n7 jailbreak and the subsequent release two days ago of <a href="http://www.cydiasubstrate.com/">Cydia Substrate</a> with support for iOS 7 and ARM64, a full-blown iOS 7 penetration testing environment can now be setup. To this extent, we’ve updated our <a href="https://github.com/iSECPartners/">publicly available</a> iOS tools for blackbox testing in order to add support for iOS 7 and ARM64. We just released the two following updates:</p> <ul> <li><a href="https://github.com/iSECPartners/ios-ssl-kill-switch/releases">iOS SSL Kill Switch v0.5</a>, our tool to disable SSL certificate verification/pinning.</li> <li><a href="https://github.com/iSECPartners/Introspy-iOS/releases">Introspy-iOS v0.4</a>, our iOS Apps security profiler.</li> </ul> <p>The pre-compiled packages for these tools now contain both an armv7 and an arm64 slice, which means that they will work on 64 bits iOS Apps for devices with an A7 chip (such as the iPhone 5s and the iPad Air).</p> <p>Both tools were successfully tested on an iPhone 5s running iOS 7.0.4:</p> <center> ![screenshot](/images/introspy-ios7.png) </center> <h3 id="sandbox-changes-in-ios-7">Sandbox changes in iOS 7</h3> <p>While testing Introspy-iOS on iOS 7, I ran into issues with the <em>sandboxd</em> daemon denying write access to specific files the tool was trying to create. Interestingly enough, it seems like the Seatbelt profiles deployed on iOS 7 have been updated, compared to iOS 6. Specifically:</p> <ul> <li>AppStore Apps can no longer write to the root folder of their container directory, for example <em>/var/mobile/Applications/3152B928-D771-424C-AE39-F79EC4A79EC5/</em></li> <li>System Apps can no longer write to <em>/var/mobile/</em></li> </ul> <p>Because of these changes, I had to modify the locations where Introspy-iOS stores its files, to the following paths:</p> <ul> <li><em>[App Container]/Library/</em> for AppStore Apps.</li> <li><em>/var/mobile/Library/Preferences/</em> for System Apps.</li> </ul> <p>It is unclear why the Seatbelt profiles were changed, although the ability to write to these locations was not actually needed by Apps. More information regarding the Seatbelt profiles used for various iOS Apps is available on the <a href="http://iphonedevwiki.net/index.php/Seatbelt">iphonedev wiki</a>.</p> Thu, 02 Jan 2014 13:44:00 +0000 https://isecpartners.github.io//ios/introspy/tools/2014/01/02/ios7-tool-update.html https://isecpartners.github.io//ios/introspy/tools/2014/01/02/ios7-tool-update.html