下载地址:https://www.pan38.com/share.php?code=yudq3 提取码:8888 【仅供学习】
现代软件的机器码检测通常采集以下硬件特征:
// 获取硬盘序列号示例
ManagementObject disk = new ManagementObject("win32_logicaldisk.deviceid=\"C:\"");
string volumeSerial = disk["VolumeSerialNumber"].ToString();
// 通过SSDT Hook拦截NtQuerySystemInformation
NTSTATUS HookNtQuerySystemInformation(
SYSTEM_INFORMATION_CLASS SystemInformationClass,
PVOID SystemInformation,
ULONG SystemInformationLength,
PULONG ReturnLength)
{
if(SystemInformationClass == SystemSmbiosTableInfo)
{
// 修改返回的SMBIOS数据
return STATUS_SUCCESS;
}
return OriginalNtQuerySystemInformation(...);
}
# 使用pywin32修改注册表存储的硬件信息
import winreg
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\IDConfigDB")
winreg.SetValueEx(key, "MachineId", 0, winreg.REG_SZ, "NEW_ID")
// 安卓端的Prop属性混淆示例
ProcessBuilder pb = new ProcessBuilder("/system/bin/setprop",
"ro.serialno", "RANDOM_" + System.currentTimeMillis());
pb.start();
完整脚本
@echo off
:: ========== 基础配置 ==========
title 系统管理工具 v1.2
color 0A
setlocal enabledelayedexpansion
:: ========== 管理员权限检查 ==========
net session >nul 2>&1
if %errorlevel% neq 0 (
echo 正在请求管理员权限...
powershell start-process -verb runas -FilePath "%0"
exit
)
:: ========== 主菜单 ==========
:menu
cls
echo ===== 请选择操作 =====
echo 1. 修改计算机名
echo 2. 修改MAC地址
echo 3. 查看系统信息
echo 4. 定时任务管理
echo 5. 退出
set /p choice=请输入选项:
if %choice%==1 goto rename_pc
if %choice%==2 goto change_mac
if %choice%==3 goto system_info
if %choice%==4 goto task_schedule
if %choice%==5 exit
:: ========== 功能模块 ==========
:rename_pc
set /p new_name=请输入新计算机名:
wmic computersystem where name="%computername%" call rename name="%new_name%"
if %errorlevel%==0 (
echo 计算机名修改成功,需要重启生效
shutdown /r /t 60 /c "计算机名已更改"
) else (
echo 修改失败,错误代码: %errorlevel%
)
pause
goto menu
:change_mac
echo 可用网卡列表:
wmic nic where "NetEnabled=true" get name, index
set /p nic_index=输入网卡序号:
set /p new_mac=输入新MAC地址(12位字符):
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\%nic_index%" /v NetworkAddress /d %new_mac% /f
netsh interface set interface "%nic_index%" admin=disable
netsh interface set interface "%nic_index%" admin=enable
echo MAC地址已更新
pause
goto menu
:system_info
systeminfo | findstr /B /C:"OS 名称" /C:"OS 版本" /C:"系统制造商" /C:"系统型号"
wmic cpu get name
wmic memorychip get capacity
pause
goto menu
:task_schedule
echo 1. 创建定时任务
echo 2. 查看现有任务
set /p task_op=请选择:
if %task_op%==1 (
set /p task_name=输入任务名称:
set /p bat_path=输入BAT文件路径:
schtasks /create /tn %task_name% /tr "%bat_path%" /sc daily /st 09:00
) else (
schtasks /query /fo list
)
pause
goto menu
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。