Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openSSH prevents usage of remote_dns subnet #553

Open
rofl0r opened this issue Feb 12, 2024 · 0 comments
Open

openSSH prevents usage of remote_dns subnet #553

rofl0r opened this issue Feb 12, 2024 · 0 comments

Comments

@rofl0r
Copy link
Owner

rofl0r commented Feb 12, 2024

openssh tries to be smarter than its users and refuses to accept IP adresses from our default remote_dns_subnet.

this patch fixes it:

--- openssh-8.4p1.org/sshconnect.c
+++ openssh-8.4p1/sshconnect.c
@@ -755,10 +755,13 @@
 
 	/*
 	 * Turn off check_host_ip if the connection is to localhost, via proxy
-	 * command or if we don't have a hostname to compare with
+	 * command or if we don't have a hostname to compare with, or
+	 * if PROXYCHAINS-NG is active and the ip starts with "224."
+	 * (default remote-dns subnet).
 	 */
 	if (options.check_host_ip && (local ||
-	    strcmp(hostname, ip) == 0 || options.proxy_command != NULL))
+	    strcmp(hostname, ip) == 0 || options.proxy_command != NULL ||
+	    (strncmp(ip, "224.", 4) == 0 && getenv("PROXYCHAINS_CONF_FILE"))))
 		options.check_host_ip = 0;
 
 	host_hostkeys = init_hostkeys();

since "options.check_host_ip" sounds like a configurable setting, there may also be a way to disable the misfeature using the openssh config file. post here if you know how.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant