shell bypass 403

GrazzMean Shell

Uname: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
Software: Apache
PHP version: 5.6.40 [ PHP INFO ] PHP os: Linux
Server Ip: 217.160.0.194
Your Ip: 216.73.217.65
User: u72294154 (9179942) | Group: ftpusers (600)
Safe Mode: OFF
Disable Function:
NONE

name : Cliente.php
<?

App::uses('Provincia', 'Model');
App::uses('Localidad', 'Model');
App::uses('Inmueble', 'Model');

class Cliente extends AppModel {

    public $validate = array(
        'nombre' => array(
            'required' => array(
                'rule' => 'notEmpty',
                'message' => 'Nombre requerido'
            ),
        ),
        'email' => array(
            'email' => array(
                'allowEmpty' => true,
                'rule' => array('email', true),
                'message' => 'Formato de email incorrecto'
            ),
        ),
        'telefono' => array(
            'min_length' => array(
                'allowEmpty' => true,
                'rule' => array('minLength', '6'),
                'message' => 'El teléfono ha de tener un mínimo 6 dígitos',
            )
        ),
    );
    public $provincia;
    public $localidad;

    public function checkExist($check) {
        $elemento = null;
        $campo = key($check);
        switch ($campo) {
            case 'provincia_id':
                $elementos = new Provincia();
                $elemento = $elementos->findById($this->data[$this->name][$campo]);

                if (!empty($elemento)) {
                    $this->provincia = $elemento;
                }
                break;
            case 'localidad_id':
                $elementos = new Localidad();
                if (!empty($this->data[$this->name]['provincia_id'])) { //provincia marcada
                    $elemento = $elementos->findByIdAndProvinciaId($this->data[$this->name][$campo], $this->data[$this->name]['provincia_id']);
                } else {
                    $elemento = $elementos->findById($this->data[$this->name][$campo]);
                }

                if (!empty($elemento)) {
                    $this->localidad = $elemento;
                }
                break;
        }

        if (empty($elemento)) {
            return false; //error
        }

        return true; //ok
    }

    public function afterSave($created, $options = array()) {
        parent::afterSave($created, $options);
        
        $entidad = $this->findById($this->id);
        if (!empty($entidad)) {
            $this->getVars($entidad); //obtenemos los valores de otras entidades para no repetir las consultas constantemente
            $db = $this->getDataSource();
            $this->updateAll(array(
                'busqueda' => $db->value($this->getBusqueda($entidad), 'string'),
                    ), array($this->name . '.id' => $this->id));
        }
    }

    private function getVars($entidad) {
        //Provincia
        if (empty($this->provincia) && !empty($entidad[$this->name]['provincia_id'])) {
            $elementos = new Provincia();
            $elemento = $elementos->findById($entidad[$this->name]['provincia_id']);

            if (!empty($elemento)) {
                $this->provincia = $elemento;
            }
        }

        //Localidad
        if (empty($this->localidad) && !empty($entidad[$this->name]['localidad_id'])) {
            $elementos = new Localidad();
            $elemento = $elementos->findById($entidad[$this->name]['localidad_id']);

            if (!empty($elemento)) {
                $this->localidad = $elemento;
            }
        }
    }

    private function getBusqueda($entidad) {
        $busqueda = array();

        //Provincia
        if (!empty($this->provincia)) {
            $busqueda[] = $this->provincia['Provincia']['nombre'];
        }

        //Localidad
        if (!empty($this->localidad)) {
            $busqueda[] = $this->localidad['Localidad']['nombre'];
        }

        //Texto
        if (!empty($entidad[$this->name]['texto'])) {
            $busqueda[] = strip_tags($entidad[$this->name]['texto']);
        }

        //Resto de campos para la búsqueda
        $busqueda[] = $entidad[$this->name]['nombre'];
        $busqueda[] = $entidad[$this->name]['email'];
        $busqueda[] = $entidad[$this->name]['empresa'];
        $busqueda[] = $entidad[$this->name]['nif'];
        $busqueda[] = $entidad[$this->name]['direccion'];
        $busqueda[] = $entidad[$this->name]['cp'];
        $busqueda[] = $entidad[$this->name]['telefono'];
        $busqueda[] = $entidad[$this->name]['movil'];

        return $this->generarBusqueda($busqueda);
    }

    public function beforeDelete($cascade = true) {
        parent::beforeDelete($cascade);
        
        //Eliminamos la relación existen entre el cliente y todos sus inmuebles
        $elementos = new Inmueble();
        $elementos->updateAll(array('cliente_id' => null), array('Inmueble.cliente_id' => $this->id));
    }

}
© 2026 GrazzMean