BMW Trojan 样本分析

常见病毒资料 ppt形式,详细的介绍了各种常见病毒的特征及防治方法,比如震荡波,冲击波,蠕虫王,求职信,尼姆达等。对病毒研究比较有兴趣的朋友是比较好的学习材料, 立即下载

仅用于链接已经删却但是需要方便查阅的原文http://blog.csdn.net/zirconsdu/article/details/7997470

转载请注明出处http://blog.csdn.net/zirconsdu/article/details/8153813。

一些具体数据结构和具体路径隐去。

 

BMW木马样本分析

摘要

2011年底和某Hunter的谈话涉及到当时新检测到的病毒BMW,于是有了这篇分析报告.今天打开该目录时,卡巴又报发现病毒,又看到了这片文章.

曾经想象病毒侵入BIOS的危害,果然就出现了BMW,不过幸亏BMW只是用BIOS工具加入了个模块,而不是对BIOS的代码进行更深层次的修改.很久以前,就认为病毒侵入控制系统固件会有更大的社会危害,而修改重烧工业自动化系统的PLC控制器固件的病毒已经见诸报端.

正文

木马包含bios.exe和bmw.exe两个文件,前者负责感染bios和mbr,后者用于可执行文件感染,下载木马等。

 

一、BIOS感染文件

主要包括:

bios.exe--是BIOS感染主文件.

Flash.dll--用于装载sys文件.

bios.sys--是BIOS驱动服务文件,用于访问BIOS.

my.sys—一个文件驱动hook实现文件.

hook.bin--是BIOS文件和MBRex文件.(MBRex含在BIOS中,便于直接感染)

hook7k.bin---是hook.bin 中的7k内容,由MBRex注入到winlogon/WinInit.

winlogon/WinInit:下载calc.exe并执行.以fileprt服务装载my.sys,原理同使用beep.sys装载bios.sys.

 

1.1    bios.exe分析

1首先XOR 98h解码代码段中0x1000-0x1500的部分,解出代码段;XOR 89h解码出数据段部分;

2通过进程枚举,如果检测到瑞星或金山杀毒,则弹对话框,并对IME做hook,在用户按键时,执行3;如果没有发现瑞星和金山,直接执行第3步;

3解析参数和检测windows版本,参数主要是-w,-d,-u,其中-u是修复系统,-w和-d不明朗;一般情况下是继续执行感染系统;

4安装BIOS驱动,从资源中抽取出bios.sys,放入系统drivers文件夹;

然后会根据情况采用三种方式来安装BIOS驱动(\\.\bios设备):

A使用\\.\MyDeviceDriver(注:不是My.sys安装上的,是另一个RootKit)DLL注入技术,将Flash.dll依次注入到services.exe 和Explorer.exe来测试是否安装\\.\bios成功;

B如果A安装不成功,针对有瑞星或KV或WIN7或WIN2008R2版本,则直接LoadLibrary Flash.dll进行bios设备安装;

C大多数情况下,停止beep服务,使用bios.sys代替beep.sys,然后启动beep服务的方式来加载bios驱动安装bios设备,然后使用备份恢复beep.sys文件;

5然后会从资源中释放出过滤驱动My.sys;

6 DeviceIoControl(BIOS, 80102188h,..)来检测是否是Award BIOS,如果是,则DeviceIoControl(BIOS, 80102180h,..)备份当前BIOS为”c:\bios.bin”,打开文件,搜索“hookrom”(hook.bin的内容)来检查当前BIOS是否已经感染,如果没有感染,则从资源中释放出cbrom.exe(Award BIOS工具)和hook.rom(BIOS Patch,含MBR和Winlogon Patch),使用cbrom.exe c:\bios.bin /isa hook.rom将hook.rom作为ISA扩展BIOS添加进BIOS固件(另一个cbrom.exe c:\bios.bin /isa release为卸载扩展BIOS模块),然后使用DeviceIoControl(BIOS, 80102184h,..)将BIOS固件写入Flash中。

