-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
IPv6 link-local address causes "Invalid argument" / "Bind Error" #89
Comments
This may not be a very important feature, but For reference: |
Thanks @oza6ut0ne for the provided links 👍 . Will be looking into this. |
At least for the server part, it doesn't seem to be it, as the function already terminates here: # [2/4] Already an IP address
if family == int(socket.AF_INET6):
if Sock.is_ipv6_address(host):
self.__log.debug("Resolving IPv6 name not required, already an IP: %s", host)
return host and it never gets to this part: # [4/4] Resolve
try:
infos = socket.getaddrinfo(host, port, family, socktype, proto, flags)
addr = str(infos[0][4][0])
self.__log.debug("Resolved %s host: %s", self.get_family_name(family), addr)
return addr What is failing is this one: try:
sock.bind((addr, port))
except (OverflowError, OSError, socket.gaierror, socket.error) as error:
msg = "Binding (family {}/{}, {}) socket to {}:{} failed: {}".format(
sock.family, sock_family_name, sock_type_name, addr, port, error
)
raise socket.error(msg) This is how I started it. $ ./pwncat -l -vvvvvvvvvvvvv fe80::93e4:8997:60c4:f3f5 7777
2020-08-22 10:31:53,037 DEBUG [MainThread] 3392:__init__(): STDOUT isatty: True
2020-08-22 10:31:53,037 DEBUG [MainThread] 3393:__init__(): STDIN isatty: True
2020-08-22 10:31:53,037 DEBUG [MainThread] 3394:__init__(): STDIN posix: False (posix)
2020-08-22 10:31:53,037 DEBUG [MainThread] 1467:create_socket(): Creating (family 10/IPv6, TCP) socket
2020-08-22 10:31:53,037 DEBUG [MainThread] 1487:create_socket(): Disabling IPv4 support on IPv6 socket
2020-08-22 10:31:53,038 DEBUG [MainThread] 1467:create_socket(): Creating (family 2/IPv4, TCP) socket
2020-08-22 10:31:53,038 DEBUG [MainThread] 1430:gethostbyname(): Resolved IPv6 host: fe80::93e4:8997:60c4:f3f5
2020-08-22 10:31:53,038 DEBUG [MainThread] 1436:gethostbyname(): Resolving IPv4 host: fe80::93e4:8997:60c4:f3f5 failed: [Errno -9] Address family for hostname not supported
2020-08-22 10:31:53,038 DEBUG [MainThread] 2192:run_server(): Removing (family 2/IPv4) due to: Resolving IPv4 host: fe80::93e4:8997:60c4:f3f5 failed: [Errno -9] Address family for hostname not supported
2020-08-22 10:31:53,038 DEBUG [MainThread] 1524:bind(): Binding (family 10/IPv6, TCP) socket to fe80::93e4:8997:60c4:f3f5:7777
2020-08-22 10:31:53,038 DEBUG [MainThread] 2212:run_server(): Removing (family 10/IPv6) due to: Binding (family 10/IPv6, TCP) socket to fe80::93e4:8997:60c4:f3f5:7777 failed: [Errno 22] Invalid argument
2020-08-22 10:31:53,038 ERROR [MainThread] 2217:run_server(): Bind Error: Could not bind any socket
2020-08-22 10:31:53,038 INFO [MainThread] 3035:__server_rebind(): Rebind count is used up. Shutting down. |
ISSUE TYPE
OS / ENVIRONMENT
Here is the terminal output (address is masked for privacy).
STEPS TO REPRODUCE
Same as above log.
EXPECTED BEHAVIOUR
Works same as IPv6 global unicast address.
ACTUAL BEHAVIOUR
Invalid argument
/Bind Error
The text was updated successfully, but these errors were encountered: