Jump to content
xisto Community
Sign in to follow this  
dogtag

Cpanel Db Creator

Recommended Posts

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:

<?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:

$cpanel_user
$cpanel_password

$cpanel_host


Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.