Wednesday, 15 May 2019

Security Training for Developers: Cost Saver & Business Enabler

By Peter Ganzevles

Having delivered training for a long time and being involved in the process for even longer, I have come across many different people and even more questions. I’ll get questions I never thought about being asked, coupled with questions that I expect. However, there is one question I get more than any other, and it usually reads something like this:

“Thank you for the training, the developers gave good feedback on it. Now I know someone who I think would benefit from a training too, but how can I convince them that it’s worth it?”

This blog post will answer this question and address the topic more thoroughly than in a quick email response. In this post, we’ll address the value of training developers, and why it is worth doing.

Just Like… Fishing
And no, I don’t mean phishing. The famous quote from 12th century philosopher Maimonides told us that you can “give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime.” This quote is key to understanding the importance of training from a business perspective. Over the course of my penetration testing career, I’ve tested clients’ applications, found some horrible flaws and reported them in the best way I could to help them fix the issue. Then, a year later, I’d carry out a retest, and while they had fixed that instance of the issue, the very same flaw that caused it to begin with was applied elsewhere in a new feature, which caused a similar issue.

These recurring issues are the prime example of a lack of knowledge in a particular area, and there are two ways to deal with it. The first is to come back for a retest just before every major release, but that requires a lot of time and effort scheduling, is rather costly, and generally inspires little confidence in the application. The second option is to train the developers, testers and project leaders to be aware of the risks when writing applications to prevent them from writing vulnerable code or missing it during testing.

Just Like… Puppies
There are hundreds of ways to train a developer, and while each has its merits, some are more effective than others. When toilet training a puppy, owners often make the mistake of pushing the puppy’s nose into where the ‘accident’ happened, to teach the dog that it has misbehaved. While the dog will learn quickly and avoid that spot, the same might happen five foot to the left. Similarly, shoving coding mistakes into a developer’s face and hoping that they’ll learn will likely have the same effect. The same code won’t be rewritten, but the underlying issue is likely to rear its head again in the future.

Another method is to run the class through a one-day course where we show the major flaws that often occur in applications. While this is quick and relatively cheap, it is unstimulating for most; it will not necessarily be adjusted to their skill levels since it needs to be challenging for the more experienced and comprehendible for the less experienced, which makes it somewhat unsuited for both. While trainings like this exist for companies with a smaller group of developers and testers who all have a similar skill level, it is not the solution I’d consider best.

Just Like… University
That brings us to the method that we’ve tried and tested for a few years now, which is a two-day course that functions similarly to a university. While the initial information is still presented to the group, it is offered in a way that allows for discussion and questions throughout each topic. Then, after the topic is over, every student gets the chance to practise what they’ve learned hands-on, either alone or in pairs, to ensure they fully understand what they’ve learned. The best thing about this hands-on part of the training is that it’s not just me teaching and helping, it’s the students as well. Ideas are exchanged, tips are given, and real stories from their own development career are shared. I’ve even had people leave the room to fix code on the spot!

Just Like… That
So, what are the long-term benefits of this method? I have given training to many companies and each has given a different answer. Some were able to grow further without hiring more testers, as fewer mistakes were made and the existing testing team had a lighter workload as a result. Many of them also explained that while training is an investment early on, it decreases the amount of issues found during penetration tests, which reduces the amount of time developers spend fixing issues, allowing them to spend that time on feature requests instead. A handful of clients even hinted that they were getting more customers, as they could prove that they were more secure than their competitors. Another client said that they were now using their newly found security knowledge in their recruiting process to find even better and more suited additions to the team, which then helped to increase the overall maturity. And finally, it is valuable for employees as they can put the skills on their resume should they ever change jobs, and with the ever-increasing demand for security knowledge, that isn’t a bad thing.

Wednesday, 17 April 2019

The Power of Social Engineering, Part One: Know Your Enemy

Written by Stuart Peck

On 9th April 2019 in London, ZeroDayLab hosted our Social Engineering Masterclass, where I presented (with a line-up of other ZeroDayLab speakers), the tactics, techniques, and procedures of how attackers deploy social engineering to great effect.

