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
It's a new year, so let's summarize some ...
The last time the tribe shared information about ...
On June 15, 2017, the global 5G entered a critica...
Many friends have the demand for multi-IP cluster...
Maxthon Hosting has long provided 20% discount co...
We work in weak current, and we have the most con...
[[375332]] Preface The author has recently comple...
CMIVPS has launched this month's promotion, o...
When it comes to tech innovation, it seems like w...
Is there anyone who needs a Spanish VPS? GINERNET...
CMIVPS is a Chinese hosting company founded in 20...
80VPS, a long-established Chinese merchant, is a ...
[[432534]] On November 1, the World Advanced Manu...
When it comes to staying beautiful, this is proba...
Hello everyone, I am Bernie, an IT pre-sales engi...