xssbom漏洞(xss漏洞实战文章)

今日搞笑 2022年05月29日
本文导读目录:

xss注入漏洞产生的原因?xss注入过程步骤是什么?防范xss注入的方法有哪些

对于的用户输入中出现XSS漏洞的问题,主要是由于开发人员对XSS了解不足,安全的意识不够造成的。现在让我们来普及一下XSS的一些常识,以后在开发的时候,每当有用户输入的内容时,都要加倍小心。请记住两条原则:过滤输入和转义输出。

一、什么是XSS

XSS又叫CSS (Cross Site Script) ,跨站脚本攻击。它指的是恶意攻击者往Web页面里插入恶意html代码,当用户浏览该页之时,嵌入其中Web里面的html代码会被执行,从而达到恶意的特殊目的。XSS属于被动式的攻击,因为其被动且不好利用,所以许多人常呼略其危害性。

在WEB2.0时代,强调的是互动,使得用户输入信息的机会大增,在这个情况下,我们作为开发者,在开发的时候,要提高警惕。

二、XSS攻击的主要途径

XSS攻击方法只是利用HTML的属性,作各种的尝试,找出注入的方法。现在对三种主要方式进行分析。

第一种:对普通的用户输入,页面原样内容输出。

打开http://go.ent.163.com/goproducttest/test.jsp(限公司IP),输 入:scriptalert(‘xss’)/script, JS脚本顺利执行。当攻击者找到这种方法后,就可以传播这种链接格式的链接 (http://go.ent.163.com/goproducttest/test.jsp?key=JSCODE)如:http: //go.ent.163.com/goproducttest/test.jsp?key=scriptalert(‘xss’) lt;/script,并对JSCODE做适当伪装,如:

http://go.ent.163.com/goproducttest/test.jsp?key=%3c%73%63%72%69%70 %74%3e%61%6c%65%72%74%28%27%78%73%73%27%29%3c%2f%73%63%72%69%70%74%3e,当其 它用户当点此链接的时候,JS就运行了,造成的后果会很严重,如跳去一个有木马的页面、取得登陆用户的COOKIE等。

第二种:在代码区里有用户输入的内容

原则就是,代码区中,绝对不应含有用户输入的东西。

第三种:允许用户输入HTML标签的页面。

用户可以提交一些自定义的HTML代码,这种情况是最危险的。因为,IE浏览器默认采用的是UNICODE编码,HTML编码可以用ASCII方式来写,又可以使用”/”连接16进制字符串来写,使得过滤变得异常复杂,如下面的四个例子,都可以在IE中运行。

1,直接使用JS脚本。

img src=”javascript:alert(‘xss’)” /

2,对JS脚本进行转码。

img src=”javascript:alert(‘xss’)” /

3,利用标签的触发条件插入代码并进行转码。

img onerror=”alert(‘xss’)” /

4,使用16进制来写(可以在傲游中运行)

img STYLE=”background-image: /75/72/6c/28/6a/61/76/61/73/63/72/69/70/74/3a/61/6c/65/72/74/28/27/58/53/53/27/29/29″

以上写法等于img STYLE=”background-image: url(javascript:alert(‘XSS’))”

三、XSS攻击解决办法

请记住两条原则:过滤输入和转义输出。

具体执行的方式有以下几点:

第一、在输入方面对所有用户提交内容进行可靠的输入验证,提交内容包括URL、查询关键字、http头、post数据等

第二、在输出方面,在用户输内容中使用XMP标签。标签内的内容不会解释,直接显示。

第三、严格执行字符输入字数控制。

四、在脚本执行区中,应绝无用户输入。

如何测试XSS漏洞

XSS跨站漏洞分为大致三种:储存型XSS,反射型XSS,和DOM型XSS,一般都是由于网站对用户输入的参数过滤不严格而调用浏览器的JS而产生的。

储存型XSS:

一般是构造一个比如说"scriptalert("XSS")/script"的JS的弹窗代码进行测试,看是否提交后在页面弹窗,这种储存型XSS是被写入到页面当中的,如果管理员不处理,那么将永久存在,这种XSS攻击者可以通过留言等提交方式,把恶意代码植入到服务器网站上, 一般用于盗取COOKIE获取管理员的信息和权限。

反射型XSS:

一般是在浏览器的输入栏也就是urlget请求那里输入XSS代码,例如:127.0.0.1/admin.php?key="scriptalert("xss")/script,也是弹窗JS代码。当攻击者发送一个带有XSS代码的url参数给受害者,那么受害者可能会使自己的cookie被盗取或者“弹框“,这种XSS一次性使用,危害比储存型要小很多。

dom型:

常用于挖掘,是因为api代码审计不严所产生的,这种dom的XSS弹窗可利用和危害性并不是很大,大多用于钓鱼。比起存储型和反射型,DOM型并不常用。

跨站脚本攻击(Cross Site Scripting),为了不和层叠样式表(Cascading Style Sheets, CSS)的缩写混淆,故将跨站脚本攻击缩写为XSS。恶意攻击者往Web页面里插入恶意Script代码,当用户浏览该页之时,嵌入其中Web里面的Script代码会被执行,从而达到恶意攻击用户的目的。

XSS攻击分成两类,一类是来自内部的攻击,主要指的是利用程序自身的漏洞,构造跨站语句,如:dvbbs的showerror.asp存在的跨站漏洞。

如何彻底防范XSS漏洞?

谈到XSS漏洞攻击,可能很多童鞋或多或少的晓得一些基础的东西。

XSS是一种经常出现在web应用中的计算机安全漏洞,恶意攻击者往Web页面里插入恶意html代码,当用户浏览该页之时,嵌入其中Web里面的html代码会被执行,从而达到恶意攻击用户的特殊目的。详细的防范和修复方法,一两句话是说不清楚的,建议你去i春秋学院听一听这方面的课程吧,知道创宇录制的“WEB安全漏洞原理分析”课程就有专门讲XSS漏洞的。很专业,很牛B!

XSS安全漏洞的几种修复方式

打开腾讯电脑管家——工具箱——修复漏洞,进行漏洞扫描和修复。

建议设置开启自动修复漏洞功能,开启后,电脑管家可以在发现高危漏洞(仅包括高危漏洞,不包括其它漏洞)时,第一时间自动进行修复,无需用户参与,最大程度保证用户电脑安全。尤其适合老人、小孩或计算机初级水平用户使用。开启方式如下:进入电脑管家“修复漏洞”模块—“设置”,点击开启自动修复漏洞即可。

xss漏洞如何防御?

1、基于特征的防御。XSS漏洞和著名的SQL注入漏洞一样,都是利用了Web页面的编写不完善,所以每一个漏洞所利用和针对的弱点都不尽相同,这就是给XSS漏洞防御带来的困难,不可能以单一特征来概括所有XSS攻击。

传统的XSS防御在进行攻击鉴别时多采用特征匹配方式,主要是针对JavaScript这个关键词进行检索,但是这种鉴别不够灵活,凡是提交的信息中各有JavaScript时,就被硬性的判定为XSS攻击。

2、基于代码修改的防御。Web页面开发者在编写程序时往往会出现一些失误或漏洞,XSS攻击正是利用了失误和漏洞,因此一种比较理想的方法就是通过优化Web应用开发来减少漏洞,避免被攻击:

①用户向服务器上提交的信息要对URL和附带的HTTP头、POST数据等进行查询,对不是规定格式、长度的内容进行过滤。

②实现Session标记、CAPTCHA系统或者HTTP引用头检查,以防功能被第三方网站所执行。

③确认接收的内容被妥善的规范化,仅包含最小的、安全的Tag,去掉任何对远程内容的引用,使用HTTP only的cookie。

3、客户端分层防御策略。客户端跨站脚本攻击的分层防御策略是基于独立分配线程和分层防御策略的安全模型。它建立在客户端,这是它与其他模型最大的区别。之所以客户端安全性如此重要,客户端在接受服务器信息,选择性的执行相关内容。这样就可以使防御XSS攻击变得容易,该模型主要由三大部分组成:

