GithubHelp home page GithubHelp logo

Comments (10)

ThomasHabets avatar ThomasHabets commented on May 29, 2024

You're saying you need to be in a particular set of groups to allow any network access?

Hmm, yes that does sound like it calls for a flag to not drop privileges. Unless: is there a well-known group or user that can be changed to (65534 is "nobody") that still has network access?

from arping.

zb3 avatar zb3 commented on May 29, 2024

Yes, after calling setuid, group 3003(inet) is required to open sockets, while group 3004(net_raw) is required to open raw sockets. I've tested this on Marshmallow, maybe this isn't universal.

from arping.

ThomasHabets avatar ThomasHabets commented on May 29, 2024

OK, that's what you meant.

Could you confirm that if you change https://github.com/ThomasHabets/arping/blob/arping-2.x/src/arping.c#L330 to day drop_uid(uid, 3003) that it works?

In that case can add a flag that allows setting group by name.

from arping.

zb3 avatar zb3 commented on May 29, 2024

Yes, drop_uid(uid, 3003) works in my case (setgid to 3004 works too)

from arping.

ThomasHabets avatar ThomasHabets commented on May 29, 2024

Could you try building current state and running with -g inet?

Actually, maybe arping should detect that it's running in Android and do this automatically, since extra arg every command would be annoying.

from arping.

zb3 avatar zb3 commented on May 29, 2024

This works for me, but keep in mind that I am building this in a chrooted Debian environment, where there's no group named inet by default (one has to add it manually, for instance by installing the android-permissions package).

from arping.

ThomasHabets avatar ThomasHabets commented on May 29, 2024

I know very little of Android development. Do you mean android-permissions needs to be installed on the Android phone, or in the development environment?

Do you think arping -g should accept numeric group as well?

And do you know of a way to find out that the system is an Android one, or would it even be possible at compile time? (I don't know the dev environment either)

from arping.

zb3 avatar zb3 commented on May 29, 2024

I'm not an expert here either :) But let's make one thing clear - by Android here I mean the kernel, not the OS.
android-permissions is a Debian package which simply adds groups with proper ids to the /etc/group file so we can refer to them by name. So in that case, we'd need it installed in the OS. It's Debian specific, but we can always use groupadd or simply edit the file.

If arping -g accepted numeric groups, it could make those things easier.

from arping.

zb3 avatar zb3 commented on May 29, 2024

As for detecting Android kernels, presence of a /dev/binder file seems Android specific, but maybe there's a better way.

from arping.

ThomasHabets avatar ThomasHabets commented on May 29, 2024

Filed separate feature request for detecting android: #25

from arping.

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.