Example Analysis of Session, http, web Development principles and xss vulnerabilities in ASP.NET
This article mainly shows you the "ASP.NET Session, http, web development principles, xss vulnerability example analysis", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Session, http, web development principles in ASP.NET, xss vulnerability example analysis" this article.
1 、 Session
2. Verification code
YZM.ashx
The copy code is as follows:
Using System
Using System.Web
Public class YZM: IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
Public void ProcessRequest (HttpContext context) {
Context.Response.ContentType = "image/JPEG"
Using (System.Drawing.Bitmap bitImage = new System.Drawing.Bitmap (130,100))
{
/ / set the canvas
Using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage (bitImage))
{
/ / Random number
Random my_random = new Random ()
Int num_01 = my_random.Next
Int num_02 = my_random.Next
Int result = num_01 + num_02
String num_string01 = num_01.ToString ()
String num_string02 = num_02.ToString ()
String result_string = result.ToString ()
/ / Save to the server's sessionid
HttpContext.Current.Session ["YZM"] = result_string
/ / set text
G.DrawString (num_string01 + "+" + num_string02+ "?", new System.Drawing.Font (Song style, 20), System.Drawing.Brushes.Red, new System.Drawing.PointF (0,0))
/ / Save to the output stream
BitImage.Save (context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)
}
}
}
Public bool IsReusable {
Get {
Return false
}
}
}
YZM.aspx
The copy code is as follows:
3. Http protocol
4. Button to achieve the deletion effect of Standard Brothers. Hyperlink to submit the form.
5. Web development principles
6. XSS vulnerabilities
Label similar control: Literal control, if the value of text in the property is hah, it can be embedded in the link.
You can set the mode property to Encode
7. Virtual directory ~: used in ASP.net, always starts under the application root directory
These are all the contents of this article entitled "Session, http, web Development principles in ASP.NET, sample Analysis of xss vulnerabilities". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!