|
I am hoping ot use the comet architecture in my application. This means that for every client browser, there will be a hidden iframe, pointing at a page that never completes loading. When I want to send a message to the client, I will write something to this page. When I don't, the connection to this page will stay open, but dormant.
Does anyone know if there are a limit to the number of ASP pages which I can keep open like that? I am hitting a limit, but it is just the connection limit imposed because I am running on an XP machine. On a server, will there be any limits, aside from memory and CPU?
|
|
|
|
|
I have a question about ASP.NET security. We learned in the advanced ASP.NET class not to put our username and password in our code behind page because a hacker could get to it there. They said as a good security practice we should put it in the web.config file, encrypt it, memorize the password, and lock the server room door, but what about our sql commands or query strings?
If in our code behind page we have the query:
SELECT * FROM SQLUSERDATA WHERE USER = txtUSER.Text AND PASS = txtPASS.Text
What stops a hacker from getting to the string in memory and changing it to:
SELECT * FROM SQLUSERDATA
to return all the usernames, passwords, addresses, etc. from our database. I'm assuming if they can get to the sql connection string to steal the password when it is in the code behind then they can just as easily get to sql query command string.
I am trying to put the command string for my sql query into web.config then pull in the username and password from the webform but cannot use varibles in the string because web.config does not see my webform objects. I googled for hours but could only find help with the connection string which everyone knows how to do by now, and doesn't need varibles from the webform. How do I make the following code work in the web.config:
SELECT * FROM SQLUSERDATA WHERE USER = txtUSER.Text AND PASS = txtPASS.Text
or what would be the most secure way to hide my query string from hackers?
Thanks!
timothymburke@hotmail.com
|
|
|
|
|
If a hacker would be able to read your queries in the code, that is hardly a security risk. He can't do anything with them without a database connection.
A database login is a completely different matter. If the login is in the code, and a hacker manages to get read access to the file, he has all the access to the database that the login is granted. (Sadly that is often full access.)
To change a query in the running code requires a completely different level of access. If a hacker gets that kind of access he wouldn't go for the queries, he would swipe the database login once the code has decrypted it. So in that case it matters very little where you store anything.
---
b { font-weight: normal; }
|
|
|
|
|
I understand a hackers reasoning about wanting the login to my sql server. It makes them able to get direct admin access to the sql server but it is just as difficult to grab the login from memory as it would be to grab the SQL query string, and I would assume just as simple for that same hacker to change the query before it posts back to the server. Sadly there isn't much difference between admin access and a query through an admin login given you know the most basic SQL.
"without a database connection"
They have database connection already, everyone has to have a database connection to check their login and pass against the database, even when it is incorrect, which is another best pratice to put the usernames and passwords in the database.
So my point is, access to SQL queries through an admin account yields the same security risks as direct admin access to the server, therefore, what is the point of encrypting your login in the web.config file if they are just going to have access to your queries in the code behind page that I already know is not secure since Microsoft tells us directly anyone can view the code behind page and/or change it.
"hardly a security risk"
Access to queries is a grave security risk especially when that connection has full access which as you pointed out is very often not to mention a must for any add, change, delete program, and it is only slightly less risky to a connection that has read only access always with the obvious unrevokable ability to run read-only queries like "SELECT * FROM... Hackers have used the same or related security hole for years to get at data from all the other frameworks so what can I do to stop this in .NET or am I to simply assume these same hackers will stop trying to get it at data?
Thanks for the reply.
timothymburke@hotmail.com
-- modified at 13:55 Tuesday 20th June, 2006
|
|
|
|
|
timothymburke wrote:
"hardly a security risk"
Access to queries is a grave security risk especially when that connection has full access which as you pointed out is very often not to mention a must for any add, change, delete program, and it is only slightly less risky to a connection that has read only access always with the obvious unrevokable ability to run read-only queries like "SELECT * FROM... Hackers have used the same or related security hole for years to get at data from all the other frameworks so what can I do to stop this in .NET or am I to simply assume these same hackers will stop trying to get it at data?
If you read the entire sentence, it is: "If a hacker would be able to read your queries in the code, that is hardly a security risk."
As I tried to explain in my previous post, there is a big difference between being able to read some files or part of files on the server, and changing them.
If you for an example make the mistake to publish code with debug info, and configure the site to show detailed error messages, anyone will be able to see a few lines of code if there is an exception in the page. That is an example of how someone might get to se part of the code without much effort.
To get full access to the server, on the other hand, so that someone can change any files, is quite a bit harder. As I tried to explain in the previous post, there is not much you can do to protect your code or database in that case. Whatever you do, you are f***ed anyway, pardon the language.
---
b { font-weight: normal; }
|
|
|
|
|
What I recommend is putting your connection string into a separate and compiled class file. We have a connection manager class that returns the appropriate connection depending if we are on the test or production server. Another good idea is to use stored procedures. Never give a user dataWriter access. I learned this hard way when the user connected via MS Access and was updating the tables outside the application.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
You should probably worry about what is in the Text field of the text box. Malicious code could be passed into the database if you do not strip it and you should parameterize your queries, never Concatenate strings to create a sql statement.
|
|
|
|
|
|
Hi
In my application if i give the application no and then click ,then the datails of that particular application(app no,date,...) in the form of table.please help me
|
|
|
|
|
Good luck getting an answer to that one.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi,
please i want you to tell me what is the real role of a ViewState & when & why we should use it ??
it will be better if you can give me even a small example to let me understand it please
thank you
try to be good if you can't be the best
|
|
|
|
|
|
very urgent..........
hi,
i have one textbox and one button in asp.net
i give 10(any no) in textbox ,when i click button. it create 10 buttons
dynamically
usin c#.net
suresh babu.k
|
|
|
|
|
Can you put the code up please?
|
|
|
|
|
anyone know how to code to link a header to everypage?? i have already create the header. soo i just want to add it above on all my other content page. And also the side menu on the left and footer below...?
is it using css??? do i need to add an extra row of table to put my header footer in my everycontent page???
|
|
|
|
|
|
Hi,
I have the same lines of code on my home PC, but at work it doesn't seem to want to work. What I want to do is to break down a file into it's file name and extension.
Here is my code in my button click event handler:
if (fuWineImage.HasFile)
{
string filepath = fuWineImage.PostedFile.FileName;
string pat = @"\\(?:.+)\\(.+)\.(.+)";
Regex r = new Regex(pat);
Match m = r.Match(filepath);
string file_ext = m.Groups[2].Captures[0].ToString();
Response.Write("filepath = " + filepath + "<br />");
}
The error that the browser gives me is:
Specified argument was out of the range of valid values.
Parameter name: i
The result of the Response.Write is:
myFile.jpg
Why is this not working??
Please can someone help me
Regards,
ma se
|
|
|
|
|
Well for one, there doesn't seem to be an i variable in your code that you posted, so hard to tell...
But why don't you just import the System.IO namespace and use the following:
Path.GetFileNameWithoutExtension(filePath);<br />
Path.GetFileName(filePath);<br />
Path.GetExtension(filePath);
|
|
|
|
|
Does anyone know if running ASP.NET 1.1 and 2.0 on the same server is a problem. I know I can set the Version in IIS properties but does this cause any issues?
thanks
|
|
|
|
|
Not that I've run into - have had 1.1 & 2.0 running for months with no (apparent) problems
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
|
Not a problem on my development and deployment machines.
Just need to remember to set the correct ASP.NET version.
Dan Satria
Principal Consultant
Graha Logica, Inc.
|
|
|
|
|
Hi all,
I just want to know the use of global.asax file. How its beneficial for web projects.
Varun Arora,
Software Engineer,
Knowledge Calls,
Gurgaon, India
|
|
|
|
|
It is the place to declare/initialize application-wide variables.
The global.asax file allows developers to add application and session level logic to their web applications. It is a special file which contains events which are fired when the application starts and stops, and when a users session starts and stops.
It is optional, but if you have one it must be located at the root of your site or your virtual directory. ASP.NET parses and compiles it into a class which extends the HttpApplication base class the first time any page within the application is requested. Global.asax cannot be downloaded through Http.
Read this this[^]
or
this[^]
for more information
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Hi,
Thankyou so much for providing me help.
Thanks and Regaurds,
Varun Arora,
Software Engineer,
Knowledge Calls,
Gurgaon, India
|
|
|
|