Giter Club home page Giter Club logo

Comments (7)

mfontanini avatar mfontanini commented on June 6, 2024

You need to run it as root. Have you tried that?
On Oct 31, 2014 7:15 PM, "Diogo Mónica" [email protected] wrote:

Im on a Macbook Pro running 10.9.5.

Compiling the latest version from github (master):
$ g++ traceroute.cpp -o traceroute -O3 -std=c++11 -lpthread -ltins
Running with any IPs:
$ ./traceroute 10.0.1.1
libc++abi.dylib: terminating
Abort trap: 6


Reply to this email directly or view it on GitHub
#42.

from libtins.

diogomonica avatar diogomonica commented on June 6, 2024

I haven't tried that, but if I've been able run the example above that also
creates a packet from scratch without root privileges, why would trac route
require it?! Is it because we changing the TTL field?!
On Fri, Oct 31, 2014 at 8:34 PM Matias Fontanini [email protected]
wrote:

You need to run it as root. Have you tried that?
On Oct 31, 2014 7:15 PM, "Diogo Mónica" [email protected] wrote:

Im on a Macbook Pro running 10.9.5.

Compiling the latest version from github (master):
$ g++ traceroute.cpp -o traceroute -O3 -std=c++11 -lpthread -ltins
Running with any IPs:
$ ./traceroute 10.0.1.1
libc++abi.dylib: terminating
Abort trap: 6


Reply to this email directly or view it on GitHub
#42.


Reply to this email directly or view it on GitHub
#42 (comment).

from libtins.

mfontanini avatar mfontanini commented on June 6, 2024

You need root to send an receive raw packets. Just like you implicitly need
root to run ping or traceroute (implicitly because they're both SUID
binaries).
On Oct 31, 2014 8:37 PM, "Diogo Mónica" [email protected] wrote:

I haven't tried that, but if I've been able run the example above that
also
creates a packet from scratch without root privileges, why would trac
route
require it?! Is it because we changing the TTL field?!
On Fri, Oct 31, 2014 at 8:34 PM Matias Fontanini [email protected]

wrote:

You need to run it as root. Have you tried that?
On Oct 31, 2014 7:15 PM, "Diogo Mónica" [email protected]
wrote:

Im on a Macbook Pro running 10.9.5.

Compiling the latest version from github (master):
$ g++ traceroute.cpp -o traceroute -O3 -std=c++11 -lpthread -ltins
Running with any IPs:
$ ./traceroute 10.0.1.1
libc++abi.dylib: terminating
Abort trap: 6


Reply to this email directly or view it on GitHub
#42.


Reply to this email directly or view it on GitHub
#42 (comment).


Reply to this email directly or view it on GitHub
#42 (comment).

from libtins.

diogomonica avatar diogomonica commented on June 6, 2024

Traceroute does work with sudo, sorry for not checking that first.

I guess my question still maintains though, why can I run this program without root:

using namespace Tins;
int main() {
    NetworkInterface iface = NetworkInterface::default_interface();
    NetworkInterface::Info info = iface.addresses();
    EthernetII eth("77:22:33:11:ad:ad", info.hw_addr);
    eth /= IP("192.168.0.1", info.ip_addr);
    eth /= TCP(13, 15);
    eth /= RawPDU("I'm a payload!");
    PacketSender sender;
    sender.send(eth, iface);
}

Isn't this a raw packet too?

from libtins.

einarjon avatar einarjon commented on June 6, 2024

Hi

I'm no expert and I haven't used PacketSender, but the raw packet is
wrapped into an IP/TCP header, so it is no longer a raw packet - it's just
a payload.

Cheers
Einar Jón

On 2 November 2014 00:33, Diogo Mónica [email protected] wrote:

Traceroute does work with sudo, sorry for not checking that first.

I guess my question still maintains:

Why can I run this program without root:

using namespace Tins;
int main() {
NetworkInterface iface = NetworkInterface::default_interface();
NetworkInterface::Info info = iface.addresses();
EthernetII eth("77:22:33:11:ad:ad", info.hw_addr);
eth /= IP("192.168.0.1", info.ip_addr);
eth /= TCP(13, 15);
eth /= RawPDU("I'm a payload!");
PacketSender sender;
sender.send(eth, iface);
}

Isn't this a raw packet too?


Reply to this email directly or view it on GitHub
#42 (comment).

Regards
Einar Jón
+36 30 31 43 665

from libtins.

mfontanini avatar mfontanini commented on June 6, 2024

I've just tested that and I'm surprised that it works. I'm not very used to OSX, so I don't really know which permissions you would need to do this, but you shouldn't be able to use it without root. That won't work on Linux for sure.

from libtins.

diogomonica avatar diogomonica commented on June 6, 2024

Agreed, that is exactly what threw me off. Thank you Matias.

from libtins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.