Esempio n. 1
0
 public function __construct($detection = 'detected')
 {
     $this->unpacker = new AUnpacker();
     $this->unpacker->max_files = 10;
     $this->unpacker->r_levels = 1;
     $this->unpacker->outputDir = PathFinder::ensure(VIREX_TEMP_PATH . DIRECTORY_SEPARATOR . 'urls');
     $this->baseUrl = PathFinder::get(VIREX_INCOMING_PATH, $detection, 'urls');
 }
Esempio n. 2
0
 public function __construct()
 {
     $this->unpacker = new AUnpacker();
     $this->unpacker->outputDir = PathFinder::ensure(VIREX_TEMP_PATH . DIRECTORY_SEPARATOR . 'files');
     $this->unpacker->max_size = 80000;
     $this->unpacker->max_files = 50000;
     $this->unpacker->r_levels = 1;
 }
Esempio n. 3
0
 public function encrypt_buffer($buffer, $recp)
 {
     $gpghome = PathFinder::ensure(VIREX_TEMP_PATH . DIRECTORY_SEPARATOR . 'gnupg');
     $plaintext = tempnam(VIREX_TEMP_PATH, "Buffer");
     $encrypted = $plaintext . ".gpg";
     $fout = fopen($plaintext, "w");
     fwrite($fout, $buffer);
     fclose($fout);
     $command = 'gpg --batch --pgp2 --no-tty --homedir=' . $gpghome . ' --always-trust --no-secmem-warning -e -r "' . $recp . '" ' . $plaintext;
     $result = exec($command, $output, $errorcode);
     if (!file_exists($encrypted)) {
         die("ERROR! => Error encrypting buffer!");
     }
     $encrypted_buffer = file_get_contents($encrypted);
     @unlink($plaintext);
     @unlink($encrypted);
     return $encrypted_buffer;
 }
Esempio n. 4
0
 function exec_gpg($command)
 {
     $tempd = PathFinder::ensure(VIREX_TEMP_PATH . DIRECTORY_SEPARATOR . 'gpg');
     $gpghome = PathFinder::ensure(VIREX_TEMP_PATH . DIRECTORY_SEPARATOR . 'gnupg');
     $file = uniqid('file_');
     $descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("file", "{$tempd}/{$file}.txt", "w"));
     //        $process = proc_open('gpg --always-trust --no-secmem-warning ' . $command, $descriptorspec, $pipes, $tempd);
     $process = proc_open('gpg --always-trust --no-secmem-warning --no-tty --homedir=' . $gpghome . ' ' . $command, $descriptorspec, $pipes, $tempd);
     if (is_resource($process)) {
         proc_close($process);
     }
     $response = file_get_contents("{$tempd}/{$file}.txt");
     unlink("{$tempd}/{$file}.txt");
     return $response;
 }