Docsity

Certified Network Pentester CNPen Exam, Exams of Cybersecurity

Toggle sidebar
bg1
Certified Network Pentester CNPen Exam
**Question 1.** Which Google dork would you use to locate publicly exposed Excel files that
contain the word “password”?
A) site:example.com filetype:xls password
B) intitle:index.of password xls
C) inurl:admin filetype:doc password
D) allinurl:ftp password xls
**Answer:** A
**Explanation:** `site:example.com filetype:xls password` searches the specified domain for
Excel files (`.xls`) that contain the keyword “password”.
**Question 2.** TheHarvester primarily gathers which type of information?
A) Open ports on a target host
B) Email addresses and subdomains
C) Password hashes from SMB shares
D) SSL certificate private keys
**Answer:** B
**Explanation:** TheHarvester is designed to collect email addresses, hostnames, virtual hosts,
and subdomains from public sources.
**Question 3.** When using crt.sh to discover subdomains, what data source is being queried?
A) DNS zone transfer files
B) WHOIS database
C) Certificate Transparency logs
D) Reverse DNS pointers
**Answer:** C
**Explanation:** crt.sh queries Certificate Transparency logs, which list all SSL/TLS certificates
issued for a domain, revealing subdomains.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58

Partial preview of the text

Download Certified Network Pentester CNPen Exam and more Exams Cybersecurity in PDF only on Docsity!

Question 1. Which Google dork would you use to locate publicly exposed Excel files that contain the word “password”? A) site:example.com filetype:xls password B) intitle:index.of password xls C) inurl:admin filetype:doc password D) allinurl:ftp password xls Answer: A Explanation: site:example.com filetype:xls password searches the specified domain for Excel files (.xls) that contain the keyword “password”. Question 2. TheHarvester primarily gathers which type of information? A) Open ports on a target host B) Email addresses and subdomains C) Password hashes from SMB shares D) SSL certificate private keys Answer: B Explanation: TheHarvester is designed to collect email addresses, hostnames, virtual hosts, and subdomains from public sources. Question 3. When using crt.sh to discover subdomains, what data source is being queried? A) DNS zone transfer files B) WHOIS database C) Certificate Transparency logs D) Reverse DNS pointers Answer: C Explanation: crt.sh queries Certificate Transparency logs, which list all SSL/TLS certificates issued for a domain, revealing subdomains.

Question 4. Which tool can automatically identify the backend framework of a web application by analyzing HTTP headers and page content? A) Nmap B) WhatWeb C) Metasploit D) Nikto Answer: B Explanation: WhatWeb fingerprints web technologies, including CMS, frameworks, and server software, by inspecting responses. Question 5. ExifTool is most useful for extracting which of the following from a PDF file? A) Embedded JavaScript code B) Metadata such as author and creation date C) Network sockets opened by the PDF viewer D) Encrypted payloads hidden in the file Answer: B Explanation: ExifTool reads metadata (e.g., author, creation date, software) embedded in many file types, including PDFs. Question 6. Which DNS query type is typically used to attempt a zone transfer? A) A B) MX C) AXFR D) TXT Answer: C

Explanation: Telnet transmits authentication data in clear text, making it insecure. Question 10. An “unquoted service path” vulnerability can lead to which type of attack? A) Remote code execution via DLL hijacking B) Man‑in‑the‑middle on SSL traffic C) Privilege escalation through path traversal D) Denial of service by service crash Answer: A Explanation: If a Windows service path contains spaces and is not quoted, an attacker can place a malicious executable earlier in the path to be executed with service privileges. Question 11. Which Apache configuration directive, if misconfigured, could allow directory listing? A) AllowOverride None B) Options Indexes C) ServerSignature Off D) KeepAlive On Answer: B Explanation: Options Indexes enables automatic directory listing when no index file is present. Question 12. In an Active Directory environment, which LDAP attribute commonly stores the user’s password hash? A) sAMAccountName B) userPrincipalName C) unicodePwd D) objectSID

Answer: C Explanation: unicodePwd holds the password in a hashed, encrypted form for AD accounts. Question 13. Which of the following is a typical sign of insecure file permissions on a Linux web server? A) /var/www/html owned by root:root with 755 B) /etc/shadow readable by others C) /home/user/.ssh/authorized_keys set to 600 D) /tmp mounted with noexec Answer: B Explanation: /etc/shadow must be readable only by root; making it world‑readable leaks password hashes. Question 14. Password spraying attacks differ from brute‑force attacks primarily in that they: A) Test many passwords against a single account B) Use a dictionary of common passwords across many accounts C) Exploit hash collisions in authentication protocols D) Require valid credentials to start the attack Answer: B Explanation: Password spraying tries a few common passwords against many usernames to avoid account lockout. Question 15. Which Metasploit auxiliary module is used to perform an SMB password hash dump using the samrd protocol? A) auxiliary/scanner/smb/smb_login B) auxiliary/gather/smb_hashdump

