Security Testing in Software Development
Security Testing in Software Development
III-YEAR-CSE
2021 R
UNIT IV
SECURITY TESTING
Traditional Software Testing – Comparison – Secure Software Development Life Cycle – Risk Based
Security Testing – Prioritizing Security Testing With Threat Modeling – Penetration Testing –
Planning and Scoping – Enumeration – Remote Exploitation – Web Application Exploitation Exploits
and Client Side Attacks – Post Exploitation – Bypassing Firewalls and Avoiding Detection – Tools for
Penetration Testing
PART A
Answer:
Traditional software testing focuses on verifying functionality, performance, and correctness of
software without considering security aspects.
Answer:
Security testing identifies vulnerabilities and ensures the software is protected against threats,
whereas traditional testing verifies functional correctness.
Answer:
SSDLC is an approach where security is integrated into every phase of the software development
lifecycle to build secure applications.
Answer:
SSDLC helps in detecting and fixing security flaws early, reducing cost, risk, and effort in later
stages.
Answer:
It is a testing approach that focuses on identifying and testing the most critical security risks
based on threat analysis.
Answer:
To prioritize and allocate testing resources to areas with the highest security risks.
Answer:
Threat modeling is a process of identifying, analyzing, and mitigating potential security threats
to a system.
2
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Answer:
It helps prioritize security testing by identifying which areas are most vulnerable to threats.
Answer:
Penetration Testing is a simulated cyberattack performed to find and exploit vulnerabilities in a
system.
Answer:
Phases include planning, reconnaissance, enumeration, exploitation, post-exploitation, and
reporting.11. What is the purpose of planning and scoping in penetration testing?
Answer:
It defines objectives, target scope, rules of engagement, and legal boundaries for the penetration
test.
Answer:
Enumeration involves actively gathering detailed information about the target like usernames,
shares, and services.
Answer:
It refers to exploiting vulnerabilities in a system from a remote location without physical access.
Answer:
It involves exploiting vulnerabilities in web apps such as SQL injection, XSS, and authentication
bypass.
3
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Answer:
Cross-Site Scripting (XSS) and malicious browser plugins are examples of client-side attacks.
Answer:
Post-exploitation is the phase where the attacker maintains access, gathers data, and escalates
privileges after initial compromise.
Answer:
It refers to techniques used to avoid detection and access systems protected by firewall rules.
Answer:
Using encrypted communication or polymorphic payloads helps avoid intrusion detection
systems.
Answer:
Nmap and Metasploit are commonly used tools in penetration testing.
Answer:
The right tools help effectively identify vulnerabilities and simulate real-world attacks
efficiently.
4
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Part B
Definition:
Traditional software testing is the process of evaluating and verifying that a software application
performs its intended functions correctly without focusing on security aspects.
Main Objective:
To ensure:
Functionality
Reliability
Performance
Usability
1. Requirement Analysis
2. Test Planning
5. Test Execution
7. Test Closure
Type Purpose
Diagram
Main Focus Functionality, performance, and correctness Identifying vulnerabilities and ensuring protection
To check whether the software meets To ensure software can withstand malicious
Goal
requirements attacks
Tools Used Selenium, JUnit, QTP, TestNG Burp Suite, Nessus, Metasploit, Nmap
Detection Finds bugs, logic errors, performance issues Finds security holes and loopholes
Example Bug Button doesn’t work, crash on login SQL Injection, XSS, Privilege Escalation
7
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Definition:
The Secure Software Development Life Cycle (SSDLC) is a framework that integrates
security practices into every phase of the software development life cycle (SDLC), ensuring
that software is developed securely from the start.
Main Goal:
To identify and mitigate security risks early in the software development process, reducing cost
and enhancing software safety and compliance.
- Threat modeling
2. Design - Security architecture
- Risk analysis
- Secure configuration
5. Deployment - Patch management
- Encryption setup
- Continuous monitoring
6. Maintenance - Security updates
- Incident response
9
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Benefits of SSDLC:
10
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Conclusion:
SSDLC ensures that security is not an afterthought. It builds secure software by incorporating
security measures from planning to post-deployment.
Definition:
Risk-Based Security Testing is a testing approach that prioritizes and focuses on testing the
most critical areas of the application based on risk levels.
Main Goal:
To identify, analyze, and test parts of the software that are most vulnerable or likely to
be attacked.
Term Meaning
11
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Term Meaning
Identify Assets
Identify Threats
Perform Testing
& vulnarabilities
Prioritize Tests
Assess Risks
(High-risk first)
1. Asset Identification
→ What needs to be protected (data, components, APIs, etc.)
12
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
3. Risk Assessment
→ Evaluate likelihood and impact of threats.
Conclusion:
Risk-Based Security Testing helps to test smarter, not harder. It ensures that the most
vulnerable and impactful parts of the application are secured first.
Definition:
Threat modeling is the process of identifying, analyzing, and evaluating potential threats to
a system.
13
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
By combining it with security testing, we can prioritize which areas to test first based on
threat severity and risk level.
Step Purpose
1. Asset Identification Know what needs protection (e.g., user data, payment info)
5. Perform Security Tests Use tools to verify vulnerabilities (SAST, DAST, Pen-testing)
+---------------------------+
↓
+---------------------------+
| 5. Prioritize Testing |
| (Focus on top threats) |
+---------------------------+
Technique Description
Identifies six threat types: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of
STRIDE
Service, Elevation of Privilege
DREAD Rates risk using Damage, Reproducibility, Exploitability, Affected Users, Discoverability
Benefits:
Conclusion:
By using threat modeling to prioritize security testing, teams can test what matters most
first, ensuring stronger and more efficient software protection.
Definition:
15
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Penetration Testing, also known as ethical hacking, is the process of simulating real-world
cyberattacks on a system, application, or network to identify and exploit security
vulnerabilities.
Objective:
This stage involves defining the scope and objectives of the penetration test. It's crucial to
understand what systems or networks will be tested and what testing methods will be
employed.
16
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
During reconnaissance, information about the target system is gathered. This includes details
like network names, domain records, and any publicly available information about the
organization's infrastructure.
2. Scanning
In this phase, various tools and techniques are used to understand how the target application
responds to intrusion attempts.
Static analysis involves inspecting the application's code without executing it. This helps
identify potential vulnerabilities based on code structure and logic.
Dynamic analysis involves inspecting the application's behavior while it's running. This
provides real-time insights into how the application responds to different inputs and
interactions.
3. Gaining Access
Once vulnerabilities are identified in the scanning phase, this stage focuses on exploiting
those vulnerabilities to gain unauthorized access to the target system.
Common techniques include exploiting flaws like SQL injection or cross-site scripting to
gain control over the application or system.
4. Maintaining Access
After gaining initial access, the goal is to establish a persistent presence within the system.
This mimics the behavior of real attackers who aim to maintain access over an extended
period.
5. Analysis
Once the penetration test is complete, the results are compiled into a detailed report.
This report includes information about the vulnerabilities that were successfully exploited,
any sensitive data accessed, and the duration of undetected access.
17
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Penetration-testing-methods
External Testing
This test targets a company's online assets, like its website, web applications, email systems,
and domain name servers (DNS). The goal is to break in and steal valuable data, just like a
real hacker would.
Purpose: This method helps organizations understand their vulnerabilities from an external
threat perspective, highlighting weaknesses that malicious actors could exploit. It enables
proactive mitigation of risks before they are exploited by real attackers.
Internal Testing
Here, a tester who has access to the company's internal systems simulates an attack from
within. This could be like an employee's account being hacked through a phishing attack,
even if the employee themselves isn't doing anything wrong.
Purpose: The aim is to evaluate the effectiveness of internal security controls and detection
mechanisms. By simulating an insider threat scenario, organizations can identify weaknesses
in their internal security posture and improve measures to prevent unauthorized access.
Blind Testing
In this test, the tester only knows the name of the company. This simulates a real attack,
showing how the company's security team responds in real time without prior knowledge of
the test.
Purpose: This approach tests the organization's incident response capabilities and readiness
to handle unexpected attacks. It helps assess how effectively security teams detect, respond
to, and mitigate security breaches without advance notice, reflecting real-world attack
scenarios.
18
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Double-Blind Testing
This is like a surprise drill. The security team doesn't know about the test in advance, so they
can't prepare. This shows how well they can handle unexpected attacks.
Purpose: The objective is to evaluate the organization's overall security posture, including the
effectiveness of monitoring and response mechanisms under realistic conditions.
It provides insights into the organization's ability to detect and mitigate security threats without
prior preparation or knowledge of the simulated attack.
Targeted Testing
Both the tester and the company's security team know about the test and work together. This is a
training exercise where the security team gets live feedback from the tester, learning how to
improve their defenses.
Purpose: This method serves as a controlled exercise to train and validate the response
capabilities of the security team.
It allows for real-time feedback from the tester, facilitating continuous improvement of security
measures and incident response protocols based on identified vulnerabilities and weaknesses.
Black Box Penetration Testing:- In this Method attacker does not know the target as it
exactly simulates an actual cyber attack where an actual black hat hacker attacks.
This testing takes time as the attacker does not know the system so he gathers them.
This method is used to find existing vulnerabilities in the system and to simulate how far a
hacker can go into the system without any info about the system.
Grey Box Penetration Testing:- In this method, the attacker is provided with a bit more
information about the target like network configurations, subnets, or a specific IP to test,
Attacker has a basic idea of how the machine is to which he/she is going to perform an attack,
they may also be provided with low-level login credentials or access to the system which helps
them in having a clear approach, This saves time of Reconnaissance the target.
19
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
White Box Penetration Testing:- We can say that in this testing method attackers have
developer-level knowledge about the system which also includes an assessment of source code,
Ethical hackers have full access to the system more in-depth than black box testing. It is used to
find out potential threats to the system due to bad programming, misconfigurations, or lack of
any defensive measures.
Penetration testing utilizes WAF data such as logs, except in blind and double blind tests, to
identify and exploit application weaknesses.
WAF administrators use pen testing results to update configurations and enhance protection
against vulnerabilities discovered during testing.
Penetration testing satisfies compliance requirements for security audits like PCI DSS and
SOC 2.
Standards like PCI-DSS 6.6 mandate a certified WAF, but pen testing remains crucial for
improving WAF configurations and overall security.
The penetration test can be done to find the vulnerability which may serve as a weakness for
the system.
It can help determine the impact of an attack and the likelihood of it happening.
It can be used to test the security of any system, no matter how large or small.
It can be used to find vulnerabilities in systems that have not yet been exploited.
20
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
The penetration test which is not done properly can expose data that might be sensitive and
more.
The penetration tester has to be trusted, otherwise, the security measures taken can backfire.
Nmap: It is a network exploration tool and security scanner. It can be used to identify hosts and
services on a network, as well as security issues.
Wireshark: It is a packet analyzer. It can be used to capture and analyze network traffic.
Burp Suite: It is a web application security testing tool. It can be used to find security issues in
web applications.
Enumeration is a critical phase in penetration testing where an ethical hacker actively connects
to a target system to gather detailed information about it. This information can later be used to
identify vulnerabilities and exploit them.
Definition
21
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Technique Purpose
NetBIOS Enumeration Discover shared resources and users
SNMP Enumeration Get system info via Simple Network Management Protocol
SMTP Enumeration Identify valid email accounts on the mail server
DNS Enumeration Gather info about domain names and IPs
LDAP Enumeration Access user and group info in directory services
NFS Enumeration Discover exposed file systems
RPC Enumeration Gather details about Remote Procedure Calls on a system
Example
nmap -sV -T4 [Link]
Definition:
Remote Exploitation is the process where an attacker targets a vulnerable system over a
network (like the internet or LAN) to gain unauthorized access, execute malicious code, or
take control.
Objective:
Information Gathering
23
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Vulnerability Scanning
Gaining Access
Privilege Escalation
Maintaining Access
Covering Tracks
Common Tools:
Metasploit Framework
Netcat
Nmap
24
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
| |
|-------------------------------->
|<--------------------------------
| Privilege Escalation
|<--------------------------------
25
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
| Backdoor/Reverse Shell
|<--------------------------------
|<--------------------------------
Real-Life Example:
Summary:
Step Description
Definition:
Vulnerability Description
Cross-Site Scripting
Injecting malicious JavaScript
(XSS)
Cross-Site Request
Forcing users to perform unwanted actions
Forgery (CSRF)
File Upload
Uploading malicious files (web shells)
Vulnerabilities
Tools Used:
Burp Suite
OWASP ZAP
Nikto
SQLMap
Wfuzz, DirBuster
Definition:
27
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Client-Side Attacks exploit vulnerabilities in the user's browser, plugins, or web content
loaded from a website. The attacker tricks the user into executing malicious code in the browser.
XSS (Cross-Site
Injected scripts run in victim's browser
Scripting)
Malicious Ads
Advertisements with hidden malicious code
(Malvertising)
Maltego
+---------------+ +-----------------------+
+-------+-------+ +----------+------------+
28
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
| |
|<------------------------------------|
| |
|------------------------------------>|
|<------------------------------------|
Real-Life Examples:
SQL Injection in Yahoo (2012): Allowed attackers to steal user data by exploiting login
vulnerabilities.
Summary Table:
Type Example Tool Goal
Custom
CSRF Perform actions as a user
Scripts
Tricks
Drive-by
Exploit Kits Install malware silently
Download
Definition:
Post Exploitation refers to the activities carried out after successfully exploiting a target
system. The attacker now has access and focuses on:
Maintaining access
Covering tracks
Objective Purpose
Information
Extract system, network, and user info
Gathering
Objective Purpose
System Reconnaissance
3. Privilege Escalation
4. Persistence
31
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
5. Lateral Movement
6. Covering Tracks
| Exploited System |
| Information Gathering |
| Privilege Escalation |
32
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
| Maintain Access |
| - Backdoors, Auto-Scripts |
| Lateral Movement |
| Cover Tracks |
Metasplo
Post modules for gathering info, privilege escalation
it
Mimikat
Dump passwords/tokens on Windows
z
BloodHo
Visualize and exploit Active Directory
und
PowerSh
Used for stealthy Windows exploitation
ell
33
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Definition:
Firewall Bypass: Techniques used to evade firewall rules that block unauthorized access
to or from a network.
Avoiding Detection: Strategies to hide attacker activities from security tools like IDS
(Intrusion Detection Systems), antivirus, and logging systems.
These techniques are used during reconnaissance, exploitation, and especially post-
exploitation stages of penetration testing.
34
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
🔐 Goals:
Goal Description
1. Port Redirection
3. Reverse Shell
4. Proxy Servers/VPN
1. Payload Obfuscation
Use native system tools like PowerShell, WMI, certutil to avoid suspicion.
3. Log Cleaning
4. 🧬 Stealthy Malware
🧰 Tools Used:
Tool Purpose
ProxyChai
Route traffic through proxies
ns
Veil-
Create AV-bypassing payloads
Evasion
36
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Tool Purpose
Ncat/
Covert communication
Netcat
Real-World Example:
Attacker creates a Metasploit payload that connects back on port 443 (looks like HTTPS).
Summary Table:
Technique Purpose Tool Example
Here's a complete and clear list of tools used in Penetration Testing, categorized by the
phases of the penetration testing life cycle, along with short descriptions. This is useful for
both academic study and practical learning.
Purpo
Phase Tool Name
se
1.
Reconnaissanc
e
38
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Purpo
Phase Tool Name
se
2. Scanning and
Enumeration
Full-featured vulnerability
- OpenVAS
scanner
3. Gaining Access
(Exploitation)
Exploitation, payload
- Metasploit Framework
generation
3. Gaining Access
(Exploitation)
4. Privilege Escalation
- Linux Exploit
Find kernel/local exploits on Linux
Suggester
5. Maintaining
Access
- Netcat
Remote shell & backdoor setup
(Backdoor)
6. Covering Tracks
Remove command
- PowerShell Scripts
history/logs
40
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
6. Covering Tracks
- bash_history
Delete Linux shell history
manipulation
7.
Reporting
Reconnaissanc
Nmap, theHarvester, Maltego, Recon-ng
e
Post
Meterpreter, Mimikatz, PowerShell Empire
Exploitation
Password
John the Ripper, Hydra, Hashcat
Attacks
Wireless
Aircrack-ng, Wifite, Kismet
Attacks
Web App
Burp Suite, OWASP ZAP, Nikto, DirBuster
Testing
41
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
Optional Add-on:
Would you like a flowchart or diagram showing where each tool fits into the penetration
testing cycle? Or a printable one-page cheat sheet?
Let me know if you'd like it in PDF, PPT, or notebook format for your class or exam prep
1. Compare and contrast traditional software testing with security testing. Explain with suitable
examples.
2. Explain the Secure Software Development Life Cycle (SSDLC) and describe how security is
integrated at each phase.
3. What is Risk-Based Security Testing? Discuss its methodology, benefits, and how it differs
from conventional testing.
4. Illustrate how Threat Modeling helps in prioritizing security testing. Explain any one threat
modeling technique in detail (e.g., STRIDE, DREAD, etc.).
5. Describe the steps involved in Penetration Testing. What are the key goals and
methodologies used during a penetration test?
42
Prepared by [Link] Chithra AP/CSE.
CB3591/ESSS/UNIT 4/V-CSE/SRRCET
6. Explain the importance of Planning and Scoping in Penetration Testing. What components
should be included in a good penetration test plan?
7. Define Enumeration in penetration testing. Explain its techniques and how it contributes to
the overall security assessment process.
8. What is Remote Exploitation? Explain the process with examples of common remote
exploitation techniques used by attackers.
9. Discuss the various types of Web Application Exploits and Client-Side Attacks. How can
these be identified and prevented?
10. What is Post-Exploitation in penetration testing? Discuss the objectives, techniques, and
tools used after gaining initial access to a system.
[Link] can firewalls be bypassed by attackers? Discuss techniques used to avoid detection and
intrusion prevention systems.
12. List and explain at least five important tools used in penetration testing. Describe their
functionalities and use-cases.
43
Prepared by [Link] Chithra AP/CSE.