首页 > 其他分享 >Vulnhub Lin.Security靶机解题过程

Vulnhub Lin.Security靶机解题过程

时间:2022-10-31 21:34:51浏览次数:88  
标签:bin Lin tcp 2049 Vulnhub Security root bob usr

Lin.Security

靶机地址:http://www.vulnhub.com/entry/linsecurity-1,244/
由于靶机的作者直接给出了ssh用户名和密码,本题非常简单

识别目标主机IP地址

─(kali㉿kali)-[~/Vulnhub/Lin_Security]
└─$ sudo netdiscover -i eth1
Currently scanning: 192.168.165.0/16   |   Screen View: Unique Hosts       
                                                                            
 3 Captured ARP Req/Rep packets, from 3 hosts.   Total size: 180            
 _____________________________________________________________________________
   IP            At MAC Address     Count     Len  MAC Vendor / Hostname      
 -----------------------------------------------------------------------------
 192.168.56.1    0a:00:27:00:00:0a      1      60  Unknown vendor           
 192.168.56.100  08:00:27:8c:bf:0a      1      60  PCS Systemtechnik GmbH   
 192.168.56.144  08:00:27:d8:9f:d6      1      60  PCS Systemtechnik GmbH 

利用Kali Linux自带的netdiscover工具识别目标主机的IP地址为192.168.56.144

NMAP扫描

