OSCP (Offensive Security Certified Professional) Practice Test

OSCP Foundational Practice Test

Test your foundational knowledge for the Offensive Security Certified Professional (OSCP) exam. This mini-assessment covers core domains including Information Gathering, Web Application Attacks, Active Directory, and Privilege Escalation.

Note: You must select an answer to proceed to the next question. You cannot go back, simulating real exam pressure.

Domain Question 1 of 5
Question text goes here…
0% Score

Assessment Complete

Here is how you performed.

", "../../../etc/passwd", "; cat /etc/passwd" ], correct: 2, explanation: "Directory traversal (`../`) is used to escape the intended web root directory and access sensitive files higher up in the filesystem, such as `/etc/passwd`. The other options represent SQL Injection, Cross-Site Scripting (XSS), and Command Injection, respectively." }, { domain: "Active Directory Attacks", question: "You have gained access to a low-privileged user account in an Active Directory environment. Which attack involves requesting a Ticket Granting Service (TGS) ticket for a service account and then attempting to crack it offline to obtain the service account's plaintext password?", options: [ "AS-REP Roasting", "Kerberoasting", "Pass-the-Ticket", "Golden Ticket" ], correct: 1, explanation: "Kerberoasting targets service accounts that have a Service Principal Name (SPN) set. The attacker requests a TGS ticket, which is encrypted with the service account's NTLM hash. This ticket can be exported and cracked offline to reveal the plaintext password." }, { domain: "Privilege Escalation (Linux)", question: "You are attempting to escalate privileges on a compromised Linux machine. Which command is most effective for identifying files that have the SUID bit set, which may allow execution with the file owner's privileges (often root)?", options: [ "find / -perm -4000 2>/dev/null", "ls -la /etc/shadow", "netstat -antp", "cat /proc/version" ], correct: 0, explanation: "The `find` command with the `-perm -4000` flag searches the entire filesystem for files with the SUID (Set Owner User ID) bit set. Misconfigured SUID binaries are a very common vector for Linux privilege escalation." }, { domain: "Password Attacks", question: "When performing an offline password attack against a captured NTLM hash using Hashcat, which mode (hashtype) should you specify to correctly format the attack?", options: [ "-m 0", "-m 100", "-m 1000", "-m 3200" ], correct: 2, explanation: "Hashcat mode `-m 1000` is specifically designated for NTLM hashes. For reference, `-m 0` is MD5, `-m 100` is SHA1, and `-m 3200` is bcrypt." } ]; // --- STATE MANAGEMENT --- let currentQuestionIndex = 0; let userAnswers = []; let selectedOptionIndex = null; // --- DOM ELEMENTS --- const introScreen = document.getElementById('oscpIntro'); const quizScreen = document.getElementById('oscpQuiz'); const resultsScreen = document.getElementById('oscpResults'); const progressFill = document.getElementById('oscpProgressFill'); const subjectTag = document.getElementById('oscpSubjectTag'); const questionCount = document.getElementById('oscpQuestionCount'); const questionText = document.getElementById('oscpQuestionText'); const optionsContainer = document.getElementById('oscpOptions'); const nextBtn = document.getElementById('oscpNextBtn'); const scoreNumber = document.getElementById('oscpScoreNumber'); const scoreMessage = document.getElementById('oscpScoreMessage'); const reviewList = document.getElementById('oscpReviewList'); // --- FUNCTIONS --- function startOscpTest() { introScreen.style.display = 'none'; quizScreen.style.display = 'block'; currentQuestionIndex = 0; userAnswers = []; renderQuestion(); } function renderQuestion() { const q = oscpQuestions[currentQuestionIndex]; selectedOptionIndex = null; nextBtn.disabled = true; // Update progress const progress = ((currentQuestionIndex) / oscpQuestions.length) * 100; progressFill.style.width = `${progress}%`; // Update text subjectTag.textContent = q.domain; questionCount.textContent = `Question ${currentQuestionIndex + 1} of ${oscpQuestions.length}`; questionText.textContent = q.question; // Render options optionsContainer.innerHTML = ''; q.options.forEach((opt, index) => { const optionDiv = document.createElement('div'); optionDiv.className = 'oscp-option'; optionDiv.onclick = () => selectOption(index, optionDiv); optionDiv.innerHTML = `
${opt}
`; optionsContainer.appendChild(optionDiv); }); } function selectOption(index, element) { selectedOptionIndex = index; // Remove 'selected' class from all options const allOptions = optionsContainer.querySelectorAll('.oscp-option'); allOptions.forEach(opt => opt.classList.remove('selected')); // Add 'selected' class to clicked option element.classList.add('selected'); element.querySelector('input[type="radio"]').checked = true; // Enable Next button nextBtn.disabled = false; } function nextOscpQuestion() { if (selectedOptionIndex === null) return; // Save answer userAnswers.push(selectedOptionIndex); // Move to next question or show results currentQuestionIndex++; if (currentQuestionIndex < oscpQuestions.length) { renderQuestion(); } else { showResults(); } } function showResults() { quizScreen.style.display = 'none'; resultsScreen.style.display = 'block'; // Calculate score let correctCount = 0; userAnswers.forEach((ans, index) => { if (ans === oscpQuestions[index].correct) { correctCount++; } }); const percentage = Math.round((correctCount / oscpQuestions.length) * 100); scoreNumber.textContent = `${percentage}%`; if (percentage >= 80) { scoreMessage.textContent = "Excellent work! Your foundational knowledge is strong and aligns well with OSCP requirements."; } else if (percentage >= 60) { scoreMessage.textContent = "Good effort! Review the technical explanations below to strengthen your weak domains before the lab."; } else { scoreMessage.textContent = "Keep studying! Focus on the core domains highlighted in the explanations below to build a stronger foundation."; } // Generate review list reviewList.innerHTML = ''; oscpQuestions.forEach((q, index) => { const userAns = userAnswers[index]; const isCorrect = userAns === q.correct; const reviewItem = document.createElement('div'); reviewItem.className = `oscp-review-item ${isCorrect ? 'correct' : 'incorrect'}`; let answerHtml = ''; if (isCorrect) { answerHtml = `✓ Your Answer: ${q.options[userAns]}`; } else { answerHtml = ` ✗ Your Answer: ${q.options[userAns]} ✓ Correct Answer: ${q.options[q.correct]} `; } reviewItem.innerHTML = `
Q${index + 1}. ${q.question}
${answerHtml}
Technical Explanation: ${q.explanation}
`; reviewList.appendChild(reviewItem); }); // Scroll to top of results resultsScreen.scrollIntoView({ behavior: 'smooth', block: 'start' }); } function resetOscpTest() { resultsScreen.style.display = 'none'; introScreen.style.display = 'block'; currentQuestionIndex = 0; userAnswers = []; selectedOptionIndex = null; introScreen.scrollIntoView({ behavior: 'smooth', block: 'start' }); }

Leave a Comment

Your email address will not be published. Required fields are marked *