<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by John Kearney on Medium]]></title>
        <description><![CDATA[Stories by John Kearney on Medium]]></description>
        <link>https://medium.com/@JK1440?source=rss-7021cf190602------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*8zqg-pRgKDQ9NG4q.jpg</url>
            <title>Stories by John Kearney on Medium</title>
            <link>https://medium.com/@JK1440?source=rss-7021cf190602------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 03:45:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@JK1440/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Improving your passwords]]></title>
            <link>https://medium.com/tradecraft/improving-your-passwords-65270dd877b?source=rss-7021cf190602------2</link>
            <guid isPermaLink="false">https://medium.com/p/65270dd877b</guid>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[password-management]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[John Kearney]]></dc:creator>
            <pubDate>Tue, 05 May 2020 11:30:57 GMT</pubDate>
            <atom:updated>2020-05-05T11:30:57.543Z</atom:updated>
            <content:encoded><![CDATA[<h4>Forming a strategy to tackle the problem of weak passwords</h4><p>Improving password quality across your team or business is a challenging job. It’s also one of the most effective things you can do to become more secure. In this post, we’ll explain what we think are the most important steps to help you get this work underway.</p><h3>What to do, and what not to do</h3><figure><img alt="A list of spoof rules for setting passwords" src="https://cdn-images-1.medium.com/max/1024/1*JnD6g6EWRvjB4unQST5RUw.jpeg" /><figcaption>“<a href="https://www.flickr.com/photos/40488338@N03/17132553601">How to choose a password</a>” by Ned Potter, licensed under <a href="https://creativecommons.org/licenses/by/2.0/">CC BY 2.0</a></figcaption></figure><p>The ultimate goal of improving passwords is to ensure that every person who logs into an account is the person intended to use it. Helping users make better decisions when setting passwords is a massive step towards achieving this goal.</p><p>Often, and unfortunately, this work begins with draconian password requirements and policies being passed down from people in authority. But telling people with weak passwords that they have made bad decisions is not a good tactic. The people these policies are designed to influence are the ones most likely to be put off by them. It is far better to give them the right guidance and tools so that they can make good decisions.</p><p>No one likes being bossed around, and most people do want to do the right thing, so equipping them to help them to do that is an important piece of the puzzle.</p><h3>Softly, softly, catch the monkey</h3><p>There are some concrete, technical controls that you can implement to help improve password quality, and we’ll talk about those in a moment. It’s also important to consider how to motivate people to behave in more secure ways. Or, in other words, to develop a more positive security culture.</p><h4>Make it easy to do the right thing</h4><p>Using strong, unique, unpredictable passwords for every account is a pain. Respond to this by making it easy to do the right thing: perhaps by rolling out password managers, or implementing passwordless approaches.</p><h4>Help people understand</h4><p>Communicate with your teams about security little and often, and tell them stories about breaches that have been caused by bad passwords. Make sure they are regularly exposed to information about security, so that it’s always a current issue for them. If someone understands the impact of bad passwords they are more likely to choose good ones.</p><h4>Don’t get in your own way</h4><p>If you have tools or policies that force people to do the wrong thing (such as complexity requirements or regular password changes) change them proactively, so that you’re not contradicting yourself. Mixed messages and the sniff of hypocrisy will snuff out even the most well-intentioned effort to make change.</p><p>Next, we’ll talk more about some technical changes you can make.</p><h3>For staff accounts</h3><p>Here are some steps you can take to improve password use by your staff. We’ve put the ones we think are most important first, based on our experience. Your priorities may vary, of course; however, the more of these you can complete, the better your account security will be:</p><ol><li>Set a minimum password length of 12 characters</li><li>Ban any password containing the word “password” or the name of your company</li><li>Begin enabling two-factor authentication (2FA) for all staff accounts, starting with those with the highest level of access to sensitive data and powerful functionality</li><li>Set an account lockout policy, locking staff out after a set number of failed login attempts (between 5 and 10)</li><li>Acquire and deploy a password management application for all employees</li><li>Run a password cracking tool against your hashed passwords to identify existing weak passwords</li></ol><h3>For user accounts</h3><p>If you have a service that members of the public can create accounts for, you also need to think about their passwords. This is potentially harder to control, so the steps are different. Again, these are in our recommended order of priority, and you might want to roll out some of these for staff accounts too!</p><ol><li>Set a minimum password length of 12 characters</li><li>Ban any password containing “password”, the name of your company (and any sub-brand), and your web domain name</li><li>Ban any password found in the 10,000 most common passwords</li><li>Set an account lockout policy, locking users out after a set number of failed attempts (between 5 and 10)</li><li>Integrate the <a href="https://haveibeenpwned.com/API/v3">HaveIBeenPwned API</a> with your login/registration mechanisms to prevent users setting passwords found in public data breaches</li><li>On the login page, rename the “Password” field, “Passphrase”, and provide a link to a help page that explains passphrases</li><li>Examine your registration page, and ban passwords containing words or phrases that can be derived from it</li><li>Finally, add a feature that shows the user guidance on creating a good passphrase after they attempt to set a blocked password</li></ol><h3>And do not…</h3><p>Finally, please do not do any of the following when setting up your password policy:</p><ul><li>Do not make your staff or your users reset their passwords on a regular basis. Studies have shown, and our simulations have demonstrated to us, that regular password rotation only encourages users to use predictable patterns for passwords</li><li>Other than setting a minimum length, do not set password complexity rules. A password cracking tool doesn’t care how many special characters, numbers, or capital letters are in your password; the only thing that hinders it is password length</li><li>On that subject, do not set a maximum length for passwords. If a user can remember a 24-character passphrase, then there’s no good reason to prevent them using one</li><li>Do not ban any characters. Some users may want to use special characters, and they should be able to do so. Anything that makes it easier for users to create memorable passwords is a good thing</li></ul><p>All of these measures have been ubiquitous for many years, but they have all been shown — objectively, mathematically and repeatedly — to make passwords worse.</p><h3>Support your users</h3><p>Weak passwords are not solved by blaming or punishing the people who created them. They happen when password creators are not given the support they need. To encourage the correct behaviour, you need to provide training in good behaviours, user-centred help content, and the right tools for the job.</p><p>We recognise that not all of the steps we recommend are easy to take. They can present significant technological, communication, and cultural challenges. We have extensive experience in helping clients of our <a href="https://www.wearetradecraft.com/services/">adversary simulation service</a> improve their passwords. If you’d like to <a href="/service/mailto:hello@wearetradecraft.com">get in touch</a>, we’d be happy to have an obligation-free conversation with you about how we can help.</p><h3>Further reading</h3><p>This is a follow-up piece to our post <a href="https://medium.com/tradecraft/why-we-know-your-password-and-what-you-can-do-about-it-4997725b0aa?source=friends_link&amp;sk=489aebd59179eb753c61661bc1151764">Why we know your password, and what you can do about it</a>, in which we talk more about how bad passwords arise and what form they take.</p><p>The NCSC has some excellent guidance on passwords, including:</p><ul><li>The <a href="https://www.ncsc.gov.uk/collection/passwords">Password administration for system owners</a> collection</li><li><a href="https://www.ncsc.gov.uk/collection/top-tips-for-staying-secure-online/password-managers">Password managers: how they help you secure passwords</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65270dd877b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tradecraft/improving-your-passwords-65270dd877b">Improving your passwords</a> was originally published in <a href="https://medium.com/tradecraft">Tradecraft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Know what you have]]></title>
            <link>https://medium.com/tradecraft/know-what-you-have-9d24792ab936?source=rss-7021cf190602------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d24792ab936</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[asset-management]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[John Kearney]]></dc:creator>
            <pubDate>Tue, 28 Apr 2020 13:27:46 GMT</pubDate>
            <atom:updated>2020-04-28T13:27:46.307Z</atom:updated>
            <content:encoded><![CDATA[<p>The first step towards being more secure</p><figure><img alt="An old computer with 3.5 inch floppy disks and a disk drive" src="https://cdn-images-1.medium.com/max/1024/1*k_ZBX8RMLriyT4yFY1Akcg.jpeg" /><figcaption>Image by <a href="https://www.flickr.com/people/blakespot/">Blake Patterson</a></figcaption></figure><p>To protect what you have, you need to know what you have. The security decisions you make involve judgements and trade-offs around the risks that affect your assets. If you don’t know what assets you have, those judgements may not be right, and there’ll be a chunk of risk that you’re not thinking about. And those risks, if you knew about them, might have changed your decisions about the assets you do know about.</p><p>Lost and forgotten assets are a real problem, and are the cause of many publicly-known breaches. A widely reported one was the <a href="https://www.ispreview.co.uk/index.php/2016/10/uk-isp-talktalk-hit-huge-400000-fine-personal-data-breach.html">TalkTalk data breach</a> in 2015. The attackers accessed data through three vulnerable web pages in infrastructure that TalkTalk had become responsible for when it acquired Tiscali. Following the acquisition, TalkTalk didn’t become aware of these assets, so they quickly became out of date and vulnerable.</p><h3>The usefulness of asset lists</h3><p>Building a list of your assets is an important step towards being more secure, and having such a list is useful for more than just security. It’s a really important piece of corporate hygiene. Among other things, it can help you keep track of the third-party services you’re subscribed to, so that you don’t end up with five different development teams all subscribed to different cloud storage solutions for their code repositories. It’ll save you money: you can’t say that about many security controls!</p><p>But an asset list is not a fixed deliverable. It’s something to grow and maintain over time, not something that you create and finish with one big burst of effort. Begin by allocating a little time to create a simple skeleton list to start populating, and then tend to it for a few months, adding things and improving the structure as you go. See if you can create an initial list using the same amount of time you’re able to prioritise for ongoing maintenance, so that you can be confident you’ll have the time to keep it up to date.</p><p>As you make progress, you might find it hard to decide what to think of as assets, to categorise them intuitively, and to record the right amount of the right information about them.</p><h3>What is an asset?</h3><p>As a general rule, if something is an identifiable thing that you care about and want to be able to do things with, then it’s an asset.</p><p>At Tradecraft, we’ve adopted this loose definition deliberately, because as soon as you start looking for assets, the more assets you will see. For example, let’s say you start with a business application or customer-facing service. That’s definitely an asset. However, this application consists of numerous hosts, such as web and database servers, and these are all assets in their own right. Each server has numerous pieces of software on it. Each piece of software has libraries and components it depends on, and they in turn depend on other components.</p><p>All of these can be classified as assets, so you can see how complex an exercise this can become. And that’s just thinking about the software: hardware assets add another level of complexity, as do suppliers, offices, and the people who work from them. All of these assets might fit into different categories depending on the problem you’re thinking about at the time.</p><p>Our experience is that any attempt to organise all of them into rigid, non-overlapping categories will make the work so complicated — and the categories so small — that it’s unlikely to end up being useful.</p><p>When we think about assets, we believe that the main and most important thing is to have an asset list around which you can make sensible decisions. Sometimes the list can get long, so it’s helpful to have some categories — but only to the extent that it makes the list more usable.</p><p>We’ve iterated our way to a small set of categories that we use in our work:</p><ul><li>Services and their components</li><li>Wired and wireless networks</li><li>Software as a service (SaaS) suppliers and on-premise managed services</li><li>End user devices, such as laptops and mobile phones</li><li>Physical premises, such as office locations, warehouses, and so on</li></ul><p>These may not be right for everyone, and sometimes we have to adapt them to suit our clients, but they work for us as a starting point. For each asset, we capture a description and a unique identifier. As applicable, we also capture URLs, and IP addresses and ranges. We don’t need to record information about individual asset ownership, but you might want to.</p><h3>Designing your list and beginning to populate it</h3><p>When you begin the work, don’t forget that this is something that you’ll chip away at over time, and that you’ll need help. Host the asset list in a place where it can be shared with all contributors easily. It shouldn’t be a single spreadsheet sitting on someone’s computer.</p><p>Think about what you want to do with the list. For example:</p><ul><li>Do you want to share it with a supplier or partner to demonstrate compliance, or with a security consultant so they can better understand what you need to protect?</li><li>Are you going to use it to find out who is responsible for an asset?</li><li>Will you feed it into automated scanning tools, which you can use to check applications for vulnerabilities?</li><li>Do you want to use it to check for vulnerabilities in dependencies, or vulnerability announcements by third-party providers?</li></ul><p>Putting thought into these and other questions makes it easier to use the list to do these things further down the line.</p><p>The uses that you’ll put this list to should dictate the information that you keep about each asset, as well as the way you keep it. For example, if you want to feed this list into scanning and compliance tools, you’ll need to capture things like URLs and IP addresses for those scanners to check. If you want to use it to triage incidents and assign an appropriate asset owner, you’ll need to make sure that each asset has ownership information, and a process to make sure it stays up to date when people leave or change roles.</p><p>As with all security work, it’s best to start small and take it in small chunks. Pick the top two or three uses you’ll put the list to, and design with those in mind. As you work the problem through, make sure you have a clear understanding of who in your teams will be involved and at what stages, and involve them in your work. A little user-centred design at an early stage will make the list much more useful, and as such, much more used.</p><h3>Conclusion</h3><p>Creating an asset list is conceptually simple, but it can often become complicated and hard to maintain in practice. It’s important to remember that most of the value comes from the follow-up effort you put into the work to maintain it. Rather than rushing to get it done, set a sustainable pace and organise the work accordingly. Think about who will work on the list, and what time they will allocate: a day a month? An hour a week?</p><p>Only design something that you can reasonably maintain with the resources you have, and if necessary, talk with an expert. We have lots of experience in finding lost assets when we work with clients to help them become more secure. Do <a href="/service/mailto:hello@wearetradecraft.com">get in touch</a> for a no-obligation chat if you’d like to talk this through some more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d24792ab936" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tradecraft/know-what-you-have-9d24792ab936">Know what you have</a> was originally published in <a href="https://medium.com/tradecraft">Tradecraft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sensitive data exposure]]></title>
            <link>https://medium.com/tradecraft/sensitive-data-exposure-b48057bb0807?source=rss-7021cf190602------2</link>
            <guid isPermaLink="false">https://medium.com/p/b48057bb0807</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[adversary-simulation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[sensitive-data]]></category>
            <category><![CDATA[owasp-top-10]]></category>
            <dc:creator><![CDATA[John Kearney]]></dc:creator>
            <pubDate>Tue, 24 Mar 2020 14:20:05 GMT</pubDate>
            <atom:updated>2020-04-01T13:52:26.708Z</atom:updated>
            <content:encoded><![CDATA[<p>When confidential information is just sitting there…</p><figure><img alt="View of hands removing a paper file from a box of files" src="https://cdn-images-1.medium.com/max/1023/1*atEYALOPa9bjJUxq_4dBEA.jpeg" /><figcaption><a href="https://www.flickr.com/photos/152864051@N02/36478098435">”Removing Paper Files From Box”</a> by <a href="https://www.flickr.com/photos/152864051@N02">Whitefields Document Storage</a> is licensed under <a href="https://creativecommons.org/licenses/by/2.0/?ref=ccsearch&amp;atype=rich">CC BY 2.0</a></figcaption></figure><p>In our recent post on <a href="https://medium.com/tradecraft/broken-authentication-7d2b7e93e281?source=friends_link&amp;sk=06a4f86cf9599f69af13418faec998bd">Broken authentication</a>, we talked about attackers looking for the easiest route into an application or system. In our experience, it is often the least skilled attackers with time to kill who we find spend the most effort to discover this route.</p><p>As friendly attackers, we do exactly the same thing during our <a href="https://www.wearetradecraft.com/services/">adversary simulations</a>. We look for information about our client’s systems in the public domain. We also examine the applications, servers, web pages, and even the offices of our clients to discover what they reveal to the public.</p><p>Sometimes we — and attackers — discover sensitive information that is either publicly available or improperly secured; for example, confidential customer details in a public repository on the cloud, or passwords transmitted in clear text over a network. This is known as sensitive data exposure.</p><h3>Impact</h3><p>According to the <a href="https://www.owasp.org/images/7/72/OWASP_Top_10-2017_%28en%29.pdf.pdf">OWASP Top Ten list of web application vulnerabilities</a> from 2017, attacks that recover sensitive data have been “the most common impactful attack” in recent years. These impacts are many and varied, from individual user accounts and the data they hold being compromised, to high-profile <a href="https://en.wikipedia.org/wiki/List_of_data_breaches">public data breaches</a>, leading to serious impacts for the individuals concerned and the company responsible for securing the data.</p><p>So how can you prevent this sort of breach occurring in your web application?</p><h3>Know your data — what you have and where you have it</h3><p>Before you can secure your data, you need to understand it: how you gather it, where you keep it, and how you move it around. You also need to define what data is considered to be sensitive, which can be tricky even for small organisations, and incredibly challenging for large ones. When you do, you’ll need to remember the distinction between the broad types of sensitive data you have:</p><ul><li>data you collect, such as client personal or financial records</li><li>data that is used to access other data, such as usernames and passwords; and</li><li>information about your systems that might potentially be leveraged by an attacker, such as technical application user guides or software versions</li></ul><p>Coming to this understanding of your data should be something you work on permanently over time, not a short-term project or requirement. A small organisation working on a limited platform might be able to have a good idea of where and what its data is at a given point in time, but it doesn’t take a great deal of imagination to understand how dizzyingly complex it could be for even a modestly sized company to have complete knowledge. Rather, this is an ongoing effort that should inform the way you think about and treat your data.</p><p>Start with the straightforward things: user passwords, personal data, intellectual property, and client lists are a few examples of information that every organisation needs to protect.</p><p>Financial, medical, and other personal data about individuals is also considered sensitive, and not only by you and your business. You have to comply with the regulatory frameworks of the regions within which you operate, which contain standards for defining and managing sensitive data. Examples include the EU’s General Data Protection Regulation (GDPR) and the UK’s Financial Conduct Authority (FCA).</p><p>There’s also the data that you use to secure access to your data and systems, such as your private encryption keys and domain administrator passwords. Not only must these be appropriately stored and protected, they must also be sufficiently robust to withstand hacking attempts.</p><p>It can take remarkably few data points of seemingly minor sensitive examples of sensitive data to form part of a successful attack.</p><p>Some examples from our simulations include:</p><ul><li>A page on the corporate website that contained names and photos of all employees. The filenames of these photos contained the usernames of the people pictured. We took these usernames and used them in a successful password guessing attack against the company VPN.</li><li>An Amazon Web Service S3 bucket — a public cloud storage resource — that contained photos of passports, and didn’t require authentication</li><li>Universally unique identifiers — unique numbers used for identification purposes — being leaked from one part of an application, which when used to submit a request to another part of the same application, returned more sensitive data</li></ul><p>It’s always best practice to reveal as little information as possible, and to ensure that users of various types can only perform actions and access information that they explicitly require.</p><h3>Getting started</h3><p>Once you have understood the type of data you most need to protect and how it’s currently handled, you can begin to improve things.</p><p>This can be a lot of work, but whatever time you’re able to devote will help. Just by thinking about these problems and making small changes, you’ll be ahead of the pack.</p><p>Remember, good security is not a project, it’s ongoing iterative work to make things better. So break down your work on securing your data into small, manageable chunks.</p><p>As you look at each type of data, ask yourself the following questions:</p><ul><li>Where is it kept?</li><li>How is it protected?</li><li>Who can access it, and how?</li><li>How is it shared?</li><li>How is it audited?</li><li>How is it deleted?</li></ul><p>For example, if your customers’ personal and financial details are stored in a database, how is that database protected from just anyone accessing it? You need to ensure it has adequate protection, that access is authenticated and that only people with an explicit need to access it can do so. You also need to consider how the database records can be securely changed or deleted.</p><p>Moving data around is also an important consideration. If any sensitive data is transmitted in clear text, you need to think again about why that is, and who might be able to see it. For example, if sensitive data is moved around without encryption within your network, an attacker who gains access to part of your network might be able to gather that information by monitoring traffic. In our client work, we’ve sometimes seen sensitive personal data being emailed around in spreadsheets. In your organisation, would that be an acceptable risk?</p><p>You should also consider the mechanisms you use to protect the data, and whether they are fit for purpose. For example, how strong is your chosen encryption solution, and where are the private keys stored? Is the algorithm you use for encoding your passwords strong enough to make it difficult for an attacker to recover the passwords with a cracking tool? Some of these questions can be hard to answer. Security is a fast-moving field, and your decisions here need to keep pace with attacks as they evolve. It can be helpful to take specialist advice.</p><h3>Principles and practical steps</h3><p>Don’t be daunted. Securing your sensitive data isn’t an unmanageable problem if you stick to these key principles:</p><ul><li>Do your best to understand your data</li><li>Don’t collect data unless you need it</li><li>Don’t publish data unless there’s a good reason to do so</li><li>Delete data when you no longer need it</li></ul><p>Here’s what we think are the most important practical steps you can take to making your sensitive data more secure:</p><ul><li>Use encryption to protect your employees’ physical devices, such as mobiles and laptops</li><li>Ensure your application always defaults to the secure HTTP protocol (HTTPS), so any data transmitted between a user’s browser and your application is always encrypted</li><li>Use a robust algorithm configured with a good work factor to hash passwords, such as bcrypt, scrypt, or argon2. Store the hashes on a locked-down machine</li><li>Use proven, off-the-shelf encryption to protect data. Encryption is very hard to get right, so don’t try to do it yourselves</li></ul><p>It can be helpful to run workshops on particular questions, involving the key stakeholders and technical staff. For example:</p><ul><li>Look at your data storage and transmission mechanisms from an attacker’s perspective: where might an attacker look for such data, and what would happen if they found it?</li><li>What might happen if an attacker found a foothold in your network, through an <a href="https://medium.com/tradecraft/injection-attacks-explained-54bb6278dea0?source=friends_link&amp;sk=86566c518a0932c46d6e4cb3622557f2">injection attack</a> or other vulnerability. If they got hold of encrypted data or password hashes, how easy would it be for them to decrypt or decode them? How would you know it happened?</li><li>If an attacker logged into a standard user account that was configured with a <a href="https://medium.com/tradecraft/why-we-know-your-password-and-what-you-can-do-about-it-4997725b0aa?source=friends_link&amp;sk=489aebd59179eb753c61661bc1151764">weak password</a>, what could they see as that user? Would they be able to view unencrypted traffic moving across the network? Could they escalate their privileges? Could they use other vulnerabilities to build a route to sensitive data?</li></ul><p>Some of these questions — especially those about how an attacker might behave — can be difficult to answer. You can’t rely on a traditional risk-based approach alone, as it doesn’t form a realistic model of how an attacker behaves. Nor will a standard pentest reveal how vulnerabilities, misconfigured servers or unpatched software could be chained together to cause a breach.</p><p>In our adversary simulations we use the same techniques as criminal hackers and advanced persistent threats to realistically simulate, among other things, data breaches and theft of information.</p><p>If you’d like to have an obligation-free chat about how we can help you secure your sensitive data, <a href="http://hello@wearetradecraft.com/">get in touch</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b48057bb0807" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tradecraft/sensitive-data-exposure-b48057bb0807">Sensitive data exposure</a> was originally published in <a href="https://medium.com/tradecraft">Tradecraft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reviewing pull requests for security issues]]></title>
            <link>https://medium.com/tradecraft/reviewing-pull-requests-for-security-issues-c620f1671ca3?source=rss-7021cf190602------2</link>
            <guid isPermaLink="false">https://medium.com/p/c620f1671ca3</guid>
            <category><![CDATA[adversary-simulation]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[pull-request]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[John Kearney]]></dc:creator>
            <pubDate>Tue, 18 Feb 2020 08:50:44 GMT</pubDate>
            <atom:updated>2020-02-18T11:35:47.054Z</atom:updated>
            <content:encoded><![CDATA[<p>Why you should do it, and what you should look for</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*o5V86YhM3EpdCcrjBLiL3w.jpeg" /><figcaption><a href="https://commons.wikimedia.org/wiki/File:Digital_Background.jpg">“A blurred image of computer code”</a> by SmileEh is licensed under <a href="https://creativecommons.org/publicdomain/zero/1.0/deed.en">CC0 1.0 Universal</a></figcaption></figure><p>A standard tactic during our <a href="https://wearetradecraft.com/services/">adversary simulations</a> is to review the code base of the application or applications under test. It’s very common for us to find vulnerabilities in the code that could form part of a route an attacker could take to compromise the application. Examples include API endpoints that accept unauthenticated requests, hard-coded passwords, out-of-date software libraries, and insecure custom encryption.</p><p>Even when teams are running code reviews, these sorts of issues can slip through. One way to help catch them before they do is to create checklists for people to use during code review, and to think about how to keep them up to date based on what people learn by going through the process.</p><p>We’ve thought about this in the context of a team using pull or merge requests to manage a process where all code is reviewed before it is committed, but most of the ideas are applicable to any code review process.</p><h3>Key principles of code review</h3><p>There’s a lot of commentary on code reviews and pull requests out there, so rather than reiterate them, here’s what we believe are the most important principles for secure code reviews:</p><ul><li>Everyone’s code, without exception, should be reviewed before being merged. This includes features written by the most senior developer, or urgent patches applied to resolve a vulnerability. No review, no merge.</li><li>A clear and accessible set of principles for good coding should be shared and understood across all development teams.</li><li>Junior developers should be paired with senior developers, and empowered to make suggestions for improving and securing code. It’s a valuable part of their professional development.</li></ul><p>But what should you be looking for when you’re reviewing code? What are the key indicators of secure code, and what are the red flags that are signs of vulnerabilities?</p><h3>What does secure code look like?</h3><p>This is probably the most important question to ask when reviewing code, or when creating some coding principles. Thankfully, the answer will probably feel familiar, because the qualities that characterise good code in general work for secure code too:</p><ul><li><strong>Secure code is simple</strong>. Any member of your development team should be able to read and understand the code in any pull request, without the author sitting beside them and talking them through it. If the complexity of a change seems disproportionate to its functionality, that’s a bad sign.</li><li><strong>Secure code has a simple, flat structure</strong>. Code that is indented so heavily it looks like a sideways pyramid is a sign of increasing complexity, and the more complex code is, the more likely it is for errors and vulnerabilities to sneak in.</li><li><strong>Code comments should also be clear, concise and meaningful</strong>. It’s helpful for code to be well commented — and if it’s not, or if the comments don’t seem to make sense, it’s often a sign that the author didn’t have a clear mental model for the change they made.</li></ul><p>As is often the case, the things that improve quality generally also work for improving security: addressing the problems that make code hard to maintain, slow and prone to bugs will also make your code more secure.</p><p>So let’s assume that you are doing pull requests and are running code reviews. In terms of security, what tangible things should you look for during your reviews?</p><h3>Making code more secure</h3><p>So, what to look for? Here are some things to look for while reviewing, and things you can do to make your codebase more secure during design and development:</p><ul><li>Check for good application of the principle of least privilege. Any new or modified functionality in a pull request should only be accessible by the type of user who explicitly requires it. For example, it’s not enough to confirm that an admin API endpoint can be accessed by administrator users; you should also confirm that normal or unauthenticated users cannot.</li><li>Similarly, if a new type of user is created, or a new set of permissions to access new functionality, double check what these users or permission grant access to, and confirm that they cannot be subverted or accessed by unauthorised users.</li><li>Check that whitelists are used to control user-submitted values. Blacklists are not a good solution: they require you to anticipate every possible malicious value that can be submitted. In almost every real-world situation, this is impossible — so it’s best not to try!</li><li>Watch out for complex code structures, or red flag words in code comments, such as “complicated”, “magic”, or swear words (yes, we’ve seen them). These are a good indicator of complexity and potentially that the author doesn’t fully understand what the code does. We always home in on these areas when looking for vulnerabilities.</li><li>Confirm that failure states have been considered; that is, what happens if a failure state is triggered? Has a failure state been considered at all? If the code specifies a resource and assumes that it’s in a safe or valid state, what might happen if it is in an unsafe one?</li><li>Check that functions tidy up after themselves, and free up resources or delete things that are no longer required. For example, if a file upload is rejected because the format is wrong, is the file deleted or is it stored on the system anyway?</li><li>Code review is not just for your own code! You should code review your dependencies wherever possible before they are introduced into or referenced in your codebase.</li><li>Where libraries have been included, you should confirm that they are known up-to-date secure versions and not subject to any published vulnerabilities. Consider using automated monitoring so that you know if an update is released or a new vulnerability published.</li><li>Your application architecture should always be designed to ensure that one developer’s mistake cannot lead to a total breach. When reviewing, think about what might happen if a vulnerability does creep through: could it lead to a serious breach, or would some other vulnerability also need to exist for that to happen? If the former, give some thought to how you could address that: try to build defence in depth.</li><li>Don’t reinvent the wheel: if the functionality you need is provided by a standard, widely used library, use it. Avoid the temptation to write your own code to solve a problem because it feels quicker than learning to use a standard library. Something that’s already been put through its paces is less likely to be vulnerable.</li><li>Give some thought to how you might abuse the new feature if you were evil. Could your intended functionality be used by an attacker in some way that you don’t expect, and wouldn’t want?</li></ul><p>Finally, here are a few specific things that are often easy to spot in code:</p><ul><li>Hard-coded passwords, API keys or other secrets</li><li>Custom hashing or encryption algorithms. Encryption is incredibly hard to do well, and there are proven publicly available options that offer a high degree of security</li><li>Security options that are purposely switched off for use in development environments, such as a requirement for SSL. These often get deployed into production by mistake.</li><li>Input fields without validation, and outputs that do not escape characters which can be used in an injection attack</li><li><a href="https://owasp.org/www-community/vulnerabilities/Deserialization_of_untrusted_data">Deserialization attacks</a>: if you’re creating an object from structured data provided by a user, be careful. This can be done safely, but often isn’t.</li><li>File uploads: it’s surprisingly easy to make mistakes when handling file uploads. Can your code be tricked into writing a file into an unexpected place? Are you sure the file contains what you think it contains? Could an upload exhaust your disk space?</li><li>User input being passed to eval, system or other command execution calls</li></ul><h3>How we can help…</h3><p>You can use all the points above as a starter for getting your code review processes and principles tidied up and communicated with your team.</p><p>That said, it’s always useful to get an experienced third party to cast their eye over your codebase, especially one who can sit with your developers and help them learn what to look for.</p><p>Following our adversary simulations, and sometimes as general consulting work, we often send members of our hacking team to work with developers to review and harden code. If you’re interested, do <a href="/service/mailto:hello@wearetradecraft.com">get in touch</a>. We’re happy to have a no-obligation discussion about how you can start helping your team be more secure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c620f1671ca3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tradecraft/reviewing-pull-requests-for-security-issues-c620f1671ca3">Reviewing pull requests for security issues</a> was originally published in <a href="https://medium.com/tradecraft">Tradecraft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Broken authentication]]></title>
            <link>https://medium.com/tradecraft/broken-authentication-7d2b7e93e281?source=rss-7021cf190602------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d2b7e93e281</guid>
            <category><![CDATA[owasp-top-10]]></category>
            <category><![CDATA[web-applications]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cyber]]></category>
            <category><![CDATA[broken-authentication]]></category>
            <dc:creator><![CDATA[John Kearney]]></dc:creator>
            <pubDate>Wed, 13 Nov 2019 11:44:13 GMT</pubDate>
            <atom:updated>2020-01-30T16:20:45.500Z</atom:updated>
            <content:encoded><![CDATA[<h4>When an attacker logs into your web application</h4><figure><img alt="“Login Panel Design” by Tevrat Gündoğdu is licensed under CC BY-NC 4.0" src="https://cdn-images-1.medium.com/max/598/1*kOK-to02SfCYXvo3WT5cUw.png" /><figcaption><a href="https://www.behance.net/gallery/18037919/Login-Panel-Design"><em>“Login Panel Design”</em></a><em> by Tevrat Gündoğdu is licensed under </em><a href="https://creativecommons.org/licenses/by-nc/4.0/?ref=ccsearch&amp;atype=rich"><em>CC BY-NC 4.0</em></a></figcaption></figure><p>In our post <a href="https://medium.com/tradecraft/injection-attacks-explained-54bb6278dea0?source=friends_link&amp;sk=86566c518a0932c46d6e4cb3622557f2">Injection attacks explained</a>, we talked about how applications can be tricked into interpreting user-supplied data as an instruction to perform an operation.</p><p>However, attackers are always going to look for the easiest route in. If they can simply log straight into an application and exploit existing functionality to steal data or worse, then they won’t need to spend time searching for a critical vulnerability or trying to bypass your firewall.</p><h4>What does “broken authentication” mean?</h4><p>If the login functionality of your application can be subverted or bypassed in some way, this is referred to as broken authentication. This is such a common issue that broken authentication is an entry in the Open Web Application Security Project (OWASP) top ten web application vulnerabilities list.</p><p>The things that lead to authentication mechanisms breaking or being bypassed range from simple to highly technical. However, these vulnerabilities are preventable with good practice and by incorporating security thinking into your design processes.</p><h4>Types of broken authentication</h4><p>There are many ways authentication can be bypassed.</p><p>Firstly, OWASP defines authentication as “broken” if it doesn’t take basic steps to prevent the use of poor passwords or brute-force hacking attempts. Empowering your users to manage their passwords effectively is a vital part of building a good security culture. For more on this, see our blog post <a href="https://medium.com/tradecraft/why-we-know-your-password-and-what-you-can-do-about-it-4997725b0aa?source=friends_link&amp;sk=489aebd59179eb753c61661bc1151764">How we know your password, and what you can do about it</a>.</p><p>Brute-force password guessing attacks can sometimes succeed even when weak passwords are uncommon in your application. Such attacks use lists passwords and username/password combinations gleaned from data breaches. Readily available tools can be used to try thousands of username/password combinations automatically.</p><p>Sometimes, systems contain design flaws that allow someone to create an account without going through the normal channels. To take examples from our work:</p><ul><li>Account invitation codes in the HTML of the login page, which allowed us to create a highly privileged account</li><li>An application with a well-implemented username/password based login, but some incorrect logic that gave us access to confidential pages even when a login attempt was unsuccessful</li><li>Multiple authentication methods, one of which is vulnerable to attack even though the others are not</li><li>Login credentials transmitted over unencrypted connections, which can then be captured by an attacker</li><li>Failure to log users out correctly, leaving their sessions active and vulnerable to being taken over</li></ul><h4>How do these issues arise?</h4><p>At the root of most broken authentication issues is a problem with the design or the management of functionality of the application.</p><p>When building your application, it is extremely important to pay attention to what functionality should be accessible to the different types of users you have — authenticated or otherwise. For example, blogging applications often allow people to read posts and even leave anonymous comments without logging in. Also, any application that requires users to log in must offer login functionality and account recovery to unauthenticated users.</p><p>In our experience, decisions about what features require authorisation often go awry, or are somehow unclear to the development team. This often happens when there’s no consistent mechanism to force some features to be authenticated but not others, leaving each developer on a team to make their own decisions about how authentication should be implemented.</p><p>As for functionality management, we often find legacy or debug functionality can offer an attacker a way in. For example, an old or temporary feature built outside authentication and so accessible to all, albeit via a complicated URL. Attackers are good at finding that sort of thing!</p><p>It’s also important to be aware of the other things that your application talks to. Even when you have great authentication mechanisms applied consistently, it’s easy to be let down by other parts of your stack, such as source code repositories or backups. Any component that contains keys to your kingdom must be secured with authentication at least as good as that used by your application.</p><h4>What can you do?</h4><p>Incorporating security thinking into your development and application configuration processes is key. But what does this mean in practice?</p><p>There are five key things you can do to protect your application from this type of attack:</p><ul><li>Ensure your passwords are stored in encoded form (we recommend the bcrypt, scrypt or Argon2 hashing algorithms)</li><li>Improve password use across your organisation: see our <a href="https://medium.com/tradecraft/why-we-know-your-password-and-what-you-can-do-about-it-4997725b0aa?source=friends_link&amp;sk=489aebd59179eb753c61661bc1151764">password blog piece</a> for more advice</li><li>Ensure all login points are protected from brute-force attacks, by limiting the number of failed login attempts that can be made within a short period of time</li><li>Use multi-factor authentication! This is where users can be required to provide more than one identifying piece of information in order to log in; for example, a username, password, and a code from a <a href="https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm">time-based one-time password</a> application like Google Authenticator</li><li>Avoid designing your own authentication. There are widely used libraries and third-party services that will probably offer more robust authentication than something developed in-house</li></ul><p>Already doing that? Then consider the following:</p><ul><li>Make sure you understand the user profiles in your application and that you make consistent decisions about which profiles should be able to access which things</li><li>Only provide one login point for users. The more entry points your application has, the harder it is to secure</li><li>Make sure all data is stored securely, in such a way that only those users who are explicitly permitted to access it can do so</li><li>When allocating user permissions, ensure that administrator-level permissions are only given to users who explicitly require them</li><li>Use the <a href="https://haveibeenpwned.com/API/v3">Have I Been Pwned (HIBP) API</a> to identify and reject any submitted username/password combinations that have been identified in data breaches, and any commonly found passwords in such breaches</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d2b7e93e281" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tradecraft/broken-authentication-7d2b7e93e281">Broken authentication</a> was originally published in <a href="https://medium.com/tradecraft">Tradecraft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How we breached a corporate network via Citrix XenMobile]]></title>
            <link>https://medium.com/tradecraft/how-we-breached-a-corporate-network-via-citrix-xenmobile-934a2a0585a1?source=rss-7021cf190602------2</link>
            <guid isPermaLink="false">https://medium.com/p/934a2a0585a1</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[attack-simulation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[John Kearney]]></dc:creator>
            <pubDate>Wed, 25 Sep 2019 13:27:38 GMT</pubDate>
            <atom:updated>2020-01-30T16:27:25.972Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SmIuxqqjvvuOYaufBMJeuQ.jpeg" /></figure><p>During our <a href="http://www.wearetradecraft.com/services/">adversary simulations</a> we regularly find vulnerabilities in third-party applications used by our clients. Often these are well-known vulnerabilities that can be fixed by updating or reconfiguring the system, but sometimes they require some work by the third-party provider to produce a fix and an update.</p><p>Sometimes we find things that might not technically be vulnerabilities at all. For example, some systems include features that we can use in unexpected ways to compromise it.</p><p>In this post, we explain how we were able to exploit vulnerabilities in the Citrix XenMobile platform that allowed us to fully achieve the objective of our attack simulation. We’ll describe those objectives, which will give you some idea of what we were dealing with, and the nature of our client’s concerns.</p><p>All of the vulnerabilities discussed in this blog post were reported to Citrix, who at the time of writing have published updates to fix the ones they felt required action.</p><h3>The objective</h3><p>We were briefed to gain access to confidential personal data about vulnerable individuals held by our client.</p><p>We were asked to run a covert, blackbox simulation. In a covert simulation, we’re required to try to achieve the objective without anyone in the client organisation knowing or noticing what we’re doing. In blackbox simulations we’re given very little information about the client’s systems. All we could see was what anyone on the internet could find.</p><h3>Why XenMobile?</h3><p>We began by discreetly scanning the organisation’s externally-facing domains to identify a service that might allow us in. This was when we discovered the client used <a href="https://www.citrix.com/en-gb/products/citrix-endpoint-management/">Citrix XenMobile</a> for managing employee mobile devices. XenMobile allows organisations to manage large numbers of mobile devices, controlling installed apps and ensuring that updates and security settings are applied.</p><p>XenMobile wasn’t the only service we identified from outside the network, so why target it?</p><p>First, we knew that XenMobile is a large and complicated application with many ways for other applications or devices to talk to it. It was quite likely that it would be configured with multiple access points. In general, the bigger and more complicated a piece of software is, the more likely it is to contain vulnerabilities.</p><p>Second, we knew that XenMobile’s functionality would allow us to achieve our objectives, if we were able to gain control over it. For example, it has a feature that allows the <a href="https://docs.citrix.com/en-us/xenmobile/server/apps.html">silent installation of apps to all connected mobile devices</a>, without the authorisation of the devices’ users and without notifying administrators.</p><h3>What did we do?</h3><p>We set up an instance of XenMobile on one of our own virtual machines, and began analysing its behaviour. By running it on our own infrastructure, we could perform tests that would be detected easily if we ran them on the actual target system.</p><p>We found lots of lovely bugs; in fact, we found so many that it was a challenge to find the right ones. But we persevered, and identified several vulnerabilities that could be combined to create a working exploit:</p><ol><li>We discovered that we could download files containing administrator credentials</li><li>We discovered that we were able to upload zip files to a specific directory on the webserver, without having to log in</li><li>We logged in with the administrator credentials from step 1, and found we could unzip these uploaded files to any other directory on the webserver.</li><li>We uploaded and unzipped files that allowed us to capture the credentials of all user devices connecting to XenMobile</li></ol><h3>Downloading files containing administrative credentials</h3><p>The version of XenMobile we tested supported authentication using Security Assertion Markup Language (SAML) via an endpoint that was enabled by default. This endpoint is used for single-sign on (SSO) integration with other services. For example, it could be configured so that when a user signed into their Google account, they would also be signed into XenMobile. However, although the endpoint was unused, it wasn’t disabled, which made it vulnerable to attack.</p><p>SAML is an XML-based markup language, so we tried launching XML-based attacks against this endpoint. As it happened, one of the simplest XML attacks — an <a href="https://portswigger.net/web-security/xxe">XML External Entity (XXE)</a> attack — allowed us to read files on the target host.</p><p>The first files we recovered were encrypted, so we continued reading files until we found the one containing the decryption keys. When a webserver protects data by encrypting it, it’s quite common to find the keys on the webserver itself. Without them, the webserver wouldn’t be able to decrypt the data again.</p><p>One of the encrypted files contained credentials that could be used to make administrative requests to the XenMobile API. This gave us access to a broad range of functionality that should only have been available to highly privileged users.</p><h3>File upload vulnerability</h3><p>With our administrator access, we started examining the API to see what we could do with it. We quickly found two API endpoints that were interesting.</p><p>The first was an endpoint for connected mobile devices to upload debug files. No authentication was required to upload these files, but they were placed in a specific location.</p><p>The second was an endpoint that could unzip uploaded files. This did require the administrator access we’d gained earlier on. Normally when a file is unzipped, all the files in it are created together in a single location near the zip file; but this is just by convention. We were able to craft a malicious zip file that, when unzipped, would place files in arbitrary locations on the webserver.</p><p>I’m sure you can guess where we’re going with this.</p><p>We uploaded our maliciously crafted zip file with the first API endpoint, and then unzipped it using the second one.</p><p>Why do this? Well, read on…</p><h3>Gathering credentials</h3><p>The XenMobile webserver was intentionally designed to be able to modify or overwrite its own source code. This is quite common as it allows applications to automatically upgrade themselves, but it does have an unhelpful side effect: if an attacker can control what the application writes to those files, they can alter the source code of the application and control its behaviour.</p><p>Using the two API endpoints discovered above, we put new code on the webserver that caused it to collect the credentials of any device connecting to it.</p><h3>The result</h3><p>Because all users in the organisation had managed mobile devices, this exploit was able to capture numerous administrator credentials.</p><p>This meant we could go on to achieve our primary objective easily: we could simply log into the systems necessary to download all of the confidential data we wanted.</p><h3>What happened next?</h3><p>All of our simulations end with a comprehensive report for our clients. The report outlines the story of the breach (one version for technical teams, and one for everyone) and details all the vulnerabilities that we found. Our clients use these reports to help their staff to understand how we were able to breach them, and their technical teams to fix the vulnerabilities that gave us access.</p><p>When we find vulnerabilities in third-party software, we responsibly disclose them. We alerted Citrix and — when an update became available — we <a href="http://www.wearetradecraft.com/advisories/">published the advisories</a>.</p><p>After this work was completed our client decided to discontinue their use of XenMobile, and reinforced existing efforts to move to commodity, cloud-based services instead of on-premise solutions.</p><p>When we’re working on an <a href="http://www.wearetradecraft.com/services/">adversary simulation</a>, we always start by taking a wide view of the client’s systems and infrastructure, to try to work out where we think the risk is. We often end up choosing something to focus on that the client doesn’t expect, and the vast majority of the time, we go on to achieve the objective.</p><p>This is not surprising, as maintaining an accurate picture of risk across a complex technology estate is very hard. Arguably, it’s most hard as an insider, where <a href="https://en.wikipedia.org/wiki/Availability_heuristic">availability</a>, <a href="https://en.wikipedia.org/wiki/Optimism_bias">optimism</a> and <a href="https://en.wikipedia.org/wiki/Shared_information_bias">shared information</a> biases can easily bite.</p><p>It’s partly because of these sorts of biases that we advocate starting security processes by looking for tangible security problems, instead of by assessing risks in an abstract way. We’ll be writing more about this soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=934a2a0585a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tradecraft/how-we-breached-a-corporate-network-via-citrix-xenmobile-934a2a0585a1">How we breached a corporate network via Citrix XenMobile</a> was originally published in <a href="https://medium.com/tradecraft">Tradecraft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Injection attacks explained]]></title>
            <link>https://medium.com/tradecraft/injection-attacks-explained-54bb6278dea0?source=rss-7021cf190602------2</link>
            <guid isPermaLink="false">https://medium.com/p/54bb6278dea0</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[injection-attacks]]></category>
            <category><![CDATA[owasp-top-10]]></category>
            <dc:creator><![CDATA[John Kearney]]></dc:creator>
            <pubDate>Tue, 16 Jul 2019 09:01:25 GMT</pubDate>
            <atom:updated>2020-01-30T16:29:25.125Z</atom:updated>
            <content:encoded><![CDATA[<p>When an attacker tricks your application into running commands</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KOz9aOSbIL2_rrJp_OkvXw.jpeg" /></figure><p>When writing up <a href="http://www.wearetradecraft.com/services/">adversary simulation</a> reports for our clients, we always write the executive summary and high-level description of each finding in plain English. It’s really important that the nature and impact of our findings can be understood by all members of our customer’s team, regardless of their level of technical knowledge.</p><p>However, there’s always room for further explanation. In this post, we take a common type of vulnerability in web applications — injections — and explain it in more detail.</p><h3>What are injection attacks?</h3><p>In an injection attack, the attacker causes the application to treat user-supplied data as if it were an instruction to perform some kind of action.</p><p>That is, they enter malicious content in a field, submit it in a query, or even upload it in a file, and this content then causes the application to perform an action of their choice. Examples include giving the attacker partial or complete control over the application, displaying confidential data, or deleting database records.</p><p>Some of the ways an attacker can do this are extremely simple, while others require a great deal of skill and time to uncover.</p><p>A common attack of this type is a Structured Query Language (SQL) injection. SQL is a language used to communicate with certain types of databases. In order to read or modify the records on the database, you submit commands to it written using SQL.</p><p>In an SQL injection attack, an attacker includes some SQL in a piece of data that the application expects to receive, like a user’s profile text or email address. Then, because of a vulnerability in the application code, the application runs the SQL on the database.</p><p>For example:</p><ol><li>The attacker navigates to the New user page of the target application.</li><li>In the Email field, they enter text containing SQL that instructs the database to list all the user email addresses in its records.</li><li>When the form is completed and submitted, the application tries to process the data in the Email field in the normal fashion. However, because of the structure of the data, it is tricked into running the statement as a command.</li><li>The email addresses of all the users are then displayed in a list in the attacker’s browser.</li></ol><p>Injection attacks don’t only happen in SQL, and nor does the method of injecting the content have to involve a web form. Any point at which an application allows users to enter or upload data could contain a flaw that allows an injection attack.</p><p>Other common injection vulnerabilities include:</p><ul><li>cross-site scripting (XSS): malicious scripts are injected into a web page, and are executed when that page is visited by a user</li><li>XPath injection: similar to SQL injection attacks, an attacker submits data that causes the application to create and run a query for XML data</li><li>template injection: the attacker submits malicious code that is executed when the application takes user-supplied input and transforms it into a file according to a template, such as generating a custom welcome page for a new user</li></ul><h3>How do injection vulnerabilities happen?</h3><p>Injection vulnerabilities arise when an application does not correctly distinguish commands from user-supplied data. This type of attack has been around for a long time, and many programming language features exist to help developers prevent these attacks from succeeding. Unfortunately, these features are often not used, and some organisations have legacy software that’s old enough to pre-date them.</p><p>Some of these vulnerabilities are easy to detect using automated tools that search for injection opportunities. Others are very difficult to find, but can nevertheless be discovered by a determined attacker.</p><h3>How do we prevent them?</h3><p>There will always be errors in application code, because coders are human, and make mistakes. By adopting good coding, reviewing, and patching practices you can keep these errors to a minimum, and reduce the risk of injection vulnerabilities arising.</p><p>The Open Web Application Security Project (OWASP™) maintains a list of the <a href="https://www.owasp.org/images/7/72/OWASP_Top_10-2017_%28en%29.pdf.pdf">ten most common web application security risks</a>, which contains excellent technical recommendations that can help you ensure that the processing of user-supplied data is done in a way that avoids injection.</p><p>While these technical solutions will prevent injection attacks, cultural and process changes are also important, such as:</p><ul><li>all programming languages include methods for removing or minimising the opportunities for injection vulnerabilities. Ensure that these methods are applied consistently by your coding teams</li><li>if you develop your own applications, you need to make security an explicit priority, and make sure that user-supplied data is always appropriately processed</li><li>where you use or are considering using third-party software to provide functionality for your application, check for known vulnerabilities first, configure it securely, and update it regularly</li><li>if you rely on a third party to supply an entire web application for you, then actively engage with them and ask them questions about their security patching and monitoring services</li></ul><p>Look out for further plain English blog posts from us explaining other security risks from the OWASP top ten!</p><h3>P.S. Interested in SQL injection?</h3><p>For more about how SQL injections work, see <a href="https://www.youtube.com/watch?v=_jKylhJtPmI">this excellent video by Computerphile</a> for a detailed plain English explanation of why and how they become possible.</p><p>And on the subject of SQL injection, let’s leave the final word to XKCD:</p><p><a href="https://imgs.xkcd.com/comics/exploits_of_a_mom.png">https://imgs.xkcd.com/comics/exploits_of_a_mom.png</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54bb6278dea0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tradecraft/injection-attacks-explained-54bb6278dea0">Injection attacks explained</a> was originally published in <a href="https://medium.com/tradecraft">Tradecraft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing the security of your organisation as a whole]]></title>
            <link>https://medium.com/tradecraft/testing-the-security-of-your-organisation-as-a-whole-fc65195aefbc?source=rss-7021cf190602------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc65195aefbc</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[scoping]]></category>
            <category><![CDATA[hacking-for-defense]]></category>
            <dc:creator><![CDATA[John Kearney]]></dc:creator>
            <pubDate>Wed, 10 Jul 2019 15:15:31 GMT</pubDate>
            <atom:updated>2020-01-31T09:42:44.114Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*erhnaNuup_kFXnQ3Z8X8kw.jpeg" /></figure><p>At Tradecraft, we spend a lot of time thinking about scope. If you cherry-pick certain bits of infrastructure to look at, and don’t give others much attention, you end up with lots of secure things sitting alongside lots of insecure things. It’s a bit like fitting a fancy lock on the front door, but not checking whether the windows are open.</p><p>To put it more directly, there’s limited value in assessing the security of your website. You need to think about the security of your organisation as a whole.</p><p><strong>Starting point</strong></p><p>To start with, you’ll need to contract with a company that’s able to look at the security of your entire organisation and infrastructure, rather than one that does compliance-driven testing where the focus is on completing a tick-box list of security requirements. Thinking holistically about the security of an organisation requires a broader range of skills; as well as being able to find vulnerabilities, you need to be able to exploit them safely to find ways to break into systems and move between them. You also need to be able to consider how suppliers, people, processes and premises might be relevant to security questions, not just technology.</p><p>Once you’ve found the right partner, you need to define a comprehensive scope. That means putting together a list of all the things your organisation consists of.</p><p><strong>Defining your comprehensive scope (aka: defining all the things!)</strong></p><p>This can be quite difficult. At Tradecraft, we begin by making a list of servers, end user devices, corporate networks and Wi-Fi networks, a list of infrastructure-, platform- and software-as-a-service suppliers, plus independent software vendors who host services within customers’ premises.</p><p>For most organisations, this list is not something they actively maintain. So, if you’re thinking about working in this way with a security company, it’s worth starting to think about that now. Another important thing to look for in a provider is the willingness to work in an agile way and amend the scope as you discover new things, which you will!</p><p><strong>Designing the breach scenario: what’s the objective?</strong></p><p>When designing the breach scenario, we start by asking senior management what outcome they most want to avoid. That will vary depending on the type of organisation, but could be someone gaining access to their customer relationship management system and exporting customer information in bulk, or gaining access to credit card details. We also talk to people in less senior positions, as they often have different concerns. We try to bring all these together into one clear objective.</p><p>We bring our expertise about the type of things attackers care about; that is, what’s their pot of gold? That’s not always intuitive. Data that has little value to you can be of huge value in another context. Personal data obtained in one place, for example, can be used to attack unrelated systems. A notable example of this were the <a href="https://qz.com/445233/inside-the-irss-massive-data-breach/">attacks against the Internal Revenue Service in the US</a>, where its very likely that attacks were made against unrelated systems to obtain the social security numbers and other personal data necessary to trick the IRS’s Get Transcript service into giving access to fraudsters.</p><p>It’s also important to think about what real attackers would do to breach your systems. They’ll look for the easiest way to achieve the bad outcome, not the most intricate and drawn out. So we focus on those attacks first, moving up the complexity as our client’s security posture improves.</p><p><strong>If you haven’t looked at everything, how do you know you’re secure?</strong></p><p>Because these engagements are objective-based, the attacking team won’t necessarily look at everything in the scope; this is part of what differentiates this kind of work from ordinary penetration testing.</p><p>In an objective-based engagement, the attacking team will go where it needs to go to achieve the breach scenario agreed with the client. This means that not everything in the scope will be examined, but that’s okay. This sort of work is not an audit, it’s to show how a real breach could happen.</p><p>It’s also designed to be iterative. The next time you do one of these exercises, you’ll have fixed some things, and the attacking team will need to try harder to breach you. At Tradecraft, we keep repeating this cycle until breaching your systems requires so much skill or effort that an attacker is unlikely to persevere.</p><p>Of course, the amount of effort an attacker is prepared to put in depends on who they are and the value of your assets to them: casual or automated attacks are much easier to defend against than those mounted by skilled and determined attackers. It’s important to keep this dynamic in mind when thinking about an appropriate budget for spending on this type of work.</p><p><strong>Diligent defences must include friendly attacks</strong></p><p>Information security is a dynamic field in which two groups of people are constantly trying to outwit each other. Attackers look for novel technologies and new vulnerabilities they can take advantage of, while defenders try to find ever better ways to detect and prevent attacks.</p><p>That’s why a diligent approach to defending systems must include concerted intelligent attacks by human beings. It can’t be just an audit; it must be work that is substantially similar to that of real attackers. Automated tooling just isn’t clever enough to keep up with human attackers… not yet, anyway!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc65195aefbc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tradecraft/testing-the-security-of-your-organisation-as-a-whole-fc65195aefbc">Testing the security of your organisation as a whole</a> was originally published in <a href="https://medium.com/tradecraft">Tradecraft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why we know your password, and what you can do about it]]></title>
            <link>https://medium.com/tradecraft/why-we-know-your-password-and-what-you-can-do-about-it-4997725b0aa?source=rss-7021cf190602------2</link>
            <guid isPermaLink="false">https://medium.com/p/4997725b0aa</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[password-management]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[John Kearney]]></dc:creator>
            <pubDate>Thu, 09 May 2019 11:03:46 GMT</pubDate>
            <atom:updated>2022-08-11T15:33:19.197Z</atom:updated>
            <content:encoded><![CDATA[<p>Trying to make passwords more secure can often end up having the opposite effect, for two main reasons:</p><ol><li>When people are faced with complex rules — at least one uppercase letter, number, symbol etc. (we’ve all been there) — they will do the simplest thing possible. Most users will capitalise the first letter in their password, or all of them, and add a “1” to the end. Sound familiar?</li><li>Complex passwords made up of random generated characters are much easier for a computer to guess than for a human to remember.</li></ol><h3>The proof</h3><p>For evidence of how people choose passwords, you need look no further than the 10,000 most common passwords discovered in security breaches, as published on <a href="https://github.com/danielmiessler/SecLists/blob/master/Passwords/Common-Credentials/10-million-password-list-top-10000.txt">Github</a> or <a href="https://en.wikipedia.org/wiki/Wikipedia:10,000_most_common_passwords">this page on Wikipedia</a>. As I write, the second most common password is “password”,“Password” is number 176, “password1” is at 207, “PASSWORD” is at 710, and “Password1” checks in at 2968.</p><p>In Top of the Pops fashion (for those of you who are old enough), here’s the current top 20:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*soSN6IIfvofyHDY4" /><figcaption>Source: Github</figcaption></figure><p>As for the relative ease with which a computer can guess a random string as opposed to a well-crafted passphrase (see more on using these below), <a href="https://xkcd.com/936/">XKCD tells that story</a> better than we could.</p><h3>We don’t do what we’re told, and that can cause big problems</h3><p>No matter how many times people are told never to use the same password across many sites and services, most still do just that. It’s human nature to take the quickest and easiest option, and the one that means we won’t forget our passwords and get locked out.</p><p>When Tradecraft carries out adversary simulations, we search published data breaches for details of known users to help us identify the passwords they use to log into other places. When we find their passwords, we try them out against their accounts in the system we’re targeting.</p><p>During a recent adversary simulation, this simple password lookup — that requires no technical skills at all — gave us access to the entire system at the highest possible level.</p><h3>So what’s the good news (or help, what should I do now)?</h3><p>Once you understand how people interact with a system, and the reasons why the rules don’t result in the right kind of behaviour, you can take a different approach.</p><h3>Some tips for individuals</h3><p>As an individual you should:</p><ul><li><strong>swap passwords for passphrases:</strong> combinations of meaningful words in a string. They are easier to remember than complex character strings and, if they are long enough, harder to crack. You can generate these with online tools <a href="https://preshing.com/20110811/xkcd-password-generator/">like this one</a>, inspired by XKCD. We definitely recommend this approach to ensure the phrases are truly random</li><li><strong>use a password manager: </strong>these are applications that act like a secure vault, where you can store all your logins and passwords. Most will also generate passphrases for you when creating a new login or updating an old one. Speaking of which, you should also…</li><li><strong>update all your logins with randomly generated passphrases</strong>: this might take you a bit of time, but it’s worth it. Start with the most sensitive things like email, financial and medical accounts, and update the others when you use them</li></ul><h3>Some tips for businesses</h3><p>As a business, you should:</p><ul><li><strong>update your password policy and systems so people can use passphrases.</strong> Many policies require symbols and numbers, which do little to guarantee security (as we explained above)</li><li><strong>select a suitable password manager for your staff,</strong> and train them in how to use it</li><li><strong>once the policies and tools are in place, make sure all users update their passwords.</strong> If you have lots of users, we recommend you do this gradually</li><li><strong>read the National Cyber Security Centre’s guidance</strong> on <a href="https://www.ncsc.gov.uk/collection/passwords/updating-your-approach">updating your approach to your password policy</a></li></ul><h3>2FA</h3><p>Finally, as an individual or a business, you should always enable two-factor authentication (2FA) when it’s available.</p><p>2FA means you need to provide two ways of proving your identity. It’s used all the time by organisations like banks; for example, to take money from a cash machine, you need the card and your PIN. To log into your online banking application, you need your account details and a one-use time-limited code, generated by a custom gadget or sent by text.</p><p>Once you’ve done all that, we probably won’t know your password (but you still need to watch out for <a href="https://en.wikipedia.org/wiki/Phishing">phishing</a>).</p><h3>A passwordless future</h3><p>Humans are not good at passwords, but computers are. So maybe the long-term solution is to get rid of passwords and replace them with stronger ways of proving your identity, such as passwordless “magic” links or QR codes. We also expect to see an increasing use of standards like <a href="https://en.wikipedia.org/wiki/WebAuthn">WebAuthn</a>, which can be used to help prove your identity at the touch of a button, while also protecting you from phishing attacks.</p><p>We’ll blog more about this soon.</p><p>P.S. If you want to hear directly from Glyn Wintle, our CTO, about all things password related, here’s his talk at <a href="https://vimeo.com/60413656">Ignite London 7</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4997725b0aa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tradecraft/why-we-know-your-password-and-what-you-can-do-about-it-4997725b0aa">Why we know your password, and what you can do about it</a> was originally published in <a href="https://medium.com/tradecraft">Tradecraft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>