A few days ago to see an article about Metasploit and PowerShell, which mentioned a statement about the port scan, write very concise, very good idea, you can throw away the bulky nmap directly scan the specified IP port:
Copy Code code as follows:
1..1024 | %{Echo ((New-object Net.Sockets.TcpClient).
static void Main (string[] args) { Console.WriteLine ("Please enter IP"); String ip = Console.ReadLine (); Parallel.For (1, 65535, i = Scan (IP, I, +)); Console.WriteLine ("Scan Complete"); } public static void Scan (string ip, int port, int timeout)
Suppose the 1.txt file content is127.0.0.1192.168.1.1Then we get the file content IP for scanningwindow. bat version
: 1.txt is the filename, modify according to the requirement: C:\nmap\nmap-6.46\nmap.exe as Namp path, modified according to requirements: Put the 1.txt together with the scan script
The code is as follows
Copy Code
@echo offFor/f "delims=,"%%i in (1.txt) do C:\nmap\nmap-6.46\nmap.exe-T3-A-v-p-%%i >%%i.txt
tcpconnect Scan : TCP full connection scan. Using the Connect () function provided by the system to connect to the target port, if the target port is listening to this port, then the Connect () function will be successfully returned, otherwise, the change
MFC scan COM port Program
MFC scan COM port program source code
Features:
The core function is scan. Not only can the actual port of COM such as Bluetooth and printer be scanned, but also the
being a warrior is not a simple thing, it is an endless struggle that lasts until the last moment of our lives. No life down is a warrior, like no life down is doomed mediocre, is we let ourselves become such or that!--Natsume StoneDesign ideas:Call Optparse. Optionparse () method, build option parser, accept host name (or IP address), scan port list two parameters. Build two functions Portscan and Connscan
# Nc-Z localhost 1-10000 // scan ports 1 to 1000 of the Local Machine to obtain the opened portConnection to localhost 22 port [TCP/ssh] succeeded!Connection to localhost 80 port [TCP/HTTP] succeeded!Connection to localhost 111 port [TCP/SunRPC] succeeded!Connection to localhost 199
, Pop3, Location Service, Netbios-NS, Netbios-DGM, Netbios-SSN, IMAP, Https, Microsoft-DS, MSSQL, MYSQL, Terminal Services );// After checking the IP format, use an array to define the service name and status of each port.Echo"
";Echo"
";Echo"
IP address you scanned: ". $ remoteip ."";Echo"
";Echo"
";Echo"
{
$ Fp = @ fsockopen ($ remoteip, $ port [$ I], $ errno, $ errstr, 1 );
If (! $ Fp ){
Echo"
Ask PHP swoole extended scan IP 65,535 ports whether the idea of opening
I've only recently learned about Swoole extensions, but I've learned about pthreads extensions before, but there's no idea.
Issues that need to be addressed:
11,000 IP concurrent Scan survival (own resolution using ping or FSOCKOPEN,NODEJS, but too inefficient or want to use PHP environment)
2. Sca
Scan port data storage with thread-safe queue queues
Scan ports with multithreading
Implementing program organization with the thread class
#Coding:utf-8ImportSYSImportSocketImportSYSImportRe fromThreadingImportThread fromQueueImportQueueclassScanport (Thread):def __init__(self, target_ip, Target_port, Q): Super (Scanport, self).__init__() self.targe
Simple multi-threaded port scanning ToolYou can receive an IP address as a parameter, and if you do not, the port of the native is scanned by default1 #!/usr/bin/python2 3 ImportSocket4 Import Time5 ImportArgparse6 ImportThreading7 8 defarg_process ():9Argparser=argparse. Argumentparser (description="Port Scaner")TenArgparser.add_argument ('- I.','--ip', action='
The Tag:smtplib exists loginmultipartlines formats streamatt accessories #!/usr/bin/env python3 #coding: Utf-8import timeimport commandsimport osimport smtplibimport email. Mimemultipartimport email. Mimetextimport email. Mimebaseimport mimetypesimport Email. Mimeimage#import mimeimage# function: Scan the host's port number 22nd is open and will be successful export log, if there is a
Tag:python Scan Tool [[emailprotected]~]#catportscan.py#!/usr/bin/envpython#-*- coding:utf-8-*-importsocket# instantiation of an object S=socket.socket () #循环遍历你自定义的端口范围 Forportinrange (1,65535): #使用python的异常处理 to determine the behavior after a program error try: print "[+]attemptingtoconnectto127.0.0.1:" + STR (port) #客户端对服务器端进行连接, the format of the general address is a tuple (hostname,
"""Project name: Port probing scanWhiteVersion: 1.0Note: For example MySQL 3306 here, port to 80 can also"""#引入线程和socket的模块importthreadingimportsocketrouters=[] #用于保存探测结果lock =threading. Lock () #构造一把锁def main (): NBSP;NBSP;NBSP;NBSP;LOCAL_IPNBSP;=NBSP;SOCKET.GETHOSTBYNAME_EX ( Socket.gethostname ()) all_threads=[]foripin Local_ip[2]:fori inrange (1,255): array=ip.split (".") #把IP以点号做分割 array[3]=str (i)
Label: style blog HTTP color Io OS AR
Using system; using system. collections. generic; using system. componentmodel; using system. data; using system. drawing; using system. LINQ; using system. net; using system. net. sockets; using system. text; using system. threading. tasks; using system. windows. forms; namespace scan computer port {public partial class form1: FORM {public form1 () {initializecomponent
Python's most concise and understandable scan port code. It's definitely going to be amazing to run.
Copy the 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_
A gadget that uses Python to scan a fixed port to receive parameters: Start IP, terminate IP, target port. and test success, so in this record, Daniel do not spray.
#coding =utf-8 Import Socket import time import sys def portscanner (ip,port): Server = (ip,port) SOCKFD
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.