The phase of collecting information is an important part in our process. We are especially looking for information concerning the configuration of the system, so we can take advantage of potential shortcomings. For example, a cronjob may have been created in a Linux system where root executes script X every hour. If, however, all system users are allowed to write to this script, we can easily gain root privileges. A simple way would be to include our current user in the sudoers group.

The misconfiguration in the above scenario - and thus our prized conquest - could only be identified by us by gathering information about users (root), files (script X) and services (cronjob). Therefore, as soon as we gain access to a system, we should at least look for the information listed below. We should also mention here that the basic purpose of the following Linux commands can be transferred to other operating systems.

Information about users

  • id
  • sudo -l
  • cat /etc/passwd
  • cat /etc/shadow
  • cat /etc/group
  • cat /etc/sudoers

Information about files and services

  • cat /etc/crontab
  • cat /etc/cron/
  • find / -uid 0 -perm -u=s -type f 2>/dev/null
  • grep -ir pass /*
  • ls -ahlR /root/
  • ls -ahlR /home/
  • ps aux

Information about the network

  • ip addr show
  • hostname
  • ss -antp
  • iptables -L
  • cat /etc/resolv.conf

Information about the kernel

  • lsb_release -a
  • uname -a

Last modified: Dec. 15, 2022

Penetation Testing Course

About Pentest Training

Discover the world of penetration testing. Learn how to infiltrate networks and successfully penetrate systems and applications. Acquire the necessary hacking skills and use them when conducting professional penetration tests. Become a real penetration tester. Here you will find the free documents for the Pentest Training of binsec academy GmbH. The binsec academy GmbH offers the corresponding security training lab environments and certifications. However, the knowledge and wiki articles on hacking and penetration testing is universal.

About binsec academy GmbH

binsec academy GmbH is the European provider of online security training with virtual laboratory environments. The core component of all security training is the focus on practice, practice and more practice. In the wiki here you will find the public and freely available course materials. You can put the theory into practice at binsec-academy.com.