#!/usr/bin/env php &1', ]; exec(implode(' ', $cmd), $out, $ret); if ($ret) { printf("Error: %d\n", $ret); return 2; } foreach($out as $line) { $sp = explode('@', $line); if (count($sp) < 5) { continue; } $opcode = $sp[4]; // # ,line, #, EIO, op, fetch, ext, return, operands if ($opcode && !in_array($opcode, $whitelist)) { printf("Upload_validation: Found an opcode: %s\n", $opcode); return 1; } } return 0; } if ($_SERVER['argc'] != 2) { die("Usage: {$_SERVER['argv']['0']} file_to_test.php\n"); } exit(check($_SERVER['argv']['1']));