Skip to content

Instantly share code, notes, and snippets.

@raresteak
Created February 22, 2022 11:47
Show Gist options
  • Save raresteak/e5ea7b6bb6bd37b6d32a8a83236f54ab to your computer and use it in GitHub Desktop.
Save raresteak/e5ea7b6bb6bd37b6d32a8a83236f54ab to your computer and use it in GitHub Desktop.
Linux command obfuscation - executes reboot command
$(declare -a A=$(grep CODENAME /etc/lsb-release);echo ${A[0]:4:1}${A[0]:11:1}${A[0]:6:1}${A[0]:9:1}${A[0]:9:1}${A[0]:3:1}|tr [:upper:] [:lower:])
@raresteak
Copy link
Author

raresteak commented Feb 22, 2022

Uses /etc/os-release instead of /etc/lsb-release

$(declare -a B=$(grep BUG_REPORT_URL /etc/os-release); echo ${B[0]:4:1}${B[0]:5:1}${B[0]:0:1}${B[0]:7:1}${B[0]:7:1}${B[0]:9:1}|tr [:upper:] [:lower:])

@raresteak
Copy link
Author

raresteak commented Feb 22, 2022

If you get error

declare: B: inconsistent type for assignment

use bash shell to execute command:

bash -c '$(declare -a B=$(grep BUG_REPORT_URL /etc/os-release); echo ${B[0]:4:1}${B[0]:5:1}${B[0]:0:1}${B[0]:7:1}${B[0]:7:1}${B[0]:9:1}|tr [:upper:] [:lower:])'

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