<p>I have seen another program provide traceroute functionality within it but without needing root (superuser) privileges? I've always assumed that raw sockets need to be root, but is there some other way? (I think somebody mentioned "supertrace" or "tracepath"?) Thanks!</p>

[{'answer_id': 77029, 'author': 'moonshadow', 'author_id': 11834, 'author_profile': 'https://Stackoverflow.com/users/11834', 'pm_score': 2, 'selected': False, 'text': '<p>Ping the target, gradually increasing the TTL and watching where the "TTL exceeded" responses originate.</p>\n'}, {'answer_id': 77045, 'author': 'akraut', 'author_id': 3971, 'author_profile': 'https://Stackoverflow.com/users/3971', 'pm_score': 1, 'selected': False, 'text': '<p>Rather than using raw sockets, some applications use a higher numbered tcp or udp port.  By directing that tcp port at port 80 on a known webserver, you could traceroute to that server.  The downside is that you need to know what ports are open on a destination device to tcpping it.</p>\n'}, {'answer_id': 77060, 'author': 'Ferruccio', 'author_id': 4086, 'author_profile': 'https://Stackoverflow.com/users/4086', 'pm_score': 0, 'selected': False, 'text': "<p>You don't need to use raw sockets to send and receive ICMP packets. At least not on Windows.</p>\n"}, {'answer_id': 77205, 'author': 'James Antill', 'author_id': 10314, 'author_profile': 'https://Stackoverflow.com/users/10314', 'pm_score': -1, 'selected': False, 'text': "<p>If you have a modern Linux distro you can look at the source for traceroute (or tracepath, which came about before traceroute went no setuid) and tcptraceroute. None of those require RAW sockets -- checked on Fedora 9, they aren't setuid and work with default options for the normal user.</p>\n\n<p>Using the code that tcptraceroute does might be esp. useful, as ICMP packets to an address will not necessarily end up at the same place as a TCP connection to port 80, for example.</p>\n\n<p>Doing an strace of traceroute (as a normal user) shows it doing something like:</p>\n\n<pre><code>\nint opt_on  = 1;\nint opt_off = 0;\n\nfd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)\nsetsockopt(fd, SOL_IP, IP_MTU_DISCOVER, &opt_off, sizeof int)\nsetsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, &opt_on, sizeof int)\nsetsockopt(fd, SOL_IP, IP_RECVTTL, &opt_on, sizeof int)\n</code></pre>\n\n<p>...and then reading the data out of the CMSG results.</p>\n"}, {'answer_id': 77310, 'author': 'Andrew Johnson', 'author_id': 5109, 'author_profile': 'https://Stackoverflow.com/users/5109', 'pm_score': 1, 'selected': False, 'text': '<p><strong>ping</strong> and <strong>traceroute</strong> use the ICMP protocol.  Like UDP and TCP this is accessible through the normal sockets API.  Only UDP and TCP port numbers less than 1024 are protected from use, other than by root. ICMP is freely available to all users.</p>\n\n<p>If you really want to see how ping and traceroute work you can download an example C code implementation for them from <a href="http://www.codeproject.com/KB/IP/Ping_and_Traceroute.aspx" rel="nofollow noreferrer">CodeProject</a>.</p>\n\n<p>In short, they simple open an ICMP socket, and traceroute alters the increments the TTL using setsockopt until the target is reached.</p>\n'}]
['https://Stackoverflow.com/questions/76988', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13817/']