Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Cpanel Db Creator
dogtag
post Jun 8 2007, 10:46 AM
Post #1


Newbie [Level 1]
*

Group: Members
Posts: 23
Joined: 7-June 07
Member No.: 44,336



Hi
this would be very useful for WEB Programmers
if you have a cpanel host, you know that you cannot create MySql DBs and you should do it just by CPanel.

by this code you can do it in your programs:

CODE
<?php

// cPanel username
$cpanel_user = "user";

// cPanel password
$cpanel_password = "password";

// cPanel host
$cpanel_host = "host";

// cPanel theme/skin, usually "x"

$cpanel_skin = "x";

// Path to cURL on your server
$curl_path = "/usr/bin/curl";

//////////////////////////////////////
/* Code below should not be changed */
//////////////////////////////////////

if(isset($_GET['db']) && !empty($_GET['db'])) {
  // escape db name
  $db_name = escapeshellarg($_GET['db']);

  // will return empty string on success, error message on error
  $result = exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/adddb.html?db=$db_name'");

  // output result
  echo $result;
}
else {
  echo "Usage: cpanel_create_db.php?db=databasename";
}

?>



just replace change these values:

QUOTE
$cpanel_user

$cpanel_password

$cpanel_host
Go to the top of the page
 
+Quote Post
Saint_Michael
post Jun 9 2007, 01:47 AM
Post #2


$p4m 0n j00 $h4m3 m3 0nc3 $p4m 0n m3 $h4m3 m3 7\/\/1c3
*********************

Group: [HOSTED]
Posts: 6,444
Joined: 21-September 04
From: 9r33|\| 399$ 4|\|D 5P4/\/\
Member No.: 1,218
T17 GFX Crew



Interesting script but $5 says that this is a not a secured script and if anyone saw this saw script running on a site they could use it to plant a wonder SQL injection into your site, or use for a location to sql inject another site. Then while they get away scott free the person hosting the site this script is on will get in trouble for it.
Go to the top of the page
 
+Quote Post
jlhaslip
post Jun 9 2007, 02:55 AM
Post #3


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 3,993
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



Looks suspiciously similar to this function:

http://www.zubrag.com/scripts/cpanel-database-creator.php

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics


 



- Lo-Fi Version Time is now: 6th September 2008 - 01:50 AM