This trilogy of articles looks to build upon that message in greater detail. In part one, we will detail the tactics used by attackers, with an explanation of each of the 6 core principles of social engineering and influence. In the second article we will delve into attacks in operation, looking at case studies where social engineering is most effective, and discuss target profiling and pretexting. The final article will discuss active social engineering defence, designed for both individuals and organisational strategies that can be deployed to reduce the risk of a successful attack.

What is Social Engineering?

"Social engineering, in the context of information security, refers to psychological manipulation of people into performing actions or divulging confidential information…a type of confidence trick for the purpose of information gathering, fraud, or system access, it differs from a traditional ‘con’ in that it is often one of many steps in a more complex fraud scheme.”

It has also been defined as "any act that influences a person to take an action that may or may not be in their best interests." -Wikipedia

In the context of this article we are going to focus on the techniques and tactics of modern social engineering, with examples of phishing, vishing, smishing, and how this supports other attacks such as hacking and physical entry.

Robert Cialdini is famous for identifying and cataloguing the 6 principles of persuasion, the foundations on which most modern-day social engineering is built upon. These include:

  • Reciprocity- people tend to return the favour if they see the value in what has been offered. This is used a lot by intelligence agents and police to coerce their target into cooperation.
  • Commitment- if people commit, orally or in writing, to an idea or goal, they are more likely to honour that commitment because they have stated that that idea or goal fits their self-image. 
  • Social Proof- people will do things that they see other people doing. There have been studies conducted which have successfully convinced people in a group that a red object is blue, for example.
  • Authority- people will tend to obey authority figures, even if they are asked to perform objectionable acts. In the workplace this is driven also by the company culture.
  • Likability- people are easily persuaded by other people whom they like. If you combine this with trust, the effect is compounded. Always be wary of the attacker who comes at you with a smile.
  • Scarcity/Urgency- people are influenced by fear of loss, or negative impacts to missing deadlines. This creates urgency, where human error is likely to be exploited the most, e.g. ransomware.

With these principles in mind, you can see how unsuspecting users can be coerced or influenced into making decisions that are not in their, or their respective employer’s, interest.

For example, one of the biggest threats (and tools for attackers) in recent history is social media, which has desensitised many to the dangers of oversharing, and has led to people sharing:
  • Images of their credit cards
  • Images of boarding passes- which when you scan the barcode contains personal information including passport information
  • Information that be used to work out passwords
  • Information about their employer including images of their badge, maybe business cards
  • Selfies and videos that contain personal information, again that can be used to build a profile.

If you combine this with the wealth of information that can be gathered relatively easily on a company and their employees using open source intelligence (OSINT), this provides an attacker with a dossier of information to build a solid pretext, or in some cases actually access mailboxes where employees have re-used weak passwords or credentials found in publicly available breaches. 

Pretext, or the scenario being presented to the target, is built upon 4 conditions to establish trust. For example, through OSINT the attacker would have gathered some critical information about the target and the organisation- this could be names of direct management, colleagues in another location, project code names, information about systems, or direct impersonation of a trusted third party.

This information builds some form of credibility, which the attacker can pivot to establish some of the following:

 Figure 1: Principles of Trust

The reality is that most phishing emails try to use credibility and some form of authority because it is very difficult to build likability without the proper tone over email, but other attacks such as vishing or in person social engineering will leverage a combination of Likeability, Authority and/or Empathy to great effect. And the reality is that without the proper training, tools, and ongoing awareness to the threats, social engineering is going to continue to be used as part of the attacker’s toolkit.

Who Uses Social Engineering, and Why?

Social engineering is used as part of or as the main attack vector for a range of threat actors. These include:
  • Hackers- social engineering is a valuable part of the toolset for black-hat hackers, usually deploying a range of techniques to gain a foothold on a target’s network.
  • Scammers- highly effective but simple attacks deployed by telephone scammers is costing the global economy billions. Vishing is still a very viable attack vector.
  • Identity Thieves- using stolen information obtained through hacking or purchased on the Dark Web, these social engineers assume the identity of their target to obtain new credit or control of existing accounts, for huge financial gain.
  • Cyber Criminals- these attackers use a full suite of social engineering techniques, but phishing is the weapon of choice, either to deliver malware to gain a foothold on the network or harvesting of Personally Identifiable Information (PII).
  • Governments- state sponsored attackers use social engineering for a range of objectives from IP theft, influencing elections (in other countries), or targeted espionage.
  • Insiders- according to the 2018 Insider report, 90% of organisations feel vulnerable to insider threats. They know your system, data, and can cause maximum damage.

