SlideShare une entreprise Scribd logo
1  sur  5
Télécharger pour lire hors ligne
1 PoC of XSS Patch ,-by ABK [http://www.twitter.com/abionic]


                                            WHITEPAPER

                                      XSS Defeating
      A Trick to Subvert XSS in JavaScript enabled Browsers
         Without Removing or Validating Any User Input
                                                                By, ABK [AbhishekKr]
                                                          abhikumar163 @ gmail.com
                                                      http://www.twitter.com/abionic
   Objective: “Let Security Be Served By Web Server", don't push it on Web Developer.


   Background Information:
   Here, I’m suggesting a method using which Web Developer wouldn’t have to worry of user
   input validation to prevent XSS Attack; and User wouldn’t have to block javascript on its
   browsers… as this will subvert all the <SCRIPT/> not introduced by Web Developer.

   I’ll be using my Web Server just to show my PoC, as I’ve already implemented the required
   module in my Web Server.

   I’ve been working on a Web Server ‘ABK (secure) SiteHoster’ hosted at
   This project is hosted at: http://sourceforge.net/projects/sitehoster
   XSS-Patch support is only present in Latest Release:
   https://sourceforge.net/downloads/sitehoster/v1.0beta%20RC1/
   How To Use PoC:
   I have provided ‘ABK (S)SH - XSS Patch PoC.zip’ file at above location which have a
   ‘StartDemo.bat’ file, so you extract this ZIP file to a folder and run this Batch file to start
   the PoC Demo {to run it on linux, give the ‘java –jar …..’ command in Batch file on shell
   with Web-Root Path in place of %currDir% and POSIX in place of WIN32}.
   Then you can browse ‘http://localhost/tweet.htm’; their enter any <SCRIPT/> you want to
   test and ‘submit’ it. The clicking button ‘Read TweeTexT…’ will load your <SCRIPT/> to
   Page.
   You can even check for the SCRIPT saved in ‘tweet.csv’ file saved at Web-Root.
   I have also uploaded PoC Video Demo:
   >> as ‘ABK_XSSPatch_PoC_Video’ on SourceForge, it is 7-zipped to 1.x mb download
   >> it is can also be viewed at: http://www.youtube.com/watch?v=ENiiAccY1v0

   With an aim of "Let Web Security Be Served By Web Server", don't make it a
   headache of Web Developer.
   I'm a security enthusiast and developer who is trying to build a Web Server secured from
   ground level up.
2 PoC of XSS Patch ,-by ABK [http://www.twitter.com/abionic]


   To start with enabling server with the facilities to subvert any kind of XSS attacks. For, this
   I’ve implemented a trick I discovered last year for implementing security in one of my
   college project. I was just waiting for a proper PoC and more testing on my part, which took
   somewhat longer time due to lack of managed time.




   Concept:
   Browser uses ‘JavaScript Blockers’ but those services even block the legitimate <SCRIPT/>
   to run.

   So, here I’ve a way using which all the illegitimate <SCRIPT/> can be made inactive
   automatically without use of any Blocker/Filter/Validation. So, Web Developer and Web
   Browser don’t require any kind of Blocking/Filtering/Validation to implement this solution.
   Since Blocking avoids execution of legitimate code also. Filtering and Validation may
   sometimes not work due to advanced obfuscation of <SCRIPT/> injected.

   Any attacker succeeding in injecting a <SCRIPT/> portion in your Web Content can launch
   an XSS Attack.

   But, no matter what kind of <SCRIPT/> is injected, that will get loaded as part of <BODY/>
   tag.

   So, using this method will allow activity of all <SCRIPT/> in <HEAD/> tag.

   Along with that, it would make inactive all the <SCRIPT/> injected (sync/async both
   modes) in <BODY/> tag.
   It doesn’t require any new feature to be implemented for this, but simply uses a Bug
   (facility for us) of Browsers to implement this.
3 PoC of XSS Patch ,-by ABK [http://www.twitter.com/abionic]


   Working Mechanism:
   Suppose, Web-App has a page with code:




                                          <html>
                                          <head>
      <script> function h(){alert(“this is web-dev script in HEAD Tag”);}</script>
                                         </head>
        <body>name:<div id=”fromDB” onclick=”h();”>~=ABK=~</div></body>
                                         </html>

   Now, if any attacker visiting this web-application have provided data containing ‘any
   <SCRIPT/>’ to be inserted in this page.

   Even then, implementing this solution web-developer needs to validate no XSS attacks
   (remember our aim is leave it to Web Server).

   So, suppose there was a <SCRIPT/> provided by attacker, which got saved in your DB and
   will be retrieved back to <DIV id=’fromDB’/> present in <BODY/> tag. So, it would look like
   something…




                                             <html>
                                            <head>
         <script>function h(){alert(“this is web-dev script in HEAD Tag”);}</script>
                                            </head>
                                        <body>name:
                              <div id=”fromDB” onclick=”h();”>
              <script>alert(‘attacker injected it, could do anything’);</script>
                                             </div>
                                            </body>
                                            </html>
4 PoC of XSS Patch ,-by ABK [http://www.twitter.com/abionic]


   Wait, this is not the end 

   But, this is just the Web-Page generated at server-side and handled to our Web-Server…
   now our Web-Server has a module to transform it into something like this…




                                            <html>
                                            <head>
        <script> function h(){alert(“this is web-dev script in HEAD Tag”);}</script>
                                           </head>
                                             <BD>
                                           <BODY >
                               <script type='text/javascript'>
                      x=document.getElementsByTagName("BODY");
                     x[0].innerHTML = "name:<div id="fromDB"
            onclick="h();"><script>alert('attacker injected it, could do
                             anything');</script></div>"
                                           </script>
                                           </BODY>
                                             </BD>
                                           </html>




   then, the attackers <SCRIPT/> (which is still present there) would not execute at all.
5 PoC of XSS Patch ,-by ABK [http://www.twitter.com/abionic]


   As below, we can see the modified HTTP Response sent for a normal generated MarkUp
   Page




   Although, this can also be implemented at Web-Developer side using Server-Side Scripts
   and took benefit of until their Web-Server don’t apply such MODs or ‘ABK (secure)
   SiteHoster’ is mature enough to suit all their requirements.

   Now, here even if any <SCRIPT/> is fetched asynchronously and injected in <BODY/>
   part… even that would remain inactive inside the already formed container.


   PATCH#2
   This disabling <BODY/> inline <SCRIPT/> was noticed failing in cases, user gives
   input like <image src=”a.gif” onclick=”javascript:maliciousFunctions(args);”/>

   So, here I just used another bug; in all such cases which would not effect in
   content display of Page, but just disable these attempts.

   It simple replaces all body ‘javascript’ data with ‘javascript<span/>’ and gets
   lucky.




   CONCLUSION
   Currently, my server is not mature enough to serve all kind of Web Applications… but this
   approach is not just server-dependent.

   So, contributors for other Servers could write a module for other servers manipulating the
   Final Web-Page data sent to User in above required manner.

   And until then, Web-Developers can themselves introduce a module in their Web-Application
   to handle all requests and response… thus just a single point would be able to serve the
   purpose.

   You can mail me at above e-mail ID if you face any issue in implementing the method, or
   think it is flawed in any way.

Contenu connexe

Tendances

Spring Boot & WebSocket
Spring Boot & WebSocketSpring Boot & WebSocket
Spring Boot & WebSocket
Ming-Ying Wu
 
Service Worker 201 (en)
Service Worker 201 (en)Service Worker 201 (en)
Service Worker 201 (en)
Chang W. Doh
 

Tendances (20)

Spring Boot & WebSocket
Spring Boot & WebSocketSpring Boot & WebSocket
Spring Boot & WebSocket
 
Nodejs.meetup
Nodejs.meetupNodejs.meetup
Nodejs.meetup
 
Webpack packing it all
Webpack packing it allWebpack packing it all
Webpack packing it all
 
The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web Components
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!
 
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
 
Hitchhiker's guide to the front end development
Hitchhiker's guide to the front end developmentHitchhiker's guide to the front end development
Hitchhiker's guide to the front end development
 
Service Worker 201 (en)
Service Worker 201 (en)Service Worker 201 (en)
Service Worker 201 (en)
 
High Performance JavaScript - jQuery Conference SF Bay Area 2010
High Performance JavaScript - jQuery Conference SF Bay Area 2010High Performance JavaScript - jQuery Conference SF Bay Area 2010
High Performance JavaScript - jQuery Conference SF Bay Area 2010
 
Node.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseNode.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash Course
 
Chrome enchanted 2015
Chrome enchanted 2015Chrome enchanted 2015
Chrome enchanted 2015
 
Building and deploying React applications
Building and deploying React applicationsBuilding and deploying React applications
Building and deploying React applications
 
20160905 - BrisJS - nightwatch testing
20160905 - BrisJS - nightwatch testing20160905 - BrisJS - nightwatch testing
20160905 - BrisJS - nightwatch testing
 
Panmind at Ruby Social Club Milano
Panmind at Ruby Social Club MilanoPanmind at Ruby Social Club Milano
Panmind at Ruby Social Club Milano
 
Clojure Web Development
Clojure Web DevelopmentClojure Web Development
Clojure Web Development
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具
 
Play Framework workshop: full stack java web app
Play Framework workshop: full stack java web appPlay Framework workshop: full stack java web app
Play Framework workshop: full stack java web app
 
Building a js widget
Building a js widgetBuilding a js widget
Building a js widget
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJS
 
Serverless 프레임워크로 Nuxt 앱 배포하기
Serverless 프레임워크로 Nuxt 앱 배포하기Serverless 프레임워크로 Nuxt 앱 배포하기
Serverless 프레임워크로 Nuxt 앱 배포하기
 

Similaire à XSS Defeating Trick ~=ABK=~ WhitePaper

Jboss Exploit
Jboss ExploitJboss Exploit
Jboss Exploit
drkimsky
 
[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders
Dmitry Makarchuk
 
[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design
Christopher Schmitt
 

Similaire à XSS Defeating Trick ~=ABK=~ WhitePaper (20)

Jboss Exploit
Jboss ExploitJboss Exploit
Jboss Exploit
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
XSS Defeating Concept - Part 2
XSS Defeating Concept - Part 2XSS Defeating Concept - Part 2
XSS Defeating Concept - Part 2
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)
 
JavaScript Perfomance
JavaScript PerfomanceJavaScript Perfomance
JavaScript Perfomance
 
"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders
 
Packing it all: JavaScript module bundling from 2000 to now
Packing it all: JavaScript module bundling from 2000 to nowPacking it all: JavaScript module bundling from 2000 to now
Packing it all: JavaScript module bundling from 2000 to now
 
[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design
 
[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design
 
[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design
 
[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
 
Webpack
Webpack Webpack
Webpack
 
[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit MavenBuilding Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
 
[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design
 

Plus de Abhishek Kumar

An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring
Abhishek Kumar
 
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Abhishek Kumar
 

Plus de Abhishek Kumar (16)

Insecurity-In-Security version.2 (2011)
Insecurity-In-Security version.2 (2011)Insecurity-In-Security version.2 (2011)
Insecurity-In-Security version.2 (2011)
 
Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)
 
DevOps?!@
DevOps?!@DevOps?!@
DevOps?!@
 
xml-motor ~ What,Why,How
xml-motor ~ What,Why,Howxml-motor ~ What,Why,How
xml-motor ~ What,Why,How
 
XML-Motor
XML-MotorXML-Motor
XML-Motor
 
DevOps with Sec-ops
DevOps with Sec-opsDevOps with Sec-ops
DevOps with Sec-ops
 
Syslog Centralization Logging with Windows ~ A techXpress Guide
Syslog Centralization Logging with Windows ~ A techXpress GuideSyslog Centralization Logging with Windows ~ A techXpress Guide
Syslog Centralization Logging with Windows ~ A techXpress Guide
 
Squid for Load-Balancing & Cache-Proxy ~ A techXpress Guide
Squid for Load-Balancing & Cache-Proxy ~ A techXpress GuideSquid for Load-Balancing & Cache-Proxy ~ A techXpress Guide
Squid for Load-Balancing & Cache-Proxy ~ A techXpress Guide
 
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress GuideEthernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
 
Solaris Zones (native & lxbranded) ~ A techXpress Guide
Solaris Zones (native & lxbranded) ~ A techXpress GuideSolaris Zones (native & lxbranded) ~ A techXpress Guide
Solaris Zones (native & lxbranded) ~ A techXpress Guide
 
An Express Guide ~ "dummynet" for tweaking network latencies & bandwidth
An Express Guide ~ "dummynet" for tweaking network latencies & bandwidthAn Express Guide ~ "dummynet" for tweaking network latencies & bandwidth
An Express Guide ~ "dummynet" for tweaking network latencies & bandwidth
 
An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring An Express Guide ~ Zabbix for IT Monitoring
An Express Guide ~ Zabbix for IT Monitoring
 
An Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
An Express Guide ~ Cacti for IT Infrastructure Monitoring & GraphingAn Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
An Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
 
An Express Guide ~ SNMP for Secure Rremote Resource Monitoring
An Express Guide ~ SNMP for Secure Rremote Resource MonitoringAn Express Guide ~ SNMP for Secure Rremote Resource Monitoring
An Express Guide ~ SNMP for Secure Rremote Resource Monitoring
 
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
 
FreeSWITCH on RedHat, Fedora, CentOS
FreeSWITCH on RedHat, Fedora, CentOSFreeSWITCH on RedHat, Fedora, CentOS
FreeSWITCH on RedHat, Fedora, CentOS
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

XSS Defeating Trick ~=ABK=~ WhitePaper

  • 1. 1 PoC of XSS Patch ,-by ABK [http://www.twitter.com/abionic] WHITEPAPER XSS Defeating A Trick to Subvert XSS in JavaScript enabled Browsers Without Removing or Validating Any User Input By, ABK [AbhishekKr] abhikumar163 @ gmail.com http://www.twitter.com/abionic Objective: “Let Security Be Served By Web Server", don't push it on Web Developer. Background Information: Here, I’m suggesting a method using which Web Developer wouldn’t have to worry of user input validation to prevent XSS Attack; and User wouldn’t have to block javascript on its browsers… as this will subvert all the <SCRIPT/> not introduced by Web Developer. I’ll be using my Web Server just to show my PoC, as I’ve already implemented the required module in my Web Server. I’ve been working on a Web Server ‘ABK (secure) SiteHoster’ hosted at This project is hosted at: http://sourceforge.net/projects/sitehoster XSS-Patch support is only present in Latest Release: https://sourceforge.net/downloads/sitehoster/v1.0beta%20RC1/ How To Use PoC: I have provided ‘ABK (S)SH - XSS Patch PoC.zip’ file at above location which have a ‘StartDemo.bat’ file, so you extract this ZIP file to a folder and run this Batch file to start the PoC Demo {to run it on linux, give the ‘java –jar …..’ command in Batch file on shell with Web-Root Path in place of %currDir% and POSIX in place of WIN32}. Then you can browse ‘http://localhost/tweet.htm’; their enter any <SCRIPT/> you want to test and ‘submit’ it. The clicking button ‘Read TweeTexT…’ will load your <SCRIPT/> to Page. You can even check for the SCRIPT saved in ‘tweet.csv’ file saved at Web-Root. I have also uploaded PoC Video Demo: >> as ‘ABK_XSSPatch_PoC_Video’ on SourceForge, it is 7-zipped to 1.x mb download >> it is can also be viewed at: http://www.youtube.com/watch?v=ENiiAccY1v0 With an aim of "Let Web Security Be Served By Web Server", don't make it a headache of Web Developer. I'm a security enthusiast and developer who is trying to build a Web Server secured from ground level up.
  • 2. 2 PoC of XSS Patch ,-by ABK [http://www.twitter.com/abionic] To start with enabling server with the facilities to subvert any kind of XSS attacks. For, this I’ve implemented a trick I discovered last year for implementing security in one of my college project. I was just waiting for a proper PoC and more testing on my part, which took somewhat longer time due to lack of managed time. Concept: Browser uses ‘JavaScript Blockers’ but those services even block the legitimate <SCRIPT/> to run. So, here I’ve a way using which all the illegitimate <SCRIPT/> can be made inactive automatically without use of any Blocker/Filter/Validation. So, Web Developer and Web Browser don’t require any kind of Blocking/Filtering/Validation to implement this solution. Since Blocking avoids execution of legitimate code also. Filtering and Validation may sometimes not work due to advanced obfuscation of <SCRIPT/> injected. Any attacker succeeding in injecting a <SCRIPT/> portion in your Web Content can launch an XSS Attack. But, no matter what kind of <SCRIPT/> is injected, that will get loaded as part of <BODY/> tag. So, using this method will allow activity of all <SCRIPT/> in <HEAD/> tag. Along with that, it would make inactive all the <SCRIPT/> injected (sync/async both modes) in <BODY/> tag. It doesn’t require any new feature to be implemented for this, but simply uses a Bug (facility for us) of Browsers to implement this.
  • 3. 3 PoC of XSS Patch ,-by ABK [http://www.twitter.com/abionic] Working Mechanism: Suppose, Web-App has a page with code: <html> <head> <script> function h(){alert(“this is web-dev script in HEAD Tag”);}</script> </head> <body>name:<div id=”fromDB” onclick=”h();”>~=ABK=~</div></body> </html> Now, if any attacker visiting this web-application have provided data containing ‘any <SCRIPT/>’ to be inserted in this page. Even then, implementing this solution web-developer needs to validate no XSS attacks (remember our aim is leave it to Web Server). So, suppose there was a <SCRIPT/> provided by attacker, which got saved in your DB and will be retrieved back to <DIV id=’fromDB’/> present in <BODY/> tag. So, it would look like something… <html> <head> <script>function h(){alert(“this is web-dev script in HEAD Tag”);}</script> </head> <body>name: <div id=”fromDB” onclick=”h();”> <script>alert(‘attacker injected it, could do anything’);</script> </div> </body> </html>
  • 4. 4 PoC of XSS Patch ,-by ABK [http://www.twitter.com/abionic] Wait, this is not the end  But, this is just the Web-Page generated at server-side and handled to our Web-Server… now our Web-Server has a module to transform it into something like this… <html> <head> <script> function h(){alert(“this is web-dev script in HEAD Tag”);}</script> </head> <BD> <BODY > <script type='text/javascript'> x=document.getElementsByTagName("BODY"); x[0].innerHTML = "name:<div id="fromDB" onclick="h();"><script>alert('attacker injected it, could do anything');</script></div>" </script> </BODY> </BD> </html> then, the attackers <SCRIPT/> (which is still present there) would not execute at all.
  • 5. 5 PoC of XSS Patch ,-by ABK [http://www.twitter.com/abionic] As below, we can see the modified HTTP Response sent for a normal generated MarkUp Page Although, this can also be implemented at Web-Developer side using Server-Side Scripts and took benefit of until their Web-Server don’t apply such MODs or ‘ABK (secure) SiteHoster’ is mature enough to suit all their requirements. Now, here even if any <SCRIPT/> is fetched asynchronously and injected in <BODY/> part… even that would remain inactive inside the already formed container. PATCH#2 This disabling <BODY/> inline <SCRIPT/> was noticed failing in cases, user gives input like <image src=”a.gif” onclick=”javascript:maliciousFunctions(args);”/> So, here I just used another bug; in all such cases which would not effect in content display of Page, but just disable these attempts. It simple replaces all body ‘javascript’ data with ‘javascript<span/>’ and gets lucky. CONCLUSION Currently, my server is not mature enough to serve all kind of Web Applications… but this approach is not just server-dependent. So, contributors for other Servers could write a module for other servers manipulating the Final Web-Page data sent to User in above required manner. And until then, Web-Developers can themselves introduce a module in their Web-Application to handle all requests and response… thus just a single point would be able to serve the purpose. You can mail me at above e-mail ID if you face any issue in implementing the method, or think it is flawed in any way.