Wednesday, June 27, 2007

Hidden Users in Windows!!

I know I know!!! this is a very old topic to discuss about but still i would like to write about it. Was rummaging through old topics which i had on my machine and thought would pen something down about this . Any code found on this topic is borrowed and not my own creation if the owner is viewing this i apologize and that it is used only for educational/non-commercial purposes and i dont believe in piracy of software/code. So anyway getting back to the topic, we all know about the 'user and groups' facility in windows xp it works out as a major disadvantage in terms of security of the system and strictly speaking i would like this facility removed out of windows all together. This occurs when the users are created using the netuseradd function these users never appear on the control panel under the user accounts submenu. Users and even System administrators expect the users to be displayed at the control panel. This poses a security hazard since a user could quietly add a user and keep the account hidden from the security admins etc which can lead to stolen data problems etc. For all those unfortunate souls who are using a windows xp home edition and dont have direct access to the local users and groups in the administrative tools-> computer management use the following command :

C:\net user

at the command prompt (this is for all the code monkeys who dont know where to type) it will display all the users on the system. Then delete all the users who you feel are unwanted and have to go. The command for deleteing the users i will leave it on you guys since it is simple enough to be thought of ;). For the code monkeys i am sure they will google or something and find out. Ok now to the main part ........a guy from a particular security group has written this peice of code which i am reposting here it is in C++ which is quite easy to understand :

#include
#include
int main(){
USER_INFO_1 ui;
DWORD dwLevel = 1;
DWORD dwError = 0;
LPWSTR name = L"hidden";
LPWSTR pass = L"hidden";
ui.usri1_name = name;
ui.usri1_password = pass;
ui.usri1_priv = USER_PRIV_USER;
ui.usri1_home_dir = NULL;
ui.usri1_comment = NULL;
ui.usri1_flags = UF_SCRIPT;
ui.usri1_script_path = NULL;
NetUserAdd(NULL, dwLevel, (LPBYTE)&ui,
&dwError);
return 0;
}

This code can be easily understood by code monkeys too !! so do give ur final analysis of this topic and any futher peice of code which u guys mite want.

No comments: