zoukankan      html  css  js  c++  java
  • HTB::Return

    标签:sc.exe

    实验环境

    Name Return
    OS: Windows
    Difficulty: Easy
    Points: 20
    Release: 27 Sep 2021
    IP: 10.10.11.108

    渗透过程

    0x01 信息搜集

    nmap

    nmap -sC -sV -p$ports -sT 10.10.11.108
    Starting Nmap 7.91 ( https://nmap.org ) at 2021-10-08 11:53 CST
    Nmap scan report for 10.10.11.108
    Host is up (0.67s latency).
    
    PORT      STATE SERVICE       VERSION
    53/tcp    open  domain        Simple DNS Plus
    80/tcp    open  http          Microsoft IIS httpd 10.0
    | http-methods: 
    |_  Potentially risky methods: TRACE
    |_http-server-header: Microsoft-IIS/10.0
    |_http-title: HTB Printer Admin Panel
    88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2021-10-08 04:12:18Z)
    135/tcp   open  msrpc         Microsoft Windows RPC
    139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
    389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: return.local0., Site: Default-First-Site-Name)
    445/tcp   open  microsoft-ds?
    464/tcp   open  kpasswd5?
    593/tcp   open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
    636/tcp   open  tcpwrapped
    3269/tcp  open  tcpwrapped
    5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
    |_http-server-header: Microsoft-HTTPAPI/2.0
    |_http-title: Not Found
    9389/tcp  open  mc-nmf        .NET Message Framing
    47001/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
    |_http-server-header: Microsoft-HTTPAPI/2.0
    |_http-title: Not Found
    49574/tcp open  msrpc         Microsoft Windows RPC
    49666/tcp open  msrpc         Microsoft Windows RPC
    49669/tcp open  msrpc         Microsoft Windows RPC
    49688/tcp open  msrpc         Microsoft Windows RPC
    Service Info: Host: PRINTER; OS: Windows; CPE: cpe:/o:microsoft:windows
    
    Host script results:
    |_clock-skew: 18m32s
    | smb2-security-mode: 
    |   2.02: 
    |_    Message signing enabled and required
    | smb2-time: 
    |   date: 2021-10-08T04:13:21
    |_  start_date: N/A
    
    Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
    Nmap done: 1 IP address (1 host up) scanned in 106.35 seconds
    

    389-LDAP

    kali@kali ~ [1]> ldapsearch -h 10.10.11.108 -x
    # extended LDIF
    #
    # LDAPv3
    # base <> (default) with scope subtree
    # filter: (objectclass=*)
    # requesting: ALL
    #
    
    # search result
    search: 2
    result: 1 Operations error
    text: 000004DC: LdapErr: DSID-0C090A37, comment: In order to perform this opera
     tion a successful bind must be completed on the connection., data 0, v4563
    
    # numResponses: 1
    

    enum4liunx

    enum4linux -a 10.10.11.108
     ===========================================
    |    Getting domain SID for 10.10.11.108    |
     ===========================================
    Use of uninitialized value $global_workgroup in concatenation (.) or string at ./enum4linux.pl line 359.
    Domain Name: RETURN
    Domain Sid: S-1-5-21-3750359090-2939318659-876128439
    [+] Host is part of a domain (not a workgroup)
    

    80-HTTP

    HTBReturn1

    0x02 过程

    user.txt

    根据web页面内容猜测,该设备为打印机,此类设备会存储 LDAP 和 SMB 凭据,以便打印机从 Active Directory 查询用户列表,并将扫描的文件保存到用户电脑中。 这些配置页面通常允许设备指定域控制器或文件服务器。监听本地389端口,将设置中的地址改为攻击机IP,更新设置让打印机连接本机。

    HTBReturn2

    接收到打印机发来的数据包,获得 Username 与 Password svc-printer/1edFg43012!!

    image-20211009161354563

    靶机开放5985端口,使用 evil—winrm 进行连接:

    登录成功

    获得user.txt

    root.txt

    查看当前用户权限:

    权限

    当前用户属于Server Operators组,查看该组文档:

    • 该组的成员可以管理域控制器。

    • 此组仅存在于域控制器上。默认情况下,该组没有成员。

    • Server Operators 组的成员可以交互方式登录到服务器、创建和删除网络共享资源、启动和停止服务、备份和还原文件、格式化计算机的硬盘驱动器以及关闭计算机。无法重命名、删除或移动该组。

    • 其成员身份由域中的服务管理员组 Administrators 和 Domain Admins 以及林根域中的 Enterprise Admins 组控制。

    • 此组的成员无法更改任何管理组成员身份。这被视为服务管理员帐户,因为其成员具有域控制器的物理访问权限,他们可以执行维护任务 (如备份和还原) ,并且他们能够更改安装在域控制器上的二进制文件。

    经过测试,当前用户没有创建服务的权限,但可以修改服务配置信息:

    创建服务

    修改服务配置文件并重启:

    image-20211018114752769

    获得管理员权限反弹shell:

    image-20211018115208552

    得到root.txt。

    Reference

    sc.exe 服务控制管理命令详解

    sc.exe binaries

  • 相关阅读:
    20191028 Codeforces Round #534 (Div. 1)
    20191028 牛客网CSP-S Round2019-1
    UVA11464 Even Parity 搜索+递推
    CSP2019-S1 游记
    LG2921 [USACO2008DEC]Trick or Treat on the Farm 内向基环树
    bzoj 2002 Bounce 弹飞绵羊
    快速乘,快速幂,十进制快速幂,矩阵快速幂
    2019牛客暑期多校训练营(第五场) generator 1
    2019牛客暑期多校训练营(第五场) digits 2
    hdu 4714 Tree2cycle
  • 原文地址:https://www.cnblogs.com/chalan630/p/15421148.html
Copyright © 2011-2022 走看看