Software Development
Italiano | English

FORUM
::  Menù Principale - Sito Web
del Geom. Marcello Cantelmo :: Un'Azienda. Molte Soluzioni !
 
:: In Primo Piano
< settembre 2010 >
L
M
M
G
V
S
D
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
             

Profilo Facebook di Marcello Cantelmo
Cerca per parola chiave
 


Titolo
In che modo Proteggi il tuo software?

 Chiave Hardware
 Chiave Software
 Nessuna Protezione




10/09/2010 @ 20.44.58
script eseguito in 32 ms


Valid XHTML 1.0 / CSS
\\ Home Page : Storico per mese (inverti l'ordine)
Di seguito tutti gli interventi pubblicati sul sito, in ordine cronologico.
 
 
Di Marcello Cantelmo (del 13/03/2006 @ 18:14:09, in .NET, linkato 1670 volte)

Il vero pericolo per la sicurezza è provare un falso senso di sicurezza!

Cantelmo Software, per non far provare agli Sviluppatori un falso senso di sicurezza, propone, in questo articolo, un semplice Memory Dumper (realizzato 100% in VB.NET). Sebbene l'articolo sia stato considerato riduttivamente semplice, consente, ad un aggressore, di scaricare un Assembly .NET direttamente dalla memoria. Anche in questo caso, risulta inefficace, un qualsiasi approccio crittografico (crypter, ect.) al problema decompilazione & reverse-engineering degli Assembly .NET

A differenza di un unpacker automatico -in cui il suo loader può essere sempre intercettato- nell'esempio allegato viene illustrato come accedere ad un qualsiasi processo in esecuzione per poi effettuare il dump della memoria utilizzata!
'[i] Module1.vb
Imports CantelmoSoftware.MemoryDumper
'
Namespace CantelmoSoftware.MemoryDumper
    Module Dumper
        Sub Main()
            Dim baseAddress As Integer = &H429000 '[i] retrieve you ; - ) the "base address memory"
            Dim processMemory As New CantelmoSoftware.MemoryDumper.ProcessMemory
            Dim processArray As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName("dotNET_Crypter") 'or other process : - o
            '<<<
            If processArray.Length = 0 Then
                Debug.WriteLine("Process not Found !")
            Else
                processMemory.ReadProcess = processArray(0)
                processMemory.OpenProcess()
                '--------------------------
                Dim bytesToRead As Integer = &H12EFFE
                Dim totBytesReaded As Integer = 0
                Dim buffer As Byte() = processMemory.ReadMemory(CType(baseAddress, IntPtr), bytesToRead, totBytesReaded)
                '[i] save buffer to disk
                My.Computer.FileSystem.WriteAllBytes("c:\unpacked.bin", buffer, False)
            End If
        End Sub
    End Module
End Namespace

'[i] ProcessMemory.vb
Imports System.Runtime.InteropServices

Namespace CantelmoSoftware.MemoryDumper
    Friend NotInheritable Class ProcessMemory

        Friend Shared Function CloseHandle(ByVal hObject As IntPtr) As Integer
        End Function
 
        Friend Shared Function OpenProcess(ByVal dwDesiredAccess As UInt32, ByVal bInheritHandle As Integer, ByVal dwProcessId As UInt32) As IntPtr
        End Function
 
        Friend Shared Function ReadProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesRead As IntPtr) As Integer
        End Function
 
        Private Const PROCESS_VM_READ As UInt32 = 16
 
        Private m_hProcess As IntPtr
        Private m_ReadProcess As Process

        Public Sub New()
            Me.m_ReadProcess = Nothing
            Me.m_hProcess = IntPtr.Zero
        End Sub
 
        Friend Sub CloseHandle()
            If (CloseHandle(Me.m_hProcess) = 0) Then
                Throw New Exception("Error!")
            End If
        End Sub
 
        Friend Sub OpenProcess()
            Me.m_hProcess = OpenProcess(PROCESS_VM_READ, 1, CType(Me.m_ReadProcess.Id, UInt32))
        End Sub
 
        Friend Function ReadMemory(ByVal MemoryAddress As IntPtr, ByVal bytesToRead As UInt32, ByRef bytesReaded As Integer) As Byte()
            Dim _ptr As IntPtr
            Dim _buffer As Byte() = New Byte(bytesToRead - 1) {}
            ReadProcessMemory(Me.m_hProcess, MemoryAddress, _buffer, bytesToRead, _ptr)
            bytesReaded = _ptr.ToInt32
            Return _buffer
        End Function
 
        Friend Property ReadProcess() As System.Diagnostics.Process
            Get
                Return Me.m_ReadProcess
            End Get
            Set(ByVal value As Process)
                Me.m_ReadProcess = value
            End Set
        End Property
    End Class
End Namespace

Un obfuscator risulta essere, ad oggi, ancora la migliore scelta per la tutela della proprietà intellettuale dei nostri applicativi basati su piattaforma .NET

Articolo Link Commenti Commenti (0)  Storico Storico  Stampa Stampa
 
Pagine: 1


. . : :   U N D E R   C O N S T R U C T I O N   : : . .
Home Page:Servizi:Soluzioni:Clienti:Prodotti:Azienda

: : Use OpenOffice.org :
Copyright © 2003-2009 "Cantelmo Software" del Geom. Marcello Cantelmo. Tutti i Diritti sono Riservati • Note Legali
Document made with Nvu
Microsoftâ„¢, Windowsâ„¢, .NETâ„¢, and .NET Frameworkâ„¢ sono marchi di Microsoft Corporation. Tutti gli altri marchi appartengono ai legittimi proprietari.

powered by dBlog CMS ® Open Source