During penetration testing, when we take down a server as a springboard to further penetrate the intranet, we often need to collect intranet assets through host survival detection and port scanning. We can roughly divide the host scanning scenarios into three types: 1) directly execute under the webshell, scan and detect through the system's built-in commands or upload script tools; 2) penetrate the intranet through the rebound shell, and penetration testing frameworks such as msf come with some scanning modules; 3) scan the intranet through the socks proxy (such as proxychains+Nmap scanning). Choose the most appropriate weapon in the appropriate scenario. For example, protocols that support survival detection include ARP, ICMP, SMB, UDP, NETBIOS, SNMP, etc.; port scanning methods that support port scanning include ACK scanning, SYN scanning, TCP scanning, UDP scanning, ICMP scanning, etc. 1. ping command We often use ping to check network connectivity and telnet to test the connectivity of a specified port. Using the system's own commands to complete segment C detection is inefficient, but it is not easy to trigger security rules. If the server has a firewall turned on or ping is prohibited, the detection results will be affected. Use the ping command to scan segment C in Windows:
Use the ping command to scan segment C in Linux:
In addition, you can also combine the system's own traceroute, arp, netstat and other commands to collect intranet information, curl and wget can be used for port detection. 2. Powershell Scan the IP address survival through PowerShell script:
Script download address: https://gallery.technet.microsoft.com/scriptcenter/Invoke-TSPingSweep-b71f1b9b Use PowerShell to implement basic port scanning functions. Scanning multiple ports of a single IP:
Scanning a single port in a certain IP segment:
Scanner for a certain IP range & multiple ports
3. Intranet host detection based on MSF When using msf to perform a rebound shell to penetrate the intranet, a quick scan is performed through the scanning module that comes with msf. Host survival detection:
Port Scanning:
4. Nmap scans the intranet Nmap is a port scanner that can be used for host discovery, port scanning, version detection, OS detection, etc. Usage scenario: Establish socks proxy, proxychains+Nmap scan intranet. Support multiple scanning modes:
Quickly scan all ports:
|
<<: Interviewer: Do you understand secure data transmission?
>>: Is WeChat and QQ file transfer too inhumane? Here's how to fix it
At the end of last month, we shared some of RAKsm...
Under the wave of digital transformation, enterpr...
March 14th news: As an important supporting techn...
Bandwagonhost currently has most packages availab...
What is the difference between a wide area networ...
Hostodo has launched a February Special Deal prom...
In recent years, blockchain technology has become...
Recently, Qualcomm announced the launch of the wo...
5G technology is being rolled out in many countri...
The trend of optical fiber replacing copper fiber...
Since the beginning of 2018, the new number segme...
DesiVPS has released the latest promotion in July...
The business world is like a battlefield. Whoever...
DHCP appears A computer or mobile phone needs an ...
Every year, June 18th is an e-commerce shopping c...