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
The need for communication is indispensable in ou...
Since the commercial use of 5G, China Telecom, Ch...
There was once such an interview question: What h...
10gbiz is a foreign hosting service provider foun...
1. Introduction frp is a high-performance reverse...
@baimmi China UnionPay Co., Ltd. Due to the confi...
According to foreign media reports, the much-anti...
1. What is AP? Answer: AP - Wireless Access Point...
On December 23, at the annual APP awards ceremony...
Sharktech upgraded its website and products this ...
Today's more successful companies have realiz...
spinservers offers special discount codes for two...
Last September, I followed the trend and bought a...
Recently, a friend asked about the application of...
From the early days of dial-up to the impending a...