CompTIA PenTest+ PT0-002 Practice Question

During a penetration test, you need to script a change to the IP address of your testing machine to match a new target subnet for further exploration. Which script accomplishes this task while also verifying that the new IP address was correctly assigned?

  • ifconfig eth0 10.10.20.50 netmask 255.255.255.0 && ifconfig eth0 | grep '10.10.20.50'

  • ifconfig 10.10.20.50 netmask 255.255.255.0

  • ipconfig /set address 'Local Area Connection' static 10.10.20.50 255.255.255.0

  • ifconfig eth0 10.10.20.50 netmask 255.255.255.0

CompTIA PenTest+ PT0-002
Tools and Code Analysis
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot