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

Cannot run Velociraptor in Deno ^1.13.0 #75

Closed
sant123 opened this issue Aug 10, 2021 · 9 comments
Closed

Cannot run Velociraptor in Deno ^1.13.0 #75

sant123 opened this issue Aug 10, 2021 · 9 comments

Comments

@sant123
Copy link

sant123 commented Aug 10, 2021

Native plugins have been removed denoland/deno#10908.

So executing this command will raise an error:

vr

error: Found argument '--allow-plugin' which wasn't expected, or isn't valid in this context
        Did you mean --allow-run?

USAGE:
    deno run <SCRIPT_ARG>... --allow-env=<allow-env> --allow-net=<allow-net> --allow-read=<allow-read> --allow-run=<allow-run> --allow-write=<allow-write>

For more information try --help
@paambaati
Copy link
Contributor

@umbopepato @c4spar Will the fix be as simple as removing this line? If yes, I'd be happy to send a PR!

plugin?: boolean;

@umbopepato
Copy link
Member

umbopepato commented Aug 11, 2021

Hey @sant123, thanks for reporting!

Does one of your scripts use the plugin permission? In that case running the single script would cause the error but the vr command alone should't trigger any deno command with the plugin permission...

@paambaati right, AllowFlags should be aligned to the new flags (remove plugin and add ffi). Your PR would be much appreciated 🙂

@sant123
Copy link
Author

sant123 commented Aug 11, 2021

Hey @umbopepato, you can execute vr in any place, in any project, in any scripts file. It's totally broken since this update 😢

Edit:
Now I see what's going on. Taking a look at the velociraptor installation page, the command is the following:

deno install -qAn vr https://deno.land/x/[email protected]/cli.ts

So looking at the installer in my $PATH I encountered this:

cat $(which vr)

#!/bin/sh
# generated by deno install
exec deno run --allow-read --allow-write --allow-net --allow-env --allow-run --allow-plugin --allow-hrtime --quiet 'https://deno.land/x/[email protected]/cli.ts' "$@"

So the workaround for everybody having this issue is re-installing velociraptor:

deno install -qfAn vr https://deno.land/x/[email protected]/cli.ts

After that execute vr upgrade.

Now running the cat command you will see the flags being updated

#!/bin/sh
# generated by deno install
exec deno run --allow-read --allow-write --allow-net --allow-env --allow-run --allow-ffi --allow-hrtime --quiet 'https://deno.land/x/[email protected]/cli.ts' "$@"

And velociraptor works again without issue 😁

@sant123
Copy link
Author

sant123 commented Aug 11, 2021

@umbopepato @c4spar Will the fix be as simple as removing this line? If yes, I'd be happy to send a PR!

plugin?: boolean;

Definitely the plugin flag should be replaced by ffi flag.

@paambaati
Copy link
Contributor

@umbopepato 00fd1b1 (#76) replaces the plugin flag with ffi.

@sant123
Copy link
Author

sant123 commented Aug 16, 2021

Since this issue has been resolved and there's already a pull request to change allow-plugin for allow-ffi. I'm closing this one.

@sant123 sant123 closed this as completed Aug 16, 2021
@sant123
Copy link
Author

sant123 commented Aug 18, 2021

#76

@umbopepato
Copy link
Member

Thank you so much @paambaati and sorry for the delay in merging your PR, your changes are now live in 1.2.0 😊

@umbopepato
Copy link
Member

umbopepato commented Aug 31, 2021

The change introduced in flags by deno@^1.13.0 breaks Velociraptor installation files so a full re-install is required.
This can be done either manually with the -f flag (see Installation) or by running vr in remote mode:

$ deno run -A https://code.velociraptor.run upgrade

@umbopepato umbopepato pinned this issue Aug 31, 2021
@umbopepato umbopepato changed the title Broken after installing Deno v.1.13.0 Cannot run Velociraptor in Deno ^1.13.0 Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants