sudo apt-get install build-essential cmake libgmp3-dev libpcap-dev gengetopt byacc flex git dwarfdump
git clone git://github.com/zmap/zmap.git
Make && make install
(Kali installation Zmap also require additional installation of json-c)
Individuals prefer to scan with profiles.
A script that uses Python to write a batch validation Zmap scan results for unauthorized access.
The beginning of the code does not set a timeout, the results found just ran off a while, check the official documents of a Half-day Pymongo, found the CONNECTTIMEOUTMS, Sockettimeoutms these two parameters.
Set the connection timeout Connecttimeoutms, do not know why did not work, and changed to set the socket timeout time SOCKETTIMEOUTMS only valid.
Pymongo the default number of connections is 100, so the number of threads in the code is 99, you can adjust.
Attached is a multithreaded verification script written by the practitioner:
#/usr/bin/python #coding: UTF8 import sys import pymongo import urllib2,threading,time import sys from queue import queue Def Conn (addr,output): try:w = open (output, ' a ') conn = Pymongo. Mongoclient (addr,27017,sockettimeoutms=3000) dbname = Conn.database_names () WR = "Ip:" +ad
dr+ "\ r \ n" WR + + "dbs:\r\n" WR + + str (dbname) + "\ r \ n" w.write (WR) Print WR Conn.close () w.close () except:print addr+ "Connect Ion was failed\r\n "Class Mythread (threading. Thread): def __init__ (self): threading.
Thread.__init__ (self) def run (self): Global queue while not queue.empty ():
ip = queue.get () conn (ip,sys.argv+ ". txt") if __name__ = = "__main__":
Queue = Queue () A = open (Sys.argv, ' R ') For IP in A.readlines (): IP = ip.strip (' \ n ') queue.put (IP) for I in Range (99): c = Mythread () C.start ()