iis7 insert rewrite rule web.config

To insert a rewrite rule in to a web.config for deployment purposes you need to modify Web.Release.Config

Example <system.webServer> <rewrite xdt:Transform=”Insert”> <outboundRules> <rule name=”Add Cross Origin Access”> <match serverVariable=”RESPONSE_Access_Control_Allow_Origin” pattern=”.*” /> <conditions> <add input=”{REQUEST_URI}” pattern=”.*\.(ttf|otf|eot|woff|svg)\?*.*$” /> </conditions> <action type=”Rewrite” value=”*”/> </rule> </outboundRules> </rewrite> </system.webServer>

IIS 6.0 Add Host Headers in Bulk

IIS 6.0 Add Host Headers in Bulk

To add host headers in bulk (IIS 6.0) you will need these two scripts in C:\Inetpub\AdminScripts:

AppendHostHeaders.vbs chglist.vbs

Additionally you will need an input csv called “c:\sites.csv” that follows this format (id, sitename must be first line):

id, sitename 1, www.test.com 2042610413, www2.two.testing.com 2042610413, www2.two.www.test.com 1, www.testing.com Script: . . . → Read More: IIS 6.0 Add Host Headers in Bulk

Run IIS6 in 32 bit mode

To run IIS6 in 32bit mode you need to run these commands:

cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1 “C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe” -i

Howto: Print Site IDs to File in IIS

First create a file called c:\listsites.vbs with the following content:

OPTION EXPLICIT DIM CRLF, TAB DIM strServer DIM objWebService TAB = CHR( 9 ) CRLF = CHR( 13 ) & CHR( 10 ) IF WScript.Arguments.Length = 1 THEN strServer = WScript.Arguments( 0 ) ELSE strServer = “localhost” END IF WScript.Echo “Enumerating websites on ” & . . . → Read More: Howto: Print Site IDs to File in IIS

Howto: Migrate IIS Sites to Another Server

First you need to install the  IIS 6.0 Migration Tool

For each Web site and virtual directory on the source server, you must create a corresponding Web site and virtual directory on the target server. Later in the migration process, you will copy the content into these Web sites and virtual directories. Create the Web . . . → Read More: Howto: Migrate IIS Sites to Another Server

Howto: Change siteid of website in IIS 6.0

The easiest way to change the IIS site id is to create a .bat file like this: (Assuming that 1135282223 was the id of your current site and 5 was the ID you’d like to have)

CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs STOP_SERVER W3SVC/1135282223 CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs MOVE W3SVC/1135282223 W3SVC/5 CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs START_SERVER W3SVC/5

What is %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs ? It is . . . → Read More: Howto: Change siteid of website in IIS 6.0

Howto: Fix Microsoft IIS Internal IP Address Disclosure Vulnerability With Scripts

What is  IP Address Disclosure?

It is usually a bullshit “vulnerability” that firms will mention if they can’t find anything else to report

http://www.securityfocus.com/bid/1499/discuss

How do you fix it without wasting 10 years of your time?

First, we need to find out the site IDs for all the websites on a given windows server (i . . . → Read More: Howto: Fix Microsoft IIS Internal IP Address Disclosure Vulnerability With Scripts