In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Most people do not understand the knowledge points of this article "nmap scan port why the results are different from Python", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "nmap scan port gives different results with Python" article.
I have a vulnerable box with IP 192.168.41.2 and port scan with nmap resulting in:
Nmap-T4-p-192.168.41.2Starting Nmap 7.91 (https://nmap.org) at 2021-07-27 15:13 EDTNmap scan report for 192.168.41.2Host is up (0.00024s latency). All 65535 scanned ports on 192.168.41.2 are closedMAC Address: 00:50:56:EA:44:EB (VMware) Nmap done: 1 IP address (1 host up) scanned in 2.72 seconds
Tell me there are no open ports. Then, I use the Python script to check the results:
From scapy.all import * import argparseparser = argparse.ArgumentParser () parser.add_argument ('ip') args = parser.parse_args () ip = args.ipports = [i for i in range (65535)] def synScan (host): resp, _ = sr (IP (dst=host) / TCP (sport=5555, dport=ports, flags='S'), timeout=2, verbose=0) print (f'Open ports on {host}:\ n') for s Rin resp: if s [is open.'] .dport = = r [TCP] .requests: print (f'TCP Port {s [TCP] .dport} is open.') synScan (ip)
By running the execution script, resulting in: python3 port_scanner.py 192.168.41.2
Open ports on host 192.168.41.2:TCP Port 0 is open.TCP Port 1 is open.TCP Port 2 is open.TCP Port 3 is open.TCP Port 4 is open.TCP Port 5 is open.TCP Port 6 is open.TCP Port 7 is open.TCP Port 8 is open.TCP Port 9 is open.TCP Port 10 is open.TCP Port 11 is open.TCP Port 12 is open.TCP Port 13 is open.TCP Port 14 is open.TCP Port 15 is open.TCP Port 16 is open.TCP Port 17 is open. TCP Port 18 is open.TCP Port 19 is open.TCP Port 20 is open.TCP Port 21 is open.TCP Port 22 is open.TCP Port 23 is open.TCP Port 24 is open.
My question is what kind of scan should I trust more? Nmap is very popular with web scanners and scapegoats are quite popular, but here you see the results.
Solution
This is wrong. For example, if it is a RST message, close the port. This script tells us whether the port is filtered.
Therefore, if you want to use scapy, you must also check to see if the answer package also has the SYN package set.
The above is about the content of this article on why the results given by the nmap scan port are different from Python. I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.