Nmap Development mailing list archives

Re: IPv6 mass_dns and nsock_connect_udp


From: Kris Katterjohn <katterjohn () gmail com>
Date: Tue, 02 Dec 2008 19:30:38 -0600

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/02/2008 07:17 PM, David Fifield wrote:
On Tue, Dec 02, 2008 at 07:06:35PM -0600, Kris Katterjohn wrote:
Previously, connect_dns_servers passed a reference to a dns_server_s
sockaddr_in casted to a pointer to a sockaddr along with sizeof(struct
sockaddr) which are defined as saddr and sslen respectively in
nsock_connect_udp.
saddr is then casted to pointer to a sockaddr_storage, but sslen remains
unchanged:

Instead of passing "sizeof(struct sockaddr)" for sslen, you should pass in the
size of the struct you're using.  So pass in "sizeof(struct sockaddr_in)" for
IPv4 or "sizeof(struct sockaddr_in6)" for IPv6.  The current use of sockaddr{}
works because both it and sockaddr_in{} should always be the same size (look
at the sin_zero field of the latter).

Kris, is this the same thing as at

"Ncat: socket bind error on Mac OS X"
http://seclists.org/nmap-dev/2008/q3/0168.html

If so, then that thread might help, jah.


Not exactly, but it's certainly related.  jah's passing a much too small size
for IPv6 addresses which should never work on any system, while in the problem
above only OS X seemed to check for passed sizes larger than the expected one
(based on the family I presume).

David Fifield


Thanks,
Kris Katterjohn

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJJNeE4AAoJEP9K37xXYl366z0QAJmpH3qNnqOAEi42H4K3rD71
MqV6MikxAs5T9RbfxaKG9Mb92gafo0SM2a5rA9OGfS6u+USF8me2TfY/J0XoP3Ph
4SHqVhjAMsGSGWJuqNdIkZ3JahseriGNZcJWGAAVBb1A1gYa1iq3nBnL1fYt0ec4
Du/DJrgdXhEYLbstnmTbmrW1Mrg+oThR0+on5VwomPzwolXAMvpqfHMq5XbK1c1B
GtfXSMmJ3BeAyxZWprBw6YutyPwEwDrgYuGxZ5e8o1aWstPwg6I5ipO+uIgJUPuY
67fUKuEtMKCGi3SqTspDuWG1TV1eS3MajYg23Eq3sfJaPY2G/zFipif7Csz88VFw
CJ0maWMqcKTFFhpc80aKiAH3PhCKMwQCGk7FQZQZL0butrDZRIkQXNMvrC69ty2X
8ZZAek5gVo8oSeHaYF/FLQDiSSaVMz5XN8Hbj5rwytieak65rnRo7OOEfW8xqp6T
+NjotPcM8Mk31v1nVg88uuLNBjC0czzOV34ZjI4SyFS6otad2CWD0iZ+9r2si1d2
eAratJNpvxCg8Wy5kjB2TpwN7bnFpNm+9NrSi754hbx5ebn1tB/U3HD/QetLKxzv
goPNJc8vo789hY3/ERd8X8uLmejylr0CJOFzqQb4onrwShqDp+fzOm2S7VglfEPY
KQ8GKXewbAmmqlBUz6np
=tNzB
-----END PGP SIGNATURE-----

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: