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

declare: -g: invalid option #11

Closed
cowbe0x004 opened this issue Jun 6, 2019 · 3 comments
Closed

declare: -g: invalid option #11

cowbe0x004 opened this issue Jun 6, 2019 · 3 comments

Comments

@cowbe0x004
Copy link

Thank you for the great script! Not sure if there's alternative for declare, but I'm getting these errors in older machines.

$ bash --version
GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu)
$ declare -g
bash: line 13: declare: -g: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]

===================================================================( sudo )=====
[!] sud000 Can we sudo without a password?................................. nope
[!] sud010 Can we list sudo commands without a password?..................../lse.sh: line 328: declare: -g: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
nope
[] sud040 Can we read /etc/sudoers?....................................... nope
[
] sud050 Do we know if any other users used sudo?........................ nope
============================================================( file system )=====
[] fst000 Writable files outside user's home.............................../lse.sh: line 328: declare: -g: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
nope
[
] fst010 Binaries with setuid bit........................................./lse.sh: line 328: declare: -g: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]

@diego-treitos
Copy link
Owner

Hello @cowbe0x004, thank you for your bug report and specially thank you for providing such a good information about the problem.

I see that the version of bash that you are using does not support declare -g, so I am trying a different trick to do what the declare -g is suposed to do. Could you please try this version and tell me if it fixes your problem and the script works properly?

https://raw.githubusercontent.com/diego-treitos/linux-smart-enumeration/fix%2311/lse.sh

@cowbe0x004
Copy link
Author

yep, that works. Thank you for the fast fix.

@diego-treitos
Copy link
Owner

I am glad it is fixed. I added the fix to the main branch, so it is already available in version 1.5.

Thanks for your help!

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

2 participants