Skip to content

Commit

Permalink
change host TCP-scanner for parallel check all ports
Browse files Browse the repository at this point in the history
  • Loading branch information
harp077 committed Dec 28, 2023
1 parent 159a379 commit 1cda767
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/my/harp07/PjFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class PjFrame extends javax.swing.JFrame {
public static String currentLAF = "de.muntjak.tinylookandfeel.TinyLookAndFeel";
public static String currentTheme = "/themes/Default.theme";
public static List<String> tinyTemes = new ArrayList<>();
public static String zagolovok = "Pure Java Network Tools, v1.0.104, build 28-12-2023";
public static String zagolovok = "Pure Java Network Tools, v1.0.105, build 28-12-2023";

public PjFrame() {
initComponents();
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/my/harp07/tcp/HostTcpScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class HostTcpScanner {
private static String name;
//private static InetAddressValidator ipv = InetAddressValidator.getInstance();
private static List<String> genericTcpList
= Arrays.asList("21:ftp-22:ssh-23:telnet-25:smtp-49:tacacs-53:dns-80:http-88:kerberos-110:pop3-135:msrpc-139:netbios_ssn-143:imap-179:bgp-220:imap3-389:ldap-443:https-445:microsoft_ds-465:smtp+ssl-587:smtp+tls-636:ldaps-993:imaps-995:po3s-1433:ms_sql_srv-1434:ms_sql_mon-1720:h323-3128:proxy-3306:mysql-3389:ms_terminal-4899:radmin-5060:sip-5432:postgresql-8080:webcache-".split("-"));
= Arrays.asList("21:ftp-22:ssh-23:telnet-25:smtp-49:tacacs-53:dns-80:http-88:kerberos-110:pop3-135:msrpc-139:netbios_ssn-143:imap-179:bgp-220:imap3-389:ldap-443:https-445:microsoft_ds-465:smtp+ssl-587:smtp+tls-636:ldaps-993:imaps-995:pop3s-1433:ms_sql_srv-1434:ms_sql_mon-1720:h323-3128:proxy-3306:mysql-3389:ms_terminal-4899:radmin-5060:sip-5432:postgresql-8080:webcache-".split("-"));
private static Map<String, String> namesMap = new HashMap<>();
//private static int[] rangeTCP = new int[65536];
private static List<Integer> allTcpList = new ArrayList<>();
Expand Down Expand Up @@ -54,7 +54,7 @@ public class HostTcpScanner {
allTcpList.add(k);
}
genericTcpList.stream().forEach(x -> namesMap.put(x.split(":")[0], x.split(":")[1]));
System.out.println("TCP-ports = " + Arrays.toString(allTcpList.toArray()));
//System.out.println("TCP-ports = " + Arrays.toString(allTcpList.toArray()));
}

public static void changeInterface(Boolean bbb) {
Expand All @@ -69,7 +69,7 @@ public static void changeInterface(Boolean bbb) {
public static String getResult(JTextField tf, JTextArea ta) {
changeInterface(false);
name = tf.getText().trim();
result = " Scan TCP-ports.\n Open TCP-services for " + name + ":\n-------------\n";
result = " Scan TCP-ports.\n TCP-services for " + name + ":\n-------------\n";
resultUP = result + "\n Use parallel streams, CPU cores = " + Runtime.getRuntime().availableProcessors() + "\n TCP-Scanner data for UP:\n\n";
resultDOWN = result + "\n Use parallel streams, CPU cores = " + Runtime.getRuntime().availableProcessors() + "\n TCP-Scanner data for DOWN:\n\n";
result = result + "\n Use parallel streams, CPU cores = " + Runtime.getRuntime().availableProcessors() + "\n TCP-Scanner data:\n\n";
Expand Down Expand Up @@ -97,7 +97,7 @@ public static String getResult(JTextField tf, JTextArea ta) {
hmresult.put("" + x, "-> " + x + ", TCP-" + x + " = DOWN\n");
hmresultDOWN.put("" + x, "-> " + x + ", TCP-" + x + " = DOWN\n");
}
ta.setText("\nParallel check by TCP-ping for generic TCP-ports.\n\n Please Wait ! ..........." + x);
ta.setText("\n Parallel check by TCP-ping for generic TCP-ports.\n\n Please Wait ! ..........." + x);
});
}
///
Expand All @@ -119,7 +119,7 @@ public static String getResult(JTextField tf, JTextArea ta) {
hmresultDOWN.put("" + x, "-> " + x + ", TCP-" + x + " = DOWN\n");
}
synchronized (ta) {
ta.setText("\nParallel check by TCP-ping for all TCP-ports: 1-65535.\n\n Please Wait ! ..........." + x);
ta.setText("\n Parallel check by TCP-ping for all TCP-ports: 1-65535.\n\n Please Wait ! ..........." + x);
}
});
}
Expand Down

0 comments on commit 1cda767

Please sign in to comment.