• 请不要在回答技术问题时复制粘贴 AI 生成的内容
timeromantic
V2EX  ›  程序员

数据库被黑客勒索 BT 币,一番骚操作最终恢复!

  •  
  •   timeromantic · Jun 25, 2019 · 8997 views
    This topic created in 2691 days ago, the information mentioned may be changed or developed.

    其实并不是什么骚操作,常规操作吧,这次被黑客删除数据库总结如下:

    1.数据库 root 弱口令密码,root:123@tcp(132.232.126.162:3306)/mine?charset=utf8 123 这样的密码超级容易被人进行字典暴力破解

    2.数据库端口开放 3306,一般来说,公司内容不允许远程开放 3306 的,由于个人博客就没有注意,导致 3306 暴露,目前已经使用 docker 把数据库端口改为 6514 了。

    所以,建议大家开启 binlog,和 crontab 每日备份,修改弱口令,修改 3306 默认端口

    详细操作记录: https://www.printf520.com/single.html?id=53

    Supplement 1  ·  Jun 26, 2019
    昨天博客的访问量有八百多人,腾讯云 1M 的小水管带宽还能支持住,GOlang 后端的性能还是不错的。
    <img src="https://i.loli.net/2019/06/26/5d12d0ea8ee1853913.png" alt="微信图片_20190626095647.png" title="微信图片_20190626095647.png" />
    Supplement 2  ·  Jun 26, 2019

    微信图片_20190626095647.png

    44 replies  •  2019-06-26 17:36:27 +08:00
    sugars
    sugars
    Jun 25, 2019
    1
    你这都不用字典了,手输都能破解
    lvzhiqiang
    lvzhiqiang
    Jun 25, 2019
    2
    你这 123 和 密码为空有区别么?
    ys0290
    ys0290
    Jun 25, 2019 via iPhone❤️1
    3
    还不如 root:root 呢
    uio
    uio
    Jun 25, 2019
    4
    你可以把 db 跑在 127.0.0.1 上,
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    5
    @uio 是可以跑在 127.0.0.1 上面,不过为了开发时候方便远程访问就开放了
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    6
    @sugars 大兄弟,说得对,还好找回数据了,不然就后悔惨了
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    7
    @lvzhiqiang 汗颜!~
    uio
    uio
    Jun 25, 2019❤️1
    8
    @timeromantic 用 ssh 做个代理
    rootww21
    rootww21
    Jun 25, 2019
    9
    没有骚操作啊
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    10
    @rootww21 对,一开始就说了常规操作
    tfbrown
    tfbrown
    Jun 25, 2019
    11
    楼主你这博客是真的慢啊
    miaomiao0323
    miaomiao0323
    Jun 25, 2019
    12
    你的博客用啥框架做的,挺好看的
    dangbiao1991
    dangbiao1991
    Jun 25, 2019
    13
    你这数据库还有人勒索,是搞笑的么?
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    14
    @tfbrown 腾讯云 1M 带宽的小水管,我看现在博客活跃用户有几百人,带宽不行
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    15
    @dangbiao1991 黑客是遍地扫描,数据重不重要都不管
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    16
    @miaomiao0323 比较简介冷淡,还以为没有人喜欢这个 style
    https://www.printf520.com/about.html
    cstj0505
    cstj0505
    Jun 25, 2019
    17
    弱口令+开放外网+默认端口,这个确实容易被破。

    我之前阿里云 pg 的弱口令,没暴露外网,都被黑了
    natforum
    natforum
    Jun 25, 2019
    18
    非必要还是文本存储好,不要用什么数据库
    laoyur
    laoyur
    Jun 25, 2019❤️2
    19
    黑客说:哦好的,132.232.126.162:6514,以后重点照顾下
    Valid
    Valid
    Jun 25, 2019
    20
    哦好的,以后 binlog 也一起加密
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    21
    @laoyur 哈哈。。。6514 也是乱说的
    clino
    clino
    Jun 25, 2019
    22
    "目前已经使用 docker 把数据库端口改为 6514 了"
    你就不能加上此端口能访问的白名单吗? 这样不就没法被外面访问到了.
    MaxTan
    MaxTan
    Jun 25, 2019
    23
    所以恢复数据的骚操作就是给黑客打钱么。。。
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    24
    @MaxTan 2333333
    Varobjs
    Varobjs
    Jun 25, 2019 via Android
    25
    我的也被黑了,不过我的骚操作上重做系统,数据没啥东西不要了
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    26
    @Varobjs 不至于重做系统吧?
    98jiang
    98jiang
    Jun 25, 2019
    27
    请问一下左下角那个是怎么做的
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    28
    @98jiang 网上有开源的
    vx2018
    vx2018
    Jun 25, 2019
    29
    假评论数....
    timeromantic
    timeromantic
    OP
    Jun 25, 2019
    30
    @vx2018 没有假评论数啊?
    bruce2000
    bruce2000
    Jun 26, 2019
    31
    对左下角那个图片感兴趣,点击还有反应,请教下这个是啥技术
    mzdblsw8
    mzdblsw8
    Jun 26, 2019 via iPhone
    32
    博客不错。开源吗?
    opengps
    opengps
    Jun 26, 2019
    33
    这里的这种场景,linux 的策略就不如 windows 的独占文件。前东家生产环境的数据库服务器被加密勒索,然后数据库成功躲过,因为使用中的数据库文件不能被其他程序操作,数据导出到其他机器,在把这个机器重做系统即可
    waruqi
    waruqi
    Jun 26, 2019 via Android
    34
    blog 我还是乖乖架在 github pages 好了,省心省力
    timeromantic
    timeromantic
    OP
    Jun 26, 2019
    35
    @waruqi 自己做可定制,想怎么改就怎么改,自由度大
    timeromantic
    timeromantic
    OP
    Jun 26, 2019
    36
    @opengps 这样确实省心
    timeromantic
    timeromantic
    OP
    Jun 26, 2019
    37
    @mzdblsw8 暂时没有开源
    timeromantic
    timeromantic
    OP
    Jun 26, 2019
    38
    @bruce2000 就是 3D 加人物模型
    webshe11
    webshe11
    Jun 26, 2019
    39
    对待“宝贵的博客数据”得拿出点安全态度,“开发时候方便远程访问”,但是生产环境的 3306 就不应该暴露,改成什么都没用
    我一般都是用 docker-compose 把 web 和 db 搞到一个项目里面,这样就可以创建一个虚拟的 network,只暴露 web 端口就可以在很大程度上降低攻击面
    opengps
    opengps
    Jun 26, 2019
    40
    800 多人不一定算多。
    承载能力看峰值,不看总量,我也是低配 1 核 2G1M 机器,一天 1000 无压力,因为峰值只有几个人
    no1xsyzy
    no1xsyzy
    Jun 26, 2019
    41
    改端口号就是骗自己
    nmap 就全出来了
    VjZ6b8ld9OB5PLB0
    VjZ6b8ld9OB5PLB0
    Jun 26, 2019
    42
    限制登录 IP
    zephyru
    zephyru
    Jun 26, 2019❤️1
    43
    @bruce2000
    @98jiang
    统一回复一下..左下角是 live2d 这里博主用的是自带的模型...
    有精力其实可以自己搞模型..比如从一些手游里拆包..很有趣的
    zhuweiyou
    zhuweiyou
    Jun 26, 2019
    44
    改端口号有什么用吗...另外 800 人随便什么语言都可以吧,非要吹 GO?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1207 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 69ms · UTC 17:51 · PVG 01:51 · LAX 09:51 · JFK 12:51
    ♥ Do have faith in what you're doing.