Skip to content

Instantly share code, notes, and snippets.

@leoloobeek
Last active May 1, 2017 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoloobeek/a51b07f77e4f803facac60ba504544cd to your computer and use it in GitHub Desktop.
Save leoloobeek/a51b07f77e4f803facac60ba504544cd to your computer and use it in GitHub Desktop.
Simple Curl request to check for CORS misconfiguration
// Evan Johnson - Misconfigured CORS and why web appsec is not getting easier - AppSecUSA 2016
// Stolen from presentation above for quick reference
//curl https://site.com -H "Origin: https://test.com" -I | grep "Access-Control-Allow"
$.ajax({
url: "https://site.com/some/url"
success: function( data ) {
document.write("Key: " data['SOME_VAR']);
},
xhrFields: {
withCredentials: true
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment