亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? scan.java

?? 優秀的內網子機及端口嗅探器(附java代碼).JMap is a Java network port scanner, a security tool to identify open ports o
?? JAVA
字號:
import java.net.*;import java.io.*;import java.util.*;/***Module for scanning tcp/ip ports on a given host or subnet**Copyright (C) 2003 Tom Salmon tom@slashtom.org**This program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseas published by the Free Software Foundation; version 2.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.**@author Tom Salmon tom@slashtom.org*@version 0.3.1*/public class Scan extends Observable implements Observer {	public static final String PORT_DEFINITIONS = "ports.defs";	protected static int MAX_THREADS = 10; // hosts to scan at once	protected static int WINDOWS_MAX_THREADS = 3; //max threads to run under Win	protected InetAddress host;		private int [] hostParts = new int[4];	protected InetAddress subnet;		private int [] subnetParts = new int[4];	protected int[] portsToScan;	private PortLookup portService;	private boolean stopped = false; //true to stop scanning	protected String resultsString = new String();	protected String subnetResults;	private Vector hostsScanning = new Vector(); //stores handle to threads scanning each host	private int hostsToScan = 0;	private int hostsScanned = 0;	//for use when only scanning one port on each host	private int portsRequired = 0;;	private int portsScanned = 0;	/*	*Scan specified hostname	*This constructor always gets called, by the other constructors	*@param String hostname	*@throws ScanningException - initialisation error	*/	public Scan(String hostname) throws ScanningException{		try{			host = InetAddress.getByName(hostname);			portService = new PortLookup(PORT_DEFINITIONS);			if (portsToScan == null){ //define it				portsToScan = portService.getActivePorts();			}			//get the component parts			String [] hostStrings = host.getHostAddress().split("\\.");			if (hostStrings.length != 4){				throw new ScanningException("Error forming hostname");			}			for (int i=0; i<hostStrings.length; i++){				hostParts[i] = Integer.parseInt(hostStrings[i]);			}			// check our operating system, if windows then reduce no of threads			if (System.getProperty("os.name").startsWith("Windows")){				this.MAX_THREADS = this.WINDOWS_MAX_THREADS;			}		}		catch(UnknownHostException e){			throw new ScanningException("Host: " + hostname + " unknown :(");		}		catch(NullPointerException e){			throw new ScanningException("Could not open port services"										+ " definitions file");		}		catch(Exception e){			throw new ScanningException(e.getMessage());		}	}	/**	*Scan subnet, probing default ports	*@param String hostname	*@param String subnet, eg 255.255.255.0	*/	public Scan(String hostname, String subnet) throws ScanningException{		this(hostname); //call main constructor		if (subnet == null){			return;		}		try{			//sanity check of subnet			String [] subnetStrings = subnet.split("\\.");				if (subnetParts.length != 4){				//should be four sectios				throw new ScanningException("Subnet invalid:\n" +											"should be specified in form:\n" +											"\t255.255.255.0\tor similar");			}				//form the subnetParts array of ints			for (int i=0; i<subnetParts.length; i++){				subnetParts[i] = Integer.parseInt(subnetStrings[i]);			}				boolean zeroFlag = false; //raised after which bits should be 0			boolean badSubnet = false; //signals a bad subnet				for (int i=0; i<subnetParts.length; i++){				if (zeroFlag){					if (subnetParts[i] != 0){						badSubnet = true;						break;					}				}				else{					if (subnetParts[i] < 255){						zeroFlag = true; //remainder should be '0'						continue;					}					else if (subnetParts[i] > 255){						badSubnet = true; //illegal range						break;					}				}			}				if (badSubnet){				throw new ScanningException("Illegal subnet address\n" +											"Subnet should be in form:\n" +											"\t255.255.255.0 for example");			}			this.subnet = InetAddress.getByName(subnet);		}		catch(UnknownHostException e){			throw new ScanningException("Subnet: " + subnet + " invalid");		}	}	/*	*Scan specified ports on given hostname, to scan subnet for just one port,	*enter the same values for lowestPort and highestPort	*@param String hostname	*@param String subnet in form 255.255.255.0 (for example)	*@param int lowestPort - port to start scanning from	*@param int highestPort - port to scan up to	*@throws ScanningException - initialisation error	*/	public Scan(String hostname, String subnet,					int lowestPort, int highestPort) 	                                  throws ScanningException{		this(hostname, subnet);		if (lowestPort <= highestPort && lowestPort > 0){			portsToScan = new int[highestPort - lowestPort + 1];			//define ports to scan			int i=0;			while (lowestPort <= highestPort){				portsToScan[i++] = lowestPort++;			}		}		else{			//illegal port range			throw new ScanningException("Illegal port range specified");		}	}	/*	*Scan specified ports on given hostname	*@param String hostname	*@param int lowestPort - port to start scanning from	*@param int highestPort - port to scan up to	*@throws ScanningException - initialisation error	*/	public Scan(String hostname, int lowestPort, int highestPort) 													throws ScanningException{		this(hostname, null, lowestPort, highestPort);	}	/**	*Returns the number of ports which are to be scanned	*@return int the total number of ports to scan	*/	public int getNumberPorts(){		if (subnet == null){			return portsToScan.length;		}		else{			return portsToScan.length * this.getNumberHosts();		}	}	/**	* calculates the maximum number of possible hosts on this subnet	*@return int the maximum number of hosts on subnet	*/	protected int getNumberHosts(){		// use exclusive OR bitwise operation on subnet parts		int partOne = subnetParts[0] ^ 0xff;		int partTwo = subnetParts[1] ^ 0xff;		int partThree = subnetParts[2] ^ 0xff;		int partFour = subnetParts[3] ^ 0xff;		// scale the return value appropriatly		return partFour + (partThree*0xff) + (partTwo*0xff*0xff) + 						  (partOne*0xff*0xff*0xff) + 1; //add 1 for '0'	}	/**	*Returns list of services in format: PORT_NUMBER - DEFINITION	*@return String array of port data	*/	public static String [] getPortList(){		PortLookup portsList = new PortLookup(PORT_DEFINITIONS);		int [] portNums = portsList.getActivePorts();		String [] retrStr = new String[portNums.length];		for (int i=0; i<portNums.length; i++){			retrStr[i] = portNums[i] + " - " + 									 portsList.getService(portNums[i], "tcp");		}		return retrStr;	}	/**	*Default protocol used for scanning (TCP/IP)	*@returns String list of open ports	*/	public String scan(){		return this.scan(true, false); //tcp scan only	}	/**	*Scans given host/subnet	*@param boolean TCP/IP scanning enabled	*@param boolean UDP scanning enabled	*/	public String scan(boolean tcp, boolean udp){		if (subnet == null){			// if we are only scanning one host			this.scanHost(host.getHostName(), tcp, udp);		}		else{			int [] subnetHostParts = new int[4];			String subnetHost;			subnetResults = new String();			InetAddress returnedHost;			InetAddress tmpHost;			String displayHost; //to display hostname			int port = -1; //used only if there is one port only			//if there is only one port to scan, select it			if (portsToScan.length == 1){				port = portsToScan[0];			}			for (int i=0; i<subnetHostParts.length; i++){				// bitwise AND operation to get the starting address				subnetHostParts[i] = hostParts[i] & subnetParts[i];			}			for (int i=0; i<this.getNumberHosts(); i++){				if (stopped){					resultsString = "Scanning Aborted, results so far:\n\n" 						 	 		+ resultsString;					return resultsString;				}				//form the host to scan from the individual parts of this 				//subnet host				subnetHost = subnetHostParts[0] + "." 							  + subnetHostParts[1] + "."							  + subnetHostParts[2] + "."							  + subnetHostParts[3];				try{					returnedHost = InetAddress.getByName(subnetHost);					displayHost = returnedHost.getHostName() 							+ "(" + subnetHost + ")";				}				catch(UnknownHostException e){					displayHost = subnetHost;				}				try{					//dont scan network of broadcast address					if (subnetHostParts[3] != 0 && subnetHostParts[3] != 0xff){						//retrived less output if only scanning one port						if (port > 0){							setChanged();							notifyObservers("Probing:  " + subnetHost + 										   "   PORT: " + port + "    " + 										   portService.getService(port, "tcp"));							tmpHost = InetAddress.getByName(subnetHost);							if (tcp){								this.scanTCP(tmpHost, port);							}							if (udp){								this.scanUDP(tmpHost, port);							}						}						else{							scanHost(subnetHost, tcp, udp);							//sleep for a while							try{								Thread.sleep(500); //5 sec							}							catch(Exception e){								;							}						}					}					else{ 					}				}				catch(UnknownHostException e){					subnetResults += displayHost + " not valid\n";				}				//increment the host to scan				subnetHostParts[3]++;				if (subnetHostParts[3] == 0x100){					subnetHostParts[3] = 0;					subnetHostParts[2]++;					if (subnetHostParts[2] == 0x100){						subnetHostParts[2] = 0;						subnetHostParts[1]++;						if (subnetHostParts[1] == 0x100){							//you shouldn't really be scanning this far							//but who am i to stop you?							subnetHostParts[1] = 0;							subnetHostParts[0]++;							if (subnetHostParts[0] == 0x100){								//you really have gone too far								break;							}						}					}				}			}			if (port > 0){				while (this.portsScanned < this.portsRequired && !stopped){					try{						Thread.sleep(1000);					}					catch(Exception e){						;					}				}				stopped = false; //reset switch				resultsString = new String();				return subnetResults;			}		}		//wait for all results to come back		while(this.hostsScanned < this.hostsToScan && !stopped){			try{				Thread.sleep(1000);			}			catch(Exception e){				;			}		}		if (stopped){			resultsString = "Scanning stopped, results so far:\n\n" 						   + resultsString;		}		stopped = false; //reset switch		return resultsString; //this final results	}    /**    *Scans single port using specified TCP hoost/port    *@param InetAddress host to probe    *@param int port number    */    protected void scanTCP(InetAddress IP, int port){		portsRequired++;		ScanTCP s = new ScanTCP(IP, port);		s.addObserver(this);		Thread scanPortThread = new Thread(s);		//scanPortThread.setPriority(Thread.MAX_PRIORITY);		scanPortThread.start();    }    /**    *Scans single UDP port on host/port    *@param InetAddress IP address of the victim    *@param int port number    */    protected void scanUDP(InetAddress IP, int port){		portsRequired++;		ScanUDP s = new ScanUDP(IP, port);		s.addObserver(this);		Thread scanPortThread = new Thread(s);		//scanPortThread.setPriority(Thread.MAX_PRIORITY);		scanPortThread.start();    }	/**	*Scans a given host, protected so that external classes can only scan	*using options set in constructor	*@param String victim - the host to scan	*@param boolean TCP/IP scanning enabed	*@param boolean UDP scanning enabled	*/	protected void scanHost(String hostname, boolean tcp, boolean udp){		if (hostsToScan - hostsScanned > this.MAX_THREADS){			// we are running too many threads			// wait until half threads have done			while (hostsToScan - hostsScanned > this.MAX_THREADS/2){				try{					Thread.sleep(5000);				}				catch(Exception e){				}			}		}		//increment counter of number of hosts we're waiting for results from		hostsToScan++; 		ScanHost s = new ScanHost(hostname, tcp, udp, portsToScan, portService);		hostsScanning.add(s); //store reference to this thread		s.addObserver(this);		Thread scanThread = new Thread(s);		scanThread.setPriority(Thread.MAX_PRIORITY);		scanThread.start();		// pause before attempting to start another thread		try{			Thread.sleep(2000);		}		catch(Exception e){		}	}	public void update(Observable o, Object arg){		if (o instanceof ScanTCP){			portsScanned++;			//responce to only scanning for one port per host			if ( ((String)arg).equals("OPEN")){				ScanTCP s = (ScanTCP)o;            	subnetResults += s.getIP().getHostName() +                    "\t" + s.getPort() + " tcp  " + 					portService.getService(s.getPort(), "tcp") +                    "\tOPEN\n";			}		}		else if (o instanceof ScanUDP){			portsScanned++;			//responce to only scanning for one port per host			if ( ((String)arg).equals("OPEN")){				ScanUDP s = (ScanUDP)o;            	subnetResults += s.getIP().getHostName() +                    "\t" + s.getPort() + " udp  " + 					portService.getService(s.getPort(), "udp") +                    "\tOPEN\n";			}		}		else if (arg instanceof String){			//is a status update, update our observer			setChanged();			notifyObservers(arg);		}		else if (arg instanceof Status){			hostsScanned++;			//attempt to remove thread from list of scanning threads			hostsScanning.remove((ScanHost)o);	        try {	            resultsString +=	                 InetAddress.getByName(                     ((ScanHost)o).getHostname()).getHostName() + "(" +	                 InetAddress.getByName(((ScanHost)o).getHostname())                     .getHostAddress() + ")\n";	        }	        catch(UnknownHostException e){	            resultsString += ((ScanHost)o).getHostname() + "\n";	        }	        resultsString += ((Status)arg).toString() + "\n\n\n";		}	}	/**	*Stops the scanning of a host	*/	public void stop(){		stopped = true;		//call stop for all threads left scanning		for (int i=0; i<hostsScanning.size(); i++){			((ScanHost)hostsScanning.get(i)).stop();		}	}	public static void main(String [] args){		if (args.length != 1){			System.out.println("USAGE: scanTCP <hostname>");			System.exit(0);		}		try{			Scan scan = new Scan(args[0]);			System.out.println(scan.scan());		}		catch(ScanningException e){			System.err.println(e.getMessage());		}	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一二区| 亚洲欧美一区二区不卡| 国产精品天美传媒| 亚洲大片一区二区三区| 国产精品77777| 日韩亚洲欧美高清| 一区二区三区不卡视频| av不卡在线播放| 精品国产凹凸成av人网站| 亚洲国产精品综合小说图片区| 国产一区二区0| 日韩欧美不卡在线观看视频| 一区二区久久久| 9l国产精品久久久久麻豆| 2021久久国产精品不只是精品| 亚洲无人区一区| 色香蕉成人二区免费| 国产片一区二区| 成人av动漫网站| 中文字幕精品—区二区四季| 黑人巨大精品欧美一区| 日韩一区二区免费高清| 午夜在线电影亚洲一区| 色屁屁一区二区| 亚洲欧美日韩综合aⅴ视频| 丁香亚洲综合激情啪啪综合| 2020国产精品| 国产一区二区影院| 久久天堂av综合合色蜜桃网| 久久69国产一区二区蜜臀| 日韩无一区二区| 日本中文在线一区| 欧美一区二区黄色| 日本一不卡视频| 日韩午夜在线播放| 精品一区精品二区高清| 精品嫩草影院久久| 国产一区激情在线| 久久久久99精品国产片| 国产激情精品久久久第一区二区| 久久久久亚洲蜜桃| 国产激情一区二区三区| 国产精品五月天| 91亚洲精品一区二区乱码| 亚洲精品欧美专区| 91国模大尺度私拍在线视频| 亚洲电影在线播放| 欧美一级国产精品| 久久精品久久99精品久久| 久久综合九色综合欧美就去吻| 国产精品一区二区在线观看不卡| 国产欧美日韩亚州综合| 91美女福利视频| 日本亚洲天堂网| 久久久久国产精品麻豆| 91免费国产在线观看| 亚洲午夜成aⅴ人片| 欧美成人伊人久久综合网| 国产一区二区三区在线观看免费| 中文字幕欧美国产| 欧美亚洲综合另类| 美女国产一区二区| 一区在线播放视频| 这里只有精品电影| 粉嫩av亚洲一区二区图片| 一区二区三区四区视频精品免费| 91精品一区二区三区在线观看| 精品一区二区免费看| 日韩美女视频一区二区| 91精品国产手机| 成人永久免费视频| 日韩二区在线观看| 国产精品久久影院| 欧美一级艳片视频免费观看| 成人av网站在线| 蜜臀国产一区二区三区在线播放| 国产精品毛片a∨一区二区三区| 欧美在线free| 国产999精品久久久久久| 午夜不卡在线视频| 亚洲欧美中日韩| 欧美成人艳星乳罩| 欧美日韩一区视频| eeuss鲁片一区二区三区在线观看| 五月婷婷激情综合网| 国产精品久久久久毛片软件| 欧美一区二区久久久| 一本久久精品一区二区| 国产精品一卡二卡在线观看| 亚洲国产日韩在线一区模特| 欧美经典三级视频一区二区三区| 7777精品伊人久久久大香线蕉超级流畅| 国产成人自拍在线| 久久精品国产在热久久| 天堂成人国产精品一区| 亚洲裸体xxx| 国产精品伦理在线| 久久久久久久久久久久久久久99 | 丁香婷婷综合五月| 日韩不卡免费视频| 亚洲一区二区三区三| 中文字幕一区二区三区在线观看 | 色偷偷88欧美精品久久久| 国产精品影视网| 激情文学综合插| 美女看a上一区| 日韩高清在线观看| 天堂va蜜桃一区二区三区| 亚洲国产精品久久久久婷婷884| 中文字幕亚洲欧美在线不卡| 久久久99精品久久| 亚洲美女视频在线观看| 日本一区二区动态图| 2022国产精品视频| 久久精子c满五个校花| 久久久久久电影| 国产目拍亚洲精品99久久精品| 精品精品国产高清a毛片牛牛| 91精品久久久久久久99蜜桃| 欧美日韩国产免费一区二区| 欧美日韩亚洲综合一区| 欧美日本在线视频| 88在线观看91蜜桃国自产| 91精品国产福利在线观看| 日韩女同互慰一区二区| 久久综合99re88久久爱| 欧美韩国日本综合| 亚洲天堂2014| 亚洲一卡二卡三卡四卡| 日韩精品国产精品| 久草这里只有精品视频| 国产一区欧美二区| 99国产精品一区| 欧美日韩免费一区二区三区视频| 欧美日本在线观看| 精品国产一二三区| 中文字幕一区不卡| 亚洲国产另类av| 韩国三级中文字幕hd久久精品| 国产成人免费在线观看不卡| 成人av电影免费在线播放| 日本丰满少妇一区二区三区| 91麻豆精品国产91久久久更新时间| 欧美α欧美αv大片| 国产精品私人自拍| 午夜久久久久久电影| 久久99国产精品麻豆| av在线播放不卡| 91精品国产综合久久精品app| 2020日本不卡一区二区视频| 亚洲欧美日韩系列| 美女免费视频一区| 91麻豆.com| 日韩欧美你懂的| 亚洲精品国产视频| 看片的网站亚洲| 在线观看视频91| 精品999久久久| 亚洲一区二区三区视频在线 | 极品少妇一区二区三区精品视频 | 国产欧美日韩在线视频| 一区二区日韩av| 韩国三级中文字幕hd久久精品| 色婷婷av久久久久久久| 欧美mv日韩mv国产| 一区二区激情小说| 高清不卡一二三区| 日韩一区二区精品在线观看| 最新欧美精品一区二区三区| 蜜桃精品视频在线| 欧美日韩在线一区二区| 久久精品男人天堂av| 日本不卡一区二区| 91久久精品国产91性色tv| 久久看人人爽人人| 麻豆精品新av中文字幕| 欧美中文字幕久久| 国产精品激情偷乱一区二区∴| 麻豆成人免费电影| 欧美老肥妇做.爰bbww视频| 中文字幕一区二区三区在线观看 | 亚洲麻豆国产自偷在线| 国产成人啪午夜精品网站男同| 欧美一区二区在线播放| 夜夜精品浪潮av一区二区三区| 成人免费福利片| 久久日一线二线三线suv| 日本不卡一二三| 欧美精选一区二区| 亚洲成人在线观看视频| 日本道免费精品一区二区三区| 中文字幕免费不卡在线| 国产揄拍国内精品对白| 精品国产伦一区二区三区观看体验| 丝袜美腿亚洲一区| 884aa四虎影成人精品一区| 亚洲一线二线三线视频| 在线看一区二区| 亚洲一区二区不卡免费| 欧美日韩国产综合一区二区三区|