①对每一个网页分配独立线程且分析资源消耗的网页线程分析模块;

②包含分层防御策略四个规则的用户输入分析模块;

③保存互联网上有关XSS恶意网站信息的XSS信息数据库。

关键词: xssbom漏洞
我来说两句
黑客技术 2年前 (2022-05-30) | 回复
一些失误或漏洞,XSS攻击正是利用了失误和漏洞,因此一种比较理想的方法就是通过优化Web应用开发来减少漏洞,避免被攻击:①用户向服务器上提交的信息要对URL和附带的HTTP头、POST数据
黑客技术 2年前 (2022-05-30) | 回复
行,从而达到恶意的特殊目的。XSS属于被动式的攻击,因为其被动且不好利用,所以许多人常呼略其危害性。在WEB2.0时代,强调的是互动,使得用户输入信息的机会大增,在这个情况下,我们作为开发者,在开发的时候,要提高警惕。二、XSS攻击的主
黑客技术 2年前 (2022-05-30) | 回复
.163.com/goproducttest/test.jsp(限公司IP),输 入:scriptalert(‘xss’)/script, JS脚本顺利执行。当攻击者找到这种方法后,就可以传播这种链接格式的链接 (http:
黑客技术 2年前 (2022-05-29) | 回复
ript, JS脚本顺利执行。当攻击者找到这种方法后,就可以传播这种链接格式的链接 (http://go.ent.163.com/goproducttest/test.jsp?key=JSCODE)如:htt
bapehoodie 5个月前 (11-29) | 回复
A lot of thanks for every one of your labor on this site. Kate take interest in setting aside time for research and it is obvious why. My spouse and i know all relating to the powerful mode you convey great guides via the web site and therefore welcome response from the others about this area of interest plus our favorite girl is always being taught a whole lot. Take advantage of the rest of the new year. You are always doing a good job.
kevindurantshoes 4个月前 (12-27) | 回复
Thank you a lot for providing individuals with an extraordinarily remarkable opportunity to discover important secrets from this blog. It is often very pleasurable and as well , packed with a good time for me and my office friends to search your site nearly three times in 7 days to learn the fresh stuff you have. And lastly, I'm so usually fulfilled for the breathtaking creative ideas served by you. Some two ideas in this post are easily the most impressive we have had.
ggdboutlet 4个月前 (12-28) | 回复
A lot of thanks for all your efforts on this blog. My aunt loves managing internet research and it's simple to grasp why. I learn all regarding the dynamic mode you give sensible tips and hints by means of your blog and encourage participation from other individuals about this article so our daughter is now discovering a whole lot. Take pleasure in the rest of the new year. You are always conducting a fabulous job.
goldengoose 4个月前 (12-29) | 回复
Thanks a lot for giving everyone an exceptionally pleasant opportunity to read critical reviews from this blog. It is usually so pleasing and as well , full of a great time for me and my office friends to search the blog at the least thrice weekly to see the newest items you have got. Not to mention, I am at all times fulfilled with your wonderful guidelines you give. Some 4 facts on this page are undeniably the most impressive I have ever had.
off-white 4个月前 (12-30) | 回复
A lot of thanks for all your valuable efforts on this web page. My mom enjoys conducting investigation and it's really easy to understand why. Most of us know all regarding the powerful way you deliver informative tips and tricks through your website and strongly encourage participation from other individuals about this situation plus our favorite girl is without a doubt being taught a lot of things. Have fun with the rest of the new year. You have been conducting a really good job.
airjordan 4个月前 (01-01) | 回复
I simply had to say thanks once again. I do not know what I might have done in the absence of the entire methods revealed by you directly on that subject. Certainly was a daunting situation in my circumstances, but seeing a new well-written style you resolved that made me to cry for fulfillment. I will be happier for the help and wish you really know what a powerful job you are carrying out training most people with the aid of your blog post. Probably you have never come across all of us.
jordanoffwhite 4个月前 (01-03) | 回复
My spouse and i were ecstatic that Raymond managed to finish off his web research while using the precious recommendations he acquired from your web site. It is now and again perplexing to just continually be giving away guides that many other people have been selling. Therefore we recognize we have you to give thanks to for that. Those illustrations you've made, the easy website navigation, the relationships you aid to foster - it's most incredible, and it's leading our son in addition to the family recognize that that issue is amusing, which is highly mandatory. Many thanks for the whole lot!
kd12 4个月前 (01-04) | 回复
I am only commenting to make you be aware of of the wonderful encounter my girl encountered reading through your site. She came to understand plenty of details, with the inclusion of what it is like to possess a very effective coaching heart to get folks completely have an understanding of specified advanced matters. You undoubtedly exceeded our expectations. I appreciate you for presenting such essential, dependable, educational as well as unique thoughts on this topic to Gloria.
hermesoutlet 4个月前 (01-05) | 回复
I precisely wished to thank you so much yet again. I'm not certain what I could possibly have gone through in the absence of these aspects documented by you concerning such industry. It seemed to be a real frightful situation in my circumstances, nevertheless spending time with the very specialised tactic you treated it forced me to weep over gladness. Now i'm happy for this support and believe you recognize what an amazing job you are always undertaking teaching people today via your websites. I know that you have never met any of us.
kyrie7shoes 4个月前 (01-06) | 回复
My husband and i felt really fulfilled Edward could complete his investigation because of the ideas he got in your web pages. It is now and again perplexing to simply happen to be freely giving secrets that most people may have been trying to sell. So we see we have you to give thanks to for that. Those explanations you have made, the simple site navigation, the friendships your site assist to foster - it's many impressive, and it's really facilitating our son in addition to our family recognize that this situation is thrilling, and that's really important. Thanks for the whole thing!
goldengoosecheap 4个月前 (01-08) | 回复
Aw, this was a very nice post. In idea I wish to put in writing like this additionally ?taking time and precise effort to make an excellent article?however what can I say?I procrastinate alot and not at all appear to get one thing done.
fearofgodclothing 4个月前 (01-08) | 回复
I simply had to thank you so much yet again. I do not know what I would've used in the absence of these recommendations shared by you relating to such a topic. It truly was a fearsome circumstance in my opinion, however , being able to view your well-written way you managed that made me to leap with joy. Now i'm grateful for the assistance as well as hope that you are aware of a great job you were putting in educating the rest via a site. Most likely you have never encountered any of us.
bape 4个月前 (01-09) | 回复
I'm writing to let you be aware of what a useful discovery my wife's girl had reading the blog. She figured out many pieces, which included what it is like to have an awesome teaching mindset to have a number of people with no trouble grasp certain impossible matters. You really surpassed our own expectations. Many thanks for delivering these informative, trustworthy, informative not to mention unique tips on your topic to Emily.
bapestashoes 4个月前 (01-10) | 回复
I wanted to post you that very small observation to finally thank you very much as before with the magnificent techniques you have documented on this website. This has been so shockingly generous with people like you to provide without restraint all that most people could have distributed for an ebook in making some dough on their own, chiefly seeing that you could have done it in case you considered necessary. These techniques also served to become a good way to be certain that many people have similar desire like mine to find out more with regard to this issue. Certainly there are several more pleasurable opportunities ahead for individuals who take a look at your blog post.
goyardonlinestore 3个月前 (01-12) | 回复
A lot of thanks for each of your work on this web site. Betty delights in conducting investigation and it's really obvious why. My spouse and i hear all of the compelling ways you give priceless guides via your website and strongly encourage participation from website visitors on this matter then our own simple princess is actually studying a whole lot. Enjoy the rest of the new year. You are always carrying out a good job.
goyard 3个月前 (01-13) | 回复
Thanks a lot for giving everyone an extraordinarily spectacular possiblity to discover important secrets from this site. It is usually very ideal and as well , full of a great time for me and my office colleagues to visit the blog on the least thrice a week to find out the new issues you have. Of course, I'm just certainly satisfied concerning the unique creative ideas served by you. Certain 4 points on this page are basically the most efficient I have ever had.
offwhite 3个月前 (01-15) | 回复
My husband and i have been quite fortunate that John managed to finish up his researching through your ideas he had from your very own web pages. It's not at all simplistic to just always be giving away helpful hints which other folks may have been making money from. And we also fully understand we have got the website owner to be grateful to for that. The most important illustrations you've made, the straightforward site menu, the friendships you help to engender - it's everything excellent, and it is helping our son in addition to the family reckon that the article is enjoyable, and that's especially fundamental. Thank you for the whole lot!
palmangels 3个月前 (01-17) | 回复
I wanted to compose a small word so as to appreciate you for some of the fantastic secrets you are showing at this website. My rather long internet search has now been compensated with sensible concept to share with my partners. I would tell you that most of us site visitors actually are really fortunate to exist in a notable website with many wonderful professionals with great tactics. I feel really privileged to have encountered the web pages and look forward to many more brilliant times reading here. Thanks once more for all the details.
kd15 3个月前 (01-17) | 回复
I wanted to make a small word so as to appreciate you for the stunning concepts you are sharing at this website. My extensive internet research has now been compensated with good quality know-how to share with my contacts. I 'd assume that we website visitors are truly lucky to be in a great network with many brilliant people with insightful methods. I feel very grateful to have encountered your website and look forward to many more awesome times reading here. Thanks again for a lot of things.
kyrieirving 3个月前 (01-18) | 回复
I would like to show thanks to this writer for bailing me out of this particular incident. As a result of surfing around throughout the world wide web and obtaining principles that were not pleasant, I believed my entire life was over. Existing devoid of the answers to the issues you have resolved as a result of your article content is a critical case, and the ones which could have negatively affected my career if I had not noticed your web page. The capability and kindness in dealing with all the pieces was vital. I don't know what I would have done if I hadn't encountered such a solution like this. It's possible to at this moment look forward to my future. Thank you so much for the professional and result oriented guide. I will not hesitate to propose the blog to any person who needs and wants tips on this topic.
goldengooseusa 3个月前 (01-19) | 回复
My wife and i were quite fortunate when John could do his studies through the entire ideas he was given from your very own weblog. It's not at all simplistic to simply be giving out secrets which usually men and women could have been making money from. Therefore we do know we have the writer to be grateful to for this. These illustrations you've made, the straightforward site menu, the relationships your site assist to foster - it's mostly impressive, and it's leading our son and us imagine that that article is fun, which is certainly rather vital. Many thanks for the whole thing!
jordanshoes 3个月前 (01-20) | 回复
I actually wanted to construct a brief note to say thanks to you for some of the remarkable facts you are placing here. My long internet look up has now been recognized with brilliant details to exchange with my relatives. I would assume that we site visitors are unquestionably lucky to exist in a fine place with very many special individuals with good tips and hints. I feel extremely privileged to have encountered your website and look forward to tons of more brilliant moments reading here. Thank you again for a lot of things.
offwhite 3个月前 (01-22) | 回复
I and my friends were actually checking out the good secrets on the blog while before long I had a horrible suspicion I never expressed respect to the web blog owner for them. My people ended up so stimulated to read all of them and now have absolutely been enjoying them. We appreciate you really being considerably accommodating and for utilizing this sort of fantastic subject areas millions of individuals are really desirous to learn about. My very own sincere apologies for not expressing gratitude to sooner.
jordanoutlet 3个月前 (01-23) | 回复
I truly wanted to post a brief word in order to express gratitude to you for the stunning guides you are giving out at this website. My time consuming internet lookup has at the end been compensated with useful knowledge to talk about with my company. I 'd repeat that we visitors actually are very endowed to dwell in a fabulous place with so many brilliant professionals with very beneficial tips and hints. I feel extremely happy to have discovered your website and look forward to really more entertaining minutes reading here. Thanks a lot once again for all the details.
giannisshoes 3个月前 (01-24) | 回复
I must point out my passion for your generosity for individuals who need assistance with this particular concept. Your personal dedication to getting the solution all through had become especially important and has always empowered men and women just like me to reach their endeavors. Your personal warm and helpful report signifies a lot a person like me and a whole lot more to my office workers. Thanks a ton; from everyone of us.