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

Unexpected input or invalid characters when running on OpenWRT #1160

Open
vatruica opened this issue May 27, 2021 · 3 comments
Open

Unexpected input or invalid characters when running on OpenWRT #1160

vatruica opened this issue May 27, 2021 · 3 comments

Comments

@vatruica
Copy link

Version

  • Distribution : openwrt-19.07.2 ( Linux OpenWrt 4.14.171 #0 SMP Thu Feb 27 21:05:12 2020 x86_64 GNU/Linux)
  • Lynis version 3.0.5

Describe the bug

1st case - running the ./lynis --debug command

Exception found!

Function/test: [OS Detection]
Message: Unknown OS found in /etc/os-release - Please create an issue on GitHub and share the the contents (cat /etc/os-release): https://github.com/CISOfy/lynis
[...]

  • Detecting OS... [ DONE ]

[WARNING]: Your profile '/root/lynis-master-/lynis-master/default.prf' contains unexpected characters. See the log file for more information.

./lynis: /root/lynis-master-/lynis-master/include/profiles: line 63: od: not found

2nd case - running the ./lynis audit system

root@OpenWrt:~/lynis-master-/lynis-master# ./lynis audit system
Execution of Lynis stopped as we found unexpected input or invalid characters in argument 1
Do you believe this is in error? Let us know: [email protected]

Fatal error: Program execution stopped due to security measure

Expected behavior

1st case - i expected this to initialize as it would on e.g. a non-embedded device OS like Ubuntu

Output

Logs
root@OpenWrt:~/lynis-master-/lynis-master# cat /var/log/lynis.log
2021-05-26 12:50:45 Starting Lynis 3.0.5 with PID 9360, build date 2021-05-11
2021-05-26 12:50:45 ====
2021-05-26 12:50:45 ### 2007-2021, CISOfy - https://cisofy.com/lynis/ ###
2021-05-26 12:50:45 Checking permissions of /root/lynis-master-/lynis-master/include/profiles
2021-05-26 12:50:45 File permissions are OK
2021-05-26 12:50:45 Reading profile/configuration /root/lynis-master-/lynis-master/default.prf
2021-05-26 12:50:45 Found unexpected or possibly harmful characters in profile '/root/lynis-master-/lynis-master/default.prf'. See which characters matched in the output below and compare them with your profile.
2021-05-26 12:50:45 Suggestion: comment incorrect lines with a '#' and try again. Open a GitHub issue if valid characters are blocked
2021-05-26 12:50:45 PID file removed (/var/run/lynis.pid)
2021-05-26 12:50:45 No temporary files to be deleted
2021-05-26 12:50:45 Lynis ended with exit code 1.

Additional context

  • the shell in openwrt is "ash"
@quantumpacket
Copy link
Contributor

quantumpacket commented May 28, 2021

@victor1tnet Lynis afaik does not support OpenWrt. I tried to get it to run myself. I had to disable the checks that were causing your error (I didn't know what was causing it on preliminary inspection), but in the end I had the issue where it was trying to write to the read-only filesystem and failing (log file, if I remember). It would take a bit of work to get it to work under OpenWrt, but I am willing to help provide support for it. @mboelen

@github-actions
Copy link

Stale issue message

@agonzalez-plume
Copy link

There are a few of this type of issue open. #1282 for instance. OpenWRT is running busybox.

I've added a new os-detection for wrt, but have it show as a Linux. Then use the busybox flag to fix the checks.

Still working through all the checks but it's running much better. Currently at nameservers and working my way through the verbose logs to double check the conversion.

Will post code to my personal fork shortly for future PR

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