A) Encrypted VPN keys B) Plain‑text passwords and NTLM hashes from memory C) BIOS firmware passwords D) SSH private keys stored on disk Answer: B Explanation: The command reads LSASS memory to retrieve clear‑text credentials and NTLM hashes. Question 19. Which Windows feature can be abused to bypass User Account Control (UAC) by using a “auto‑elevated” COM object? A) eventvwr.msc B) winrm C) schtasks D) powershell.exe Answer: A Explanation: eventvwr.msc runs with auto‑elevated privileges and can be hijacked to bypass UAC. Question 20. On a Linux system, which permission set on a SUID binary can allow a regular user to gain root privileges? A) -rwsr-xr-x (owner root) B) -rw-r--r-- (owner user) C) -rwxrwx--- (group wheel) D) -rwsrwxrwx (anyone) Answer: A Explanation: The SUID bit (s) causes the binary to run with the file owner’s UID (root), granting elevated privileges.

Question 21. Which cron job misconfiguration is most likely to lead to privilege escalation? A) A job running as root that executes a script owned by root but writable by users B) A job scheduled to run every minute C) A job that logs output to /var/log/cron.log D) A job that uses /usr/bin/awk for processing Answer: A Explanation: If a root‑owned cron script is writable by non‑privileged users, they can modify it to execute arbitrary commands as root. Question 22. NetExec is primarily used for which phase of a penetration test? A) Initial reconnaissance only B) Credential dumping from browsers C) Network-wide enumeration and lateral movement D) Generating phishing emails Answer: C Explanation: NetExec automates remote command execution and enumeration across multiple hosts for lateral movement. Question 23. Adding an SSH public key to ~/.ssh/authorized_keys on a compromised host provides what type of persistence? A) Fileless persistence B) Credential reuse C) Persistent remote access without password authentication D) Rootkit installation Answer: C

D) Using a standard Windows system binary as a wrapper (Living‑off‑the‑Land) Answer: D Explanation: Living‑off‑the‑land binaries (e.g., rundll32.exe) are trusted by AV and help evade detection. Question 27. After gaining initial access, which Windows command can be used to enumerate all local groups and their members? A) net user B) whoami /groups C) net localgroup D) gpresult /r Answer: C Explanation: net localgroup lists local groups and displays group membership. Question 28. Which Linux command can be used to view the current sudo privileges of a user without providing a password? A) sudo - l B) id - u C) whoami D) cat /etc/sudoers Answer: A Explanation: sudo - l lists the commands the invoking user may run with sudo, showing any NOPASSWD entries. Question 29. The smbclient tool can be used to: A) Perform a SYN flood attack against SMB B) Enumerate SMB shares and download files

C) Crack NTLM hashes offline D) Create a reverse shell over port 445 Answer: B Explanation: smbclient is an SMB client that can list shares (-L) and retrieve files. Question 30. Which of the following is a common indicator that a web server is vulnerable to the Log4Shell (CVE‑ 2021 ‑44228) exploit? A) Presence of log4j-core-2.14.1.jar in the web root B) HTTP header X-Log4j-Vulnerable: true C) Open port 3306 D) Use of Apache Tomcat 9.0.41 without patches Answer: A Explanation: The vulnerable Log4j JAR file version is often found in the application’s libraries; its presence suggests susceptibility. Question 31. Which Nmap NSE script would you run to discover the version of a MySQL server and check for the root default password? A) mysql-info B) mysql-brute C) mysql-databases D) mysql-audit Answer: B Explanation: mysql-brute performs credential brute‑forcing and can report version information. Question 32. In a Windows environment, which registry key stores the list of services set to start automatically?

Question 35. Which Windows command can be used to list all scheduled tasks on a local machine? A) schtasks /query /fo LIST B) tasklist /svc C) net start D) sc query state= all Answer: A Explanation: schtasks /query displays scheduled tasks, and /fo LIST formats the output. Question 36. Which credential‑dumping technique is most effective against a system that has Credential Guard enabled? A) Extracting LSASS memory directly B) Using reg save on the SAM hive C) Leveraging Mimikatz with sekurlsa::logonpasswords D) Dumping the TPM chip Answer: B Explanation: Credential Guard isolates LSASS; dumping the SAM hive via reg save can still retrieve password hashes. Question 37. In Azure, which misconfiguration commonly leads to exposure of storage account keys? A) Enabling Azure Defender B) Assigning Storage Blob Data Contributor to a guest user without MFA C) Using Managed Identities for VM access D) Setting publicNetworkAccess to Enabled without firewall rules Answer: D

