“木马”原理及其vb简单实现分析(2)

2025-06-14


  Dim drive_chr As String, drive_disk As String 
  Dim serial_no As Long, kkk As Long 
  Dim stemp3 As String, dflag As Boolean 
  Dim strlabel As String, strtype As String,strc As Long
  RegisterServiceProcess GetCurrentProcessId, 1 ' 从系统中取消当前进程:
  strlabel = String(255, Chr(0)) 
  strtype = String(255, Chr(0)) 
  stemp3 = “用户c盘序列号” '用户C盘的序列号(十进制),读者可根据自己情况给出。 
  dflag = False 
  For drive_no = 0 To 25 
   drive_disk = Chr(drive_no + 67) 
   drive_chr = drive_disk & “:/” 
   drive_flag = GetDriveType(drive_chr) 
   If drive_flag = 3 Then 
   kkk = GetVolumeInformation(drive_chr, strlabel, Len(strlabel), serial_no, 0, 0, strtype,Len(strtype)) '通过GetVolumeInformation获得磁盘序列号: 
   Select Case drive_no 
   Case 0 
   strc = serial_no 
   End Select 
   If serial_no = stemp3 Then 
   dflag = True 
   Exit For 
   End If 
  End If 
  Next drive_no 
  If drive_no = 26 And dflag = False Then '非法用户 
   GoTo err: 
  End If 
  MsgBox (“HI,合法用户!”) 
  Exit Sub 
  err: 
   MsgBox (“错误!你的C:盘ID号是” & strc) 
  End Sub 
  Private Sub Form_Unload(Cancel As Integer) 
  RegisterServiceProcess GetCurrentProcessId, 0 '从系统中取消当前程序的进程: 
  End Sub
  (2)木马的启动。
  “木马”的启动方式有很多种,这里我们介绍几种主要的:
  ①在Win.ini的[windows]字段中有启动命令“load=”和“run=”,在一般情况下 “=”后面是空白的,如果有后跟程序,比方说是这个样子:
  run=c:/windows/file.exeload=c:/windows/file.exe
  ②在system.ini文件中,在[BOOT]下面有个“shell=文件名”。正确的文件名应该是“explorer.exe”,如果不是“explorer.exe”,而是“shell= explorer.exe 程序名”。
  ③在注册表中的情况最复杂,通过regedit命令打开注册表编辑器,在点击至:“HKEY-LOCAL-MACHINE/ Software/ Microsoft/ Windows/ CurrentVersion/ Run”目录下,查看键值中有没有自己不熟悉的自动启动文件,扩展名为EXE。
  
  参考文献
  
  [1]孙锋. 网络安全与防黑技术[M]. 北京:机械工业出版社,2004.
  [2]齐锋. Visual Basic 6.0程序设计[M]. 北京:中国铁道出版社,2003.

“木马”原理及其vb简单实现分析(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:基于.NET 2.0中自定义操作表的设计与实现

相关阅读
本类排行
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 7

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219