//Code by Pnig0s1992 //Date:2012,3,17 #include <stdio.h> #include <Windows.h> #include <lm.h> #pragma comment(lib,"Netapi32.lib") int AddUser(LPWSTR lpUsername,LPWSTR lpPassword,LPWSTR lpServerName); int SetGroup(LPWSTR lpUsername,LPWSTR lpServerName,LPWSTR lpGroupName); BOOL ImprovePriv(LPWSTR name); int main(INT argc,char * argv[]) { BOOL bResult = ImprovePriv(SE_MACHINE_ACCOUNT_NAME); if(argc < 3) { printf("\nCode by Pnig0s1992"); printf("\nUsage:"); printf("\n\t%s UserName Password",argv[0]); printf("\n\tRemark:Default add to Group:Administrators."); return -1; } if(bResult) { printf("Successfully promote priv!"); }else { printf("Failed promote priv."); return -1; } int Namesize=MultiByteToWideChar(CP_ACP,0,argv[1],-1,NULL,0); wchar_t *wUserName =new wchar_t[Namesize+1]; if(!MultiByteToWideChar(CP_ACP,0,argv[1],-1,wUserName,Namesize)) { return false; } int Passsize=MultiByteToWideChar(CP_ACP,0,argv[2],-1,NULL,0); wchar_t *wPassword =new wchar_t[Passsize+1]; if(!MultiByteToWideChar(CP_ACP,0,argv[2],-1,wPassword,Passsize)) { return false; } LPTSTR lpName = wUserName; LPTSTR lpPassword = wPassword; LPWSTR lpSevName = NULL; LPWSTR lpGroupName = L"Administrators"; AddUser(lpName,lpPassword,lpSevName); SetGroup(lpName,lpSevName,lpGroupName); return 0; } BOOL ImprovePriv(LPWSTR name) { HANDLE hToken; if(!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES,&hToken)) { printf("\nGet process token failed.(%d)",GetLastError()); return FALSE; } TOKEN_PRIVILEGES tkp; tkp.PrivilegeCount = 1; if(!LookupPrivilegeValue(NULL,name,&tkp.Privileges[0].Luid)) { printf("\nLookup process priv failed.(%d)",GetLastError()); return FALSE; } tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; if(!AdjustTokenPrivileges(hToken,FALSE,&tkp,0,NULL,NULL)) { printf("\nAjust process priv failed.(%d)",GetLastError()); return FALSE; } CloseHandle(hToken); return TRUE; } int AddUser(LPWSTR lpUsername,LPWSTR lpPassword,LPWSTR lpServerName) { USER_INFO_1 ui; DWORD dwLevel = 1; DWORD dwError = 0; NET_API_STATUS nStatus; ui.usri1_name = lpUsername; ui.usri1_password = lpPassword; 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; nStatus = NetUserAdd(lpServerName,dwLevel,(LPBYTE)&ui,&dwError); if(nStatus == NERR_Success) { printf("\nAdd user:%S successfully!",lpUsername); }else { printf("\nAdd user failed:%d.",nStatus); } return 0; } int SetGroup(LPWSTR lpUsername,LPWSTR lpServerName,LPWSTR lpGroupName) { NET_API_STATUS nStatus; LOCALGROUP_MEMBERS_INFO_3 lgui; lgui.lgrmi3_domainandname = lpUsername; nStatus = NetLocalGroupAddMembers(lpServerName,lpGroupName,3,(LPBYTE)&lgui,1); if(nStatus == NERR_Success) { printf("\nSuccessfully set USER:%S to GROUP:%S!",lpUsername,lpGroupName); }else if(nStatus == NERR_GroupNotFound) { printf("\nCan't find such a group:%S.",lpGroupName); }else { printf("\nSet GROUP:%S failed.",lpGroupName); } return 0; }
什么叫MBSA? Microsoft Baseline Security Analyzer或一般 称之为MBSA的便于应用的专用工具,可依据Microsoft安全系数提议协助明确电子计算机的安全性情...
坚信许多都了解Sqlmap,可是却不清楚怎样根据sqlmap来引入对不对? 今日将实战演练教大伙儿怎样真实的应用sqlmap来引入?要是了解这12种方式,包你只必须应用Sqlmap这一个专用工具把握...
首先必须要先登入管理后台。 进入后台管理后,在网站地址后面加上 admin/southidceditor/admin_style.asp 这是良精南方的远程编辑器路径。...
什么叫OSSEC HIDS? OSSEC HIDS是一个多服务平台,可拓展和根据开源系统的服务器入侵防御系统系统软件,具备强劲的强劲的有关和剖析模块。 OSSEC HIDS是不是完全免...
什么叫Rat Proxy? 该专用工具是一种大中型的处于被动和全自动安全性审批专用工具。它对于比较敏感,精确的检验和全自动注解安全性有关的策略模式和潜在性的难题开展了提升,根据对目前客户起动的Web...
本文介绍一个用C语言和网络数据包分析开发工具实现的简易网络Sniffer。目前,已经有不少的Sniff工具软件,如Windows环境下,最富盛名的工具是Netxray和Sniffer pro,用它们在...