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.
${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' });
}
