Penetration Testing Tutorial: Stages, Types, Methods & Tools

Penetration testing or also known as pen testing is the process of simulating real attacks on systems or networks to access the risks associated with potential security breaches. During pen test, testers not only discover vulnerabilities but also exploit them.
app testing
Pen testing is mainly attempting to breach any application systems, protocol interface etc. to uncover vulnerabilities, such as codes that are susceptible to attacks. Penetration testing which is generally ethical hacking is a necessary in-demand skill for testing an organization’s defense systems.
Why do we need to perform Pen Testing:

  • To uncover the critical vulnerabilities within your network systems
  • It can provide an overview of an organization’s exploitable vulnerabilities and include recommendations on how you can optimize the protection levels
  • Reveal problems that were not known
  • Prevent business interruptions, loss and protect brand image
  • Find both known and unknown hardware/software flaws which can be identified and fixed using automated tools
  • Assess and validate the efficacy of an organization’s defensive mechanisms

Stages of Penetration Testing:
As penetration testing is very much technical and complicated, it needs to be split into different stages. Lets take a brief look:
1)  Planning & Setting your Goal: In this phase, you define the scope and goal of the test to be carried out including, addressing the system on which the test is performed and finalising the steps for the test. You need to also understand and gain knowledge about the network, domains and the server to identify how the target works on potential vulnerabilities.
mobile app
2) Scanning Phase: During this phase, it becomes clear to the tester that how the target app will respond to the intrusion attempts. This is basically done in 2 ways:

  1. Static Analysis: Inspect an app’s code to see how it performs in a running state
  2. Dynamic Analysis: Provides a real-time view of how an app performs

3) Selection of Proper Pen-testing tools: Choosing the right tool, requires mere intelligence, a little bit of luck and lot of patience. Rather than just going for quality and checking whether it fits to your job, its essential to note that it doesn’t contain any sort of malware or codes that could in-turn hack the tester.
There are plenty of tools available online for free but note to double check as most of them may contain malware and mostly undocumented back doors. But the best pen testers always go for their own written codes and tools as they don’t trust on free sources.
Eg: Nmap, Aircrack-ng, Wifiphisher, Burp Suite, OWASP ZAP etc.
4) Gaining Access: This stage is basically about using web apps like SQL injections, cross-site scripting, back doors etc. to uncover the target vulnerabilities. Once the vulnerabilities are found, testers try to solve them by intercepting traffic, escalating privileges or by stealing data.
5) Maintaining the Access: In this stage, the pen tester tests whether the vulnerability can be used to achieve a persistent presence in the exploited system. This is done to imitate the advanced persistent threats that remain for months or even years in a system to steal the most sensitive data from an organization.
6) Analysing the System: The results like the number of vulnerabilities exploited, the intensity of the sensitive data that could have been accessed and the total time the pen tester could spend within a network system without being detected is checked and documented.
Types of Penetration Testing
The type of penetration testing generally depends upon the scope of the goal to be attained or the testing is simulated against the employee, internal resources or external sources. On the basis of this, penetration testing is mainly of 3 types:

  • Black Box Testing: In this case, the tester needs to collect all information regarding the system before he/she starts working
  • White Box Testing: Here, the pen tester is provided with almost all details regarding the system such as IP addresses, source codes, OS details etc.
  • Grey Box Testing: In this, the tester is provided with partial knowledge about the system

Penetration Testing Methods
By analysing different methods of attacks that might affect an organization, there might be different methods of penetration testing:
1) External Testing: This targets the assets of an organization that is visible on the internet. So the main aim is to gain access and also extra valuable data.
2) Internal Testing: Here, the tester with the access to an app behind its firewall is simulated by an attack by the malicious insider.
3) Blind Testing: In this case, the pen tester is only given the name of the organization, so that the system security personal gets a real-time look at how actual app assault happens.
4) Double Blind Testing: In this type of attack, the security personal within the organization would have no idea regarding the assault same as like it happens in real attempted breaches.
5) Targeted Testing: In this testing, the pen tester and the security personal both work together regarding the vulnerabilities. This is quite a valuable method as it offers instant suggestions from the hackers point of view.
Penetration Testing Tools
Penetration testing is the process which is undertaken by testers to find vulnerabilities in your systems before the attackers intrude in. The different pen test tools can be broken down into major categories like:
1) Port Scanners: Tools in this category typically gather information and personal data about a specific target from a remote environment.
2) Vulnerability Scanner: These tools are used to find if there is any known vulnerabilities in the targeted system.  This is again subdivided to:

  • Host-based
  • Network based

