THM JRPenTester Pentesting Fundamentals Writeup

Pentesting Fundamentals

Pentesting Fundamentals


What is PenTesting


Ans: Finding the Vulnerability in the system and using the right mitigations is known as PenTest.

A Pentester will use the same waepons and tactics just like an Black hat hacker use.

According to Security Magazine, a cybersecurity industry magazine, there are over 2,200 cyber attacks every day - 1 attack every 39 seconds. https://www.securitymagazine.com/articles/87787-hackers-attack-every-39-seconds

Penetration Testing Ethics



Hat CategoryDescription Example
White HatThese hackers are considered the "good people". They remain within the law and use their skills to benefit others. For example, a penetration tester performing an authorised engagement on a company.
Grey HatThese people use their skills to benefit others often; however, they do not respect/follow the law or ethical standards at all times. For example, someone taking down a scamming site.
Black HatThese people  are criminals and often seek to damage organisations or gain some form of financial benefit at the cost of others. For example, ransomware authors infect devices with malicious code and hold data for ransom.


Rules of Engagement (ROE)

The ROE is a document that is created at the initial stages of a penetration testing engagement. This document consists of three main sections (explained in the table below), which are ultimately responsible for deciding how the engagement is carried out. The SANS institute has a great example of this document which you can view online here.

Section Description
PermissionThis section of the document gives explicit permission for the engagement to be carried out. This permission is essential to legally protect individuals and organisations for the activities they carry out.
Test ScopeThis section of the document will annotate specific targets to which the engagement should apply. For example, the penetration test may only apply to certain servers or applications but not the entire network.
RulesThe rules section will define exactly the techniques that are permitted during the engagement. For example, the rules may specifically state that techniques such as phishing attacks are prohibited, but MITM (Man-in-the-Middle) attacks are okay.


Penetration Testing Methodology


The steps that a pentester take during PenTest is known as Methodology. A practical methodology is a smart one, where the steps taken are relevant to the situation at hand.

For example, having a methodology that you would use to test the security of a web application is not practical when you have to test the security of a network.

Before discussing some different industry-standard methodologies, we should note that all of them have a general theme of the following stages:



Stage Description
Information GatheringThis stage involves collecting as much publically accessible information about a target/organisation as possible, for example, OSINT and research. Note: This does not involve scanning any systems.
Enumeration/ScanningThis stage involves discovering applications and services running on the systems. For example, finding a web server that may be potentially vulnerable.
ExploitationThis stage involves leveraging vulnerabilities discovered on a system or application. This stage can involve the use of public exploits or exploiting application logic.
Privilege EscalationOnce you have successfully exploited a system or application (known as a foothold), this stage is the attempt to expand your access to a system. You can escalate horizontally and vertically, where horizontally is accessing another account of the same permission group (i.e. another user), whereas vertically is that of another permission group (i.e. an administrator).
Post-exploitationThis stage involves a few sub-stages: 1. What other hosts can be targeted (pivoting) 2. What additional information can we gather from the host now that we are a privileged user 3.  Covering your tracks 4. Reporting







OSSTMM


images/3-1.png


The Open Source Security Testing Methodology Manual provides a detailed framework of testing strategies for systems, software, applications, communications and the human aspect of cybersecurity.

https://www.isecom.org/OSSTMM.3.pdf

The methodology focuses primarily on how these systems, applications communicate, so it includes a methodology for:
1. Telecommunications (phones, VoIP, etc.)
2. Wired Networks
3. Wireless communications
Advantages Disadvantages
Covers various testing strategies in-depth.The framework is difficult to understand, very detailed, and tends to use unique definitions.
Includes testing strategies for specific targets (I.e. telecommunications and networking)Intentionally left blank.
The framework is flexible depending upon the organisation's needs.Intentionally left blank.
The framework is meant to set a standard for systems and applications, meaning that a universal methodology can be used in a penetration testing scenario.Intentionally left blank.



OWASP


images/3-2.png


The "Open Web Application Security Project" framework is a community-driven and frequently updated framework used solely to test the security of web applications and services.


The foundation regularly writes reports stating the top ten security vulnerabilities a web application may have, the testing approach, and remediation.


Advantages Disadvantages
Easy to pick up and understand.It may not be clear what type of vulnerability a web application has (they can often overlap).
Actively maintained and is frequently updated.OWASP does not make suggestions to any specific software development life cycles.
It covers all stages of an engagement: from testing to reporting and remediation.The framework doesn't hold any accreditation such as CHECK.
Specialises in web applications and services.Intentionally left blank.





NIST Cybersecurity Framework 1.1


images/3-3.png


The NIST Cybersecurity Framework is a popular framework used to improve an organisations cybersecurity standards and manage the risk of cyber threats. This framework is a bit of an honourable mention because of its popularity and detail.


The framework provides guidelines on security controls & benchmarks for success for organizations from critical infrastructure (power plants, etc.) all through to commercial.  There is a limited section on a standard guideline for the methodology a penetration tester should take.




Advantages Disadvantages
The NIST Framework is estimated to be used by 50% of American organisations by 2020. NIST has many iterations of frameworks, so it may be difficult to decide which one applies to your organisation.
The framework is extremely detailed in setting standards to help organisations mitigate the threat posed by cyber threats. The NIST framework has weak auditing policies, making it difficult to determine how a breach occurred.
The framework is very frequently updated.The framework does not consider cloud computing, which is quickly becoming increasingly popular for organisations.
NIST provides accreditation for organisations that use this framework. Intentionally left blank.
The NIST framework is designed to be implemented alongside other frameworks.Intentionally left blank.



NCSC CAF




images/3-4.png
The Cyber Assessment Framework (CAF) is an extensive framework of fourteen principles used to assess the risk of various cyber threats and an organisation's defences against these.


The framework applies to organisations considered to perform "vitally important services and activities" such as critical infrastructure, banking, and the likes. The framework mainly focuses on and assesses the following topics:
• Data security
• System security
• Identity and access control
• Resiliency
• Monitoring
• Response and recovery planning



Advantages Disadvantages
This framework is backed by a government cybersecurity agency. The framework is still new in the industry, meaning that organisations haven't had much time to make the necessary changes to be suitable for it.
This framework provides accreditation.The framework is based on principles and ideas and isn't as direct as having rules like some other frameworks.
This framework covers fourteen principles which range from security to response.Intentionally left blank.



Black/Grey/White Box PenTesting



images/3-5.png

Black Box Testing

No Knowledge about inner working of the Application or the service.
The PenTester will have the normel user access, he then find Vulnarebilities and miss configurations and gain access.
No need of Programming to perform these type of Testing.
A good time is need to be spend in Information Gathering and in Enumeration phase to understand the attack surface of the target.


Grey Box Testing

Most Popular Testing process in Penertration Teseting according to Try Hack me.
Combination of Black and White Box Testing.
PenTester have some limited knowledge, he do Pentest like a Black Box then use his knowledge to further assist.
Saves time compare to Black Box.
Often chosen for extremely well-hardened attack surfaces.

White Box Testing

Low level Process usually done by software developer who know programming.
Tester will have full knowledge of target's internal and its expected behavior.
More time consuming then Black Box.
Guarantees that the entire attack surface can be validated.

Comments

Popular posts from this blog

THM JRPentester Intro To Pentesting > Principles of Security

Advanced_Exploitation--Game_Zone Writeup