How to collect intranet information

How to collect intranet information

The essence of penetration testing is information collection. We can roughly divide the intranet information collection into five steps, namely local information collection, domain information collection, login credential theft, survival host detection, and intranet port scanning.

The two most common questions are:

  • Who am I? -- whoami
  • Where am I? -- ipconfig/ifconfig

When we gain administrator privileges on a host, we are always eager to learn more.

Local information collection

1. Query account information:

Understand the user role and user permissions of the current host to determine whether permissions need to be further enhanced.

  1. win: whoami, net user username
  2. linux: whoami, id, cat /etc/shadow, cat /etc/passwd

2. Query network and port information

Confirm the connected network status based on the IP address/network connection/related network address of the destination host.

  1. Win: ipconfig, netstat -ano
  2. ARP table: arp -a
  3. Routing table: route print
  4. View the DNS cache record command: ipconfig/displaydns
  5.  
  6. linux: ifconfig, netstat -anplt
  7. ARP table: arp -a / Routing table: route -n
  8. View login log to obtain login source IP

3. Query the process list

Check all processes running locally and confirm the status of local software, with a focus on security software.

  1. win:tasklist
  2. linux: ps, top

4. Query system and patch information

Get the system version and patch update status of the current host, which can be used to assist in escalating permissions.

  1. win:systeminfo, query system information/patch installation status.
  2. wmic qfe get Caption,description,HotfixID,installedOn //Query patch information, including description link/patch description/KB number/update time and other information
  3. wmic qfe list full query all information
  4.  
  5. Linux: Check the kernel version by uname -a or use rpm -qa to check which packages are installed

5. Credentials Collection

Sensitive information is stored on the server side, and various login credentials are collected to expand the results.

  1. Windows:
  2. Local password hash and plain text password/browser password capture/server plain text password
  3. linux:
  4. history records sensitive operations/shadow file cracking/mimipenguin captures passwords/uses Strace to collect login credentials/full disk search for sensitive information

Information collection within the domain

After collecting the relevant information of the local machine, it is necessary to determine whether the current host is in the domain. If it is in the domain, it is necessary to further collect information in the domain.

1. Determine whether there is a domain

Generally, domain servers will also serve as time servers, so use the following command to determine the primary domain

  1. After running the net time /domain command, there are generally three situations as follows:
  2.  
  3. 1. A domain exists, but the current user is not a domain user, and the prompt indicates that the permissions are insufficient.
  4. C:\Users > bypass > net time /domain
  5. System error 5 occurred
  6. access denied.
  7.  
  8. 2. A domain exists and the current user is a domain user
  9. C:\Users\Administrator > net time /domain
  10. The current time of \\dc.test.com is 2020/10/23 21:18:37
  11.  
  12. The command completed successfully.
  13.  
  14. 3. The current network environment is a workgroup, and there is no domain
  15. C:\Users\Administrator > net time /domain
  16. Unable to locate domain controller for domain WORKGROUP.

2. Find the domain administrator

  1. net user /domain //Get domain user list
  2. net group /domain //Query the list of all user groups in the domain
  3. net group "Domain Admins" /domain //Query domain administrator users
  4. net group "Domain Controllers" /domain //View domain controllers
  5. net localgroup administrators /domain //Query the domain's built-in local administrator group users

3. Find the domain controller

Generally speaking, the domain controller server IP address is the DNS server address. By finding the DNS server address, you can locate the domain controller.

  1. nslookup/ping domain name, resolve to domain controller server IP address

<<:  The lingering troubles of Apple computers! How to make them compatible with USB flash drives and mobile hard drives

>>:  Sweden bans China from participating in 5G construction? China's 5G technology has no shortage of cooperation

Recommend

Developing strategies at the data center level

Data centers are the infrastructure for modern bu...

5G and IoT: Compatible with each other

5G is here! It’s hard to ignore the hype surround...

How to enable owners and facility managers to realize smart buildings

Building owners and facility managers are turning...

Best Practices for Stream Computing Processing with Flink on Zeppelin

Content framework: Big Data Overview Flink Learni...

Empowering thousands of industries, 5G will be implemented first in these areas!

When it comes to the hottest technology in the wo...

Can the Internet of Things drive the deployment of IPv6?

IPv6 has features that IPv4 lacks, which makes it...

Smart Manufacturing: Ensuring a Smart Future for Manufacturing

Smart manufacturing has the potential to improve ...

Expert Viewpoint: Looking into the future of the Internet

How will businesses’ approach to networking evolv...

When will the chaos of number portability end?

The full implementation of the number portability...