redcode-labs / Coldfire

Golang malware development library
MIT License
927 stars 142 forks source link

Fixing IsRoot default handle #5

Closed Sufod closed 3 years ago

Sufod commented 3 years ago

The default case of the 'IsRoot' method was returning 'True' even if the username wasn't root.

I propose this fix which is also removing the trailing \n in the username returned by the whoami command.

Also the fix prevent usernames like "babyroot" or whatever username containing "root" being detected as root.

wintrmvte commented 3 years ago

Thank you very much, merged :>