CyberSecurityInterview Questions HackerBook
CyberSecurityInterview Questions HackerBook
Technologies
8549995000
Contents
1. What is meant by SQL injection? .......................................................................................................... 5
2. What are the Types of SQL Injections? ................................................................................................. 5
3. How do you prevent SQL Injection? ..................................................................................................... 5
4. What is the tool that is used for SQL Injection? ................................................................................... 6
5. Tell me some commands for sqlmap? .................................................................................................. 6
6. What is Cross Site Scripting (XSS)?........................................................................................................ 6
7. What are the Different Types of XSS? .................................................................................................. 6
8. Which is the most severe among all the XSS Vulnerabilities? .............................................................. 7
9. What is the difference between Stored XSS and DOM Based XSS? ..................................................... 7
10. What is the Impact of XSS? ............................................................................................................... 7
11. What are the Prevention Techniques for XSS? ................................................................................. 7
12. What is Content Security Policy (CSP)? ............................................................................................. 7
13. What is meant by CSRF and how do you test it? .............................................................................. 7
14. What are the Mitigations of CSRF? ................................................................................................... 8
15. What is CSRF Tokens? ....................................................................................................................... 8
16. What is meant by SSRF and its Impact? ................................................................................................. 8
17. How to test SSRF and What is the Root cause of SSRF? ................................................................... 9
18. What are the Mitigations of SSRF? ................................................................................................... 9
19. What is the difference between CSRF and SSRF? ............................................................................. 9
20. What is meant by CORS?......................................................................................................................... 9
21. What is Same Origin Policy? ................................................................................................................... 9
22. What are the Preventions mechanism for CORS? ................................................................................ 10
23. What is XXE Attack? .............................................................................................................................. 10
24. What are the Different types of XXE attacks? ...................................................................................... 10
25. How to prevent XXE vulnerabilities?..................................................................................................... 10
26. What is meant by IDOR and how do you test IDOR? ............................................................................ 11
27. How do you design application to protect from IDOR? ........................................................................ 11
28. Privilege escalation? Types? ................................................................................................................. 11
29. How do you prevent Privilege Escalation?............................................................................................ 11
30. What is meant by Click jacking Vulnerability? ...................................................................................... 11
31. What is the mitigation for Click jacking Vulnerability? ......................................................................... 11
HackerBook
Technologies
8549995000
63. What are the tools you have worked on Mobile security?................................................................... 19
64. How do you test API, what are the tools you have used for API? ........................................................ 19
65. What is the latest TLS? .......................................................................................................................... 19
66. What is the purpose of NMAP? ............................................................................................................ 19
67. What is the Difference between Authentication and Authorization? ............................................ 19
68. What’s the difference between HTTP and HTTPS? ......................................................................... 19
69. What’s the protocol responsible for secure communication? ....................................................... 20
70. What’s the purpose of digital Certificates? .................................................................................... 20
71. Can you name 2 or 3 Digital Certificate provides (CA)? .................................................................. 20
72. Assume a user is trying to launch a secure banking website and the sending a feedback. Will that
be Symmetric or Asymmetric or both encryption mechanisms? ............................................................... 20
73. What is the SSL Handshake?? ......................................................................................................... 20
74. What are the 3 steps that are invoked in 3 way tcp-ip handshake? .............................................. 21
75. What is the default port for RDP?................................................................................................... 21
76. What is the default port for SMTP? ................................................................................................ 21
77. What's purpose of SMTP server? For E-mail purpose? .................................................................. 21
78. What is the default port for DNS? .................................................................................................. 21
79. What's purpose of DNS server?--> resolving names to Ip address we call it as reverse DNS. ....... 22
80. What is the default port for web proxy? ........................................................................................ 22
81. What is Threat Modelling? List 2 or 3 techniques for Threat Modelling? ...................................... 22
82. What is the difference between STRIDE and DREAD? .................................................................... 22
83. What's the full form of STRIDE? ...................................................................................................... 23
84. What's the full form of DREAD? ...................................................................................................... 23
85. What’s the purpose of CVSS? ......................................................................................................... 23
86. What’s the range of CVSS?.............................................................................................................. 23
87. What is the severity of the vulnerability/defect for the CVSS score 9.5?....................................... 23
88. What is the severity of the vulnerability/defect for the CVSS score 2.0?....................................... 23
89. What are the severity ratings for the vulnerabilities under CVSS? ...................................................... 23
90. Give one example for critical severity? ................................................................................................. 23
91. Explain about Security Misconfiguration? ............................................................................................ 23
92. What's a DOS attack? ............................................................................................................................ 24
93. DDOS stands for? .................................................................................................................................. 24
94. What is the DDOS attack? ..................................................................................................................... 24
HackerBook
Technologies
8549995000
95. What are the steps involved in 3 way TCP-IP handshake? ................................................................... 24
96. What's the difference between TCP connect scan (Full duplex) and Stealth scan (Half duplex)? ....... 24
97. Identity of the attacker is hidden during Full duplex scan or Half duplex scan? .................................. 25
98. What’s are the arguments to be used for Null scan and Finish scan in nmap? .................................... 25
99. What’s are the arguments to be used for Version scan in nmap? ....................................................... 25
100. Name all the TCP flags in a TCP packet? ............................................................................................. 25
100. What’s the difference between RST and FIN? .................................................................................... 25
101. What’s the difference between PSH and URG? .................................................................................. 25
102. What are the 3 principles of Information Security? ........................................................................... 25
103. What is the Threat that gets triggers by Lack of availability? ............................................................. 25
104. What is full form of DDOS and how do you test DDOS? ..................................................................... 26
105. Do you design application to protect from DOS or DDOS? ................................................................ 26
106. How do you test Session management? ............................................................................................. 26
107. How do you design application to protect from Session Hijacking Attacks?...................................... 26
108. How do you test Brute Force Attack for a Login page? ...................................................................... 26
109. How do you design application to protect from Brute Force Attacks? .............................................. 26
110. How do you implement login feature of a website for better security? ............................................ 27
111. What’s the importance of HSTS? ........................................................................................................ 27
112. Different bw Open, Closed and Filtered? ........................................................................................... 27
113. Test Strategy? ..................................................................................................................................... 27
114. CVSS Scoring? ...................................................................................................................................... 27
115. False Positive means? ......................................................................................................................... 28
116. Data vs Info?....................................................................................................................................... 28
117. Meanings of Vulnerability, exploit, Payload, Threat ? ........................................................................ 28
118. TLS communication works? ................................................................................................................ 28
119. Session Hijacking -- Types ................................................................................................................... 28
120. How does the Firewall work?.............................................................................................................. 28
121. How do the IDS work?......................................................................................................................... 28
122. What’s the difference between IDS and IPS? ..................................................................................... 29
123. Name 1 or 2 examples of Firewalls? ................................................................................................... 29
124. Name 1 or 2 examples of IPS /IDS? ..................................................................................................... 29
125. Name 1 or 2 examples of AV or Anti Malware?.................................................................................. 29
126. What’s meant by Virus? ...................................................................................................................... 29
HackerBook
Technologies
8549995000
Sqlmap –u url
9. What is the difference between Stored XSS and DOM Based XSS?
In Stored XSS the payload is stored in the server and it executes multiple times when victim launches the
vulnerable page.
DOM XSS is a client side attack. It makes use of DOM Objects to executes the payload.
First I login to the application as a normal user, Even though am an attacker and I try to capture
a request and I try to frame a request by modifying some of the details like password, address,
phone number or zip code. Then I send this CSRF through any social engineering attacks to the
victim. If incase the victim is already login to the application and parallel if he runs our link the
password or the phone will gets updated.
17. How to test SSRF and What is the Root cause of SSRF?
We run Burp Collaborator client, where it runs a service through some socket that service we
mention in any of the intercepted request. If attack is success then we will be able to list the
backend servers in the burp client.
Root Cause:
SSRF is that a web application needs to retrieve resources from another domain to fulfil the
requests. But, the input URL is not properly sanitized and allows attacker to manipulate the
destination.
SSRF stands for Server Side Request Forgery. In SSRF the attacker tries to gain access to the back end
servers
- The same origin policy is very restrictive & consequently various approaches have been devised to
circumvent the constraints.
- Many websites interact with sub domains or third party sites in a way that requires full cross origin
access
- A controlled relaxation of the same origin policy is possible using cross origin resource sharing
- CORS protocol uses a suite of http headers that defines trusted web origin and associated properties
such as whether authenticated access is permitted.
- These are combined in a header exchange
In some situations, an attacker can escalate an XXE attack to compromise the underlying server or other
back-end infrastructure, by leveraging the XXE vulnerability to perform SSRF attacks.
Exploiting XXE to retrieve files, where an external entity is defined containing the contents of a file, and
returned in the application's response.
Exploiting XXE to perform SSRF attacks, where an external entity is defined based on a URL to a back-end
system.
Exploiting blind XXE filtrate data out-of-band, where sensitive data is transmitted from the application
server to a system that the attacker controls.
Exploiting blind XXE to retrieve data via error messages, where the attacker can trigger a parsing error
message containing sensitive data.
Generally, it is sufficient to disable resolution of external entities and disable support for XInclude.
This can usually be done via configuration options or by programmatically overriding default behavior.
Consult the documentation for your XML parsing library or API for details about how to disable
unnecessary capabilities.
Try to access resources which you are not authorised it can be API, Library, Method etc
Ex: ABC BANK.com, a/c no: 2233, a/c no: 2333
This can cause users to unwittingly download malware, visit malicious webpages, provided credentials
or sensitive data/information.
Send complex data, for example, over a network between different components of an application or in an
API call.
Deserialization: is the process of restoring this byte stream to fully functional replica of the original
object, in the exact state as when it was serialized.
The website’s logic can then interact with this desterilized object, just like it would with any other
objects.
Insecure Deserialization:
This potentially enables an attacker to manipulate serialized objects in order to pass harmful data in the
application code.
It is even possible to replace a serialized object with an object of an entirely different class.
Alarmingly objects of any class that is available to the website will be desterilized and instantiated
regardless of which class was expected.
For this reason, insecure deserialization is sometimes known as object injection vulnerability.
This means that the deserialization itself can initiate an attacker even if the websites own functionality
does not directly interact with the malicious object
For this reason website whose logic is based on strongly types languages can also be vulnerable to these
techniques.
- It allows an attacker to reuse existing application code in harmful ways, resulting in numerous other
vulnerabilities, often remote code execution.
- Even in cases where remote code execution is not possible, insecure deserialization can lead to
privilege escalation arbitery file access and DOS attack.
-execute strict constraints for the deserialization process before object creation
It focuses on the need for threat modelling, secure design patterns and principles.
These flaws in insecure design are not something that can be rectified by an implementation.
Local File Inclusion attacks are used by attackers to trick a web application into running or exposing files
on a web server. If the attack is successful, it will expose sensitive information, and in severe cases, can
lead to XSS and remote code execution.
Mitigations:
Remote file inclusion (RFI) is an attack targeting vulnerabilities in web applications that dynamically
reference external scripts. The perpetrator's goal is to exploit the referencing function in an application
to upload malware (e.g., backdoor shells) from a remote URL located within a different domain.
Mitigations: Remote file inclusion (RFI) is an attack targeting vulnerabilities in web applications that
dynamically reference external scripts. The perpetrator's goal is to exploit the referencing function in an
application to upload malware (e.g., backdoor shells) from a remote URL located within a different
domain.
42. How do you test the login page when there is a Username, Password and SUBMIT
Button and list out all the possible scenarios?
Brute force attack
SQL injection bypass payload as 1’ or ‘1’=’1
Click jacking
User enumeration (to check whether the user is there or not)
2FA (By giving all*** in the place of OTP to bypass 2fa)
(We can change some parameters to disable OTP options)
Captcha (Default captchas or disabling the captcha)
Default usernames and passwords like admin and welcome
43. If there is a functionality of file upload what are the scenarios that we are going to test it?
File Extension (we can extend how much we want)
Execution (if we upload files with .html, .php, scripts also accepting and getting executed)
File content ( by not even checking the file content of file it is accepting to upload)
../../ (give like same in the browser and try to upload a file and file path is getting displayed)
Virus files
Change file name while storing in server (this will mitigate the exploitation of files)
Hashing: It is used to protect integrity. Whatever the size of input we give it will convert into
unique hash value and it is irreversible.
Encoding: it has no keys. Data is converted to other forms. There are techniques like
Asymmetric: It has two keys for the cryptography Public key, Private Key
If we use Public key for encryption means then we will use private key for decryption, and vice versa
46. What is the test methodology that you have follow to do security testing?
Basically the approach varies based on the client requirement we do get requirement to perform any
automated scanning and we do get requirement for both automated scan and manual pen testing.
When we perform automated scan the approach is like we scan the application and we try to perform
the automated scan where we provide the username and password and record the login sequence and
initiate the scan once the report gets generated we do manual verification for their vulnerabilities and
we prepare a consulted report based on CVSS score. We refer to OWASP for manual security test cases
and along with automated scan results even we attach this normal security test results as well.
47. What are the tools you have used for DAST?
Burp Suite, App Scan, VeraCode, ZAP, Nikto, NMAP, Nessus, Netsparker
48. What are the tools that you have used for SAST?
Checkmarks, Sonarqube, AppScan, Veracode, Fortify, GitLab, Coverity
49. What are the tools that you have used for Network security Assessment?
I have used tools like NMAP, Nessus, Nexpose for Network pen testing
50. Provided the website, what is the methodology for doing the pen testing?
We follow a hybrid model where we scan the application and do the analysis and we do the manual pen
testing. As part of manual pen testing we don’t do any automated scans, we check for the OWASP
Vulnerabilities, common web vulnerabilities, business logic vulnerabilities and we execute all those
scenarios and we will collect all the Proof of Concepts and finally we work on the reporting. This is how
like we perform the manual based pen testing and the methodology for website.
51. Provided one IP address, what is the methodology for doing the pen testing?
For IP Address we do the information gathering (Reconnaissance) and then scanning and then finding
vulnerabilities and exploitations. As part of Reconnaissance we try to collect as many details as possible
like IP addresses, name service, domain name service, sub domains, services that are running in that IP
HackerBook
Technologies
8549995000
address, open port numbers, and known vulnerabilities and then we check for the vulnerabilities and
the exploitation . depending upon the service it is running we try to do more enumeration.
52. Tell me what is meant by Treat modelling and list some techniques of threat modelling?
Basically threat modelling is done in the initial stage of the SDLC. We usually do security testing based on
the designed documents, requirement documents & architecture. There is lot of techniques like STRIDE,
DREAD, CVSS and PASTA.
I have experienced on SRTIDE mechanism for Spoofing, Tampering, Repudiation, Information Disclosure,
DOS and Elevation of privilege. And try to find all the critical assets we check their connections with
respect to the different users and then we draw the diagrams based on that we try to identify threats.
This is very important stage because all test strategy should base on the threat modelling.
53. Tell me SDLC and its phases and security testing activities in those phases?
Requirement gathering & Analysis, We do Threat Modelling
Design
Develop - Secure coding
Testing - Dynamic scan and Manual PT
Deployment - Hardening
54. Full form of SAST, DAST, SDLC, CVSS, GDPR, PCIDSS, VAPT?
SAST: Static Application Security Testing
55. Tell me some interesting Vulnerabilities’ that you have found so far?
XSS Vulnerability
CSRF Vulnerability
SSRF Vulnerability
HackerBook
Technologies
8549995000
56. What is meant by Zero day attack and list some Zero day attack?
Zero days has Vulnerability meant where the developers don’t know t to fix
Remote code execution vulnerability exists when MSDT is called using the URL protocol from a calling
application such as Word. An attacker who successfully exploits this vulnerability can run arbitrary code
with the privileges of the calling application. The attacker can then installs programs, view, change, or
delete data, or create new accounts in the context allowed by the user’s rights.
Purpose limitation
Accuracy
Storage limitation
Data minimization
Acceptability
It is used to provide a set of standatised data protection laws across all the member countries
Guidelines or Requirements:
Cryptographic failures
Injection
Insecure design
Security misconfiguration
SSRF
Mass Assignment
Security Misconfiguration
Injection
63. What are the tools you have worked on Mobile security?
64. How do you test API, what are the tools you have used for API?
For testing the API’s first we need to construct the request . for construct the request we need the
request details, API request details, end point url, request method type, if not like either we can get the
entire JSON Collection or the Swagger url, once the request details are framed then we can perform the
pen testing, we need to configure the proxy in the API tool like Postman tool and take that request to
the Burp Suite then try all the scenarios with different payloads and positions.
Authorization comes up after the authentication process and it is used for checking the access or the
permissions across different pages or resources.
HTTP URL in your browser's address bar is http:// and the HTTPS URL is https://.
HTTP sends data over port 80 while HTTPS uses port 443.
No SSL certificates are required for HTTP, with HTTPS it is required that you have an SSL
certificate and it is signed by a CA.
HTTP doesn't require domain validation, where as HTTPS requires at least domain validation
and certain certificates even require legal document validation.
72. Assume a user is trying to launch a secure banking website and the sending a feedback.
Will that be Symmetric or Asymmetric or both encryption mechanisms?
Phase 1:
Validate the certificate and inistall, send “session key” (encrypt with public key of server (session)}
HackerBook
Technologies
8549995000
Phase 2:
Client hello: The client sends a client hello message with the protocol version, the client random, and a
list of cipher suites.
Server hello: The server replies with its SSL certificate, its selected cipher suite, and the server random.
In contrast to the RSA handshake described above, in this message the server also includes the following
(step 3):
Server's digital signature: The server uses its private key to encrypt the client random, the server
random, and its DH parameter*. This encrypted data functions as the server's digital signature,
establishing that the server has the private key that matches with the public key from the SSL certificate.
Digital signature confirmed: The client decrypts the server's digital signature with the public key,
verifying that the server controls the private key and is who it says it is. Client DH parameter: The client
sends its DH parameter to the server.
Client and server calculate the premaster secret: Instead of the client generating the premaster secret
and sending it to the server, as in an RSA handshake, the client and server use the DH parameters they
exchanged to calculate a matching premaster secret separately.
Session keys created: Now, the client and server calculate session keys from the premaster secret, client
random, and server random, just like in an RSA handshake.
74. What are the 3 steps that are invoked in 3 way tcp-ip handshake?
79. What's purpose of DNS server?--> resolving names to Ip address we call it as reverse
DNS.
The Domain Name System (DNS) is the phonebook of the Internet. Humans access information
online through domain names, like nytimes.com or espn.com. Web browsers interact through
Internet Protocol (IP) addresses. DNS translates domain names to IP addresses so browsers can
load Internet resources.
Each device connected to the Internet has a unique IP address which other machines use to find
the device. DNS servers eliminate the need for humans to memorize IP addresses such as
192.168.1.1 (in IPv4), or more complex newer alphanumeric IP addresses such as
2400:cb00:2048:1::c629:d7a2 (in IPv6).
STRIDE
DRIED
OCTAVE
P.A.S.T.A.
87. What is the severity of the vulnerability/defect for the CVSS score 9.5?
Critical
88. What is the severity of the vulnerability/defect for the CVSS score 2.0?
Low
89. What are the severity ratings for the vulnerabilities under CVSS?
0.0-3.9 is considered "Low" ; 4.0-6.9 is "Medium" , 7.0 TO 8.9 – High, 9.0-10.0 is
"Critical" severity.
X-Frame Options
HackerBook
Technologies
8549995000
We need to set
X-Frame Options to Deny or Same Origin
Strict Transport Security To Max value of 2 years
X-Content-Type-Options to No Sniff
X-XSS Protection To 1
96. What's the difference between TCP connect scan (Full duplex) and Stealth scan (Half
duplex)?
TCP Connect scan establish a full connection with the target but SYN scan completes only a half
of the connection with target.
For full duplex -> sync, sync+ack, ack
For half duplex -> sync, sync+ack, reset
HackerBook
Technologies
8549995000
97. Identity of the attacker is hidden during Full duplex scan or Half duplex scan?
Half duplex scan
98. What’s are the arguments to be used for Null scan and Finish scan in nmap?
Null scan (-sN)
99. What’s are the arguments to be used for Version scan in nmap?
-sV
2nd Flag - Acknowledgement. The Acknowledgement flag is used to acknowledge the successful
receipt of packets. ...
104. What is full form of DDOS and how do you test DDOS?
A Denial of Service (DOS) attack is a malicious attempt to affect the availability of a targeted
system, By using HPING3 Tool.
107. How do you design application to protect from Session Hijacking Attacks?
Session configuration-session Id should be long & unique.
Implement proper timeouts/ expiration for cookie expiration
Set secure flag for the cookie – communication over HTTPS
Set HTTP flag for the cookie- accessible the cookie only HTTP
Set HSTS request header- avoid forcible launch of application through HTTP
108. How do you test Brute Force Attack for a Login page?
By using Burp suite tool, for login id use some kind of default passwords, for both Used id and
password we use cluster bomb method, is there any deviation from expected output we conform
para meter length.
109. How do you design application to protect from Brute Force Attacks?
Use Strong Passwords
Restrict Access to Authentication URLs
Limit Login Attempts
HackerBook
Technologies
8549995000
Use CAPTCHAs
110. How do you implement login feature of a website for better security?
https should be used for website
input filtering for username like string @string
user name case sensitivity
password strength should be minimum above 8 chars & case sensitive
multifactor authentication required like OTP, 2-step Verification, finger print, secret code, Captcha. Etc
don’t display generic errors for login failure
storage of passwords should be Hashing + Salt
password history – minimum 3 months
Firewalls are software or hardware that work as a filtration system for the data attempting to
enter your computer or network. Firewalls scan packets for malicious code or attack vectors that
have already been identified as established threats.
Intrusion detection systems are used to detect anomalies with the aim of catching hackers before
they do real damage to a network. They can be either network- or host-based. ... Intrusion
HackerBook
Technologies
8549995000
detection systems work by either looking for signatures of known attacks or deviations from
normal activity.
The primary difference between the two is that one monitors while the other
controls. IDS systems don't actually change the packets. They just scan the packets and check
them against a database of known threats. IPS systems, however, prevent the delivery of the
packet into the network.
A computer virus is a type of computer program that, when executed, replicates itself by
modifying other computer programs and inserting its own code. When this replication succeeds,
the affected areas are then said to be "infected" with a computer virus.
HackerBook
Technologies
8549995000
A Trojan horse, or Trojan, is a type of malicious code or software that looks legitimate but can
take control of your computer. A Trojan is designed to damage, disrupt, steal, or in general
inflict some other harmful action on your data or network. ... Once installed, a Trojan can
perform the action it was designed for.
Rootkits are a type of malware that are designed so that they can remain hidden on your
computer. But while you might not notice them, they are active. Rootkits give cybercriminals
the ability to remotely control your computer.
129. How do you perform penetration testing in production without any tools?
like social engineering can be done by humans only. Manual checking includes design, business
logic as well as code verification.
it done in 2-ways are : block box testing, and white box testing
in black box testing we get the details like :- information gathering, scanning, gain access – find
vulnerabilities.
Staging means is used to test out newer versions of software before it is moved live into
production. Staging is a pre-production environment, for final testing immediately prior to
deploying to production.
Red teams are focused on penetration testing of different systems and their levels of security
programs. They are there to detect, prevent and eliminate vulnerabilities.
HackerBook
Technologies
8549995000
A blue team is similar to a red team in that it also assesses network security and identifies any
possible vulnerabilities.
132. What’s the difference between Black box Testing and White box testing?
Black Box Testing is a software testing method in which the internal structure/ design/
implementation of the item being tested is not known to the tester.
White Box Testing is a software testing method in which the internal structure/ design/
implementation of the item being tested is known to the tester.
133. What’s the difference between Black box Testing, White box testing and Grey box
testing?
Black Box Testing is also known as functional testing, data-driven testing, and closed box
testing. White Box Testing is also known as structural testing, clear box testing, code-
based testing, and transparent testing. Grey Box Testing is also known as translucent testing as
the tester has limited knowledge of coding.
134. What’s the difference between Black Hats, White Hats and Grey Hats?
Black hat hackers are criminals eager to hack into apps and steal information. White hat hackers are
researchers and security experts who use their security expertise to protect people and systems.
Gray hat hackers occupy a more complex middle ground.
Static application security testing (SAST) is a white box method of testing. ... Dynamic
application security testing (DAST) is a black box testing method that examines an application
as it's running to find vulnerabilities that an attacker could exploit.
HackerBook
Technologies
8549995000
HackerBook
Technologies
8549995000