─$ sudo nmap -sS -sV -sC -p- 192.168.56.144 -oN nmap_full_scan
Starting Nmap 7.92 ( https://nmap.org ) at 2022-10-31 08:56 EDT
Nmap scan report for bogon (192.168.56.144)
Host is up (0.00014s latency).
Not shown: 65528 closed tcp ports (reset)
PORT      STATE SERVICE  VERSION
22/tcp    open  ssh      OpenSSH 7.6p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 7a:9b:b9:32:6f:95:77:10:c0:a0:80:35:34:b1:c0:00 (RSA)
|   256 24:0c:7a:82:78:18:2d:66:46:3b:1a:36:22:06:e1:a1 (ECDSA)
|_  256 b9:15:59:78:85:78:9e:a5:e6:16:f6:cf:96:2d:1d:36 (ED25519)
111/tcp   open  rpcbind  2-4 (RPC #100000)
| rpcinfo: 
|   program version    port/proto  service
|   100000  2,3,4        111/tcp   rpcbind
|   100000  2,3,4        111/udp   rpcbind
|   100000  3,4          111/tcp6  rpcbind
|   100000  3,4          111/udp6  rpcbind
|   100003  3           2049/udp   nfs
|   100003  3           2049/udp6  nfs
|   100003  3,4         2049/tcp   nfs
|   100003  3,4         2049/tcp6  nfs
|   100005  1,2,3      42673/tcp6  mountd
|   100005  1,2,3      43901/tcp   mountd
|   100005  1,2,3      48518/udp6  mountd
|   100005  1,2,3      58572/udp   mountd
|   100021  1,3,4      32885/tcp6  nlockmgr
|   100021  1,3,4      35243/udp   nlockmgr
|   100021  1,3,4      40811/tcp   nlockmgr
|   100021  1,3,4      58273/udp6  nlockmgr
|   100227  3           2049/tcp   nfs_acl
|   100227  3           2049/tcp6  nfs_acl
|   100227  3           2049/udp   nfs_acl
|_  100227  3           2049/udp6  nfs_acl
2049/tcp  open  nfs_acl  3 (RPC #100227)
40811/tcp open  nlockmgr 1-4 (RPC #100021)
43901/tcp open  mountd   1-3 (RPC #100005)
52643/tcp open  mountd   1-3 (RPC #100005)
57903/tcp open  mountd   1-3 (RPC #100005)
MAC Address: 08:00:27:D8:9F:D6 (Oracle VirtualBox virtual NIC)
Service Info: OS: 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 9.41 seconds

从NMAP扫描结果可以看到2049开放,NSF共享

Root提权

“To get started you can log onto the host with the credentials: bob/secret“

因为题目本身给出了用户名和密码:bob/secret,因此可以直接用ssh登录

┌──(kali㉿kali)-[~/Vulnhub/Lin_Security]
└─$ ssh [email protected]                  
[email protected]'s password: 

██╗     ██╗███╗   ██╗   ███████╗███████╗ ██████╗██╗   ██╗██████╗ ██╗████████╗██╗   ██╗
██║     ██║████╗  ██║   ██╔════╝██╔════╝██╔════╝██║   ██║██╔══██╗██║╚══██╔══╝╚██╗ ██╔╝
██║     ██║██╔██╗ ██║   ███████╗█████╗  ██║     ██║   ██║██████╔╝██║   ██║    ╚████╔╝ 
██║     ██║██║╚██╗██║   ╚════██║██╔══╝  ██║     ██║   ██║██╔══██╗██║   ██║     ╚██╔╝  
███████╗██║██║ ╚████║██╗███████║███████╗╚██████╗╚██████╔╝██║  ██║██║   ██║      ██║   
╚══════╝╚═╝╚═╝  ╚═══╝╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝  ╚═╝╚═╝   ╚═╝      ╚═╝  
Welcome to lin.security | https://in.security | version 1.0

bob@linsecurity:~$ id
uid=1000(bob) gid=1004(bob) groups=1004(bob)
bob@linsecurity:~$ sudo -l
[sudo] password for bob: 
Matching Defaults entries for bob on linsecurity:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User bob may run the following commands on linsecurity:
    (ALL) /bin/ash, /usr/bin/awk, /bin/bash, /bin/sh, /bin/csh,
        /usr/bin/curl, /bin/dash, /bin/ed, /usr/bin/env, /usr/bin/expect,
        /usr/bin/find, /usr/bin/ftp, /usr/bin/less, /usr/bin/man, /bin/more,
        /usr/bin/scp, /usr/bin/socat, /usr/bin/ssh, /usr/bin/vi,
        /usr/bin/zsh, /usr/bin/pico, /usr/bin/rvim, /usr/bin/perl,
        /usr/bin/tclsh, /usr/bin/git, /usr/bin/script, /usr/bin/scp
bob@linsecurity:~$ sudo bash
root@linsecurity:~# id
uid=0(root) gid=0(root) groups=0(root)
root@linsecurity:~# cd /root
root@linsecurity:/root# ls -alh
total 32K
drwx------  6 root root 4.0K Jul 11  2018 .
drwxr-xr-x 23 root root 4.0K Jul 10  2018 ..
-rw-r--r--  1 root root 3.1K Apr  9  2018 .bashrc
drwx------  2 root root 4.0K Jul 10  2018 .cache
-rw-r--r--  1 root root    0 Jul 10  2018 .cloud-locale-test.skip
drwx------  3 root root 4.0K Jul 10  2018 .gnupg
drwxr-xr-x  3 root root 4.0K Jul  9  2018 .local
-rw-r--r--  1 root root  148 Aug 17  2015 .profile
drwx------  2 root root 4.0K Jul  9  2018 .ssh
root@linsecurity:/root# 

这个靶机非常简单,只试了其中/bin/bash,因为还有很多其他的命令用于sudo提权。

标签:bin,Lin,tcp,2049,Vulnhub,Security,root,bob,usr
From: https://www.cnblogs.com/jason-huawen/p/16845880.html

相关文章

  • Linux下的C语言编写
    终端下输入:创建目录:mkdirC_Program进入目录:cdC_Program创建目录:mkdirhello_world进入目录:cdhello_world使用gedit:gedit输入以下代码并保存:#include<stdio.h>int......
  • Linux C语言 Makefile 的使用 函数
    创建三个.c文件终端输入:创建目录:mkdirMakefile进入目录:cdMakefile使用gedit:gedit第一个文件:main.c#include<stdio.h>#include"input.h"#include"calcu.h"intm......
  • FlinkSql之TableAPI详解
    一、FlinkSql的概念核心概念Flink的TableAPI和SQL是流批统一的API。这意味着TableAPI&SQL在无论有限的批式输入还是无限的流式输入下,都具有相同的语义。......
  • ST-link驱动安装(遇到的各种问题:问题1.No st-link detected.问题2:st-link usb communi
    一、上ST官方网站下载最新版本的驱动。ST官方网站:https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-develop......
  • Linux I/O模型
    I/O:指的是计算机的input和outputLinux的I/O磁盘I/O网络I/O:一切皆文件,本质为对socket文件的读写磁盘I/O进程向内核发起系统调用,请求磁盘上的某个资源......
  • [单片机框架][driver层][ioctl] MCU模拟Linux注册驱动
    概念ioctl是设备驱动程序中设备控制接口函数,一个字符设备驱动通常会实现设备打开、关闭、读、写等功能,在一些需要细分的情境下,如果需要扩展新的功能,通常以增设ioctl()命......
  • Linux finger 命令
    Linux命令是对Linux系统进行管理的命令。对于Linux系统来说,无论是中央处理器、内存、磁盘驱动器、键盘、鼠标,还是用户等都是文件,Linux系统管理的命令是它正常运行的核心,与......
  • 机器学习 之 liblinear的帮助文档翻译
    文章目录​​〇、推荐​​​​一、liblinear版本​​​​二、翻译整合​​​​介绍​​​​安装​​​​快速开始​​​​Scipy快速入门​​​​设计说明​​​​数据结构​......
  • Linux源码安装MySQL
    在Linux中源码安装MySQL​​A、必备条件​​​​a>CMake​​​​b>Boost​​​​c>Mysql​​​​B、安装详情​​​​a>添加mysql用户​​​​b>配置mysql预编译参数​​​......
  • Linux如何在history命令时,查看命令执行时间
    效果如下实现过程直接在/etc/profile文件的末尾,加上:exportHISTTIMEFORMAT="%Y-%m-%d%H:%M:%S"注意:在末尾的“引号”与“S”之间,加入一位空格,将日期时间和历史命令用空格......