Book III 1 in Visual C#
Book III 1 Make Code 39 Extended In Visual C#.NET Using Barcode generation for VS .NET Control to generate, create Code39 image in VS .NET applications. Writing Secure Code
Make Bar Code In C#.NET Using Barcode creator for VS .NET Control to generate, create bar code image in Visual Studio .NET applications. Normally, a user enters the appropriate information into the text box But a cracker attempting a SQL Injection attack would enter the following string into textBox1: Code 39 Creator In .NET Using Barcode printer for VS .NET Control to generate, create Code 39 image in .NET framework applications. FOOBAR ;DELETE FROM Items;-- Paint Code 3 Of 9 In VB.NET Using Barcode generator for VS .NET Control to generate, create Code 39 Extended image in .NET applications. The SQL code that would be run by your code would look like this: GS1 - 12 Generator In Visual C# Using Barcode creation for VS .NET Control to generate, create UPC A image in Visual Studio .NET applications. SELECT * FROM Items WHERE ProductID = FOOBAR ;DELETE FROM Items;-- Data Matrix 2d Barcode Creation In C# Using Barcode creation for .NET Control to generate, create DataMatrix image in .NET applications. The SQL Server executes some code you didn t expect; in this case, the code deleted everything in the Items table Draw Code 128A In C# Using Barcode creation for .NET framework Control to generate, create Code-128 image in .NET applications. Building Secure Web Forms Applications
Making Code 3/9 In Visual C#.NET Using Barcode encoder for Visual Studio .NET Control to generate, create Code 39 Full ASCII image in .NET framework applications. Preventing SQL Injection
Encoding Barcode In Visual C#.NET Using Barcode generation for .NET Control to generate, create barcode image in .NET applications. The easiest way to prevent SQL Injection is to never use string concatenation to generate SQL Use a stored procedure and SQL parameters You can read more about that in 2 of this minibook Barcode Creator In Visual C# Using Barcode drawer for Visual Studio .NET Control to generate, create bar code image in .NET applications. Script exploits
Identcode Generation In C# Using Barcode maker for VS .NET Control to generate, create Identcode image in Visual Studio .NET applications. A script exploit is a security flaw that takes advantage of the JavaScript engine in a user s Web browser Script exploits take advantage of one of the more common features of public Web Forms applications enabling interaction among users For instance, a Web Forms application may enable a user to post a comment that other users of the site can view, or it may allow a user to fill out an online profile Generating USS Code 128 In VS .NET Using Barcode maker for .NET Control to generate, create Code-128 image in .NET applications. Understanding script exploits
UCC - 12 Drawer In Visual Studio .NET Using Barcode drawer for VS .NET Control to generate, create UPC-A image in .NET framework applications. If a malicious user were to put some script code in his or her profile or comment, that hacker could take over the browser of the next user who comes to the site Several outcomes are possible, and none of them are good For instance, the cookies collection is available to JavaScript when a user comes to your site A malicious user would put some script code in his or her profile that could copy the cookie for your site to a remote server This could give the malicious user access to the current user s session because the session identifier is stored as a cookie The malicious user would then be able to spoof the current user s identity Decoding USS Code 39 In VS .NET Using Barcode reader for .NET Control to read, scan read, scan image in Visual Studio .NET applications. Preventing script exploits
UPC A Creation In Visual Basic .NET Using Barcode encoder for VS .NET Control to generate, create UPC Code image in Visual Studio .NET applications. Fortunately, ASPNET prevents users from typing most script code into a form field and posting it to the server Try it with a basic Web Forms project by following these steps (you see the error shown in Figure 1-3): UPC-A Supplement 5 Decoder In .NET Framework Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in .NET applications. 1 Create a new Web Forms project 2 Add a text box and a button to the default page 3 Run the project 4 Type <script>msgbox()</script> into the text box 5 Click the button Generate UCC - 12 In VB.NET Using Barcode generator for .NET Control to generate, create GS1 128 image in VS .NET applications. Additionally, you can use the ServerHTMLEncode method to encode anything that the Web Forms application sends to the screen this will make script code appear in real text rather than in HTML Barcode Generator In Java Using Barcode generator for Java Control to generate, create barcode image in Java applications. Building Secure Web Forms Applications
Create Barcode In .NET Using Barcode creation for Visual Studio .NET Control to generate, create barcode image in .NET applications. Figure 1-3: Script exploits are blocked by default
Data Matrix 2d Barcode Scanner In VS .NET Using Barcode scanner for VS .NET Control to read, scan read, scan image in .NET framework applications. Book III 1
Best practices for securing Web Forms applications
Aside from make sure that your Web Forms application will prevent SQL Injection attacks and script exploits, you should keep in mind some good practices for securing your Web applications The following list runs down some of the most important practices for securing your Web applications: Keep your IIS box up to date Back up everything Avoid using a Querystring variable Don t leave HTML comments in place Any user can view the HTML code and see your comments by choosing View Source in a browser Don t depend on client-side validation for security it can be faked Use strong passwords Don t assume what the user sent you came from your form and is safe It is easy to fake a form post Make sure that error messages don t give the user any information about your application E-mail yourself the error messages instead of displaying them to the user Writing Secure Code Using SystemSecurity
Use Secure Sockets Layer Don t store anything useful in a cookie Close all unused ports on your Web server Turn off SMTP on IIS unless you need it Run a virus checker if you allow uploads Don t run your application as Administrator Use temporary cookies, if possible, by setting the expiration date to a past date The cookie will stay alive only for the length of the session Put a size limit on file uploads You can do it in the WebConfig file:
|
|
|
|
| ALL RIGHTS RESERVED. Business Refinery (c) 2006 - 2010. | Terms of Use | Privacy Policy |