Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo make load does not work #33

Open
6 tasks done
Producdevity opened this issue Feb 26, 2022 · 4 comments
Open
6 tasks done

sudo make load does not work #33

Producdevity opened this issue Feb 26, 2022 · 4 comments

Comments

@Producdevity
Copy link

Prerequisites

  • Running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • Made sure to run the sudo make startup command first
  • Made sure everything runs without errors until sudo make load
  • Made sure that the keylogger command itself runs fine

Expected Behavior

That the keylogger would start after running sudo make load.

Current Behavior

I am getting this error: make: *** No rule to make target 'load'. Stop.

Context

  • Operating System: Mac OS 12.2
@caseyscarborough
Copy link
Owner

This error is typically when make is either unable to find the Makefile, the target in the Makefile, or doesn't have the proper permissions. Can you ensure there are no changes to the Makefile (like spaces instead of tabs), you're in the repository root, and you have permissions to the file?

If that's still not working, here's a few other things you can try:

  • Provide your version of make by running make -v
  • Check that the keylogger.plist file is in your /Library/LaunchDaemons folder after running sudo make startup
  • Check that running the launchctl load /Library/LaunchDaemons/keylogger.plist works on its own

I haven't tested this on macOS 12 so perhaps there could be an issue there, but it seems more like something related to make.

@Producdevity
Copy link
Author

Thanks for your response!

I am running versions GNU Make 3.81.

This is the content in the keylogger.plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>keylogger</string>
  <key>ProgramArguments</key>
  <array>
      <string>/usr/local/bin/keylogger</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>KeepAlive</key>
  <true/>
</dict>
</plist>

I am not sure but I think that that means it does run it at startup and the sudo make load is only making sure the Daemon is starting right now too, correct?

(Makefile is unedited btw)

@lfreinag
Copy link

lfreinag commented May 18, 2024

I am having the same symptoms as @Producdevity.

The interesting thing is that if I run manually and locally (at the git cloned repository) the command keylogger it all works like a charm.

So I solved this problem with nohup:

nohup ./Keylogger &

You will need to kill it differently though:

ps -e | grep "Keylogger"
kill -9 pid_of_keylogger_from_above_command

I hope this helps someone 😉

P.D. For the record, I am also running macOS 12. But I am running 12.6.6 🤔 Maybe this is the issue?

@lfreinag
Copy link

Sorry for the multiple answers. I have now redone the whole setup to see if my solution worked. It didn't!

But now I know exactly what the problem is.

On the Settings --> Security & Privacy --> Accessibility options you need to have both "Terminal" and "keylogger" allowed.

When running it from the terminal with keylogger I got the popup automatically to add the "Terminal" to the options.

Then if you run launchctl load /Library/LaunchDaemons/keylogger.plist from the terminal, you will get another popup automatically to add the "keylogger" to the options and it will work after this.

Be aware that if it returns an error once you run the launchctl load command, stating that the keylogger.plist is already running you will need to perform a sudo make unload and then retry.

I hope this solves the problems for any other users trying to use your app. Can @Producdevity or someone test that this solution is correct?

I am not sure if it is worth it to add it to the documentation side of the issues but I can gladly add a PR to add it 😉 If it is confirmed of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants