10

A pop-up ad box appears whatever site I am opening. Tried resetting settings, disabling extensions, removing all users on chrome.

It seems it is not about chrome since same thing happens on Firefox too which I hadn't even opened before.

I suspect it may have something to do with some repositories I added lately, even if so what to do?

Let me describe the pop-up since I can't upload an image because I don't have enough reputation. It places itself at the middle of the page and not so big. Does not move with the rest of the page, stays while scrolling the page. Inside there is sometimes google ads. AdBlock blocks the content but not the pop-up itself.

An image of the pop-up

The result of inspect element:

<div id="thisisonesplashforclicktocloseidhere" style=
  "position:fixed;z-index:999900;top:50%;left:50%;margin-top:-125px;margin-left:-150px;width:300px;height:250px;background-color:#fff;border:4px solid #444;-moz-box-shadow:0 0 12px 4px #888;-webkit-box-shadow:0 0 12px 4px #888;box-shadow:0 0 12px 4px #888;-webkit-border-radius:4px;border-radius:4px;">
  <iframe frameborder="0" height="0" scrolling="no" src=
  "http://guzelyemek.com/reklam.html?gads_300x250" style=
  "display: none !important; visibility: hidden !important; opacity: 0 !important;"
    width="0"></iframe><a href="javascript:hideADSnow()" id="clickonME" style=
    "position:absolute;top:-8px;right:-7px;display:block;width:29px;height:29px;background:transparent url(http://3.bp.blogspot.com/-2pNyEIhTbiU/UWJ-FMsZktI/AAAAAAAAUKg/3FPcPp0CNko/s1600/close-button.png) no-repeat top left;"></a>

chrome://plugins:

enter image description here

Note: Using AdBlock Plus it is possible to block it. I just added the id of the box's div to the filter list but that's just curing the symptoms not the actual illness. So journey continues.

About scanning with ClamTk: It found some 1732 threat which consist mostly (I mean almost all of them) of windows files and interestingly some of ClamAV's own files. Only meaningful entries were these:

  • /usr/lib/shim/shim.efi
  • /usr/lib/shim/shim.efi.signed
  • /boot/efi/EFI/ubuntu/shimx64.efi
  • /boot/efi/EFI/ubuntu/MokManager.efi
  • /home/mumi/.cache/mozilla/firefox/50ug9xkr.default/cache2/entries/35CD2F7BA91E394C584FB72D214090559CC987F8

I just deleted the Firefox thing but don't think other things are harmful.

Ok, I found this suspicious code from the sources tab of Firefox debugger tool:

f (window==window.top) {
   function hideADSnow() {
     document.getElementById('thisisonesplashforclicktocloseidhere').style.display='none';
     document.getElementById('thisisonesplashforclicktocloseidhere').innerHTML =' ';
  }

  var writeNow="";
  writeNow += "<div style=\"position:fixed;z-index:999900;top:50%;left:50%;margin-top:-125px;margin-left:-150px;width:300px;height:250px;background-color:#fff;border:4px solid #444;-moz-box-shadow:0 0 12px 4px #888;-webkit-box-shadow:0 0 12px 4px #888;box-shadow:0 0 12px 4px #888;-webkit-border-radius:4px;border-radius:4px;\" id=\"thisisonesplashforclicktocloseidhere\">";

  writeNow += "<iframe src=\"http:\/\/habermatich.com\/gads\/show_ads.php?format=gads_300x250\" width=\"300px\" height=\"250px\" frameBorder=\"0\" scrolling=\"no\"><\/iframe>";

  writeNow += "<a href=\"javascript:hideADSnow()\" id=\"clickonME\" style=\"position:absolute;top:-8px;right:-7px;display:block;width:29px;height:29px;background:transparent url(http:\/\/3.bp.blogspot.com\/-2pNyEIhTbiU\/UWJ-FMsZktI\/AAAAAAAAUKg\/3FPcPp0CNko\/s1600\/close-button.png) no-repeat top left;\"><\/a>";
  writeNow += "<\/div>";
  try { 
    var checkIs = document.getElementById('ads_boxy');
  } catch(err) { 
    var checkIs = null;
  }
  if (checkIs == null) {
    var adsbox = document.createElement('div');
    adsbox.id = 'ads_boxy';
    document.body.appendChild(adsbox);
  }
  var checkIs = document.getElementById('ads_boxy');
  checkIs.innerHTML = writeNow;
}

Even when trying to install Ubuntu from start it's there.

This guy seems to have the same problem with me. I suspect this is a root kit of some kind but both rkhunter and chkrootkit didn't find anything. Maybe it is a new root kit.

I tried another router with no luck. Restarting router numerously didn't help. It doesn't show on the windows machine on the network or windows on my machine(it is a dual boot system) any more but I saw at least once on both. I guess I only have one option now.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
mumi
  • 133
  • 1
    Could you add to your question a snapshot of that ad pop-up or screen-shot of chrome or firefox ? – Sergiy Kolodyazhnyy Oct 28 '14 at 16:27
  • I don't have enough reputation :) – mumi Oct 28 '14 at 16:29
  • just need 1 more points; only if someone didn't downvoted the moment it is submitted :( – mumi Oct 28 '14 at 16:45
  • 2
    Please upload the snapshot at http://imgur.com and add the link in your question. Someone will put the actual picture in there. – user68186 Oct 28 '14 at 16:48
  • thank you @user68186, too busy finding simplest solutions :) – mumi Oct 28 '14 at 16:53
  • 1
    In chrome, try going to chrome://plugins and posting a list of what you see there in the main post. –  Oct 28 '14 at 16:56
  • 1
    Hmmm, plugins page is same as mine - nothing fishy there, it seems – Sergiy Kolodyazhnyy Oct 28 '14 at 17:10
  • 1
    Have you tried clearing everything cache/browsing history and restarting the browsers ? There are some persistent cookies, too, that can survive even if you clear browsing history, so try installing BleachBit ( from software center ), and clean everything with that – Sergiy Kolodyazhnyy Oct 28 '14 at 17:17
  • @Xieerqi Did all of that but let me try it. – mumi Oct 28 '14 at 17:24
  • @Xieerqi Did not work :( – mumi Oct 28 '14 at 17:30
  • 1
    Not even with BleachBit ? – Sergiy Kolodyazhnyy Oct 28 '14 at 17:48
  • 1
    Ok, try scanning with ClamAV/ClamTk antivirus, it may be a rare case of Linux malware, but i doubt it. I still tend to believe this is a persistent cookie that makes your browser display a popup. There is two URLs in the "inspect element" line you posted. You could try getting a website blocker for firefox - such as Block site 1.1.8 - and blacklist those two URLs. Let us now what ClamAV/ClamTk says – Sergiy Kolodyazhnyy Oct 28 '14 at 18:19
  • ClamTk is running for hours now (maybe I should make him skip the windows partition). Those URLs change everytime when a new page loads, I'm guessing they're just sources of the images of the ads. – mumi Oct 28 '14 at 19:31
  • My guess is that it has something to do with some repositories I added a couple hours before this happened. Should I add some detail about that?@Xieerqi – mumi Oct 28 '14 at 19:33
  • 2
    This looks like a man-in-the-middle injection of ads. Are you on a trusted network? Can you post the details of your proxy settings, if you are using a proxy? Also, if possible, could you post a link to the full HTML of a webpage that shows the popup? Finally, does the popup appear if you visit an encrypted page, like your webmail? – Travis G. Oct 28 '14 at 20:00
  • I am at home and actually didn't do anything about network as far as I know.I really don't how a proxy is used but my network settings are all auto or default. Popup does not select a particular webpage, even askubuntu homepage or reddit shows it, so it is probably not coming from the webpage that is being visited. But gmail doesn't show it so you have some lead in here sir @TravisG. – mumi Oct 28 '14 at 21:41
  • I would recommend to disable/remove all non-canonical repositories (and please do share the details here, of the repositories you had installed). Uninstall all antivirus software and remove all 3rd party toolbars from all browsers. Also remove all software of unknown reputation from your system (check the Ubuntu software center for all installations). – Sri Oct 29 '14 at 06:15
  • I agree with @TravisG. Are there injected code and pop-ups on TLS-encrypted web sites? If Gmail doesn't suffer, then it's likely because of its site-wide encryption. Can you test if a live system or other machines on the same network exhibit the same behaviour? – David Foerster Nov 07 '14 at 13:38
  • It was showing up even after I select "try ubuntu" from a live usb. The sites with a "https" at their start didn't seem to be effected. A windows machine on the network showed it once or twice but after numerous attempts (involving resetting router numerous times, using malwarebytes) to solve, it was gone(I really don't have any idea why). I tried a different router connecting directly with a cable from my notebook, it was still there. Well I just reinstalled the ubuntu now and it seems gone.@DavidFoerster – mumi Nov 07 '14 at 14:03

6 Answers6

8

Since you mentioned in comment that the other computer on the network started having the same issue, it may well be that your router settings are altered or the router is infected (yes, that is possible). In fact, your problem is very very similar to this post from security.stackexchange.com . FIY, you may want to use that site in such cases , cuz there's more people who deal with this type of issues.

OK, back to the problem . If you research it a little you'll find that probably a very common problem with routers is when DNS settings are altered. There's also more serious malware for routers,too. DNS server is basically a translator: since computers only deal in numbers, when you type "google.com" in a browser, your computer will send request to DNS servers saying " Hey, what's IP address for google.com? " . DNS server on his side looks through databases, and finds what IPs belong to google.com. Now, if your router's DNS settings are changed, the request goes to a fake DNS server, which will redirect you to fake website or a website that looks like real thing but with malware.

What can be done is the following:

  • Access your router's settings, and check if DNS settings have been altered. You can access them typically by typing 192.168.0.1 into address bar of Firefox or any other browser, and it should open a page with all sorts of settings for your router (read up on your router's manual to make sure the address is right). But if you've never looked at these settings before, it may be hard to determine whether or not something has been changed. Also, look if any routing settings were changed or you see something fishy there.

  • Reset the router to default settings. Again, this can be done through 192.168.0.1 . This may be under "Advanced Options", but search around the settings or just read the manual. Good idea is to reboot the router after you changed the settings back to default to make sure it takes effect. If that helps and the popup doesn't come up any more on either machine, change router's admin password to something else than before and something strong, plus maybe change wifi password (WPA PSK or whatever you're using).

  • Get a new router. You could either buy one yourself and configure it or contact your Internet service provider , explaining the situation. They may offer more options, too.

Among other things, what I'd do in such case is do some small tests.

  • You mentioned that you connect by wifi and have Windows files there. So is it a laptop ? you double boot ? Try taking it to another network, and see if pop-up persists. If it doesn't show up on another networ - it's definitely your router.

  • Does it show up in Windows ? If it's the router , it's definitelly not related to OS or your browsers or anything like that.

  • Change your settings for DNS in Ubuntu. The thing is that Ubuntu's Network Manager by default will let a dnsmaq plug in decide what DNS to use (and typically it will be your internet service provider's'). Now, you can use your own DNS regardless of what internet service provider gives. To do that - open the Networ Manager indicator in the right side corner and go to Edit connections. Select the network, and click Edit button. Go to IPv4 tab, change drop down menu from "Automatic (DHCP)" to "Automatic (DHCP) addresses only", and where DNS servers type in whatever DNS server you like. You can choose 8.8.8.8 (Google's public DNS). I use OpenDNS(208.67.222.222). these are well known and trusted. Then open terminal and type sudo nano /etc/NetworkManager/NetworkManager.conf and change line dns=dnsmasq to #dns=dnsmasq. Save file with Ctrl+O and exit with Ctrl+X. Now you could either do sudo service network-manager restart or simply reboot the computer. I'd prefer rebooting. Connect again to your network, and once ready in terminal type nm-tool | tail. It should confirm you're using your selected DNS. If popup doesn't persists with such settings - definitely router's DNS problem. Steps I've gone through here is same as I've described in my other post here

That is it. I'm in no way computer security expert, so everything in this post is the best I can suggest. Best of luck! and let us know if this helps, or how you solved the problem in the end.

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
1

Could it be your Proxy settings routing your traffic via some server that injects this in to the HTML? Try this from your terminal:

echo $http_proxy

Should come back with nothing. (Or at least nothing unexpected.)

Chrisky
  • 211
  • 2
  • 3
  • 1
    Yeah it printed nothing – mumi Oct 29 '14 at 00:06
  • 1
    OK. So it's probably not a proxy thing. Another suggetsion: have you tried firing up the Chrome Debugger (F12), use the Network tab, visit a simple page, then looking at the Network traffic? Is the code for the pop-up served anywhere here? Or failing that: Wireshark. Again, visit the simplest page that generates an ad, and see where the traffic for this is coming from. If it's not coming via the network, then yep, it's probably a plug-in. – Chrisky Oct 29 '14 at 08:42
  • It somehow stopped on chrome but on firefox it shows on network. but I really didn't understand what they mean. They are just domains that uses google ads to advertise. If there is a way to share the result of the network tool, I can. – mumi Oct 29 '14 at 11:44
0

Just re-install of browsers should fix this. I had similar issue and removed as many toolbars possible; but nothing helped. If you could, take a backup of bookmarks and re-install the browsers.

BDRSuite
  • 3,156
  • 1
  • 12
  • 11
  • it seems it has nothing to do with browsers but will give it a try if nothing helps at the end. – mumi Oct 28 '14 at 16:41
0

Try installing Ad-block plus addon for chrome and firefox from Chrome Web store and Firefox Addon store respectively. That should get rid of anything erratic like your problem.

Hope this helps...

  • Ad preventing extensions blocks the ads inside the box but not the box itself. That's why I think it's probably a kind of malware. But thanks. – mumi Oct 28 '14 at 18:04
  • 1
    ABP can block the box as well... – manishraj2011 Oct 28 '14 at 18:08
  • 1
    I managed to prevent it to show itself by blocking its div id from adblock settings, so practically the problem is solved but there might be deeper reasons to it so let me wait a bit to accept this as answer but thanks a lot. – mumi Oct 28 '14 at 21:22
0

It can be a browser extension. Please enter in Menu > Tools > Extensions, uninstall all extensions that you consider suspect.

So, you can try remove the configuration files from these browser.

Close the browser,open the terminal and perform:

rm -fR ~/.config/google-chrome

Open the browser.

Good luck.

  • Only adblock is active now and I really don't have much extension.Just one question about removing things on a linux system: is this reversible? – mumi Oct 28 '14 at 19:38
  • 1
    If you remove this directory, it won't make any trouble on your system. The directory ./config/google-chrome is created when you open the browser at first time. When you remove it and reopen the browser the directory is created again. So, if you don´t syncronize your bookmarks, I recommend you rename the directory using mv ~/.config/google-chrome ~/.config/google-chrome-backup for example. – Marcos Silveira Oct 28 '14 at 20:18
  • Hmm.. That didn't work for me :( I mean not the backup thing but deleting config file. – mumi Oct 28 '14 at 22:13
  • @mumi You mentioned that it stopped in chrome somehow. Did it stop after deleting folder and reboot? Or just randomly stopped? – Sergiy Kolodyazhnyy Oct 30 '14 at 21:18
  • @Xieerqi Randomly stopped and came back plus started at the other computer on the network – mumi Oct 31 '14 at 00:41
  • @mumi Did you connect to the other computer in any way, or they just share router ? – Sergiy Kolodyazhnyy Oct 31 '14 at 01:12
  • @Xieerqi Just router. The router is connected via cable to the other computer, I connect via wireless. – mumi Oct 31 '14 at 12:19
0

A fresh install of ubuntu seems to solve the problem.

mumi
  • 133