!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16. PHP/5.4.16 

uname -a: Linux roko-bkp 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 

uid=48(apache) gid=48(apache) groups=48(apache),1003(webmaster) 

Safe-mode: OFF (not secure)

/var/www/html/admin/noticia/   drwxr-xr-x
Free 9.35 GB of 93.48 GB (10.01%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     noticia_grava.php (14.31 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
    
#############################################################################
    # Nome: oficio_grava.php                                                    #
    # System: Irpen                                                             #
    # Criado por: Breno Henrique Vivarelli                                      #
    # Empresa: Netnigro                                                         #
    # E-mail: breno@netnigro.com.br                                             #
    # Descrição: Inclusão, alteração e inativação de ofícios                    #
    # Histórico:                                                                #
    #    . 03/06/2008 - Breno Henrique Vivarelli                                #
    #            Criação da Página                                              # 
    #############################################################################
                
/*
    echo "<pre>";
      print_r($_POST);
    echo "</pre>";
    die();*/
                
    // Includes
    
include("../../config/config.php");
    include(
INCLUDES "conexaoBD.php");
    include(
INCLUDES "sentencas_sql.php");
    include(
INCLUDES "funcoes_uteis.php");
    include(
INCLUDES "valida_usuario.inc.php");


    function 
postar_twitter($msg){
      require_once(
"twitteroauth/twitteroauth/twitteroauth.php");

      
#Configure abaixo os dados de aplicação para autenticação
      
$consumer_key "KigytPTifAEYNj8ZlJJQ";
      
$consumer_secret "PH3pph7WiUAVBo7ebhGqfw5P1XJPGTWiaZ33n7eLGQ";
      
$oauth_token "248623012-ZlhhVBtDHfcul4bT7y5ikIGHjs0SdPi5h40Vrilw";
      
$oauth_token_secret "3oZZxnkdDBNZe472RwxnbU4hMWTdVppYPv7y0QFfeuk";

      
$connection = new TwitterOAuth($consumer_key$consumer_secret$oauth_token$oauth_token_secret);

      if(!
$connection) {
          echo 
"Erro na conexão";
          die();
      }

      
$result $connection->post('statuses/update', array('status' => $msg));
      echo 
"Enviado!";

    }




    function 
uploadJPEG($file,$path,$maxdim=386,$maxsize=50072000){    
      if(
is_uploaded_file($file[tmp_name])){
        
$mime $file[type];
        if((
$mime == "image/jpeg")||($mime == "image/pjpeg")){
          if(
$file[size] < $maxsize){
            list(
$larg_orig$alt_orig) = @getimagesize($file[tmp_name]);
            
$larg $maxdim;
            
$alt 257;
            
$imagem_nova imagecreatetruecolor($larg$alt);
            
ini_set(memory_limit"512M");
            
$imagem = @imagecreatefromjpeg($file[tmp_name]);
            @
imagecopyresampled($imagem_nova$imagem0000$larg$alt$larg_orig$alt_orig);
            return (@
imagejpeg($imagem_nova$path)) ? 5;
          }
          return 
4;
        }
        return 
3;
      }
      return 
2;
    }
    
    function 
listaimagemRemoveAcentos($str$enc "UTF-8"){        
        
$acentos = array(
        
'A' => '/&Agrave;|&Aacute;|&Acirc;|&Atilde;|&Auml;|&Aring;/',
        
'a' => '/&agrave;|&aacute;|&acirc;|&atilde;|&auml;|&aring;/',
        
'C' => '/&Ccedil;/',
        
'c' => '/&ccedil;/',
        
'E' => '/&Egrave;|&Eacute;|&Ecirc;|&Euml;/',
        
'e' => '/&egrave;|&eacute;|&ecirc;|&euml;/',
        
'I' => '/&Igrave;|&Iacute;|&Icirc;|&Iuml;/',
        
'i' => '/&igrave;|&iacute;|&icirc;|&iuml;/',
        
'N' => '/&Ntilde;/',
        
'n' => '/&ntilde;/',
        
'O' => '/&Ograve;|&Oacute;|&Ocirc;|&Otilde;|&Ouml;/',
        
'o' => '/&ograve;|&oacute;|&ocirc;|&otilde;|&ouml;/',
        
'U' => '/&Ugrave;|&Uacute;|&Ucirc;|&Uuml;/',
        
'u' => '/&ugrave;|&uacute;|&ucirc;|&uuml;/',
        
'Y' => '/&Yacute;/',
        
'y' => '/&yacute;|&yuml;/',
        
'a.' => '/&ordf;/',
        
'o.' => '/&ordm;/',
        
'_' => '/ /');
        
           return 
preg_replace($acentosarray_keys($acentos), htmlentities($str,ENT_NOQUOTES$enc));
    }
    
    
    
    function 
remover($a){
        
$a eregi_replace("[àáâäã]","a",$a);
        
$a eregi_replace("[èéêë]","e",$a);
        
$a eregi_replace("[ìíîï]","i",$a);
        
$a eregi_replace("[òóôöõ]","o",$a);
        
$a eregi_replace("[ùúûü]","u",$a);
        
$a eregi_replace("[ÀÁÂÄÃ]","A",$a);
        
$a eregi_replace("[ÈÉÊË]","E",$a);
        
$a eregi_replace("[ÌÍÎÏ]","I",$a);
        
$a eregi_replace("[ÒÓÔÖÕ]","O",$a);
        
$a eregi_replace("[ÙÚÛÜ]","U",$a);
        
$a eregi_replace("ç","c",$a);
        
$a eregi_replace("Ç","C",$a);
        
$a eregi_replace("ñ","n",$a);
        
$a eregi_replace("Ñ","N",$a);
        
$a str_replace("´","",$a);
        
$a str_replace("`","",$a);
        
$a str_replace("¨","",$a);
        
$a str_replace("^","",$a);
        
$a str_replace("~","",$a);
        return 
$a;
    }
    
    
// Parâmetros provênientes da requisição
    
$titulo                    $_POST["txtTitulo"];
    
$dt_inicio_publicacao      FormataData($_POST["txtDtInicioPublicacao"],"BD") . " " $_POST["txtHInicioPublicacao"];
    
$dt_termino_publicacao     FormataData($_POST["txtDtTerminoPublicacao"],"BD") . " " $_POST["txtHTerminoPublicacao"];      
    
$hiperlink_externo         $_POST["txtHiperlinkExterno"];
    
$novidadeSN                $_POST["ckbNovidadeSN"];
    
$importanteSN              $_POST["ckbImportanteSN"];
    
$vis_homeSN                $_POST["ckbVisHomeSN"];
    
$texto_resumido            stripcslashes($_POST["txtTextoResumido"]); 
    
$texto_completo            stripcslashes($_POST["txtTextoCompleto"]); 
    
$dt_cadastro               date("Y-m-d H:i:s");  
    
$tipo_fonte                $_POST["rdgFonteNoticia"];
    
$destaque                   $_POST["dstq"];
    
$img_destaque               $_POST["img_destaque"];
    
$check_twitter               $_POST["ckbcheck_twitter"];
    
$imagem                       $_FILES["imagem"];
    
$imagem_nome             utf8_encode($imagem["name"]);
    
$imagem_nome            strtolower(listaimagemRemoveAcentos($imagem_nome));
    
//die($imagem_nome);
    //$imagem_nome            = remover($imagem_nome);
    
$tipo                    $imagem["type"];
    
$idIMG                    $_POST['idIMG'];
    
/*
    echo("<pre>");
    print_r($_POST);
    echo("</pre>");
    */

    
if($check_twitter=='S')
    {
        
$check_twitter='S';
    }
    else
    {
        
$check_twitter='N';
    }

    
//echo $titulo.'<br />'.$dt_inicio_publicacao.'<br />'.$dt_termino_publicacao.'<br />'.$hiperlink_externo.'<br />'.$novidadeSN.'<br />'.$importanteSN.'<br />'.$vis_homeSN.'<br />'.$texto_resumido.'<br />'.$texto_completo.'<br />'.$dt_cadastro.'<br />'.$tipo_fonte.'<br />'.$destaque.'<br />'.$imagem_nome.'<br />';
    
    
if ($destaque == 1) {
        
        
$dest 'S';
        
        if (
$imagem_nome != '') {

            if ((
$tipo != "image/pjpeg" && $tipo != "image/jpeg") && $tipo != "") {
                echo 
utf8_decode("<script>alert('Atenção!\\nEnviar somente arquivos com extensão .jpeg');history.go(-1);</script>");
                die();

            }
            
$dtCad date("Y-m-d");
            
$sqlSalvaIMG "INSERT INTO imagens (IMG_RowID, IMG_DtCadastro, IMG_Nome, IMG_AtivoSN) VALUES (null,'$dtCad','$imagem_nome','S')";
            
//echo '<p>'.$sqlSalvaIMG.'</p>';
            
if($conexao->query($sqlSalvaIMG)) {
                
                
$idIMG mysqli_insert_id($conexao);
                
                
$conexao->commit();
                
            }
            
            
//echo $tipo.' - '.$nome;
            
            
$caminho "imagens/";
            
$arq $imagem_nome;
            
$path $caminho.$arq//Nome do arquivo grande no servidor com caminho
            
$up uploadJPEG($imagem,$path); // Para o 3 e 4 parametros usam valores padro
        
}
    } else {
        
    
//    $idIMG = '';
        
$dest 'N';
        
    }
    
    if (
$idIMG == '')
        
$idIMG 0;
        
    if (
trim($dt_termino_publicacao) == '')
        
$dt_termino_publicacao '0000-00-00 00:00:00';
    
    
//echo '<p>'.$idIMG.'</p>';
    
    //die();
    
    
if($tipo_fonte == "O")
    {
        
$fonte $_POST["txtFonte"];  
    }
    else
    {
        
$fonte null;
    }
    
    if(isset(
$_POST["ckbPeriodoIndefinidoSN"]))
    {
        
$periodo_indefinidoSN  $_POST["ckbPeriodoIndefinidoSN"];
    }
    else
    {
        
$periodo_indefinidoSN "N";
    }
    
    
$cod_noticia    $_REQUEST['hddNoticia']; 
    
    
// Ação que o script deverá executar (Inclusão - I, Alteração - U, Ativação - A ou Inativação - IN)
    
$acao   $_REQUEST['hddAcao'];
    
    if(isset(
$_POST["btnAtivar"]))
    {
        
//$acao = "A";
    
}
    else if(isset(
$_POST["btnInativar"]))
    {
        
//$acao = "IN";
    
}  
    
    
/*echo "<pre>";
    print_r($_REQUEST);
    echo "</pre>";*/
    
    //die($acao);
    
    
$erro false
    switch(
$acao)
    {
        
// Inclusão de notícia
        
case "I":
                
/*
                 $sql        = INCLUI_NOTICIA;
                 $tipo_dados = TIPO_DADOS_INCLUI_NOTICIA;
                 $parametros = array($titulo,$dt_cadastro,$periodo_indefinidoSN,$dt_inicio_publicacao,$dt_termino_publicacao,$tipo_fonte,
                                     $hiperlink_externo,$texto_resumido,$texto_completo,$fonte,$novidadeSN,$importanteSN,$vis_homeSN,$dest,$idIMG,$check_twitter, 0);
                */
                
$sql "INSERT INTO noticia (
                                NOT_Titulo,
                                NOT_DtCadastro,
                                NOT_PeriodoIndefinidoSN,
                                NOT_DtInicioPublicacao,
                                NOT_DtTerminoPublicacao,
                                NOT_TipoFonte,
                                NOT_HiperlinkExterno,
                                NOT_TextoResumido,
                                NOT_TextoCompleto,
                                NOT_Fonte,
                                NOT_NovidadeSN,
                                NOT_ImportanteSN,
                                NOT_VisualizacaoHomeSN,
                                NOT_DestaqueSN,
                                NOT_ImgDestaque_DR,
                                NOT_TwitterSN,
                                NOT_QtdeVisualizacoes)
                                VALUES ('"
.addslashes($titulo)."','".$dt_cadastro."','".$periodo_indefinidoSN."','".$dt_inicio_publicacao."','".trim($dt_termino_publicacao)."',
                                    '"
.$tipo_fonte."','".$hiperlink_externo."','".addslashes($texto_resumido)."','".addslashes($texto_completo)."','".$fonte."',
                                    '"
.$novidadeSN."','".$importanteSN."','".$vis_homeSN."','".$dest."','".$idIMG."','".$check_twitter."', '0')";
                 
$msg        "Notícia incluída com sucesso!";
                 break;
                            
        
// Alteração dos dados da notícia
        
case "U":
                
/*
                 $sql        = ALTERA_NOTICIA;
                 $tipo_dados = TIPO_DADOS_ALTERA_NOTICIA;
                 $parametros = array($titulo,$dt_cadastro,$periodo_indefinidoSN,$dt_inicio_publicacao,$dt_termino_publicacao,$tipo_fonte,
                                     $hiperlink_externo,$texto_resumido,$texto_completo,$fonte,$novidadeSN,$importanteSN,$vis_homeSN,$dest,$idIMG,$check_twitter,$cod_noticia);
                */
                
$sql "UPDATE noticia "
                            
" SET NOT_Titulo = '".addslashes($titulo)."',
                                NOT_DtCadastro = '
$dt_cadastro',
                                NOT_PeriodoIndefinidoSN = '
$periodo_indefinidoSN',
                                NOT_DtInicioPublicacao = '
$dt_inicio_publicacao', "
                             
"NOT_DtTerminoPublicacao = '$dt_termino_publicacao',
                                NOT_TipoFonte = '
$tipo_fonte',
                                NOT_HiperlinkExterno = '
$hiperlink_externo',
                                NOT_TextoResumido = '"
.addslashes($texto_resumido)."',
                                NOT_TextoCompleto = '"
.addslashes($texto_completo)."',"
                            
.  "NOT_Fonte = '$fonte',
                                NOT_NovidadeSN = '
$novidadeSN',
                                NOT_ImportanteSN = '
$importanteSN',
                                NOT_VisualizacaoHomeSN = '
$vis_homeSN',
                                NOT_DestaqueSN = '
$dest',
                                NOT_ImgDestaque_DR = '
$idIMG',
                                NOT_TwitterSN = '
$check_twitter'
                                WHERE NOT_RowID = 
$cod_noticia ";
                 
$msg        "Notícia alterada com sucesso!";  
                 break;
                  
        
// Ativação da notícia
        
case "A":
                
/*
                 $sql        = ATIVA_NOTICIA;
                 $tipo_dados = TIPO_DADOS_ATIVA_NOTICIA;
                 $parametros = array($cod_noticia);
                 */
                 
$sql "UPDATE noticia "
                           
"SET NOT_AtivoSN = 'S' "
                           
"WHERE NOT_RowID = $cod_noticia";
                 
$msg        "Notícia ativada com sucesso!"
                 break;
                  
        
// Inativação da notícia
        
case "IN":
                
/*
                  $sql        = INATIVA_NOTICIA;
                  $tipo_dados = TIPO_DADOS_INATIVA_NOTICIA;
                  $parametros = array($cod_noticia);
                  */
                  
$sql "UPDATE noticia "
                             
"SET NOT_AtivoSN = 'N' "
                             
"WHERE NOT_RowID = $cod_noticia";
                  
$msg        "Notícia inativada com sucesso!"
                  break;
    }

    
/*
    echo 'Stmt: '.$stmt.'<br />Tipo_dados: '.$tipo_dados.'<br />Parametros: <br />';
    echo '<pre>';
    print_r($parametros);
    echo '<pre>';
    //die();
    */
    //echo '<pre>'.$sql.'</pre>';
    //die();

    
if($conexao->query($sql)) {
        
        
$conexao->commit();
        
    } else {
        echo 
$conexao->error;
        
$erro true;          
        
$msg "Erro - " $conexao->error
    }         


    
/*
    if($stmt = $conexao->prepare($sql)) 
    {
        // Anexa os parâmetros na senteça sql
        $res = db_stmt_bind_param($stmt,$tipo_dados,$parametros);
         
       if($res)
       {
            // Executa a query
            $exec = $stmt->execute();
            
            if($exec)
            {  
                $stmt->close();                   
                $conexao->commit();
            }   
            else
            {
                $erro = true;  
                $msg = $stmt->error;
                $stmt->close();
            }           
        }
        else
        {       
            $erro = true;             
            $msg = "Erro"; 
        }
     }
    else
    {    
        $erro = true;          
        $msg = "Erro";  
    }  
    */
    
$parametros_url = array("msg" => "$msg");
    if(
$erro)
    {
        
$parametros_url["erro"] = "S";                                   
    }
      
    if(
in_array($acao,array("I","U")))
    {
        
Redireciona("noticia_cad.php",$parametros_url);
    }
    else
    {
        
Redireciona("../index.php",$parametros_url); 
    } 
    
?>


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0036 ]--