R2i DotNetNuke Blog

 

Understand Your Server Security: Microsoft IIS ASP Multiple Extensions Security Bypass

Saturday, April 03, 2010 by Kevin M Schreiner

Media: View the Video | Download the Samples

When you are done, check out the next post which provides a more universal solution regardless of where your site is hosted. Part 2 - A Real Solution for Microsoft IIS ASP Multiple Extensions Security Bypass

The purpose of this Video is to provide a bit more exposure and coverage of a severe and *long term* flaw which has existed within the Microsoft based web hosting service - IIS for a very long time, which only recently has been uncovered.

Known in small circles with no apparent broad public announcement as the the cryptic "Microsoft IIS ASP Multiple Extensions Security Bypass", this flaw allows any user who has the ability to upload a file to your server, the ability to attack that server, or in worse cases, make that server a drone in a very short length of time.

This video is meant to act as an understanding of the flaw, and most importantly demonstrate how to correct the issue. While the fix is simple to conduct, you must considera few specific topics which could cause residual issues in the future. The video will also demonstrate a possible residual issue and give you a bit more understanding of what to look for if you have been compromised.

First and foremost, let's take a look at the scenario. In this case, our website, running on Microsoft Windows Server 2003 R2 SP2, with IIS 6, provides a public wiki, allowing any registered user to provide content and updates.

In this case you see an ordinary File Input element on the site, not so ominous - right? The developers have been careful in this case to not allow a user to upload malicious extensions, settling on allowing only known images and text file extensions. As seen in this demonstration.

So, it won't let me upload the "Flawed.asp" file, because quite frankly that would be really bad as it is a known Script file extension!

But what happens if the file extension is the correct type?

Let's rename this first file, "Flawed.asp" to "Flawed.asp;image.jpg". As seen here I have appended a graphic filename preceeded by a semicolon to the original asp extension. Hence the "Multiple Extensions Security Bypass" label.

Now when I upload, you can see that the server allows me to perform the upload with ease!

Okay great, so I uploaded an Image, no harm no foul - afterall, Windows 7 detects the correct Icon and File type based on the name I just gave it locally right? Wrong - while my local environment is show it properly, the Windows Server reads the first half of the filename, the one ending with .asp and executes the Active Server Pages handler for the extension. If I hit the link, you can see that the file is executed!

Uh, oh. Now what? Well, consider the following demonstration files in sequencial order.

  1. Obtain the security credentials to access the database. This can be done by reading the contents of the web.config file. Sample file: MyWebConfig.asp
  2. With the retreived credentials, access the database. In this case I select the userid and username for the top 50 users in my site.

With the knowledge to conduct queries in the database, I could easily provide myself a textbox to now just ream the server with query after query, obtaining any peice of information I desire.

Now, as I mentioned there is a quick and simple way to plug the hole, taking only a few seconds. But, as I mentioned there may be some residual issues. This is demonstrated by the third example: Trojan.asp. If I stop the server from executing ASP pages, what stops me from creating my own ASPX page long before the hole is plugged? Trojan.asp generates a root file named "Verify.aspx", which when executed as seen here, allows me to pass a username via the url into the page. Knowing how the target server processes the Authentication logic, I am able to authenticate the user with full Super User permissions. Now, after the hole is plugged, I can still return to the site at any time.

Fixing the hole, as mentioned is simple, and can be performed in two ways:

  1. Prohibiting ASP pages from executing globally across the server. To do this just navigate to the Web Server and click the "Web Service Extensions" folder. Then, after selecting Active Server Pages, click Prohibit. This stops the problem from happening entirely.



  2. If you must allow Legacy ASP code (even though I would love to talk you into abandoning it entirely), you can disable script execution at a folder level on each folder which will allow user uploads. Do this by navigating to the folder in IIS. Right Clicking the file to get to the Properties, and then setting Execute Permissions to None.

Before you run around screaming that the sky is falling, use the provided tools to see if your server is allowing the ASP pages to execute. I recommend testing first by just copying the files into the server and hitting them. Because, while you may think you know every place file uploads are allowed on your front ends, you may be mistaken or you may have had a problem in a previous version of your site which did allow the ASP pages to be uploaded in this fashion. Knowledge is power, and this specific knowledge is far more powerful in your hands than in the hands of someone who might want to do you harm.

 
Comments

2500 characters remaining

Add Comment
Recent Comments

February 09, 2011

August 31, 2010

[url=http://www.nfl4sale.com/Indiana-Pacers-jerseys-79.htm]Indiana Pacers[/url]
[url=http://www.nfl4sale.com/Los-Angeles-Clippers-jerseys-80.htm]Los Angeles Clippers[/url]
[url=http://www.nfl4sale.com/Los-Angeles-Lakers-jerseys-81.htm]Los Angeles Lakers[/url]
[url=http://www.nfl4sale.com/Memphis-Grizzlies-jerseys-82.htm]Memphis Grizzlies[/url]
[url=http://www.nfl4sale.com/Miami-Heat-jerseys-83.htm]Miami Heat[/url]
[url=http://www.nfl4sale.com/Milwaukee-Bucks-jerseys-84.htm]Milwaukee Bucks[/url]
[url=http://www.nfl4sale.com/Minnesota-Timberwolves-jerseys-85.htm]Minnesota Timberwolves[/url]
[url=http://www.nfl4sale.com/New-Jersey-Nets-jerseys-86.htm]New Jersey Nets[/url]
[url=http://www.nfl4sale.com/New-Orleans-Hornets-jerseys-87.htm]New Orleans Hornets[/url]
[url=http://www.nfl4sale.com/New-York-Knicks-jerseys-88.htm]New York Knicks[/url]
[url=http://www.nfl4sale.com/Orlando-Magic-jerseys-89.htm]Orlando Magic[/url]
[url=http://www.nfl4sale.com/Philadelphia-76ers-jerseys-90.htm]Philadelphia 76ers[/url]
[url=http://www.nfl4sale.com/Phoenix-Suns-jerseys-91.htm]Phoenix Suns[/url]
[url=http://www.nfl4sale.com/Portland-Trail-Blazers-jerseys-92.htm]Portland Trail Blazers[/url]
[url=http://www.nfl4sale.com/Sacramento-Kings-jerseys-93.htm]Sacramento Kings[/url]
[url=http://www.nfl4sale.com/San-Antonio-Spurs-jerseys-94.htm]San Antonio Spurs[/url]
[url=http://www.nfl4sale.com/Seattle-SuperSonics-jerseys-95.htm]Seattle SuperSonics[/url]
[url=http://www.nfl4sale.com/Toronto-Raptors-jerseys-96.htm]Toronto Raptors[/url]
[url=http://www.nfl4sale.com/Utah-Jazz-jerseys-97.htm]Utah Jazz[/url]
[url=http://www.nfl4sale.com/Washington-Wizards-jerseys-98.htm]Washington Wizards[/url]

August 31, 2010

[url=http://www.nfl4sale.com/Super-Bowl-Merchandise-jerseys-33.htm]Super Bowl Merchandise[/url]
[url=http://www.nfl4sale.com/Super-Bowl-XLII-Gear-jerseys-34.htm]Super Bowl XLII Gear[/url]
[url=http://www.nfl4sale.com/Tampa-Bay-Buccaneers-jerseys-35.htm]Tampa Bay Buccaneers[/url]
[url=http://www.nfl4sale.com/Tennessee-Titans-jerseys-36.htm]Tennessee Titans[/url]
[url=http://www.nfl4sale.com/Washington-Redskins-jerseys-37.htm]Washington Redskins[/url]
[url=http://www.nfl4sale.com/Miami-Dolphins-jerseys-99.htm]Miami Dolphins[/url]
[url=http://www.nfl4sale.com/MLB-jerseys-2.htm]MLB[/url]
[url=http://www.nfl4sale.com/Arizona-Diamondbacks-jerseys-38.htm]Arizona Diamondbacks[/url]
[url=http://www.nfl4sale.com/Atlanta-Braves-jerseys-39.htm]Atlanta Braves[/url]
[url=http://www.nfl4sale.com/Baltimore-Orioles-jerseys-40.htm]Baltimore Orioles[/url]
[url=http://www.nfl4sale.com/Boston-Red-Sox-jerseys-41.htm]Boston Red Sox[/url]
[url=http://www.nfl4sale.com/Chicago-Cubs-jerseys-42.htm]Chicago Cubs[/url]
[url=http://www.nfl4sale.com/Chicago-White-Sox-jerseys-43.htm]Chicago White Sox[/url]
[url=http://www.nfl4sale.com/Cincinnati-Reds-jerseys-44.htm]Cincinnati Reds[/url]
[url=http://www.nfl4sale.com/Cleveland-Indians-jerseys-45.htm]Cleveland Indians[/url]
[url=http://www.nfl4sale.com/Colorado-Rockies-jerseys-46.htm]Colorado Rockies[/url]
[url=http://www.nfl4sale.com/Detroit-Tigers-jerseys-47.htm]Detroit Tigers[/url]
[url=http://www.nfl4sale.com/Florida-Marlins-jerseys-48.htm]Florida Marlins[/url]
[url=http://www.nfl4sale.com/Houston-Astros-jerseys-49.htm]Houston Astros[/url]
[url=http://www.nfl4sale.com/Kansas-City-Royals-jerseys-50.htm]Kansas City Royals[/url]
[url=http://www.nfl4sale.com/L.A.-Dodgers-jerseys-51.htm]L.A. Dodgers[/url]
[url=http://www.nfl4sale.com/Los-Angeles-Angels-of-Anaheim-jerseys-52.htm]Los Angeles Angels of Anaheim[/url]
[url=http://www.nfl4sale.com/Milwaukee-Brewers-jerseys-53.htm]Milwaukee Brewers[/url]
[url=http://www.nfl4sale.com/Minnesota-Twins-jerseys-54.htm]Minnesota Twins[/url]
[url=http://www.nfl4sale.com/New-York-Mets-jerseys-55.htm]New York Mets[/url]

August 31, 2010

[url=http://www.nfl4sale.com/NFL-jerseys-1.htm]NFL[/url]
[url=http://www.nfl4sale.com/Arizona-Cardinals-jerseys-4.htm]Arizona Cardinals[/url]
[url=http://www.nfl4sale.com/Atlanta-Falcons-jerseys-5.htm]Atlanta Falcons[/url]
[url=http://www.nfl4sale.com/Baltimore-Ravens-jerseys-6.htm]Baltimore Ravens[/url]
[url=http://www.nfl4sale.com/Buffalo-Bills-jerseys-7.htm]Buffalo Bills[/url]
[url=http://www.nfl4sale.com/Carolina-Panthers-jerseys-8.htm]Carolina Panthers[/url]
[url=http://www.nfl4sale.com/Chicago-Bears-jerseys-9.htm]Chicago Bears[/url]
[url=http://www.nfl4sale.com/Cincinnati-Bengals-jerseys-10.htm]Cincinnati Bengals[/url]
[url=http://www.nfl4sale.com/Cleveland-Browns-jerseys-11.htm]Cleveland Browns[/url]
[url=http://www.nfl4sale.com/Dallas-Cowboys-jerseys-12.htm]Dallas Cowboys[/url]
[url=http://www.nfl4sale.com/Denver-Broncos-jerseys-13.htm]Denver Broncos[/url]
[url=http://www.nfl4sale.com/Detroit-Lions-jerseys-14.htm]Detroit Lions[/url]
[url=http://www.nfl4sale.com/Green-Bay-Packers-jerseys-15.htm]Green Bay Packers[/url]
[url=http://www.nfl4sale.com/Houston-Texans-jerseys-16.htm]Houston Texans[/url]
[url=http://www.nfl4sale.com/Indianapolis-Colts-jerseys-17.htm]Indianapolis Colts[/url]
[url=http://www.nfl4sale.com/Kansas-City-Chiefs-jerseys-19.htm]Kansas City Chiefs[/url]
[url=http://www.nfl4sale.com/Minnesota-Vikings-jerseys-21.htm]Minnesota Vikings[/url]
[url=http://www.nfl4sale.com/New-England-Patriots-jerseys-22.htm]New England Patriots[/url]
[url=http://www.nfl4sale.com/New-Orleans-Saints-jerseys-23.htm]New Orleans Saints[/url]
[url=http://www.nfl4sale.com/New-York-Giants-jerseys-24.htm]New York Giants[/url]
[url=http://www.nfl4sale.com/New-York-Jets-jerseys-25.htm]New York Jets[/url]
[url=http://www.nfl4sale.com/Oakland-Raiders-jerseys-26.htm]Oakland Raiders[/url]
[url=http://www.nfl4sale.com/Philadelphia-Eagles-jerseys-27.htm]Philadelphia Eagles[/url]
[url=http://www.nfl4sale.com/Pittsburgh-Steelers-jerseys-28.htm]Pittsburgh Steelers[/url]
[url=http://www.nfl4sale.com/San-Diego-Chargers-jerseys-29.htm]San Diego Chargers[/url]
[url=http://www.nfl4sale.com/San-Francisco-49ers-jerseys-30.htm]San Francisco 49ers[/url]
[url=http://www.nfl4sale.com/Seattle-Seahawks-jerseys-31.htm]Seattle Seahawks[/url]
[url=http://www.nfl4sale.com/St.-Louis-Rams-jerseys-32.htm]St. Louis Rams[/url]

August 26, 2010


[url=http://www.salegucci.net/]gucci outlet[/url]
[url=http://www.salegucci.net/]gucci bags[/url]
[url=http://www.salegucci.net/]sale gucci[/url]
[url=http://www.salegucci.net/]gucci handbags[/url]
[url=http://www.salegucci.net/]gucci store[/url]


[url=http://www.salegucci.net/Gucci_Abbey_Bags.html]Gucci Abbey Bags[/url]
[url=http://www.salegucci.net/Gucci_Belt.html]Gucci Belt[/url]
[url=http://www.salegucci.net/Gucci_Belt_Bags.html]Gucci Belt Bags[/url]
[url=http://www.salegucci.net/Gucci_Boston_Bags.html]Gucci Boston Bags[/url]
[url=http://www.salegucci.net/Gucci_Canvas_Bags.html]Gucci Canvas Bags[/url]
[url=http://www.salegucci.net/Gucci_Crystal_Bags.html]Gucci Crystal Bags[/url]
[url=http://www.salegucci.net/Gucci_D_Gold_Bags.html]Gucci D Gold Bags[/url]
[url=http://www.salegucci.net/Gucci_hats.html]Gucci hats[/url]
[url=http://www.salegucci.net/Gucci_Indy_Handbags.html]Gucci Indy Handbags[/url]
[url=http://www.salegucci.net/Gucci_Jolicoeur_Bags.html]Gucci Jolicoeur Bags[/url]
[url=http://www.salegucci.net/Gucci_Joy_Bags.html]Gucci Joy Bags[/url]
[url=http://www.salegucci.net/Gucci_Leather_Bags.html]Gucci Leather Bags[/url]
[url=http://www.salegucci.net/Gucci_Mens_Bags.html]Gucci Mens Bags[/url]
[url=http://www.salegucci.net/Gucci_Messenger_Bags.html]Gucci Messenger Bags[/url]
[url=http://www.salegucci.net/Gucci_New_Jackie_Bags.html]Gucci New Jackie Bags[/url]
[url=http://www.salegucci.net/Gucci_Pelham_Bags.html]Gucci Pelham Bags[/url]
[url=http://www.salegucci.net/Gucci_Positano_&_Hysteria.html]Gucci Positano & Hysteria[/url]
[url=http://www.salegucci.net/Gucci_Princy_&_Britt_Bags.html]Gucci Princy & Britt Bags[/url]
[url=http://www.salegucci.net/Gucci_Shoulder_Bags.html]Gucci Shoulder Bags[/url]
[url=http://www.salegucci.net/Gucci_Sunglasses.html]Gucci Sunglasses[/url]
[url=http://www.salegucci.net/Gucci_Tote.html]Gucci Tote[/url]
[url=http://www.salegucci.net/Gucci_Travel_Business_Bags.html]Gucci Travel Business Bags[/url]
[url=http://www.salegucci.net/Gucci_Jewelry.html]Gucci Jewelry[/url]
[url=http://www.salegucci.net/Gucci_Wallets.html]Gucci Wallets[/url]

August 06, 2010

Our website carries on the large-scale sales activity, welcome you to patronize greatly, you will obtain very big pleasantly
<a href="http://www.maslou.com" title="louis vuitton">louis vuitton</a>
<a href="http://www.maslou.com" title="replica handbags">replica handbags</a>
<a href="http://www.maslou.com" title="lv">lv</a>
<a href="http://www.maslou.com" title="louis vuitton bags">louis vuitton bags</a>
<a href="http://www.maslou.com" title="louis vuitton handbags">louis vuitton handbags</a>
<a href="http://www.maslou.com/specials.html" title="discount handbags">discount handbags</a>
<a href="http://www.maslou.com/products_all.html" title="lv">lv</a>
<a href="http://www.maslou.com/specials.html" title="discount handbags">discount handbags</a>
<a href="http://www.maslou.com/products_new.html" title="louis vuitton bags">louis vuitton bags</a>
<a href="http://www.maslou.com/blog" title="louis vuitton blog">louis vuitton blog</a>

<a href="http://www.louisvuittonbagss.com" title="louis vuitton">louis vuitton</a>
<a href="http://www.louisvuittonbagss" title="replica handbags">replica handbags</a>
<a href="http://www.louisvuittonbagss" title="lv">lv</a>
<a href="http://www.louisvuittonbagss" title="louis vuitton bags">louis vuitton bags</a>
<a href="http://www.louisvuittonbagss" title="louis vuitton handbags">louis vuitton handbags</a>
<a href="http://www.louisvuittonbagss/specials.html" title="discount handbags">discount handbags</a>
<a href="http://www.louisvuittonbagss/products_all.html" title="lv">lv</a>
<a href="http://www.louisvuittonbagss/specials.html" title="discount handbags">discount handbags</a>
<a href="http://www.louisvuittonbagss/products_new.html" title="louis vuitton bags">louis vuitton bags</a>

<a href="http://www.we2shoes.com" title="christian louboutin">christian louboutin</a>
<a href="http://www.we2shoes.com" title="louboutin">louboutin</a>
<a href="http://www.we2shoes.com" title="christian louboutin shoes">christian louboutin shoes</a>
<a href="http://www.we2shoes.com" title="louboutin shoes">louboutin shoes</a>
<a href="http://www.we2shoes.com" title="bridal shoes">bridal shoes</a>
<a href="http://www.we2shoes.com" title="sexy shoes">sexy shoes</a>
<a href="http://www.we2shoes.com" title="high heels shoes">high heels shoes</a>

<a href="http://www.guccishopping.com" title="ed hardy">ed hardy</a>
<a href="http://www.guccishopping.com" title="ed hardy clothing">ed hardy clothing</a>
<a href="http://www.guccishopping.com" title="ed hardy s

Kevin M Schreiner April 03, 2010

Thanks, I'm working on providing some additional Best Practices specifically for resolving the problem.

5 April 03, 2010

Very interesting, I had heard of the possible issues noted in the past regarding unauthenticated users and file uploads, but I didnt realize or consider this issue for sites which allow users to register and then upload. For me, I see no difference between unauthenticated, and newly registered. Thanks!
 

Most Discussed

 

Subscribe to our blog

 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share