Zmap Scan MongoDB with multi-threaded verification scripts

Source: Internet
Author: User

Installation Environment:
sudo apt-get install build-essential cmake libgmp3-dev libpcap-dev gengetopt byacc flex git dwarfdump
Download Zmap:
git clone git://
Install Zmap:
Make && make install
(Kali installation Zmap also require additional installation of json-c)
Individuals prefer to scan with profiles.
Zmap-c/etc/zmap/zmap.conf-o Output.txt
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[1]+ ". txt") if __name__ = = "__main__":
      Queue = Queue () A = open (Sys.argv[1], ' R ')  For IP in A.readlines (): IP = ip.strip (' \ n ') queue.put (IP) for I in Range (99): c = Mythread () C.start ()

Related Article

Contact Us

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: and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: