tweaks numero duo
This commit is contained in:
@@ -53,6 +53,7 @@ public class ServerCommand extends Command {
|
|||||||
ports.put(8123, "DynMap");
|
ports.put(8123, "DynMap");
|
||||||
ports.put(25566, "Minequery");
|
ports.put(25566, "Minequery");
|
||||||
ports.put(3306, "MySQL");
|
ports.put(3306, "MySQL");
|
||||||
|
ports.put(3389, "RDP");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -122,7 +123,7 @@ public class ServerCommand extends Command {
|
|||||||
BaseText text = new LiteralText(String.format("- %s%d%s ", Formatting.GREEN, port, Formatting.GRAY));
|
BaseText text = new LiteralText(String.format("- %s%d%s ", Formatting.GREEN, port, Formatting.GRAY));
|
||||||
if (ports.containsKey(port)) {
|
if (ports.containsKey(port)) {
|
||||||
text.append(ports.get(port));
|
text.append(ports.get(port));
|
||||||
if (ports.get(port).startsWith("HTTP")) {
|
if (ports.get(port).startsWith("HTTP") || ports.get(port).startsWith("FTP")) {
|
||||||
text.setStyle(text.getStyle()
|
text.setStyle(text.getStyle()
|
||||||
.withClickEvent(new ClickEvent(
|
.withClickEvent(new ClickEvent(
|
||||||
Action.OPEN_URL,
|
Action.OPEN_URL,
|
||||||
@@ -133,8 +134,7 @@ public class ServerCommand extends Command {
|
|||||||
new LiteralText("Open in browser")
|
new LiteralText("Open in browser")
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
}
|
} else if (ports.get(port) == "DynMap") {
|
||||||
else if (ports.get(port) == "DynMap") {
|
|
||||||
text.setStyle(text.getStyle()
|
text.setStyle(text.getStyle()
|
||||||
.withClickEvent(new ClickEvent(
|
.withClickEvent(new ClickEvent(
|
||||||
ClickEvent.Action.OPEN_URL,
|
ClickEvent.Action.OPEN_URL,
|
||||||
@@ -145,7 +145,29 @@ public class ServerCommand extends Command {
|
|||||||
new LiteralText("Open in browser")
|
new LiteralText("Open in browser")
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
text.setStyle(text.getStyle()
|
||||||
|
.withClickEvent(new ClickEvent(
|
||||||
|
ClickEvent.Action.COPY_TO_CLIPBOARD,
|
||||||
|
String.format("%s:%d", address.getHostAddress(), port)
|
||||||
|
))
|
||||||
|
.withHoverEvent(new HoverEvent(
|
||||||
|
HoverEvent.Action.SHOW_TEXT,
|
||||||
|
new LiteralText("Copy")
|
||||||
|
))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
text.setStyle(text.getStyle()
|
||||||
|
.withClickEvent(new ClickEvent(
|
||||||
|
ClickEvent.Action.COPY_TO_CLIPBOARD,
|
||||||
|
String.format("%s:%d", address.getHostAddress(), port)
|
||||||
|
))
|
||||||
|
.withHoverEvent(new HoverEvent(
|
||||||
|
HoverEvent.Action.SHOW_TEXT,
|
||||||
|
new LiteralText("Copy")
|
||||||
|
))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class PScanRunner {
|
|||||||
futures.add(isPortOpen(es, address.getHostAddress(), port, timeoutMS, threadDelay));
|
futures.add(isPortOpen(es, address.getHostAddress(), port, timeoutMS, threadDelay));
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
boolean _1 = es.awaitTermination(200L, TimeUnit.MILLISECONDS);
|
es.awaitTermination(200L, TimeUnit.MILLISECONDS);
|
||||||
} catch (InterruptedException ignored) {
|
} catch (InterruptedException ignored) {
|
||||||
}
|
}
|
||||||
List<PortScannerManager.ScanResult> results = new ArrayList<>();
|
List<PortScannerManager.ScanResult> results = new ArrayList<>();
|
||||||
@@ -52,7 +52,6 @@ public class PScanRunner {
|
|||||||
Thread.sleep(delay);
|
Thread.sleep(delay);
|
||||||
portsScanned++;
|
portsScanned++;
|
||||||
try {
|
try {
|
||||||
//System.out.println(ip + ":" + port);
|
|
||||||
Socket socket = new Socket();
|
Socket socket = new Socket();
|
||||||
socket.connect(new InetSocketAddress(ip, port), timeout);
|
socket.connect(new InetSocketAddress(ip, port), timeout);
|
||||||
socket.close();
|
socket.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user