?????????????????????????????к?????в?????????????顣????????? XSS ?????????????????????????????????????????????????????????????????????????????????????????????ж????????????????????????????????????????????й??????????????????????????????????????“???????”???????????????????????????????????????й???????????????????????????????????????????????????????????????????????????????????????????????????????д???? “XSS”??

????XSS ??????????漰??????????

????• ??????
????• ?????
????• ??????????????????????????????????????ж???

??????????????У????????????????й???????????????????????????????壬?????????????????????????? XSS ?????????磬???????????????????IM ????????????????????????????????????? URL??????????? Web ??????д??? URL ??????????????????沢????????????????н????

????XSS ??????????????

?????????? Web ????????????????????????? Web ??ó??????????????? HTTP ?? HTML ?????HTTP Э???? HTML ???????????????????? Web ??沼?????????檔

??????? Web ??ó???????????? HTTP ?????? GET ?? POST???????????????????????? HTML ???????Щ????????Щ????????????? XSS ???????????????????????

????1. Web ?????????????

????GET http://www.somesite.com/page.asp?pageid=10&;;lang=en&title=Section%20Title

????2. ????????????????????? HTML ?????????

????<h1>Section Title</h1>

??????????????????“title”????????????????????????????????????????????в????? Web ??ó?????? <h1> ????С??????????????????????????? HTML??

????3. ?????????????????????????????????????????????????????????????????????????????????????ζ??????????????

???????????????????? <h1> ???????????

????http://www.somesite.com/page.asp?pageid=10&lang=en&title=Section%20Title</h1><script>alert(‘XSS%20attack’)</script>

???????????? HTML ????????

????<h1>Section Title</h1><script>alert(‘XSS attack’)</script>

???????????????????????????????????????????????????????顣???????????????Щ??????в??????????Щ???????????????

????XSS ????????в?ж???????

?????????????????? Web ???????????????????в?ж????????????ж?????????в?????????????? XSS ?????? Cookie????????????? ActiveX????? Flash ??????????????????????????????????????????

??????????????Щ URL??????б??п?????????????У????????????????????????????ε???????????????????ε???????е? URL??

???????????????????? XSS ??????????????????????????????????????????????и?????????????????????????????????????????Щ?????????????Щ??????????????????Щ URL????????????????????????????д??????????????????????? http://mybank.com/somepage?redirect=<;;script>alert(‘XSS’)</script>????????????“redirect”????????й?????

????????????????????????????????????????????????????????????????????“?????????????????????”?????????? URL ????????????????????????????????????????????

?????????????????????????????Σ???? -- Σ???????Σ??????????????????????????????????????????????????? -- ???????????????????Щ????

???????? XSS ???

??????????????????????????????????????????????ε?????????????????????????????????????????????????????????Щ?????????л????? Bugtraq ?? Vulnwatch ????????????κι???????????γ?????????????й?????????ζ?????ó????????е??????????????????cookie ? ??? POST ????????м?飬??????????????????????????????

???????????????????????????漰?????????????????? XSS ???????????????????????????в???????????????????й??????????SQL ???????????????????????????????????????????????????????????????磬????? XSS ???????????????????????????й?????

??????????????????????? Web ??ó?????п?????????С?顣??????????λ???????????????ú?к??з??????????????????????????????????????????????

????1.????????????????

?????????????????????????????????????????????????????????????????????????