The main reason why social engineering is the most widely used in the attacker’s toolkit, is that there is literally very little infrastructure or cost of the attack, yet it yields amongst the highest in returns for the attackers.

To fully understand the effectiveness of social engineering, we have to deep dive into case studies, tactics and why they work, and what companies and individuals can do to detect and protect themselves, which will be covered in part 2 and 3.

Monday, 4 March 2019

Supply and Demand, Risk and Severity – Defining the Damage


Written by Will Lambert

Suppliers- we all have them, we all need them. Some are essential to our day-to-day business activities, whether they provide website hosting, supply power, provide heating or air con systems and maintenance, payroll software, CCTV, education services, physical or information security, the list goes on. With this almost never-ending list of suppliers, each poses an individual risk to our organisations. You should already have a good understanding of how suppliers interact with your workplace, how important they are, and which ones are most important. This can be described as a rank of criticality. If a supplier is high on this rank of criticality, we also need to understand what risks they present to our organisations

Let’s revisit defining risk. A risk is defined by ascertaining a threat (anything that can harm an asset) multiplied by vulnerability (a lack of safeguard). The initial identification of risk is no easy task but what is usually misunderstood is assigning a severity to a risk. So, for example, if we have a supplier who handles all our customer data (asset), the risk is that they become breached (through lack of safeguard), so what is the severity of the risk being realised upon our business?

Severity can be defined by using a quantitative guide called a likelihood / impact matrix; for this blog, this is what we will be using. For each organisation, impact and likelihood metrics will be different but let’s use the following as a brief example.

Likelihood can be defined using the following matrix;

The following can be used to help define impact for an organisation.

Using the above matrices, each individual asset that a supplier is providing must be assessed to gauge the severity of risk each supplier presents. Likelihood values can be ascertained by using a qualitative assessment, which is a subjective or personal view in gauging how likely a supplier is to fall victim to a cyber-attack – essentially, it’s a gut feeling. However, we can also use Supplier Evaluation Risk Management (SERM) which provides a much more accurate picture of how resilient your supplier is to a cyber-attack and any incident response preparation actions they may have taken in order to return to a BAU state.

Before we look at likelihood, let’s have a quick review of impact. Impact is a bit trickier; it’s all about considering the effect it would have on your organisation. Impacts would include consideration of any regulatory fines imposed by governing bodies, such as the ICO (EU GDPR and DPA18), PCI DSS, and if you are an Operator of Essential Services (OES) whomever your Competent Authority (CA) is. Impact would also consider items like reputational damage and remediation activities such as credit monitoring for all your customers like Equifax did after their 2018 breach.

Asset Value (AV), Single Loss Expectancy (SLE) and Annual Loss Expectancy (ALE) metrics can (and in the case of mature organisations should) be used to help guide the assessment of impact but this process can be a convoluted one, especially when you consider the fines and remediation activities, and is therefore a different blog post entirely!

Circling back to identifying likelihood values, essentially, we are asking ourselves, how likely is it that this supplier will become compromised. The SERM approach allows us to ask how seriously our suppliers take information security and gauge their responses. This is more than just a simple gut feeling, this is using industry best practices, applicable standards and almost anything else you feel is relevant to your business, incorporated into a questionnaire format and sent to your suppliers.

Depending on the rank of criticality we described earlier, matched with your organisation’s statement of information risk appetite, and even consideration of possible impact levels, suppliers can be sent a real in-depth Supplier Validation Questionnaire (SVQ). Supplier responses will be reviewed by your information security team upon return, and then followed up with prompts for evidence of policies, processes or even (where required) a visit to your suppliers’ premises to ratify responses. As you move down the rank of criticality, a lighter touch of questionnaire should be used. For instance, you wouldn’t want a stationery supplier being sent a 200 question SVQ unless you had a sufficient business requirement to do so.

