pwnieexpress / blue_hydra

Blue Hydra
Other
837 stars 109 forks source link

PID File #105

Closed jacksgt closed 7 years ago

jacksgt commented 7 years ago

Hi,

I think using /var/run/blue_hyrda.pid is rather unideal for a simple PID file, because it requires root rights.

/var/run/user/$uid/blue_hydra.pid is a better choice, since any user is allowed to write into his own /var/run/user/$uid directory (where $uid is a numeric user id, as in the output of id -u).

https://github.com/pwnieexpress/blue_hydra/blob/develop/bin/blue_hydra#L84

ZeroChaos- commented 7 years ago

blue_hydra also requires root rights, so I don't understand the issue.

jacksgt commented 7 years ago

I did not see that mentioned anywhere in docs.. what other actions require root rights? (Which could not be authorized e.g. via Polkit?)

ZeroChaos- commented 7 years ago

I believe btmon needs root, that is the biggest one. I suppose moving the pod file is fine, but I would like some confirmation that you are successfully running as non-root.

On Jul 17, 2017 17:21, "Jack" notifications@github.com wrote:

I did not see that mentioned anywhere in docs.. what other actions require root rights? (Which could not be authorized e.g. via Polkit?)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pwnieexpress/blue_hydra/issues/105#issuecomment-315888456, or mute the thread https://github.com/notifications/unsubscribe-auth/ABl--W1IqDo1kqAr8pGaY4vD284vC8zNks5sO9BKgaJpZM4Oah83 .

-- This e-mail and any attachments are for the sole use of the intended recipients(s) and may be confidential. Use of any Pwnie Express product signifies your agreement to the Rapid Focus Security Terms of Service https://www.pwnieexpress.com/terms-of-service and is subject to export controls under the U.S. Commerce Department’s Export Administration Regulations (“EAR”).

jacksgt commented 7 years ago

Manually changing the PID file to /var/run/user/1000/blue_hydra.pid at least gives the Welcome to Blue Hydra prompt, but exits with 1 afterwards (without any error message). Any way I can make the output more verbose?

ZeroChaos- commented 7 years ago

Check the log. It expects to be root, weird permission errors are not really checked.

On Jul 17, 2017 17:37, "Jack" notifications@github.com wrote:

Manually changing the PID file to /var/run/user/1000/blue_hydra.pid at least gives the Welcome to Blue Hydra prompt, but exits with 1 afterwards (without any error message). Any way I can make the output more verbose?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pwnieexpress/blue_hydra/issues/105#issuecomment-315889905, or mute the thread https://github.com/notifications/unsubscribe-auth/ABl--aaXLZSdeQzwXHnT4kvkJohPEareks5sO9GtgaJpZM4Oah83 .

-- This e-mail and any attachments are for the sole use of the intended recipients(s) and may be confidential. Use of any Pwnie Express product signifies your agreement to the Rapid Focus Security Terms of Service https://www.pwnieexpress.com/terms-of-service and is subject to export controls under the U.S. Commerce Department’s Export Administration Regulations (“EAR”).

jacksgt commented 7 years ago

As you mentioned, btmon seems to absolutely require root privileges. Adding myself to the bluetooth users group did not help.

# Logfile created on 2017-07-17 23:44:15 +0200 by logger.rb/v1.2.7
  I, [2017-07-17T23:44:15.411522 #15385]  INFO -- : BlueHydra Starting...
  I, [2017-07-17T23:44:15.411573 #15385]  INFO -- : Runner starting with 'btmon -T -i hci0' ...
  I, [2017-07-17T23:44:15.412620 #15385]  INFO -- : Marking older devices as 'offline'...
  I, [2017-07-17T23:44:15.415217 #15385]  INFO -- : Btmon thread starting
  I, [2017-07-17T23:44:15.415286 #15385]  INFO -- : Discovery thread starting
  I, [2017-07-17T23:44:15.415342 #15385]  INFO -- : Chunker thread starting
  I, [2017-07-17T23:44:15.415405 #15385]  INFO -- : Parser thread starting
  I, [2017-07-17T23:44:15.415457 #15385]  INFO -- : Result thread starting
  I, [2017-07-17T23:44:15.415497 #15385]  INFO -- : Command Line UI thread starting
+ E, [2017-07-17T23:44:15.420307 #15385] ERROR -- : Error with hciconfig hci0 reset..
+ E, [2017-07-17T23:44:15.420387 #15385] ERROR -- : Can't down device hci0: Operation not permitted (1)
+ E, [2017-07-17T23:44:15.420737 #15385] ERROR -- : Btmon thread exiting...
  E, [2017-07-17T23:44:15.420879 #15385] ERROR -- : Thread failure: btmon_thread
  I, [2017-07-17T23:44:15.420954 #15385]  INFO -- : Runner stopped. Exiting after clearing queue...
  I, [2017-07-17T23:44:15.421031 #15385]  INFO -- : Queue clear! Exiting.
  W, [2017-07-17T23:44:15.421115 #15385]  WARN -- : GOODBYE! ^_^

In that case I think blue_hydra should check for an effective uid == 0 or at least mention it in the README :-)

ZeroChaos- commented 7 years ago

Root check has been added to the filtering branch and will be in develop in the morning.

jacksgt commented 7 years ago

Very nice, thanks for adding this!

Am 8. August 2017 04:51:56 MESZ schrieb Zero_Chaos notifications@github.com:

Root check has been added to the filtering branch and will be in develop in the morning.