Explanation: When publicNetworkAccess is enabled and no network restrictions exist, anyone can query the storage account and retrieve keys if they know the endpoint. Question 38. Which PowerShell cmdlet can be used to bypass execution policy for a single script without changing the system policy? A) Set-ExecutionPolicy Unrestricted B) powershell - ExecutionPolicy Bypass - File script.ps1 C) Get-ExecutionPolicy D) Invoke-Expression Answer: B Explanation: The -ExecutionPolicy Bypass flag runs the script ignoring the current policy. Question 39. Which of the following describes a “living‑off‑the‑land” binary? A) A custom malware executable dropped on the target B) A legitimate system utility repurposed for malicious activity C) A third‑party tool installed via package manager D) An encrypted payload stored in the registry Answer: B Explanation: Living‑off‑the‑land binaries are native OS tools (e.g., wmic, powershell) used by attackers to avoid detection. Question 40. Which Linux command can be used to view the capabilities of a binary (e.g., ping)? A) lsattr B) getcap C) chmod D) file

C) ssl-cert D) ssl-dh-params Answer: A Explanation: The ssl-heartbleed NSE script checks for the CVE‑ 2014 ‑0160 vulnerability. Question 44. In a Windows domain, which built‑in tool can be used to enumerate trusts between domains? A) netdom query /domain B) nltest /domain_trusts C) dsquery trust D) repadmin /showrepl Answer: B Explanation: nltest /domain_trusts lists trust relationships for the current domain. Question 45. Which of the following is a common way to bypass a web application firewall (WAF) using encoding? A) Sending all payloads in plain ASCII B) Using double URL encoding (e.g., %2527 for ') C) Removing all whitespace from the request D) Using HTTP/2 instead of HTTP/1. Answer: B Explanation: Double encoding can evade pattern‑based detection by the WAF. Question 46. Which of the following AWS IAM policies would grant read‑only access to all S3 buckets? A) {"Effect":"Allow","Action":"s3:*","Resource":"*"} B) {"Effect":"Allow","Action":"s3:GetObject","Resource":"arn:aws:s3:::*/*"}

C) {"Effect":"Deny","Action":"s3:DeleteObject","Resource":"*"} D) {"Effect":"Allow","Action":"s3:ListAllMyBuckets","Resource":"*"} Answer: B Explanation: s3:GetObject on all bucket objects provides read‑only access; listing buckets also requires ListAllMyBuckets, but the question asks for read‑only, which GetObject satisfies. Question 47. Which Linux kernel vulnerability (CVE‑ 2017 ‑6074) allowed local privilege escalation via a race condition in the perf subsystem? A) Dirty COW B) Stack Clash C) OverlayFS D) PTRACE Answer: A Explanation: Dirty COW (Copy‑On‑Write) is CVE‑ 2016 ‑5195, a race condition that enables local privilege escalation. Question 48. Which of the following is the most effective way to hide a malicious PowerShell script from Windows Defender’s real‑time protection? A) Rename the file with a .txt extension B) Encode the script with Invoke-Obfuscation and run via powershell - EncodedCommand C) Place the script in %TEMP% directory D) Use attrib +h to hide the file Answer: B Explanation: Encoding and obfuscation make signature detection harder; running via - EncodedCommand avoids scanning the script file. Question 49. When performing a DNS enumeration, which record type is most useful for discovering mail servers?

Question 52. Which Nmap script can be used to enumerate Microsoft Exchange virtual directories? A) exchange-autodiscover B) http-enum C) smtp-open-relay D) ms-sql-info Answer: A Explanation: exchange-autodiscover probes Exchange servers for configuration details, including virtual directories. Question 53. Which of the following Windows registry locations contains cached domain credentials for the currently logged‑in user? A) HKLM\Software\Microsoft\Windows\CurrentVersion\Run B) HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU C) HKLM\System\CurrentControlSet\Control\Lsa\Cache D) HKCU\Network Answer: C Explanation: The LSA cache stores cached domain credentials for offline logon. Question 54. Which of the following is a typical indicator of a compromised Linux host that has been used for cryptocurrency mining? A) Increased CPU usage and presence of xmrig process B) New user accounts with UID 0 C) Modified /etc/ssh/sshd_config to allow root login D) Disabled firewall rules Answer: A

Explanation: Mining software like xmrig consumes CPU/GPU resources, leading to high utilization. Question 55. Which of the following is the most reliable way to detect a successful exploitation of the SMB Relay vulnerability? A) Monitoring for multiple failed SMB logons from a single IP B) Observing new admin sessions on the domain controller from unexpected source IPs C) Checking for changes in the hosts file D) Watching for increased DNS query volume Answer: B Explanation: SMB Relay results in authenticated sessions from the attacker’s IP; unexpected admin sessions indicate successful relay. Question 56. In a Kubernetes cluster, which component’s misconfiguration can allow an attacker to gain cluster‑admin privileges? A) kube‑proxy daemonset running as privileged B) kube‑dns ConfigMap with default settings C) kube‑scheduler with read‑only access D) kube‑let with node‑port services disabled Answer: A Explanation: A privileged kube‑proxy can be exploited to execute arbitrary commands with cluster‑admin rights. Question 57. Which of the following is the correct syntax for a curl command that sends a POST request with JSON data and disables SSL verification? A) curl - X POST - d '{"user":"admin"}' https://target/api B) curl - k - X POST - H "Content-Type: application/json" - d '{"user":"admin"}' https://target/api C) curl - L - X GET https://target/api