如果不是Award BIOS,则使用hook.rom中MBR直接替换原MBR。具体是,读取hook.rom,空过前面0x5D字节(BIOS部分)到MBR代码部分,复制MBRex到局部缓冲区(0x1C00字节,0x0E扇区);打开\\\\.\\PHYSICALDRIVE0且调整权限,读取MBR扇区到局部缓冲0x0E00处,检查是否感染(“int1” signature),若没有感染,则使用[0x01F8]值初始化[0x0226](是DayCounter),用0x0F00处0x80字节(从磁盘上读出的MBR部分)覆盖到0x0100处,主要是保存硬盘分区表。然后,将局部缓冲区14个扇区写入磁盘。

至此感染完毕。至于-u恢复,则是相反过程恢复回去。

 

1.2    flash.dll分析

用于以服务形式加载BIOS.sys, 主要功能在是DllMain中,其余代码是heap实现选择。

DLL_PROCESS_ATTACH DllLoad实现中,通过打开\\.\bios检测是否有Bios驱动,若没有,OpenSCManager =>> CreateService(bios) =>> StartService(bios);

DLL_PROCESS_DETACH的DllUnload实现中,OpenSCManager =>> ControlService (bios, STOP) =>> DeleteService(bios)

 

1.3    bios.sys分析

BIOS驱动文件,服务形式,安装\\.\bios设备,用于Ring0访问BIOS。

DriverEntry->DriverEntryImpl =>> IoCreateDevice("\\Device\\Bios")

主要是DriverIoControl,IOCTL_CODE有三个:

80102180h --- BackupBIOS

80102184h --- BurnBIOS

80102188h --- CheckBIOS

CheckBIOS流程:

使用MmMapIoSpace map BIOS物理地址[0x0F0000+0x10000] to liner space,然后搜索字符串“$@AWDFLASH”确定是否Award BIOS;找到后,在其后0x2A处,找SMI_PORT保存;然后通过 “_MS_”和“IMD_”辅助找到BIOS_SIZE并保存。

BackupBIOS流程:

MmMapIoSpace map BIOS物理地址[0x0F0000+BIOS_SIZE] to liner space =>> ZwCreateFile(\\DosDevices\\C:\\bios.bin) =>> ZwWriteFile。

BurnBIOS流程:

ZwCreateFile(\\DosDevices\\C:\\bios.bin) =>> ZwReadFile到ExAllocatePoolWithTag分配的缓冲区中;擦除Flash,将缓冲区中内容编程到Flash中;释放缓冲,关闭文件。

EraseFlash流程:

首先,写"$SMI"到EBP寄存器,然后OUT 0x29到SMI_PORT(是扩展端口),适当延时(应当延时相对比较长时间?),检测EBP是否TOGGLE为“SMI$”,若是,擦除成功。

ProgramFlash流程:

分页,每次编程16字节;依次编程;use page auto increament。

页编程流程:

首先,写"$SMI"到EBP寄存器,然后OUT 0x2F到SMI_PORT(是扩展端口),适当延时,检测EBP是否TOGGLE为“SMI$”,若是,页编程成功。

 

1.4    my.sys分析

IoCreateDevice(\\Device\\hide)钩到\\Device\\Harddisk0\\DR0的驱动disk.sys,对READ、WRITE、DEVICEIOCONTROL的DISPTACH进行HOOK,阻止MBRex扇区部分被读取和修改。在WINLOGON的感染代码里my.sys以fileprt服务的名义被加载。

DriverReadHook:

判断如果是读前63个扇区,则设置完成例程DriverReadCompletionRoutine,若不是,调用原读例程正常读;

DriverReadCompletionRoutine会根据读模式,找到相关缓冲区,清零,使这样无法读取MBRex(14扇区)所在的扇区。

DriverWriteHook:

根据写模式,得到相关缓冲区,如果是写前14扇区,则需要偏移0x100处的FBFBECECFCFCEBEBh的Signature作为口令(MBR中0x100处即为这些数值)可以调用原写例程写入;否则IofCompleteRequest with STATUS_SUCCESS;若是15-63扇区,直接IofCompleteRequest with STATUS_SUCCESS;其余扇区,调用原写例程正常写;

保姆级教程:在RK3576上配置USB网卡从零到外网访问(附udev规则详解) 本文提供了在RK3576开发板上配置USB网卡的完整教程,涵盖从内核驱动、udev规则到网络路由的全流程。重点讲解了如何利用USB Gadget功能实现高速网络连接,并构建稳定的算力集群,确保多设备间通信及外网访问。 阅读详情

