If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Site hаck

Started by brknny, Jul 05, 2022, 08:06 AM

Previous topic - Next topic

brknnyTopic starter

I created a mini CMS and made it available on the internet. Upon revisiting the site, I discovered that hackers had infiltrated it and posted offensive content. It seems likely that they were children, as the password for the site was easily guessed.

The question is whether the password was guessed or if there was a vulnerability in the script itself. The hackers also altered some settings, which is concerning, as they left behind information that included the upload photo width, photo preview width, photo folder, and number of records displayed per page. The authorization process involved inputting a password, which was then checked against a stored md5 hash value. If the password was incorrect, an error message would display.
Otherwise, the user would be logged in as admin.
  •  


nesterland

In each folder, include an index file that can be either PHP or HTML. Rename the login folder in the admin panel to a different name. Log all site visits including any GET and POST requests to a database.

Consider modifying the access rights for files, particularly the configuration file if one exists. This is the minimum precautionary advice that I can provide, but it's critical to create a strong password. I did not read the code in its current format as it strains my eyes.
  •  

jainteq

To enhance website security, use an SSL certificate to encrypt all data transmitted through your server and prevent interception by hаckers. An SSL certificate is increasingly important for e-commerce sites where transactions take place, and Google recommends the use of HTTPS encryption, ranking secure resources higher in search results. Hostpro web hosting provider offers SSL from reputable certification authorities with free connection and support.

Select a secure hosting service that provides reliable backups, DDoS protection, and antivirus capabilities. Hostpro backs up its clients' sites daily to servers in Ukrainian and foreign data centers while protecting them with ImunifyAV+ antivirus and DDoS defense.
To restrict unauthorized access to accounts, add two-factor authentication to the admin area and social network accounts, emails, cloud services, and other resources. Establish a secure password policy that requires 12-digit passwords with a mix of special characters and upper- and lowercase letters.

Avoid using personal information that hаckers can obtain online, and change passwords regularly. Update your software regularly to eliminate security vulnerabilities that could compromise confidential data, and ensure that the OS is current and supported. Back up website data frequently to enable prompt recovery from cyberattacks or equipment failure.
To prevent hаckers from accessing admin directories, rename the administrator directories known only to the webmaster and protect them from indexing by search engines using the file robots.txt.
  •  

alloberogar

I would provide the following in-depth analysis and recommendations for the security issues you've encountered with your mini CMS:

1. Password security:
  - The fact that the hackers were able to easily guess the admin password indicates a weak password policy and inadequate password hashing/salting.
  - Recommended best practices:
    - Enforce a strong password policy, requiring a minimum length (e.g., 12 characters) and a combination of uppercase, lowercase, numbers, and special characters.
    - Implement rate-limiting or account lockout mechanisms to prevent brute-force attacks.
    - Use a secure hashing algorithm, such as bcrypt or Argon2, and apply a unique salt to each password hash to protect against rainbow table and precomputed hash attacks.
    - Consider implementing two-factor authentication (2FA) for an additional layer of security.

2. Input validation and sanitization:
  - The hackers' ability to modify the site's settings suggests potential vulnerabilities in input validation and sanitization.
  - Conduct a thorough review of all user input fields, including those used for setting changes, to ensure that they are properly validated and sanitized to prevent code injection, SQL injection, and other types of attacks.
  - Use well-established input validation libraries or frameworks, such as those provided by your programming language's standard library or popular security-focused libraries.
  - Implement strict input validation rules, such as whitelisting allowed characters, lengths, and formats, to minimize the risk of malicious input.

3. Authorization and access control:
  - The hackers' ability to modify the site's settings indicates issues with the application's authorization and access control mechanisms.
  - Implement a robust role-based access control (RBAC) system that clearly separates administrative functions from regular user actions.
  - Ensure that only authorized users with the appropriate permissions can access and modify sensitive settings.
  - Regularly review and audit the access control policies to ensure they align with the principle of least privilege.
  - Consider implementing additional security measures, such as two-step verification or session management controls, to further strengthen the authorization process.

4. Logging and monitoring:
  - Establish comprehensive logging and monitoring mechanisms to detect and respond to suspicious activities, such as unauthorized access attempts or configuration changes.
  - Collect detailed logs, including user actions, IP addresses, timestamps, and other relevant information, to aid in incident investigation and forensics.
  - Integrate the logging system with a security information and event management (SIEM) solution or a centralized logging platform to enable real-time monitoring and alerting.
  - Regularly review the logs and investigate any anomalies or suspicious events to identify and address potential security breaches.

5. Security audits and incident response:
  - Conduct regular security audits, either internally or with the help of a reputable cybersecurity firm, to identify and address any vulnerabilities in the application's architecture, code, and deployment.
  - Develop a well-defined incident response plan to handle security incidents, such as the one you've encountered. The plan should include steps for containing the breach, investigating the incident, restoring the system, and notifying affected parties.
  - Regularly test and update the incident response plan to ensure it remains effective and aligned with the evolving threat landscape.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...