 |
 | target PE sections |  |
topix93
Joined: 15 Mar 2012 |
Posts: 0 |
|
|
 |
Posted: Thu Apr 19, 2012 6:31 am |
|
 |
 |
 |
 |
i found this: https://www.clamav.net/doc/webinars/Webinar-Alain-2009-03-04.pdf https://www.clamav.net/doc/webinars/Webinar-Alain-2009-03-04.pdf
and my question is: how can i extract target pe sections?
|
|
GuitarBob
Joined: 09 Jul 2006 |
Posts: 9 |
Location: USA |
|
 |
Posted: Thu Apr 19, 2012 11:12 am |
|
 |
 |
 |
 |
You can use a debugger to see the sections in a PE file. I like Filealyzer. It is free from Spybot Search & Destroy at https://www.safer-networking.org/en/filealyzer/ on the web. I like version 1.6.0.0, an older version. The code section is usually used for an MDB file hash, which you can get from the OpenSBI tab. You can use the Hexdump followed by List strings tab to see the file contents and grab the hexadecimal representation for a string for an NDB signature. See below:
filesize:filehash:Trojan.Whatever MDB sig for a file section
Trojan.Whatever:1:hexstring NDB sig for a string in the file
Regards,
|
|
topix93
Joined: 15 Mar 2012 |
Posts: 0 |
|
|
 |
Posted: Thu Apr 19, 2012 4:59 pm |
|
 |
 |
 |
 |
How do I know the bytes from the pe file sections which begin?
|
|
GuitarBob
Joined: 09 Jul 2006 |
Posts: 9 |
Location: USA |
|
 |
Posted: Fri Apr 20, 2012 12:36 am |
|
 |
 |
 |
 |
You can get an MD5 hash for a section and use that as the signature. The code section is usually used for a section hash because it might be used again in other malware. Sometimes there is more than one code section, so you can get a MD5 hash for the entire file in that case--if you can not figure out the right code section to use. The MD5 file hash will minimize false positives, but it will only detect that one malware. It is a safe and quick signature. Using the file or section size in the signature also will minimize false positives.
Regards,
|
|
topix93
Joined: 15 Mar 2012 |
Posts: 0 |
|
|
 |
Posted: Mon Apr 23, 2012 12:38 pm |
|
 |
 |
 |
 |
if I wanted to get the signature of the PE file I must get the sections of the file. but to be able to extract, programmatically, I have to know the beginning of these sections ... how do I figure out what is the beginning of these sections?
|
|
GuitarBob
Joined: 09 Jul 2006 |
Posts: 9 |
Location: USA |
|
 |
Posted: Mon Apr 23, 2012 9:54 pm |
|
 |
 |
 |
 |
FileAlyzer will let you see all the sections in a PE file, and you can view individual sections. You will be able to see where a section begins. I am sure that other debuggers and disassemblers like Ida Pro or OllyDbg will do the same. Clam AV has a built-in disassembler (or part of one), but it is only for internal scanning.
I do not know how you would find the beginning of a section within your program other than via calling a disassembler or via some disassembler functions.
Regards,
|
|
topix93
Joined: 15 Mar 2012 |
Posts: 0 |
|
|
 |
Posted: Tue Apr 24, 2012 6:04 am |
|
 |
 |
 |
 |
if I want, I can use the antivirus clamwin classes to extract the signature files?
|
|
GuitarBob
Joined: 09 Jul 2006 |
Posts: 9 |
Location: USA |
|
 |
Posted: Tue Apr 24, 2012 11:59 am |
|
 |
 |
 |
 |
I do not know what you mean by "using the ClamWin classes to extract the signature files."
ClamWin uses its code to scan files to look for the signatures in its signature database. You can use the ClamWin code in another application to scan, of course, but your application must be open source, like ClamWin.
Regards,
|
|
topix93
Joined: 15 Mar 2012 |
Posts: 0 |
|
|
 |
Posted: Tue Apr 24, 2012 1:59 pm |
|
 |
 |
 |
 |
where can i find the code about the extracting of the signature?
|
|
GuitarBob
Joined: 09 Jul 2006 |
Posts: 9 |
Location: USA |
|
 |
Posted: Tue Apr 24, 2012 4:20 pm |
|
 |
 |
 |
 |
It sounds like you are intending to build your own antivirus. I think you will need to examine the code yourself--which is beyond the support we can give here. The code ClamWin uses is merely ported over from ClamAV for Linux to a Windows version, which is not exactly the same.
Regards,
|
|
topix93
Joined: 15 Mar 2012 |
Posts: 0 |
|
|
 |
Posted: Tue Apr 24, 2012 4:47 pm |
|
 |
 |
 |
 |
exactly, I'm trying to build an antivirus for my personal project. I didn't understand what it means to your last sentence.
|
|
GuitarBob
Joined: 09 Jul 2006 |
Posts: 9 |
Location: USA |
|
 |
Posted: Tue Apr 24, 2012 6:48 pm |
|
 |
 |
 |
 |
I ment that the ClamWin code is primarily from the ClamAV project for Linux computers. ClamWin basically adds a Windows GUI to the ClamAV code so that it can be used on Windows computers, but there are some other small differences. The ClamWin port is available for download/examination at
https://www.clamwin.com/component/option,com_weblinks/catid,2/Itemid,80/ on the web.
Any use of open source software code (like ClamWin) in another application requires that you also make your application open source.
Regards,
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © phpBB Group
Design by phpBBStyles.com | Styles Database.
Content © ClamWin Free Antivirus GNU GPL Free Software Open Source Virus Scanner. Free Windows Antivirus. Stay Virus Free with Free Software.
|  |