相关推荐

S.BUS协议及编解码,C语言源码

1、简介 SBUS本质是一种串口通信协议,采用100K的波特率,8位数据位,两位停止位,偶效验,即8E2的串口通信。 值得注意的有三点: 1.SBUS采用负逻辑,所以无论接收还是发送都要进行硬件取反(注意,一定要硬件取反),电路如下 这是我在网上看资料时看到的电路,实际上我用的是下面这个电路 2.SBUS有两种模式, a.高速模式:每4ms发送一次 b...

qq_31232793的博客 1万+

手把手教你用单结晶体管搭建简易振荡电路(含电路图和波形分析)

本文详细介绍了如何使用单结晶体管(UJT)搭建简易振荡电路,包括电路设计、波形分析和实战技巧。通过具体的电路图和参数计算,帮助电子爱好者和工程师快速掌握UJT振荡器的设计与调试方法,适用于脉冲信号生成和时钟源制作等应用场景。

weixin_29207533的博客 520

KF-gins输出结果绘图

KF-gins输出结果绘图

m0_51977577的博客 1110

COMSOL相场法模拟枝晶生长:溶质偏析模型搭建全流程

凝固过程中枝晶形貌与溶质偏析直接决定铸件微观组织与力学性能,是材料加工领域长期关注的核心问题。相场法凭借弥散界面描述天然处理拓扑演化,成为模拟枝晶生长的主流数值方法,而通用有限元平台COMSOL为自定义偏微分方程求解提供了高度灵活的实现路径。从热力学驱动、界面各向异性到溶质再分配,模型需准确耦合相场方程与浓度扩散方程,才能在二元合金凝固模拟中还原真实枝晶尖端速度、二次臂形貌及界面富集行为。围绕溶质偏析这一关键变量,建模过程涉及无量纲化参数标定、反溶质截留项配置、分离式求解器与网格各向异性控制等核心细节。该方

weixin_30402231的博客 309

多个linux系统安装到一块硬盘(Kylin+UOS+ubuntu)

之前写过一篇类似的文档,笔者把kylin和UOS安装在一块硬盘上上一篇的文档地址多个linux系统安装到一块硬盘(Kylin+UOS)_银河麒麟系统和uos安装成双系统-CSDN博客本次记录的是三个系统到一块硬件上银河麒麟:Kylin-Desktop-V10-SP1-Release-2107-arm64统信:uniontechos-desktop-20-professional-1050-arm64乌班图:ubuntu-22.04.5-live-server-arm64。

aggs1990的专栏 574

【AI Agent系列】【阿里AgentScope框架】0. 快速上手:AgentScope框架简介与你的第一个AgentScope程序

这是我们学习的第四款智能体框架了。前面我们学习了 AutoGPT、MetaGPT、LangGraph 等智能体应用开发框架,各有优缺点。今天我们开始学习AgentScope这一款多智能体开发框架。卷起来吧,多看看,多用用,没坏处。

同学小张的博客 5436

1000路监控IP地址规划的方法与思路!看完就会!超简单!

四个区域ip地址比较明显了,如果那个摄像机有问题,可以直接通过批量ping ip地址可以很快定位到那个摄像机出了问题,同时也可以有效防止ip冲突,ip是网络故障中出现频率比较高的问题,也可以减少广播风暴。,如果让系统自动分配ip地址的话,容易产生ip冲突,所以1000路监控的ip地址不能只有一个大网段,我们需要对其划分vlan,方便管理和减少网络故障。”,如果你在开始了dhcp自由分配ip地址的话,容易出现ip冲突等问题,所以设置时需要注意。255.255.252.0,可以容纳,4*254个ip地址。

qq_43416206的博客 507

RK3588S之CPU--benchmark(一)

本章会基于RK3588S来介绍有关CPU常用的benchmark工具及测试过程

文艺小少年的博客 1500

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

上一篇: PE可执行文件格式-微软原汁原味
下一篇: A common thread sync issue analysis of android application
zirconsdu
博客等级 码龄21年 186粉丝 61原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址