Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Session, http, web Development principles and xss vulnerabilities in ASP.NET

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report