TCP connection scanning, based on sockets, uses threading to implement multi-threading and to control the number of processes.Note: The Threads_limit variable depends on the host, and there are too many definitions to make the following error:650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/86/F2/wKiom1fPfPGTqgnjAAAL7L75bGQ904.png-wh_500x0-wm_3 -wmp_4-s_3950277187.png "title=" 1.png "alt=" Wkiom1fpfpgtqgnjaaal7l75bgq904.png-wh_50 "/>Code:Importsocketimportthreading#changethesevars.star
It can be broadly divided into two ways:1. Call Nmap for port scanningMsfconsoleNmap-v-SV www.cstc.org.cnScan results (port opening and operational information for the target service operating system)PORT State SERVICE VERSION21/TCP Open FTP Microsoft ftpd80/TCP Open http Apache tomcat/coyote JSP engine 1.1135/tcp Open MSRPC Microsoft Windows RPC139/tcp Open NETB
Automatically check the ip address used to scan the ssh port, and automatically disable command 01 for 100 scans #! /Bin/bash02 # sshd, failed03cd/var/bakwww.2cto. com04cat/var/log/secure | grepFailed | awk amp; #39; {print $13} amp; #39; | sort | uniq...
Automatically check the ip address used to scan the ssh port,
Not very familiar with multi-threading, the first simple application.1 /*2 2015.5 HT3 multi-line threaded port scanning4 5 Netstat-an6 7 */8 9#include Ten#include One#include A #pragmaComment (lib, "Ws2_32.lib") - using namespacestd; - the //port parameters passed by thread -typedefstruct - { -UnsignedintMin_port; +UnsignedintMax_port; - }port; +
the thread pool All_threads.append (t) # Loop blocks the main thread, waiting for each sub-thread to finish executing, The program then exits for T in All_threads:t.join () # Create Access IP list Method def check_ip (NEW_IP, Port): # Create a TCP socket, link a new IP list scan_link = Socket.socket ( Socket.af_inet, Socket. SOCK_STREAM) # Set link timeout time scan_link.settimeout (2) # link address (by specifying the host address we constructed, an
There are now port-proof tools, such as Psad, Portsentry, but feel the configuration is a bit cumbersome, and the server does not want to install an additional software. So I wrote a shell script to implement this function. The basic idea is: the use of iptables recent module records in 60 Seconds to scan over 10 ports of IP, and combined with the Inotify-tools tool real-time monitoring iptables log, once t
Do not need any tools, DOS command scan all the ports of a network segment!
Open a DOS window under Win2000, and then execute
FOR/L%a in (1,1,254) do start/min/low telnet 192.168.0.%a 3389
So all the open 3389 ports in this 192.168.0.x segment will be exposed.
After this command is executed
will open 254 small windows in the taskbar
Then the Telnet link failed window automatically exits after approximately 5 seconds
The rest of the window is the relat
Python's most concise and understandable scan port code. It would be amazing to run.
Copy Code code as follows:
From threading import Thread, Activecount
Import socket
Import OS
def test_port (Dst,port):
Os.system (' title ' +str (port))Cli_sock = Socket.socket (socket.af_inet, socket. SOCK_STREA
#!/usr/bin/python#-*-coding:utf-8-*-from libnmap.process import nmapprocessfrom libnmap.parser Import Nmapparserimport Requestsx=90while x Python realizes the use of Nmap and AI stations to scan open 80 port IP and reverse domain name resolution
Number of Windows Scan Port links batch
Because we have a problem with the disconnected development of a program here, there are often thousands of links in the established state, but in fact these links should have been disconnected, when the link piled up to a certain extent, the server can not access the situation. That's why the following script was generated.
The purpose of the script is to make a st
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.