concept entry in category security

This is an excerpt from Manning's book The Art of Network Penetration Testing.
The attackers typically obtain a map or schematic of the target and spend a lot of time analyzing all of the different ways into the building. These are usually doors, windows, parking garages, elevator and ventilation shafts, you name it. From an attacker’s perspective you can call these entry points or attack surfaces and that’s exactly what network services are. The entry points into our target network. The surfaces that you will attack in an attempt to gain unauthorized entry into restricted areas of the network.
In the case of the Capsulecorp pentest, I didn’t technically create any user accounts but I did overwrite the /etc/passwd file of a Linux server with an entry for a root user account that I could control. I suppose you could make the argument that this is more of a back door than a new user account. If you did, I wouldn’t argue with you. I’m just going to include it in this section to make sure I cover the point that if you created a user account, you have to remove it. The entry in /etc/passwd will need to be cleaned up.
11.2.1 Removing entries from /etc/passwd
To remove entries from /etc/passwd, SSH into the compromised Linux server as a user with root privileges. If you don’t know the root password, just use whatever credentials you used to gain access to the system initially, then use the pentest entry that you added to the /etc/passwd file to elevate to root. If you were to cat out the contents of the /etc/passwd file right now, it would look something like listing 11.1 with the pentest entry at the bottom of the file.
Listing 11.1 /etc/passwd file with backdoor entry
lxd:x:105:65534::/var/lib/lxd/:/bin/false uuidd:x:106:110::/run/uuidd:/usr/sbin/nologin dnsmasq:x:107:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin landscape:x:108:112::/var/lib/landscape:/usr/sbin/nologin pollinate:x:109:1::/var/cache/pollinate:/bin/false sshd:x:110:65534::/run/sshd:/usr/sbin/nologin nail:x:1000:1000:Nail:/home/nail:/bin/bash pentest:$1$pentest$NPv8jf8/11WqNhXAriGwa.:0:0:root:/root:/bin/bash #AJust as in chapter 9 (section 9.3.2), open the /etc/passwd file in a text editor such as vim. Scroll down to the last line containing the pentest/root account and delete it. Save the file and you’re all set. To verify that the user entry has been properly removed, run the command su pentest from your SSH prompt to try to switch to the pentest user account. You will see an error message saying, “No passwd entry for user ‘pentest’”. If you don’t see this message, then you failed to remove the entry from the /etc/passwd file. You need to go back and do this properly as described in section 11.2.1