Practice Questions
Last Update Unknown
Practice Questions
Week 1 - Day 1
What best describes the activities in the Security Testing Lifecycle?
- Secure -> Document -> Observe -> Analyse
- React -> Re-implement -> Restore -> Review
- Consult -> Review -> Analyse -> Implement
- Secure -> Monitor -> Trigger -> Improve
- Firewall -> Policy -> Police -> Enforce
Which of the following are types of security assessment?
Select one or more:
- Full Security Audit
- Grey Box hacking
- Vulnerability Penetration Audit
- Vulnerability Assessment
- Penetration Testing
Which sort of security assessment technique would be able to pick up poor levels of physical device security?
- White hat testing
- Vulnerability Auditing
- Onsite Auditing
- Laplass Analysis
- Full Penetration Testing
When thinking of testing types, which type is said to be employed when the attacker has maximum knowledge of the target, while the target has full knowledge of the attack.
- Blind
- Joined
- Double Grey
- Reversal
- Tandem
What is considered the third step in the security testing process?
- Social Engineering
- Exploit Vulnerabilities
- Active Recon
Which of the following might happen during the passive gathering phase of the security testing process?
Select one or more:
- War driving
- Querying the whois database
- Google hacking
- Port Scanning
- Spidering
What offence is section 3A of the Computer Misuse Act?
- Unauthorised access to computer material
- Making, supplying or obtaining articles for use in offence
- Intent to commit of facilitate further offences
- Reckless impairment as to detriment the lawful activities of a third party.
- Carrying out DoS attacks
How do you perform a social engineering attack ethically?
- You cannot lie to the target
- You must declare the attack using a recorded message before starting the social engineering attack.
- You are able to lie provided you record the conversation.
- You can deceive the target so long as you do no harm
- You must get a get-out-of-jail letter from the individual first.
In Kali, how could you stop a service called daemon1?
- systemctl daemon1.service stop
- service daemon1 stop
- systemctl stop daemon1.service
- ss daemon1.service stop
- kill -9 daemon1
What would this command do?
- How many lines in the file "insensitive" have the word "grep" in them but not the word "case"?
- Case insensitive grep of stdin for "grep", and then count the lines
- This would result in an error, as grepping for grep is recursive.
- This would result in an error, as there is no wc option "-l".
- How many lines in the file called "grep" are they?
Week 1 - Day 2
How would you write a google dork to find all xls spreadsheet files anywhere at napier.ac.uk which contain the word "marks".
- Extension:xls http:*.napier.ac.uk marks
- find -name *.xls @napier.ac.uk --exec grep marks
- Marks@.*napier.ac.uk extension:xls
- site:napier.ac.uk marks filetype:xls
- Whois:napier.ac.uk marks *.xls
What do MX DNS records indicate?
- Multiplexing records
- IPv6 records
- The servers which handle email
- The email address of the responsible person
- Messenger exchange records
Identify which RR in DNS the SPF framework information is stored in.
- v=spf1
- SPF1
- domainkeys
- SPF
- TXT
- email addresses associated with a domain
- whois records associated with an IP
- Web server IP numbers
- domain names associated with an owner
- DocumentRoot configurations
What is defined as the process of collecting information about your target(s) using publically available sources of information?
- Active scanning
- Passive information gathering
- Dark observance
- Server fingerprinting
- Attack planning
Which of the following would be considered appropriate possible channels to consider in the planning stage of a pen test?
Select one or more:
- Data Network
- Telecommunications
- Wireless
- Physical
- Human
Why would you normally sign a NDA with a company which is to be pen tested?
Select one or more:
- Legally prevent you sharing confidential information about the target.
- Legally prevent you saying how much the test cost.
- Legally prevent the company criticizing your test.
- Make any breach of contract criminal rather than civil.
- Legally prevent you sharing information about the weaknesses in the target.
By receiving a "get out of jail free card" (i.e. a permission memo) from the company, which of the following laws will you be exempted from?
Select one or more:
- Patriot Act
- Computer Misuse Act
- Data Retention Act
- Data Protection Act
- General Data Protection Regulations
- None of the above
Week 1 - Day 3
What issues should you be careful of when performing a port scan?
Select one or more:
- Avoiding breaking the data protection act
- Discovering machines outside the engagement zone.
- Causing passwords to become locked
- Duration of the scan
- Traffic bandwidth generated
When would arp-based sweeping be considered superior to ping-based sweeping?
- Sweeps across the internet when ICMP is blocked.
- When the target is disconnected.
- When traffic loads need to be kept low.
- Sweeps via the gateway server
- A directly connected ethernet network.
What feature of IP packets does traceroute rely on for its functionality?
- The Dont Fragment flag.
- TTL
- The URGENT flag
- The ACK flag
- Multicast packets
- Host Unreachable
- filtered
- closed
- blocked
- Port Unreachable
In netcat, what does the -w flag do?
- Switches off I/O mode
- Defines the number of seconds to wait before timing out.
- Switches on debug warning messages
- Forces netcat to wait for a response from the target
- Makes netcat watch for incoming connections.
During a TCP session the server sends back RST. What would this indicate?
- Packet should be resent.
- The packets should be considered resident
- Target is ending the session gracefully.
- The session is already closed.
- A receipt is needed for a packet
What order by default are the ports scanned using nmap?
- Low to high numbered ports
- Registered ports below 1024 first.
- High to low numbered ports
- Common port numbers first
- Random order
What flag would be needed to run a Half Open/SYN scan?
- -sH
- -sS
- -ho
- -nP
- -sT
Week 2 - Day 1
How is passive OS fingerprinting undertaken?
- By sending packets to the target to elicit a response
- By sending non-active packets to the target
- By sending active queries to the target indirectly via a reflection attack..
- Only by listening to traffic related to independent requests
- By using normal request packets rather than abusive ones to elicit a response.
Which option in nmap will perform OS fingerprinting of a target?
- -oP
- -oF
- -O
- -F
- -oS
Which of the following services have banners which appear without having to send any data to the service?
Select one or more:
- HTTP on port 5000
- DNS on port 53
- SSH
- Email on port 25
- Apache on port 80
In netcat banner grabbing, how would -w1 be useful?
- Limits the overall subnet scan to 1 minute
- Only waits for 1 second before moving to the next target
- Shows level 1 warning messages about service issues
- Supports only character widths of 1 byte, disabling UTF-8
- Switches on fast banner negotiation
In DNS cache poisoning, what fixes were actually implemented in DNS servers in order to mitigate the issue? Check all that apply.
Select one or more:
- Increase the transaction ID field to 32 bits
- Traffic throttling
- Encourage the update of DNSSEC
- Use random source ports
- SYN Cookies
Consider the following email hops
What suggests this is not from the royal bank of Scotland?
- The second hop has a sender host name unrelated to hop 1.
- Email cannot travel two hops in less than 1 second.
- Esmtp is a non existent protocol
- Email datestamps always have the same time zones between hops.
- The utc time zone is invalid
Week 2 - Day 2
What is meant by a zero day exploit?
- Vulnerability which has been attacking for less than 24 hours
- A vulnerability which will on average only be effective for less than 1 day
- A vulnerability patched only today
- Vulnerability which was only discovered today
- Vulnerability not yet published
If a user on a machine triggers an exploit by using their web browser, what sort of exploit would it be?
- Local exploit
- Passive exploit
- Client-side exploit
- Reverse exploit
- Server-side exploit
When considering exploit code, what is meant by an executable stack?
- Code stored in the stack can be executed.
- Stack maximum length in controlled from the executable.
- The stack is predefined in an executable.
- Running code can use the stack
- Shared libraries can dynamically use the stack
In code, when a subroutine is called, where does the return address get stored?
- In the .text segment
- In the stack
- In the heap
- In the JMP register
- Is statically compiled into the code.
If you have a subroutine which has two variables:
32 bit integer called X
4 byte char array called Y
Y appears immediately after X in the stack. What hex codes would you need to write into Y to cause a buffer overflow which sets X to 1. X is stored natively in little endian.
- 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01
- 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00
- 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00
- 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00
- 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00
If executable code is written into a character array on the stack during a function call, how can the exploit be triggered so that the injected code is executed?
- If the last 4 bytes of the injected code is a JMP command, then the CPU will automatically jump to that location on the stack.
- Any characters which are really assembly code is written to an array in the stack then that code is automatically executed when you return from that subroutine.
- If the array overflows and allows the return pointer in the stack to be changed to point to the code inserted in the stack.
- The first 4 bytes in an array always indicate the return address for a subroutine, and so setting that to point further into the array allows code injection to occur.
- Code in the stack can only be located using heap spraying, and so the code written in the array must contain NOP instructions.
In the gdb debugger, how you you see what is in the stack frame?
- print info stack
- info frame
- break stack
- print stack
- print &info-stack
In an executable, how does Data Execution Protection help guard against exploits?
- CRC checks are performed by the MMU on data segments to ensure they have not been modified.
- Code is stored in random locations, and so code injection can not easily find the buffer they overflowed.
- The memory management unit marks data segments so that code in those segments cannot be executed.
- Code in data segments can only be called from code in code segments, and so cannot be reached by rewriting the stack return pointer.
- The return pointer of each subroutine is marked read-only and thus cannot be changed by a buffer overflow.
Assessment 1 - Practice Exam
Question 1
Describe briefly the process by which the hostname "linuxzoo.net" would be converted into an IPv4 address. Include in your discussion the local nameserver, recursion, root servers, and delegation.
Question 2
Consider the following:
Briefly describe what has been performed to generate this output, against which machines, including details on the total number of services which have been found, and what else can be concluded from this.
Question 3
On a testers machine with address 192.168.100.99, the following command is executed:
On a target machine, the following command was executed in a shell:
Briefly describe what this achieves, and what this might be used for in terms of a penetration test.
Question 4
If I performed an nmap scan using "-Pn" and "--reason", what effect would those flags have on the scan?
Question 5
When an email traverses the network from source to destination server, hop information is added to the body of the email. Discuss 4 pieces of information which each hop holds.
Question 6
When considering the implications of the results of performing a vulnerability scan on a target it is often useful to combine that with a risk assessment. Discuss why this might be useful.
Question 7
If the attacker has no knowledge of the target, and the tester has no knowledge of the attack, what is the name of the testing type being employed, and discuss the implications of this type of test.
Question 8
How would you perform a nmap scan which does not first do host discover, and instead goes directly to a port scan involving the ports 137, 138 and 139 using tcp. Only scan 192.168.1.1
Question 9
Reflect on the difference between a half open and a fully open type scan. What situations would one be better than the other, or vice-verse?
Question 10
As part of a security testing process, discuss how Google hacking could be employed as part of passive reconnaissance.
Week 3 - Day 1
In metasploit, what is the significance of LHOST?
- The IP number of the target as seen from the target.
- The server running the metasploit server
- The target of the attack.
- The server to download the payload from
- The host to be connected to by the exploit payload
What key risk should be considered before running a metasploit attack?
- The amount of traffic generated during an attack will be very large.
- Metasploit will deactivate all firewalls, which in turn makes all targets more vulnerable.
- Using metasploit is illegal even with permission.
- You may detect issues which you were not aware of.
- The target service may be rendered inoperative.
In an attack payload, what is a bind shell?
- A shell connects to a different machine to receive commands
- Bind shells lock all ports in the target making the machine non-operational.
- A shell which spreads across all systems in the target network using secondary attacks
- A shell listens on the target for commands..
- A shell which binds itself to other executables on the target.
Which of the following are metasploit interfaces?
Select one or more:
- msfcli
- msfconsole
- msfcmd
- msfweb
- msfshell
What is the function of a metasploit encoder?
- Encoders will convert an exploit for one service to make it effective for other services.
- Encoders will compress payloads to make them more efficient.
- To disguise a payload and thus evade detection.
- Convert shells to use the local keyboard mappings.
- To convert exploits to different CPU architectures
Why might a multistage payload be useful in metasploit?
- To chain two exploits together when one single exploit would not work.
- To carry an payload shell over an encrypted reverse connection
- An exploit can be wrapped in an email and sent as a targeted attack.
- To run multiple shells on the target
- A secondary stage can instigate attacks on other targets in the network.
Week 3 - Day 2
What various ways are available to hold session state in an HTTP session?
Select one or more:
- URL path unique to each user
- Browser serial number
- Cookies
- Source IP
- UserAgent field
If you have a need to put in a character into a URL which would normally be illegal, how would this be achieved? Specifically, how would a space character be inserted?
- Using an HTML escape, i.e. &space;
- Using the hex value of the ASCII code, i.e. x20
- Using the hex value of the ASCII code, i.e. %20
- Using the hex value of the ASCII code, i.e. 0x20
- Using the hex value of the ASCII code, i.e. 
What is the likely way that the following data was encoded?
R29yZG9uIHdhcyBoZXJlCg==
- uuencode
- sha512
- md5
- URL escaped
- base64
What exploit issue is defined as XSRF?
- Causing new content to appear on a trusted site via SQL injection.
- Forging session variables through brute force.
- Masquerading as a trusted website using DNS manipulation
- Triggering unwanted actions on one website via the user's browser by visiting an evil website.
- Injecting new content into a trusted website so it appears to be trusted content.
If a HEAD request returns a etag entry, what is this suggestive of?
- The server is running Apache.
- The underlying filesystem uses inodes
- The server OS is linux.
- The page is an actual file on the webserver.
- The page has not changed since the last visit.
In avoiding length extension attacks involving hashes on md5, which of the following would be considered an effective defense?
- hash(data + key)
- Use a longer secret key before performing any hashes.
- Referrer field analysis
- SHA512
- HMAC
Week 3 - Day 3
What disadvantage is there with automatic spidering?
- Cannot navigate pages with more than one link.
- Frequently requests the same pages multiple times.
- Hard to configure
- Cannot easily handle javascript menus
- Slow
In a Debian-based linux distribution, where would the site-specific files be located?
- /etc/httpd/conf.d/
- /etc/apache2/conf.d/
- /var/httpd/conf.d/
- /etc/httpd/sites-available/
- /etc/apache2/sites-available/
In an Debian Linux distribution, how do you enable public_html user directories?
- Edit httpd.conf and set "UserDir public_html".
- Edit http.conf and set "UserDir public_html".
- a2enmod userdir
- Edit .htaccess and set "UserDir public_html".
In an Debian-based distribution, how do you restart the apache2 service?
- servicectl restart apache2
- systemctl apache2 restart
- systemctl restart apache2
- service apache2 restart
- service restart apache2
Week 4 - Day 1
In mysql, what does the following query do:
SELECT DATABASE()
- Returns rows containing all the database names defined in the system.
- Allows the user to select the database they wish to send queries to.
- Is an invalid statement as it does not have a FROM.
- Displays the version number of the database.
- Returns data which identified the current database name.
In a database there is a table called INTEREST, which has an attribute called RATE. Possible RATE values include 1.5%, 10%, 105%. The field is a string (a varchar), and includes the percentage sign in the data.
How would you find all the rows with RATES equal to 10%.
- SELECT * from INTEREST where RATES == 10
- SELECT * from INTEREST where RATES = '10%'
- SELECT * from INTEREST where RATES = 10
- SELECT * from INTEREST where RATES LIKE '10%'
- SELECT * from INTEREST where RATES = 10%
Consider the following query which is used in a web script:
SELECT password
FROM accountinfo
WHERE user = 'theuser'
In this case, the script is executed on the server by substituting the value of the URL parameter THEUSER into the query instead of the word theuser.
How could you set the parameter THEUSER so that the query would return with password for all the rows stored in the database?
- THEUSER=' OR user is NOT NULL
- THEUSER='%'
- THEUSER=' OR user != '
- THEUSER=' OR user is NULL
- THEUSER='' (two single quotes)
Consider the following query which is used in a web script:
SELECT password
FROM accountinfo
WHERE user = 'theuser'
In this case, the script is executed on the server by substituting the value of the URL parameter THEUSER into the query instead of the word theuser.
How could you set the parameter THEUSER so that the query would return with user for all the rows stored in the database?
- THEUSER=' UNION SELECT user from accountinfo where user LIKE '%
- THEUSER='password'
- THEUSER=' OR user is NULL
- THEUSER='' ORDER BY user (two single quotes)
- THEUSER='' UNION SELECT user from accountinfo
^ (two single quotes)
You can enter text into an html form and submit it.
You can assume the hex code 21 relates to the ASCII character "!", and that "--" is the comment string for SQL. If you enter the following text into the web form and submit it, what gets sent to the web server?
Demo %21 -- extra
- Demo %21 --
- Demo !
- Demo ! -- extra
- Demo %21
- Demo %21 -- extra
Consider the following query which is used in a web script:
SELECT password
FROM accountinfo
WHERE user = 'theuser'
AND accounttype = 6
In this case, the script is executed on the server by substituting the value of the URL parameter THEUSER into the query instead of the word theuser.
How could you set the parameter THEUSER so that the query would return with password for all the rows stored in the database, even for rows where the accounttype is not 6?
THEUSER=' OR user is NULL OR
THEUSER=' OR user is not null --
THEUSER=' OR user is NOT NULL
THEUSER='' OR user != 'theuser' (two single quotes)
THEUSER='%'&ACCOUNTTYPE=%
Given that you can inject SQL into a parameter, what would you inject to confirm that the number of columns being returned in that SQL statement was 3?
- ' UNION SELECT NULL,NULL,NULL --
- ' UNION SELECT COUNT(*) == 3 --
- ' UNION SELECT * HAVING 3 --
- UNION SELECT count(database_schema.rows) where database_schema.table = self() --
- ' UNION SELECT COUNT(*) HAVING 3 --
In terms of an SQL injection attack, which of the following is true concerning a Blind SQL Injection attack?
- Used only when you do not know the name of the tables involved.
- The result of injecting is knowing that either the query found data or found nothing.
- Used in blind and double blind testing procedures
- A technique used on encrypted channels, as you cannot understand the encrypted answer returned.
- Only needed when you do not know the name of the columns
Week 4 - Day 2
Which of the following statements are true in a brute force password attack.
- Butterfly tables are used to crack the login details.
- Hash tables are used to generate passwords
- Dictionaries are used to generate passwords
- All possible combinations of characters and password lengths are used.
- Passwords are tried multiple times until they are accepted
In a Hybrid password attack, which of the following statements are true:
- Starts with brute force, and as passwords are cracked it stores them in a dictionary.
- Starts with a dictionary attack, but when the dictionary is all used up switches to brute force.
- Performs a dictionary attack, but varies the attack speed to mimic a real-world user.
- Mixes dictionary and brute force attacks.
- Performs a brute force attack but varies the username being targetted.
What is the reduce function for in a rainbow table?
- Takes a hash and maps it to a string which looks like an appropriate password.
- Reduces a password to an equivalent hash
- Reduces the length of a password to that permitted by the target.
- Takes a hash and reduces the bits required to hold that hash
- Reverses a hash and produces the password which created that hash
In a Rainbow Table, what is the concept of Chain Merging?
- Where a password is formed by merging two other passwords
- Passwords with the same characters but written in a different order are merged together.
- Where a hash reduces to two different passwords
- Where the first and last password in a chain is identical, merging avoids cyclic chain traversal.
- Where more than one chain holds similar information
If a file of hash passwords have been obtained which were built using a per-machine salt, comment on the use of Rainbow Tables to help crack the passwords.
- It is worthwhile building a rainbow table just for this one problem.
- A Rainbow Table would only be useful if it had already been built using the same salt.
- Rainbow tables build without a salt would still be effective here.
- Rainbow Tables are effective as they already contain every possible salted password.
- Only a Hybrid Rainbow Table using Markov chains is known to be effective.
In NTLM, which of the following is true regarding its hashing algorithm?
Select one or more:
- It splits the password up into 7 character chunks
- It preserves the case of the passwords
- Passwords can be up to 128 characters long
- It uses a salt
- The hash is based on MD4