473,511 Members | 10,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

understanding .NET security

I think that I start to understand this .NET security.

Basically it comes to this:

* You use strong names in the dll and exe, so the application user must
configure this application with key one time that it can be trusted.
Similar like ActiveX but no dialog box is shown.

* The program tells the JIT compiler what rights it need.
For example, a clock would not need file access, so it could tell the JIT
that it does not use the FileIOPermission for file access.
This way, a hacker cannot misuse this clock program to write a file to
the windows folder.

Jul 21 '05 #1
1 1806
> I think that I start to understand this .NET security.

Basically it comes to this:

* You use strong names in the dll and exe, so the application user must
configure this application with key one time that it can be trusted.
Similar like ActiveX but no dialog box is shown.

* The program tells the JIT compiler what rights it need.
For example, a clock would not need file access, so it could tell the JIT that it does not use the FileIOPermission for file access.
This way, a hacker cannot misuse this clock program to write a file to
the windows folder.


And I must add these hints too

* You need a .config file at the same location of the exe file and the used
dll's to
make .NET be able to find the newly provided dll's.
I have been fighting some problems with the JIT compiler incorrectly
claming that
he did not find the correct dll, while they were just right there.

* If one of these dll's uses the dynamic MFC dll's then add these to the
folder too.
(mfc70.dll, msvcp70.dll and msvcr70.dll for VC++ 2002)
Do not expect that MFC is installed on that machine.
(The odd thing is that .NET 1.0 have these dll's in it's folder, but
apparently does
not put this in a search path.

* Put something like this to your main() in order to see why the pogram
crashes.
try {
Application.Run(new Form1());
} catch (SecurityException e) {
MessageBox.Show("Not enough security rights to run this
program!\r\r"+e.ToString()+"\r\rThis program will now terminate!",
"ctRepair: Security
error",MessageBoxButtons.OK,MessageBoxIcon.Error);
} catch (Exception e) {
MessageBox.Show("This program caused an unknown
exception!\r\r"+e.ToString()+"\r\rThis program will now terminate!",
"ctRepair: Unknown
exception",MessageBoxButtons.OK,MessageBoxIcon.Err or);
}

* Use Microsoft FxCop to inspect your .NET created DLL's if they are
reusable for other languages.
This program helped me a lot to help port my code.

* Add this to your assembly file (C# example) if you are porting existing
unmanaged C++ code to managed code.
It gives too much security rights but at least the code runs like an
older .exe program, and can be started from a
network driver, open network folder, read/write the registery and access
any folder on your local machine....
In a next stage you can start revoking these righst step by step.

using System;
using System.Security;
using System.Security.Permissions;

[assembly:SecurityPermission(SecurityAction.Request Minimum,
UnmanagedCode=true)]
[assembly:FileIOPermission(SecurityAction.RequestMi nimum,
Unrestricted=true)]
[assembly:RegistryPermission(SecurityAction.Request Minimum, All="*")]

[assembly:ZoneIdentityPermission(SecurityAction.Req uestMinimum,Zone=Security
Zone.NoZone)]

[assembly:ComVisible(true)]
[assembly:CLSCompliant(true)]

Well, I hope that this overview avoids other people becoming depressed when
all seems to fail when they start using .NET for the first time. ;-)
Jul 21 '05 #2

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

Similar topics

5
2423
by: j-marvin | last post by:
hi- i am using the abyss webserver at the moment. i went through the process of how a buffer overflow would work in my mind. i noticed you can limit the size of post data and its limit value is...
7
1499
by: CheGueVerra | last post by:
First of all Hello all you css freak. geeks and gurus. I just started using css for some web pages I had to do at work and I'im testing some stuff at home to understand more. Now, I wanted to...
9
4174
by: Marty McDonald | last post by:
If I invoke a web service, and it throws an exception, I can see the exception if the client app is a .Net app. However, if the client app is not a .Net app, I only receive the HTTP 500 error. I...
29
2973
by: RAY | last post by:
Hi , my boss has asked I sit in on an interview this afternoon and that I create some interview questions on the person's experience. What is C++ used for and why would a company benefit from...
1
218
by: | last post by:
I think that I start to understand this .NET security. Basically it comes to this: * You use strong names in the dll and exe, so the application user must configure this application with key...
82
6222
by: Eric Lindsay | last post by:
I have been trying to get a better understanding of simple HTML, but I am finding conflicting information is very common. Not only that, even in what seemed elementary and without any possibility...
3
4384
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
4
1475
by: joelagnel | last post by:
I'm new to .NET and have a basic understanding of operating systems. I can also do some magic in Csharp, but I lack an understanding of what's going on under the hood, with respect to how windows...
0
7148
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
7367
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
7430
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...
1
7089
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5673
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.