diff --git a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServer.java b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServer.java index 8fb698e0f1..c0296aec2e 100644 --- a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServer.java +++ b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServer.java @@ -69,7 +69,7 @@ public class GhidraServer extends UnicastRemoteObject implements GhidraServerHan private static String HELP_FILE = "/ghidra/server/remote/ServerHelp.txt"; private static String USAGE_ARGS = - " [-p] [-a] [-d] [-u] [-anonymous] [-ssh] [-ip] [-i] [-e] [-n] "; + " [-p] [-a] [-d] [-u] [-anonymous] [-ssh] [-ip ] [-i ] [-e] [-n] "; private static final String RMI_SERVER_PROPERTY = "java.rmi.server.hostname"; @@ -421,7 +421,6 @@ public class GhidraServer extends UnicastRemoteObject implements GhidraServerHan } private static String initRemoteAccessHostname() throws UnknownHostException { -// System.setProperty("java.rmi.server.useLocalHostname", "false"); String hostname = System.getProperty(RMI_SERVER_PROPERTY); if (hostname == null) { if (bindAddress != null) { @@ -433,7 +432,7 @@ public class GhidraServer extends UnicastRemoteObject implements GhidraServerHan localhost = findHost(); if (localhost == null) { log.fatal("Can't find host ip address!"); - System.exit(0); + System.exit(-1); } } hostname = localhost.getHostAddress(); diff --git a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/ServerHelp.txt b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/ServerHelp.txt index 855cda938f..e1a8a603a5 100644 --- a/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/ServerHelp.txt +++ b/Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/ServerHelp.txt @@ -1,8 +1,8 @@ Ghidra server startup parameters. Command line parameters: [-ip ] [-i #.#.#.#] [-p#] [-a#] [-d] [-e] [-u] [-n] - -ip : identifies the remote access IP address or hostname (FQDN) which should be - used by remote clients to access the server. + -ip : identifies the remote access IPv4 address or hostname (FQDN) which should be + used by remote clients to access the server. -i #.#.#.# : server interface IPv4 address to listen on (default will listen on all interfaces). diff --git a/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/ServerConnectTask.java b/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/ServerConnectTask.java index e4b73188e6..e182d986c3 100644 --- a/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/ServerConnectTask.java +++ b/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/ServerConnectTask.java @@ -123,17 +123,6 @@ class ServerConnectTask extends Task { return name; } -// private static void setOutgoingIpAddress(InetAddress destAddr, int serverPort) -// throws IOException { -// // TODO: this may not be needed since we do not create remote objects on the client -// InetSocketAddress sockAddr = new InetSocketAddress(destAddr, serverPort); -// Socket s = new Socket(); -// s.connect(sockAddr, 5000); -// String ip = s.getLocalAddress().getHostAddress(); -// System.setProperty("java.rmi.server.hostname", ip); -// s.close(); -// } - private static boolean isSSLHandshakeCancelled(SSLHandshakeException e) throws IOException { if (e.getMessage().indexOf("bad_certificate") > 0) { if (ApplicationKeyManagerFactory.getPreferredKeyStore() == null) { @@ -158,8 +147,6 @@ class ServerConnectTask extends Task { */ public static GhidraServerHandle getGhidraServerHandle(ServerInfo server) throws IOException { -// setOutgoingIpAddress(InetAddress.getByName(server.getServerName()), server.getPortNumber()); - GhidraServerHandle gsh = null; try { // Test SSL Handshake to ensure that user is able to decrypt keystore. diff --git a/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/remote/GhidraServerHandle.java b/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/remote/GhidraServerHandle.java index dc1be2239e..13277e4885 100644 --- a/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/remote/GhidraServerHandle.java +++ b/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/remote/GhidraServerHandle.java @@ -47,6 +47,9 @@ public interface GhidraServerHandle extends Remote { * 9: Added support for transient checkouts (7.2) * 10: Added BlockStreamServer (7.4) * 11: Revised password hash to SHA-256 (9.0) + * - version 9.1 switched to using SSL/TLS for RMI registry connection preventing + * older clients the ability to connect to the server. Remote interface remained + * unchanged allowing 9.1 clients to connect to 9.0 server. */ public static final int INTERFACE_VERSION = 11; diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectInfoDialog.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectInfoDialog.java index b05dd924e0..eac6e066da 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectInfoDialog.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ProjectInfoDialog.java @@ -557,7 +557,7 @@ public class ProjectInfoDialog extends DialogComponentProvider { @Override public void run(TaskMonitor monitor) { try { - // NOTE: conversion of non-shared project will loose version history + // NOTE: conversion of non-shared project will lose version history project.getProjectData().updateRepositoryInfo(taskRepository, monitor); status = true; } diff --git a/Ghidra/RuntimeScripts/Common/server/server.conf b/Ghidra/RuntimeScripts/Common/server/server.conf index ac5df5920e..9c155dfa83 100644 --- a/Ghidra/RuntimeScripts/Common/server/server.conf +++ b/Ghidra/RuntimeScripts/Common/server/server.conf @@ -108,7 +108,7 @@ ghidra.repositories.dir=./repositories # Command line parameters: (Add command line parameters as needed and renumber each starting from .1) # [-ip ] [-i ###.###.###.###] [-p#] [-a#] [-anonymous] [-ssh] [-d] [-e] [-u] [-n] # -# -ip : remote access hostname or IP address to be used by clients +# -ip : remote access hostname or IPv4 address to be used by clients # -i #.#.#.# : interface IPv4 address to accept connections on (default all interfaces) # -p# : base TCP port to be used (default: 13100) # -a# : an optional authentication mode where # is a value 0 or 2 diff --git a/Ghidra/RuntimeScripts/Common/server/svrREADME.html b/Ghidra/RuntimeScripts/Common/server/svrREADME.html index 2cf2900aa3..59078612b2 100644 --- a/Ghidra/RuntimeScripts/Common/server/svrREADME.html +++ b/Ghidra/RuntimeScripts/Common/server/svrREADME.html @@ -204,12 +204,12 @@ name/address queries.

-By default the server will attempt to identify an appropriate remote access IP address which will -be written to the log at startup. In addition, the server will only bind/listen to incoming -connections on this address by default. It is important to understand between the published address -and the listening address. See the -ip parameter and --i options in the Server -Options section for more details. +By default the server will attempt to identify an appropriate remote access IPv4 address which will +be written to the log at startup. In addition, the server will listen for incoming +connections on all IPv4 interfaces by default. It is important to understand the difference between +the published remote access address and the listening address (i.e. interface) which are both +configurable. See the -ip and -i options in +the Server Options section for more details.

(Back to Top) @@ -291,9 +291,9 @@ public key files may be made without restarting the Ghidra Server. login for -a0 authentication mode. Without this option, the users client-side login ID will be assumed.
-
  • -ip <hostname>
    Identifies the remote access IP address or - hostname (FQDN) which should be used by remote clients to access the server. By default the - host name reported by the operating system is resolved to an IP address, if this fails the +
  • -ip <hostname>
    Identifies the remote access hostname (FQDN) + or IPv4 address which should be used by remote clients to access the server. By default the + host name reported by the operating system is resolved to an IPv4 address, if this fails the local loopback address is used. The server log will indicate the remote access hostname at startup. This option may be required when a server has multiple IP interfaces, relies on a dynamic DNS or other network address translation for incoming connections. @@ -301,9 +301,9 @@ public key files may be made without restarting the Ghidra Server.

  • -i <#.#.#.#>
    Forces the server to be bound to a specific - IP interface on the server. If specified and the -ip option is not, + IPv4 interface on the server. If specified and the -ip option is not, the address specified by -i will establish the remote access IP - address as well as restricting the listing interface. If this option is not specified connections + address as well as restrict the listening interface. If this option is not specified connections will be accepted on any interface.

  • -p#
    Allows the base TCP port to be specified (default: 13100). The