3)  Application Scanner: These type of tools checks in for any type of weakness within the web-application (eg: Ecommerce apps)
Below we have listed a few tools that can be used for simple assessments or even complex tasks in which some are got for free and some require licence payments.
1) Aircrack-ng: This is a full suite of wireless assessment tool that covers attacking(cracking WAP & WEP) and packet capture.
2) SQLmap: This is an automated SQL injection and database tool common and widely used in platforms -MSSQL, MySQL, Access, PostgreSQL, SQLite etc.
3) THC-Hydra: It is generally known to be a network login cracker that supports several services and it isn’t very complex to handle.
4) Metaspoilt: One of the most popular and advanced framework that is based on the concept of ‘exploit’ that is you pass on a code that cause breaches and enter the system.
 5) Nessus vulnerability scanner: This is one of the most commonly used pen tool worldwide to identify vulnerabilities, malware that attackers use against your system and even policy violating configurations.
 6) WireShark: Also known as Ethereal, this is a network analysis tool that captures packet in real time and displays the results in human readable format codes.
automation testing
 Conclusion
As high-profile data breaches continue to dominate the headlines, the attitude of enterprises towards cyber security have also started shifting. As a result, there is an increased focus on detection and remediation strategies today. But, sophisticated security strategies only work out if the process, technology and people put in their inputs together to test and identify whether there is any weaknesses left open.

Performance Testing – Types, Stages, and Advantages

Performance testing has proved itself as a crucial success factor of projects with an aim to demonstrate an application which works as per benchmarked specification within a given response time and on a practical database.
testbytes-mobile-app-testing-banner
It actually enables developers to elicit the diagnostic information needed to eliminate bottlenecks in the performance of a system or software or application in users’ system. In otherwise it determines the readiness of the system to third party use.
Type of Performance tests
Performance testing is a comprehensive terminology. It entails five types of tests such as performance testing, load testing, scalability test, volume testing and stress testing.
1) Performance testing
This is the first task and it includes testing each part of the system to detect which part is slow. Based on the results of this test, efforts are made to make the response faster.
2) Load testing
This test is done to test whether the application or system is user ready in terms of expected load or not.  The applications performance is examined by the response time it takes for a specified user load.
3) Stress testing
The test is done to understand at what level of stress or user number, the system starts generating errors and whether it is able to come back online after a massive spike in user number or a crash. The time taken to come back online is another factor to reckon with in this test.
4) Scalability testing
Scalability testing is done to ensure that the software is handling increasing workload effectively. This is done by gradually adding work load or users and continuously monitoring performance of the software or application.
5) Volume testing
This ensures how effectively the system is able to handle a large amount of data. That is why, it is also known as flood testing. The data is then gradually increased with the apps usage.
Performance Testing Stages
There are basically 7 important steps in performance testing.
1) Identifying the testing environment:
The testing team has to identify the hardware, software, network configurations and tools needed to start the test. This may include the actual production system or a replica of the same. Sometimes a subset of the production system with same or lower specification is also used.
2) Identifying the performance metrics:
Performance metrics is very important which determines the parameters on which the performance has to be tested. The metric must include response time, wait time, average load time, peak response time, error rate, concurrent users, throughput, request per second, CPU utilisation, memory utilisation, constraints etc. The success criterion differs from application to application. Therefore, corresponding success criteria must be included in the metrics.
3) Planning and designing the test:
At this stage the test team has to identify test scenarios taking into account variability of users, test data and testing parameters. This may lead to creation of more than one model for testing.
4) Configuring the testing environment:
At this stage the testing environment consisting of hardware, software and testing instruments needs to be prepared to monitor the performance of the application or system.
5) Capturing the data:
When everything is ready testing is begun and the data captured on different parameters is captured for analysis.
6) Analysis and report generation:
The data captured in the previous step is analysed and shared with the team. Based on the analysis corrective action is taken to rectify the problems.
7) Retesting:
The test is again performed on the same parameters to test if the rectification work is sufficient or needs fine tuning. Once this is found to be okay testing is carried out using different parameters and rectification, if needed, conducted.
Test-your-WebApps-for-better-stability
Advantages of Performance Testing
Performance testing helps to –

  • Assess the amenability of the system to growth
  • Identify weak points in the architecture
  • Detect bugs in the software that could not have been identified otherwise
  • Tune up the system
  • Verify resilience and reliability of the system

When Should Performance Testing be Performed?
To save money and time, performance testing should be done early in the application or system development life cycle. This helps in testing the basic technology such as network performance, load balancing, application server performance, database server performance and web server performance. However, this should be done with expected load levels.
Detecting and correcting a performance problem after the website has gone live can be a prohibitively costly proposition for you. As soon as all the web pages are built and working load testing should be initiated. Thereafter, every time a module or part of software or application is implemented it should be tested for performance.
Conclusion
To avoid delay and cost overrun the best practice to be adopted is testing the application early in its development cycle. So individual units or modules should be tested for performance as and when these are complete.
Moreover, a single test does not resolve all queries. So repeated, but smaller tests need to be performed to come up with a robust system.