当前位置:网站首页>【Mongodb】READ_ ME_ TO_ RECOVER_ YOUR_ Data, the database is deleted maliciously

【Mongodb】READ_ ME_ TO_ RECOVER_ YOUR_ Data, the database is deleted maliciously

2022-06-24 22:44:00 Gu Niao

1. Introduce

My personal Baidu cloud server installed MongoDB, Default configuration used ( Port is the default port , There's no password ), Then I forgot about it , Also because I often use the wireless network card to access the Internet ,ip It is often dynamic , The security group of the ECS releases all ip. It is a database running naked on the cloud , A few days later, I found MongoDB Client connection failure , Reconnected MongoDB, The library built is missing , Left a new library :READ_ME_TO_RECOVER_YOUR_DATA, There's only one watch in it :README, The general content is that they were attacked , You need to pay bitcoin to recover .

 Insert picture description here

2. resolvent

I use the method of configuring user name and password to access the server now mongodb database , There are other ways . I access the terminal through the pagoda panel tool , You can also use other shell Tools .

  1. Connect mongodb

     Insert picture description here

  2. Add users and read / write permissions to the database

    use hcs-server
    db.createUser({
           user: "guniao", pwd: "123456", roles: [{
           role: "readWrite", db: "hcs-server" }] }) 
    
  3. verification , Output 1 Indicates that the verification is successful

    db.auth("guniao","123456")
    
  4. modify mongodb In the configuration file authorization by enabled, And restart

     Insert picture description here

  5. Use Mongodb Compass The visualizer verifies the user and password again , And re import the data

     Insert picture description here
     Insert picture description here

  6. Modify background connection mongodb Of URL Address

     Insert picture description here

Refer to the connection :
https://blog.csdn.net/qq_34241004/article/details/120704586
https://www.freesion.com/article/3431841152/

原网站

版权声明
本文为[Gu Niao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241647473182.html