• Resolved albarosa

    (@albarosa)


    Hello,

    I have a question regarding the .env files. Unfortunately, my website has been under constant attack since 03.07. Initially, the attacker targeted the .env files in order to gain access using a hacked (older) WordPress login URL:
    Date: 2024-07-03
    Time: 21:58:31
    IP: 136.243.212.110
    Request: GET request with a suspicious parameter
    User-Agent: serpstatbot/2.1 (advanced backlink tracking bot; https://serpstatbot.com/; [email protected])
    Country: Germany
    Size: 4360
    Response time: 266

    The request with a suspicious parameter was the word of the old login URL, so it is sure, that the Hacker got some sensitive files. However, it was the older login URL. With your Plugin i changed this URL to another name.

    After this and also other attacking requests, it appears that my website is infected with malware, as my hosting provider was able to detect something.

    I must mention that my website is not officially accessible yet, and it is 99% certain that the attacker is an individual from a German company, as I had created a staging copy of my website for demonstration purposes just before. In order to create this staging copy, I deactivated the firewall of your plugin by deactivating and reactivating the entire plugin once, as I noticed that the firewall was not active in this state. So I created the staging copy in this state (additionally, I also disabled the function that prevented images from being transmitted) and only reactivated the firewall on the original website after creating the staging copy. Shortly after I shared the URL of the staging copy with this company, the attacks began and are still ongoing. However, my website is now under the “Under Attack” mode of my Hosting site, making it more manageable.

    I would like to know if the .env files from your plugin are generally hidden or blocked to find out how much data the attacker could ultimately steal. Additionally, despite using now the Files .env deny codes in my .htaccess file I am unable to protect the .env files. No 404 error message is displayed and I still had constant and numerous attacks on the files until a few hours ago.

    Thank you for your response and best regards,
    albarosa

    P.S. Here is an example screenshot of how the .env requests look like: https://pasteboard.co/WphQ8k4ROb6s.png

    • This topic was modified 3 months, 2 weeks ago by albarosa.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @albarosa,

    Which hosting do you use? What architecture is there to use .env does it have FTP and DB access details?

    .env file seems accessed with the GET method means it was available to access the public and placed where it should not be, It should be accessed from the parent folder of the web.

    WordPress does not have the .env file so we still do not implement any security for it.

    Forbidden access when accessing from the website. You should add below in .htacess if you have apache or any other server which supports .htacess. if not supported it might be the reason it is accessible you can cross check by access from browser location {site_url}/{path_to_.env}

    # Disable index view
    Options -Indexes

    # Hide a specific file
    <Files .env>
    Order allow,deny
    Deny from all
    </Files>

    If .env has DB access, they might add an admin and have injected files using file manger, etc plugin.

    Better first make .env not acccesible

    Change FTP / DB password / Remove any new Admin user and change password for admin user.

    Update all WordPress core files and plugins/themes files. and now check which extra files are there. If any have the back door as infected code remove it.

    Regards

    Thread Starter albarosa

    (@albarosa)

    Hello @hjogiupdraftplus,

    My website is on a shared business hosting plan, so I don’t have my own dedicated server. I don’t know which architecture is used, and my hosting provider says there are no .env files. Furthermore, my website is still under investigation, and I’m waiting for responses from my hosting provider. Up until now, it’s not clear to me why the following code:

    <Files .env>
    Order allow,deny
    Deny from all
    </Files>

    has no effect in my .htaccess file. I added this code to the .htaccess file two days ago when I noticed the attacks, but the requests were not blocked. I tried also this code

    <FilesMatch "^\.">
    Order allow,deny
    Deny from all
    </FilesMatch>

    but without any effect.

    Similarly, I blocked the IP addresses three times: once through your plugin (i used the blacklist function in the firewall section), once via the .htaccess file with two different variants, and once through my hosting provider’s dashboard. Nevertheless, the attacks frome the same IP adresses continued until I finally put the website in “Under Attack Mode.” That helped, and there have been no attacks today. It could also be that the hosting provider has taken measures, but I don’t know what exactly. I know that my website is being investigated and tested for various issues.

    Thank you for all the tips; I have already changed all passwords. When you say:

    “Update all WordPress core files and plugins/themes files. and now check which extra files are there. If any have the back door as infected code remove it.”

    Would this possibly be a function where your PRO version could help? Or does that not fall within the scope of the plugin? Your PRO version also includes a malware scan. Would that be suitable for this?

    I see that you also offer advice for malware cleanup. I might need that.

    Thank you for a response and best regards,
    Albarosa

    • This reply was modified 3 months, 2 weeks ago by albarosa.
    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @albarosa,

    Ok, if you have shared server please contact your hosting proivder and .env file is not part of the general WordPress installation.

    Why htaccess not working server provider might can answer, It depends on the Webserver etc.

    Unfortunately, www.ads-software.com rules do not allow their forums to be used by us for paid software.
    But on our website, you can raise a support ticket.

    No it is suggestion, we do not offer manual malware clean up.

    Regards

    Thread Starter albarosa

    (@albarosa)

    Thank you very much for the very helpful answers @hjogiupdraftplus.

    I am still waiting for the results from my hosting provider, and then I will make further decisions.

    Kind regards

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @albarosa

    Ok, keep me posted.

    Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.