As an example, Stan’s Stationery supplies your business with pens, paper, etc. Let’s give this particular supplier an impact rating of 1. As this supplier can inflict only a small amount of damage, we send Stan’s Stationery a light SVQ. The response from this supplier states that they have no information security measures in place, they have no policies or protection measures or even the slightest interest in information security. Therefore, the likelihood of their breach is almost certain - 5. We feed the impact and likelihood into the risk matrix and we get an overall risk rating of 5. See the Risk Matrix below.

This is a low impact, high probability of breach, but because we have validated the supplier, we know this for sure.

It is important to realise that incorporation of other business processes may be required- a Data Protection Impact Assessment (DPIA) springs to mind. If your SVQ response from Stan’s Stationery showed that they provide a lot more for your organisation than you first realised, in fact, it hosts your website, or processes payments as brief examples. In this case, they process high amounts of personal data and so if breached, would mean you may face the ICO and subsequently receive the fines – dependant on your contracts in place and situation surrounding the breach. You will need to carry out a DPIA on this supplier if not already done. As a result of this new information, the impact level has also changed from 1 to 4 (depending on your organisation’s information risk appetite) in this example, and a subsequent risk score of 20 (See Fig 4 – Updated Risk Matrix) – a big change up from the original score of 5. A greater understanding of their information security practices will be required, and a deeper SVQ will need to be sent and validated.

Of course, Stan’s Stationery can be replaced by any supplier- this is a high-level overview of how SERM can be used. Depending on your quantity of suppliers this may need the automating of this process, or at least employing a managed service to manage your supply chain risk. Following on from a suppliers’ response, your organisation will need to identify what actions you will take to either help them improve their information security practices and defences, or simply cease the relationship with them. This is a cost / benefit analysis and business decision of which SERM will help you best understand the real cost behind each supplier.

For further information regarding supplier risk management, more blog posts can be found here:

  1. The Domino Effect
  2. Automating SERM

Wednesday, 19 December 2018

Top-5 Predictions for 2019: Cyber Threats and How to Protect

Written by: Stuart Peck, Director of Cyber Security Strategy, ZeroDayLab 

2018 has been an eventful year, especially with the introduction of GDPR and the California Consumer Privacy Act, a never-ending barrage of high-profile breaches, sophisticated malware and crypto jacking campaigns, and a ramp up in criminal and fraudulent activities. Reviewing the events from the last 12 months, it’s clear that although there has been a significant increase of attacks, the attack vectors remain vastly the same as they have always been: human error, configuration issues, weaknesses in the supply chain and, unsurprisingly, patching problems!

So, without dampening the Christmas Spirit (too much), what does 2019 potentially have in store for us? What can organisations do pre-emptively to reduce the likelihood and impact of a cyber-attack? Here are my top 5 predictions for 2019;

1.     More Third Party Applications / Code Libraries will be targeted.

Organisations focus on protecting their own critical assets with significant investments in resources and technologies, but then either give access (or share critical data) with third parties who are not as mature. In 2018, we've seen some examples where Open-Source or third-party integrations have been abused by attackers, with Magecart’s JavaScript injection being a primary example. With API abuse to steal authentication tokens also on the rise, the impact of this attack can be significant, not only exposing client / customer data, but potentially the entire supply chain, similar to the recent Facebook breach. In 2019, I predict that this will be the vector of choice for a few reasons;

1) Many organisations don't conduct regular security reviews on their supply chain, let alone review the impact of using third-party code libraries and integrations.
2) These attacks are easy to scale and are therefore cost effective for attackers.
3) The yields and likelihood of selling off or sharing the techniques to other groups is also very high, again making this a profitable exercise.

2.       Business Email Compromise attacks will evolve.

