This 10-step grey-box pentest strategy has proven to not only be effective but also efficient – as it uses a minimum number of test cases to cover a large range of vulnerabilities with minimum false positives! We, from Vector Consulting, took it into our hands to lay down an actionable risk-oriented step-by-step grey-box pentesting procedure. This 10-step cookbook recipe from a security engineer’s perspective is to be applied along the entire lifecycle of the product.

Why is a pentesting strategy necessary?

“In today’s connected vehicles, safety and security are one and the same” rightfully stated GM President Dan Ammann. A good pentest strategy is the need of the hour to combat the rising cybercrime. ISO 21434 lays the foundation for a good security process framework, however, no guidance regarding security testing.

It has been also quite daunting for the OEMs to streamline their automotive security testing processes, as less to nothing is mentioned in the current standards! There are no ISO standards that talk about how to perform a penetration test. There are open guidelines from NIST, OWASP, PTES (Penetration Test Execution Standard) to name a few but all are very black-box centric focusing more on IT and web-application security and no stress upon the implementation steps.

My previous article – Security testing techniques to combat cybercrime – introduces grey-box pentests and the ingredients for good security testing. Learn about the difference between black-box to grey-box pentesting. Now we deep dive into the 10 steps on how to realize that.

10-step grey-box penetration testing method

Step 1: Reconnaissance for efficient grey-box pentests

As a first step for successful pentesting, we need to extract the system information and analyze the basic features, user goals, target group, product description, and cybersecurity impacts. For instance: Unintended or prevention of airbag deployment. We perform active and passive reconnaissance to gather as much information about the device such as actively ping probing the MCU, port scanning. Passively via market requirements, user manuals, legally published material etc. This scoping activity is vital because, the more you know about the device, the more reliable is your pentest result.

Step 2: Structural analysis

We analyze the high-level architecture schematics and perform a structural analysis to understand the system context, the interaction between the various components, and its outside world via the interfaces and attack pathways.

High-level architecture model of automotive airbag

Step 3: Asset elicitation

From the architecture schematics, high-level product requirements are traced to elicit the valuable assets based on the Safety, Finance, Operational Performance and Privacy (S, F, O, P) scheme e.g.: Hardware, software – critical CAN frames (e.g., Airbag deployment diagnostic signal, vehicle speed, brake pressure signal), proprietary information, etc.

Step 4: Specifications

We analyze the product requirements, the CE (European conformity) verification documents, and processor datasheets to obtain the hardware and software specifications. This data along with the attack history is fed into vulnerability databases such as Common Vulnerabilities and Exposures (CVE) to find out the publicly known vulnerabilities associated with the specifications. This step helps to enrich our step 5: Threat Analysis and Risk Assessment (TARA) to enumerate all possible threats.

Workflow involved in vulnerability scanning

Step 5: Threat Analysis and Risk Assessment (TARA)

We create a mini-TARA that helps to derive the penetration test cases, which is the essence of a grey-box pentest. We follow the top-down approach starting with the assets followed by the corresponding damage scenarios, threat scenarios, and finally the attack pathways. Based on the threat level and impact level, the risk level is determined for every threat.

Step 6: Minimum viable penetration test cases

We select the high-risk threats (risk level: 4 and 5) from the TARA to generate minimum and non-redundant pentest cases. The attack pathways corresponding to these threats act as pentest cases.

Step 7: Penetration test

To recreate the attack scenario on the device to identify if potential vulnerabilities as enumerated in TARA are valid or invalid.

  1. Interface Discovery: All available hardware interfaces are determined, and preliminary tests are performed to detect target responsiveness with port scanning tools like Nmap and Zenmap.
  2. Network Discovery: Network traffic is analyzed to determine protocols, communication formats and determine the baseline behavior with network analyzer tools like Wireshark.
  3. Network Penetration Test: Network-based attacks are mounted using low-level access to the bus with forged frames using tools like Metasploit, Scapy, etc.
  4. Software Penetration Test: Software is manipulated in terms of unauthorized read and write to check if corrupted flashware or deletion can be executed. Flash dumps are parsed for sensitive information and checked if existing security mechanisms can be bypassed.

Step 8: Key Performance Indicators (KPIs)

Unmeasured performances do not improve!

  • Test Effectiveness KPI – Fault Detection Rate: This determines the number of seeded faults discovered out of the total number of seeded faults injected into the system.
  • Test Efficiency KPI – Vulnerability Discovery Average: This determines the average number of vulnerabilities found per test case.

Step 9: Functional security requirements

Functional requirements are enhanced to address the valid vulnerabilities identified in step 7. Robust security countermeasures are added to make the system more secure.

Step 10: Regression test cases

After applying the security update in step 9, we perform steps 2 to 6 again and conclude the iterations when the total valid vulnerabilities are as low as possible. A clean-up activity is performed to ensure the system is free of executables and configured back to its original state.

Grey-box pentest enhancements

This strategy can be automated for optimization and directly extract the minimum test cases from the design models, architectural heuristics, threat catalogs, and machine learning models.

Conclusion: Limits of grey-box pentesting

Methodology is key to achieving reliability. As the famous adage goes – “If you fail to plan, you are planning to fail” – Benjamin Franklin. However, there are threats to validity that cannot be avoided. The technical competency, in other words, the experience of a pen tester decides how accurate the test result is. Constraints, as legal regulations, improper test environment, tool inefficiencies could also compromise the validity of a test outcome and need to be also factored in before performing a pentest.

Grey-Box Pentesting


Further readings and video

Share:

Legal Notice

This text is the intellectual property of the author and is copyrighted by coderskitchen.com. You are welcome to reuse the thoughts from this blog post. However, the author must always be mentioned with a link to this post!

Leave a Comment

Related Posts

Debugging without Security risks
Niroshan Rajadurai

Debugging without security risks

Security researcher Michael Myng found the keylogging code in software drivers that were preinstalled on HP laptops to make the keyboard work. He discovered the

Error: Safety security both
Sebastian Krings

A simple error: Safety, security or both?

Aside from safety properties, can we use static analysis tools to detect security issues? Yes, as we will show by discussing a programming error in uftpd,

Hey there!

Subscribe and get a monthly digest of our newest quality pieces to your inbox.