473,386 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using extensions other than .aspx?

I would like to use something like .x rather than .aspx for my asp.net
projects. One reason is, I'd rather everyone not know what
language/platform our projects are written in. (I like security AND
obscurity on our site.) Right now it is trivial to use Google to find
all pages using asp.net, with a google search for .aspx files. If an
exploit comes out for .net stuff, Google becomes a hacker's tool to
locate pages to exploit quite easily. (Witness the recent PHP/bb
exploit recently.)

Anyway, I've renamed one of my index.aspx files to index.x, I added the
..x association in IIS to load the aspnet_isapi.dll, I created a file
association for .x in my filesystem that is exactly like the one for
..aspx. I restarted IIS completely.

However, when trying to hit the .x page, it simply downloads the
contents of the page, it doesn't execute it on the server. The only
line in the .x file is:

<%@ Page language="c#" Codebehind="index.aspx.cs"
AutoEventWireup="false" Inherits="view.index" %>

(I did leave the .cs file named index.aspx.cs.)

And in VS.net 2003, it does not see the .x file as anything special,
even though the file system recognizes the file as an "ASP.NET Server
Page."

Has anyone got this to work?

Thanks!

Jul 21 '05 #1
4 2759
I saw a thread on the same topic where someone made a very valid remark :
the HTML code created by ASP.NET is quite recognizable. Even if you can hide
the extension, viewsource is likely to reveal you are using ASP.NET...

Patrice

--

"Thomas" <to*******@gmail.com> a écrit dans le message de
news:11**********************@o13g2000cwo.googlegr oups.com...
I would like to use something like .x rather than .aspx for my asp.net
projects. One reason is, I'd rather everyone not know what
language/platform our projects are written in. (I like security AND
obscurity on our site.) Right now it is trivial to use Google to find
all pages using asp.net, with a google search for .aspx files. If an
exploit comes out for .net stuff, Google becomes a hacker's tool to
locate pages to exploit quite easily. (Witness the recent PHP/bb
exploit recently.)

Anyway, I've renamed one of my index.aspx files to index.x, I added the
.x association in IIS to load the aspnet_isapi.dll, I created a file
association for .x in my filesystem that is exactly like the one for
.aspx. I restarted IIS completely.

However, when trying to hit the .x page, it simply downloads the
contents of the page, it doesn't execute it on the server. The only
line in the .x file is:

<%@ Page language="c#" Codebehind="index.aspx.cs"
AutoEventWireup="false" Inherits="view.index" %>

(I did leave the .cs file named index.aspx.cs.)

And in VS.net 2003, it does not see the .x file as anything special,
even though the file system recognizes the file as an "ASP.NET Server
Page."

Has anyone got this to work?

Thanks!

Jul 21 '05 #2
That is good to know, however we rarely use ASP.NET HTML output, we
mostly output XML. But more importantly, we're not trying to prevent
someone from ever figuring out what we're using, we would just like to
stay out of Google results for "aspx" searches to help mitigate
exploits a bit.

Jul 21 '05 #3
I have figured out half of the problem... I now have IIS executing my
..x files as ASP.NET files. However, despite a bunch of registry changes
that I've read about, I cannot get VS.NET to fully accept my .x files
as .aspx file replacements. It seems to at least recognize them as
"HTML-like" files, but when right-clicking on the file, there is no
option to "View Code." This is crucial to get working, or it will be a
real PITA to work with this code in VS.net.

So here is what I learned, for anyone else that is interested.

1. To get your .x extension to work in IIS, you not only need to add a
..x mapping to the aspnet_isapi.DLL in the home directory configuration
area, you also need to edit machine.config (located in the
c:\windows\microsoft.net\framework\<version>\confi g directory) so that
it has a "handler" reference for your .x files which matches the one it
already has for .aspx. Look for "httpHandlers" and then add this line
near .aspx (for convenenience):

<add verb="*" path="*.x" type="System.Web.UI.PageHandlerFactory"/>

Restart IIS using "iisreset /restart" and your .x files should load
just like .aspx files.

2. The following registry entries were added by me, based on
where I found aspx already in the registry, and seem to help VS.NET and
windows recognize the .x files a bit, but like I said above, it still
won't show "View Code" or similar options for .x files in VS.NET.
(Note: These changes correspond to
VS.net 2003 and .NET framework 1.1.4322. Don't blindly make these
changes. Back up your registry. Yadda yadda yadda.)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio \7.1\Languages\File
Extensions\.x]
@="{58E975A0-F8FE-11D2-A6AE-00104BCC7269}"
"unused"="HTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio \7.1\Editors\{8281C572-2171-45AA-A642-7D8BC1662F1C}\Extensions]

