|
Brought to you by:
Suppliers of:
|
|
|
| |
| The following exploit code is a simple to use Javascript based port scanning code. The code utilizes the behavior of the IMG tag to detect the presence of an open/closed port. |
| |
Credit:
The information has been provided by Petko Petkov.
The original article can be found at: http://www.gnucitizen.org/projects/javascript-port-scanner/
|
| |
Source:
var AttackAPI = {
version: '0.1',
author: 'Petko Petkov (architect)',
homepage: 'http://www.gnucitizen.org'};
AttackAPI.PortScanner = {};
AttackAPI.PortScanner.scanPort = function (callback, target, port, timeout) {
var timeout = (timeout == null)?100:timeout;
var img = new Image();
img.onerror = function () {
if (!img) return;
img = undefined;
callback(target, port, 'open');
};
img.onload = img.onerror;
img.src = 'http://' + target + ':' + port;
setTimeout(function () {
if (!img) return;
img = undefined;
callback(target, port, 'closed');
}, timeout);
};
AttackAPI.PortScanner.scanTarget = function (callback, target, ports, timeout)
{
for (index = 0; index < ports.length; index++)
AttackAPI.PortScanner.scanPort(callback, target, ports[index], timeout);
};
|
|
|
|
|