Improper User data collection lead to domain user passwords being overwritten
rebrec opened this issue · 1 comments
It seems there is an error in the script on lines 701 and 705 which can lead to domain users' password being overwritten (if the user executing the script has admin rights)
701 : net user !users[%%i]! /domain %USERDOMAIN% > NUL 2>&1
[...]
705 : call:cmd %SYS%\acc "net user !users[%%i]! /domain %USERDOMAIN%"
According to net.exe documentation :
net user [<UserName> {<Password> | *} [<Options>]] [/domain]
...
/domain
Performs the operation on the domain controller in the computer's primary domain.
The user's domain must not be provided after the /domain
parameter.
As a consequence The %USERDOMAIN% variables should be removed on lines 701 and 705.
The impact is quite severe since it overwrite the domain user password with the password contained in the variable %USERDOMAIN% (overwriting domain admin password if you have this right...)
Tell me if you prefer a pull request
Appart from that, really useful tool !
Thanks for sharing
You are correct. The %USERDOMAIN%
specification is not necessary for the /domain
option. Never run into this issue because it never happened to run ir-rescue with a domain administrator account.
Feel free to make a pull request to remove the extra argument from the command.
Thanks.