Warning: session_start(): open(/var/lib/php/sessions/sess_635hgm49f0nkm5so1h9fc06m7f, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
srecord noeq PortScan(S ip) {
settable int numberOfThreads = 10;
settable double timeout = 10; // seconds
List openPorts;
ExecutorService es;
run {
openPorts = new L;
es = Executors.newFixedThreadPool(numberOfThreads);
print("Port scanning " + ip + " with timeout " + timeout + " s in " + threads + " threads.");
new List> futures;
for (int port = 1; port <= 65535; port++) {
futures.add(portIsOpen(port));
}
es.shutdown();
for (Future f : futures) {
int port = f!;
if (port != 0)
openPorts.add(port);
}
}
L get aka openPorts() {
if (openPorts == null) run();
ret openPorts;
}
Future portIsOpen(int port) {
ret es.submit(new Callable() {
@Override public Integer call() {
try {
new Socket socket;
socket.connect(new InetSocketAddress(ip, port), toMS_int(timeout));
print("Connected to " + ip + ":" + port);
socket.close();
return port;
} catch (Exception ex) {
return 0;
}
}
});
}
}