403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.154
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Old Sites/ees_request/externalpages/ams/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Old Sites/ees_request/externalpages/ams/objection_send.php
<?php
    include('config.php');
    define( '_JEXEC', 1 );
    define('JPATH_BASE', dirname(__FILE__) );
    define( 'DS', DIRECTORY_SEPARATOR );
    require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
    require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
    require_once ( JPATH_BASE .DS.'libraries'.DS.'joomla'.DS.'factory.php' );
    require_once ( "Mailer.class.php");
    
    session_start();

    $mainframe =& JFactory::getApplication('site');
    $user =& JFactory::getUser();             
    
    if (!$user->guest) {
        $db_connection=mysql_connect($host, $username, $password, $db_name);
        if (!$db_connection) {
            die("<br><b>Database Error:</b> Could not connected. Try again later.<br>");
            exit;
        }
        @mysql_select_db($db_name, $db_connection) or die("Unable to select database.");
        mysql_query("SET NAMES 'utf8'", $db_connection);

       $filename =  $_FILES['fileatt']['name'];
       // break file into parts seperated by .
       $filename = explode('.', $filename); 
       // take the last part of the file to get the file extension
       $filename = $filename[count($filename)-1]; 
   
        if( $_FILES['fileatt']['size'] != 0 ) {
            
              $filename = $_FILES['fileatt']['name'];
              
              if( ($_FILES['fileatt']['type'] != 'application/pdf') && (strtolower($filename) != "pdf") ) {
                 $error = 1; 
              }
              else $error = 0; 
              
              if( $error == 1 ) {
                    if( $_FILES['fileatt']['type'] != 'application/msword' ) {
                        $error = 1; 
                    }
                    else $error = 0;
              }
              
              if( $error == 0 ) {
            
                    $Q = "SELECT * FROM lesson WHERE id='". $_SESSION['LESSON_ID']."'";
                    $result = mysql_query($Q);
                    $lesson = mysql_fetch_array($result);
                    
                    /*
                        Check FILE and UPLOAD
                    */      
                          $upload_file = tempnam("externalpages".DS."ams".DS."docs".DS."objections".DS, $user->id."_");
   
                          if( move_uploaded_file($_FILES['fileatt']['tmp_name'], $upload_file ) ) {
                              
                              if( !$db_connection ) {
                                     
                                     unlink($upload_file);
                                     echo "Error saving data to the database. The file was not uploaded";     
                              }
                              else {
                                  $query = "INSERT INTO `objection` VALUES('".$user->id."', '".$lesson['departmentId']."', 
                                         '".$lesson['sectionId']."', '".$lesson['id']."', '".date('Y')."', '".date("Y-m-d")."',
                                         '".basename($upload_file)."','".$_FILES['fileatt']['name']."', '".$_FILES['fileatt']['type']."')";
 
                                  if( !mysql_query($query)) {
                                      
                                      unlink($upload_file);
                                      echo "Error saving data to the database. The file was not uploaded";
                                      exit; 
                                  }
                                  else {
                                        /*
                                            If the FILE uploaded, then send emails "
                                        */
                                      
                                        $Q3 = "SELECT application_form.`userId`, `departmentId`, `sectionId`, `lessonId`, jos_users.`id`,jos_users.`email` 
                                               FROM `application_form`,`jos_users` 
                                               WHERE application_form.userId=jos_users.id 
                                               AND `lessonId`='".$lesson['id']."' AND `submited`='1'
                                               AND `departmentId`='".$lesson['departmentId']."' AND `sectionId`='".$lesson['sectionId']."'";
                                        $result3 = mysql_query($Q3);
                                        
                                        $emails = '';
                                        $objection = mysql_fetch_array($result3);
                                        
                                        do {
                                            $emails = $emails."<".$objection['email'].">,";   
                                        } while( $objection = mysql_fetch_array( $result3 ) );
                                        
                                      
                                        $allEmails = substr($emails,0, strlen($emails)-1 );
                                        
                                        $mailer = new Mailer('infoteiser@gmail.com','ΤΕΙ ΣΕΡΡΩΝ - Ήλεκτρονικό Σύστημα Αιτήσεων','infoteiser@gmail.com','','Ένσταση Μαθήματος','Σας επισυνάπτεται το αρχείο ενστάσεως.');
                                        $mailer->attachFile();
                                        
                                        if( @$mailer->send() ) {
                                            echo "<h1> Η ένσταση σας έχει αποσταλεί επιτυχώς! </h1>";   
                                        }
                                        else {
                                            unlink($upload_file);  
                                            $deleteQuery = "DELETE FROM objection
                                                            WHERE userId='".$user->id."' AND lessonId='".$_SESSION['LESSON_ID']."'";
                                            
                                            mysql_query($deleteQuery);
                                      
                                            echo "<h3><font color='red'>Υπήρξε σφάλμα με την ολοκλήρωση της διαδικασίας.</font>Παρακαλώ δοκιμάστε ξανά πατώντας";
                                            echo " [ <a href='javascript:history.go(-2)'> ΕΔΩ </a> ] </h3> ";
                                        }
                                          
                                  }
                              }
                          }
                          else {
                            echo "Error uploading. The file was not uploaded";  
                            exit;      
                          }          
              }
              else {
                echo "<br><br><font color='red'>Το αρχείο που έχετε επιλέξει δεν είναι αρχείο κειμένου τύπου DOC ή PDF.</font>";             
                echo " [ <a href='javascript:history.go(-1)'> Επιλογή Αρχείου Ενστάσεως </a> ] "; 
                exit;
              }
           
        }
        else {
            echo "<br><br><font color='red'>Δεν έχετε επιλέξει κάποιο αρχείο.</font>";
            echo " [ <a href='javascript:history.go(-1)'> Επιλογή Αρχείου Ενστάσεως </a> ] ";                   
        }    
    }
    else {
        echo "<br><font color='red'>Απογορεύεται η πρόσβαση. Δεν είστε συνδεδεμένοι!</font>";
    }
?>

Youez - 2016 - github.com/yon3zu
LinuXploit