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
In the past few days, South Korea and the United ...
What is 4G/5G dynamic spectrum sharing? Why is 4G...
Usually when we open a web page, such as a shoppi...
According to Science and Technology Daily, on Jun...
Megalayer is a foreign hosting company establishe...
With the continuous development of mobile phones,...
Each new Wi-Fi version brings new features and it...
BGP.TO is currently offering promotions for serve...
When it comes to the Internet and cloud computing...
On November 27, the Ministry of Industry and Info...
5G provides a large number of new applications fo...
RAKsmart's independent server flash sale cont...
Network latency is not a new term. In modern Ethe...
[[420910]] Market Introduction Market research fi...
Expanding the presence of fiber optics has become...