"x"=dword:00000027

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio \7.1\Editors\{57312C73-6202-49E9-B1E1-40EA1A6DC1F6}\Extensions]
"aspx"=dword:00000028
"x"=dword:00000028

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio \7.1\Projects\{CB4CE8C6-1BDB-4dc7-A4D3-65A1999772F8}\FileExtensions\.x]
"EditorFactoryNotify"="{57312C73-6202-49e9-B1E1-40EA1A6DC1F6}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio \7.1\Projects\{E6FDF86B-F3D1-11D4-8576-0002A516ECE8}\FileExtensions\.x]
"EditorFactoryNotify"="{57312C73-6202-49e9-B1E1-40EA1A6DC1F6}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio \7.1\Projects\{F184B08F-C81C-45f6-A57F-5ABD9991F28F}\FileExtensions\.x]
"EditorFactoryNotify"="{57312C73-6202-49e9-B1E1-40EA1A6DC1F6}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio \7.1\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}\FileExtensions\.x]
"EditorFactoryNotify"="{57312C73-6202-49e9-B1E1-40EA1A6DC1F6}"

[HKEY_USERS\S-1-5-21-1496065579-1245650880-2130403006-500\Software\Microsoft\Windows\CurrentVersion\Expl orer\FileExts\.x\OpenWithProgids]
"aspxfile"=hex(0):
"VisualStudio.aspx.7.1"=hex(0):

[HKEY_CLASSES_ROOT\.x]
"PerceivedType"="text"
@="VisualStudio.aspx.7.1"

[HKEY_CLASSES_ROOT\.x\OpenWithList]

[HKEY_CLASSES_ROOT\.x\OpenWithList\devenv.exe]
@=""

[HKEY_CLASSES_ROOT\.x\OpenWithProgids]

[HKEY_CLASSES_ROOT\.x\OpenWithProgids\aspxfile]
@=""

[HKEY_CLASSES_ROOT\.x\OpenWithProgids\VisualStudio. aspx.7.1]
@=""

[HKEY_CLASSES_ROOT\.x\PersistentHandler]
@="{eec97550-47a9-11cf-b952-00aa0051fe20}"
If anyone knows what other changes are necessary to get VS.NET to
accept new asp.net file extensions, please let me know.

Jul 21 '05 #4
After further investigation and after trying the VS.NET "power tools"
that claim to be able to add custom extensions to VS.NET 2003, I have
found that this is in fact not really possible. I even found some posts
from Microsofties saying that it might be possible in VS.NET 2005...

yay.

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: nospam | last post by:
I got three (3) files (1) Untitled.aspx (2) Untitled.aspx.1.cs (3) Untitled.aspx.2.cs These three files must be used together to make file #1, Untitled.aspx, page work via J.I.T. when the...
3
by: Tech Witch | last post by:
Does anyone know of a quick reference I could provide to the it security folks at my work that outlines what file extensions, ports, and dll's sql server uses? They've gone hog wild with...
6
by: Guest | last post by:
Hi, I unerstand that if you choose IIS to host your .Net Remotingcomponents with HTTP channel and SOAP formatter, you get thebuilt-in security and configuraion features of IIS. Also we canexpose it...
3
by: Johnny | last post by:
Hi, I have created an ASP.NET application (let's call it FooBar) with VS.NET on my local machine, residing in http://localhost/FooBar. Deploying it to another folder on my machine works well...
3
by: Thomas | last post by:
I would like to use something like .x rather than .aspx for my asp.net projects. One reason is, I'd rather everyone not know what language/platform our projects are written in. (I like security AND...
42
by: (PeteCresswell) | last post by:
I skimmed the MS spiel at http://msdn.microsoft.com/sql/express, and noted the part about "all inside the Visual Studio 2005 environment". Do the older SQL server tools for security and stored...
2
by: JT | last post by:
Hi, I apologize if this is posted in the wrong group or if this has been covered in the past. I didn't find anything in previous posts. I'm wondering how far the influence of the frontpage...
4
by: Grant Merwitz | last post by:
Hi I am trying to implement the Microsoft Ajax.NET extensions to perform a lookup on a key press of a text box. What this will do is once a user enters a letter into the textbox, this will...
8
by: =?Utf-8?B?RGFuTQ==?= | last post by:
Can someone help with the following problem. I am sending an encrypted SOAP message to a .NET 2.0 + WSE 3.0 web service. When .NET attempts to decrypt the message it cannot read the private key...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.