In 2018, ZeroDayLab saw a significant increase in not only the intensity of business email compromise campaigns, but the sophistication used by attackers. In the last Quarter of 2018, attackers were using more advanced techniques to compromise supply chain mailboxes to harvest invoices and other information, usually to craft highly convincing phishing emails that either deliver malware aim to defraud their target out of funds. These attacks, although not new, have adapted as awareness of Whaling (CEO Scamming), has matured, but the techniques witnessed in Q4 2018 will proliferate in 2019, and catch unsuspecting organisations off guard.

3.       Crime-as-a-service will be a driving factor behind many attacks.

After high profile Global Ransomware attacks such as NotPetya and Wannacry, it seems in 2018, Ransomware attacks have dropped off the face of the earth, mainly due to awareness, volatility in crypto currencies, and increased attention from law enforcement. However, bucking the downward trend is ransomware-as-a-service offerings such as “GandCrab”, which have both seen an upturn in infections, and maturity of the offering to their criminal consumers, with reported ill-gotten gains in the millions. 

Crime-as-a-service has all but removed the barrier to entry to cyber-crime, with hacking-as-a-service, malware / ransomware-as-a-service and now phishing-as-a-service featuring highly on the Dark Web and Telegram; these platforms provide even the most novice of criminals the ability to target relatively mature organisations with some level of success. This trend is only going to rise in 2019.

4.       Lack of visibility will be punished

There are a few things that the recent Marriot breach has taught us: blind spots can be punishing, attackers are constantly looking for ways to compromise assets that organisations have no visibility of, or even worse, are not in an asset register and therefore have no idea of its existence. The rise of Shadow IT, where solutions and technology are purchased without the knowledge of IT / Information Security, provides attackers a target where in most cases there is no protection or monitoring for unauthorised access. This opportunity allows the attacker to potentially pivot on to a more critical system, or in worst case scenarios, actual access to personal information.

In both cases, these are an easy attack surface with significant oversight. Attackers constantly use tools like Shodan and Censys to discover public facing assets with default / weak passwords, weak encryption, or any of the critical risks found within the OWASP Top Ten; these are quick wins for attackers and deal a devastating blow to organisations with a huge impact to reputation, and usually catch the information security team off guard.

5.       Cloud Security Misconfiguration

Although great strides have been made to improve the security of critical assets in the cloud, organisations still haven’t fully embraced the protection available, or worse, have misconfigured environments allowing attackers to capitalise on this. There have been many incidents in 2018 that highlighted this: open S3 buckets with vast amounts of customer data unencrypted and available to anyone, weak admin credentials with no MFA, private keys posted in GitHub repositories, the list goes on. Human error is a factor that the cloud sadly won’t fix, only expedite, with significant consequences for organisations that don’t embrace the Sec in ‘DevSecOps’! With increased Governance around the protection of the Privacy and Security of PII (Personal Identifiable Information), those fully adopting the benefits of the cloud also need to fully enforce the security controls.

There is some good news, however; there are many things organisations can do to reduce the impact of the aforementioned security risks;

  1. Ensure Asset registers are fully up to date and include any cloud-based applications and systems within these. In addition, ensure they are patched to the latest version, or highlight the risk for those that cannot be, with the relevant justifications and mitigation. This seems simple, but the volume of organisations that don’t have a fully up to date and relevant register is significant.
  2. Conduct regular Ethical Hacking Assessments on your risky assets, especially those that are public facing. Check cloud and internal networks for misconfiguration - the quickest win to prevent abuse from attackers. Also test those integrations; understand how and where you are exposed.
  3. Train Developers and Operational teams (DevOps) on secure coding and deployment principles. Ensure these are documented through a defined set of procedures and policies. Also ensure developers are using secure coding frameworks, and not using risky third party libraries, or untested open-source object.
  4. Conduct regular BIA (Business Impact Assessments), to help define critical assets, and ensure they have the relevant controls in place - essentially find your blind spots and fix them!
  5. Conduct Supplier Evaluation Risk Assessments regularly, understand the security maturity of your critical suppliers, and act to address those that expose you to unnecessary risk.

By conducting the above activities in 2019, you’ll not only reduce the risk to your critical assets, but also have the appropriate intelligence to develop a strategy moving forward.