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

2020 is already halfway through, how far is 5G from a full-scale outbreak?

In 2019, we often heard the industry say that 201...

5GRedCap: The role of RedCap in 5G evolution

3GPP Release (Rel) 17, due in mid-2022, introduce...

Manually simulate and implement Docker container network!

[[435189]] Hello everyone, I am Fei Ge! Nowadays,...

BriskServers: $7.8/mo-AMD Ryzen9 7950x/4GB/80GB/Unlimited data @ 10Gbps/Ashburn

BriskServers was founded in 2021 by a group of ga...

Servervy: €1.5/month-2GB/10GB SSD/100M unlimited traffic/Netherlands VPS

The whois query of the domain name Servervy.com s...

Where will edge computing investments go?

At the beginning of 2020, edge computing seemed t...

Verizon expands Ultra Wideband 5G and 5G Home Internet to new cities

Verizon, the US telecom operator, recently announ...

How to Re-evaluate Unified Communications Tools in the Work-from-Home Era

As the pandemic shapes a new normal, value chains...

Regular end-to-end encryption may not be that secure

[51CTO.com Quick Translation] Is the messaging pl...

Omdia: Global Gigabit Broadband Users to Reach 50 Million by 2022

According to the latest report released by market...

Big and small! The little sister tells you everything about BeautifulSoup

[[427165]] Learn more about BeautifulSoup Scrapin...

With HTTP protocol, why do we need Websocket?

[[428410]] WebSocket is a full-duplex communicati...