????• Paros proxy ( http://www.parosproxy.org )???????? HTTP ???????
????• Fiddler ( http://www.fiddlertool.com/fiddler )???????? HTTP ???????
????• Burp proxy ( http://www.portswigger.net/proxy/ )
????• TamperIE ( http://www.bayden.com/dl/TamperIESetup.exe )????????? GET ?? POST

?????????????????г??????? Web ????????????????????????????????????????????????????????????????棬??????? Web ????????? HTTP ???????????Щ?????????????????? XSS ?????????????????Щ?????????????????????Щ??????????????? HTML ?????????????????????????????

???????????????? GET ?? POST ?????????????????????????е????? javascript ???????????????????????????? Web ??????? -- ?????????????????????????????????????????Ч???????

????2.???????書?? -- ????????? PM ????

?????????Щ????????????????????????漰?書????????????????????????Щ????????????????????????????в???????????????????ó????????????????????? Web ?????????????????????????????????????????????????г?????????Щ??檔

????3.??????г??????????????????

??????????????н????????????????????????????????????????棬?г????в?????????????cookie ???????? HTTP ?????POST ??????????????????????????????????????? Web ?????????? SOAP ???????????????????????????Ρ?

????????г??????????????????????????????????????????????????????????裡??????????????????????????????????????????????????????????? forwardURL ?? lang ????????????????? name??password??msgBody??msgTitle ???????? POST ??????????Щ Cookie ?????????Щ??????????????????????????

????4.??????????г?????????

?????????????????????г????????????? XSS ?????????????????????????????????????????????????????????????????????????г?????????????????????????????в???????????????????????????????????????????????????????????????????ж????????????????????????Щ????????Щ???????????

????5.?????????????????

??????????????????У?????????????????????????????????????????????????????????Щ???顣???? XSS??????? HTML ???????????????????????????????????? HREF ???????????? IFRAME ????У????? CLSID ????????? IMG SRC ?????Щ Flash ????? PARAM NAME ?????????

???????????????Щ???????????????????????????????????????????????????????????ζ????????????????????????????“>”??????????????????????????????????????????????????????????????????? URL ?? HTML ??????????????????罫??????? %22 ?? "??

????6.????????????????????????????????????????????????

????????????????????????? <script>alert(‘hi’)</script> ??????????????е???????????????????????????????????????????н??????????????????е???????????????????????????????????????“script”???????????о????????????????????????????????????????????cookie??POST ??????????á?“pageId=10”???????????????????????????????????????????????????????????????????????????????????????????????????????ó???????????Щ????????????????????????????????Ρ??????????????????????????Щ??????б?????????????????????????

??????????????

??????????????????????????о?????????????????? HTML ????????????????????????????????????????????????????????????????о?????????????????????????????????????????????仯????????????????????????????????????漰???????????????????????????????????????????????????????

????1.>"'><script>alert(‘XSS')</script>

????2.>%22%27><img%20src%3d%22javascript:alert(%27XSS%27)%22>

????3.>"'><img%20src%3D%26%23x6a;%26%23x61;%26%23x76;%26%23x61;%26%23x73;%26%23x63;%26%23x72;%26%23x69;%26%23x70;%26%23x74;%26%23x3a;alert(%26quot;XSS%26quot;)>

????4.AK%22%20style%3D%22background:url(javascript:alert(%27XSS%27))%22%20OS%22

????5.%22%2Balert(%27XSS%27)%2B%22

????6.<table background="javascript:alert(([code])"></table>

????7.<object type=text/html data="javascript:alert(([code]);"></object>

????8.<body onload="javascript:alert(([code])"></body>

?????????仯????????????????????????????ú??????????????????????檔?????Щ?????????????????仯??????????????????????? “>””???????????????????????????????????????????? URL ????????????????????????????????????????????“<>”???????????????????????????????????????????????????? XSS?????? ”&{alert('XSS')};”

??????ú???

??????????????? XSS ???????????????? XSS ????????????????????????????????????????????????????????????“msgTitle”????????????????????????????????????????????С????????????????????????????? HTML ????????“msgTitle”???????????????????С??????????????????? XSS ?????????????????????????????浽?????????????????????????У???????????????

????????????????? XSS ?????????????????????в????????Ρ????磬??????????? GET ?????????????????????????????????а????????????????????????????????????

???????

????XSS ?????????????? Web ??ó????????鶴?????С?????????????в??????????o???????????????У???????????????????????????????????????棬??????????????????????????????cookie??POST ?????SOAP????????????????????е??????????衣????????????????????????????????? HTML ?????????????????????????ó??????????????????????????????????????????????Щ???????????????????????????? PM ???н???????????????????????????в???