ERROR: '/usr/sbin/iptables-restore -w -n' failed: iptables-restore v1.8.5 (legacy): interface name `vethd6d63cd@if18' must be shorter than IFNAMSIZ (15)
Posted onEdited onInSecurityWord count in article: 1.4kReading time ≈1 mins.
一、 介绍
Damn Vulnerable Web Application (DVWA)(译注:可以直译为:”该死的”不安全Web应用程序),是一个编码差的、易受攻击的 PHP/MySQL Web应用程序。 它的主要目的是帮助信息安全专业人员在合法的环境中,练习技能和测试工具,帮助 Web 开发人员更好地了解如何加强 Web 应用程序的安全性,并帮助学生和教师在可控的教学环境中了解和学习 Web 安全技术。
DVWA的目的是通过简单明了的界面来练习一些最常见的 Web 漏洞,所练习的漏洞具有不同的难度级别。 请注意,此软件存在提示和无提示的漏洞。 这是特意为止。 我们鼓励您依靠自己的能力尝试并发现尽可能多的安全问题。
:: get the high risk ports on windows/winserver :: usage: right-click and run this script as administrator
@echo off setlocal enabledelayedexpansion
:: set high risk ports set "ports=21222325536911011113513914316138944587310251099143315212049218122222375237928883128330633893690388840004040444048484899500050055432560156315632590059846123637970017051707771807182784880198020804280488051806980808081808380868088816184438649884888808888900090019042904390839092910092009300999010000110001111111211180801988820880250002501027017270182801750030500605007050090600006001060030"
for%%pin (%ports%) do ( netstat -ano | findstr LISTEN | findstr /c:":%%p " >nul iferrorlevel1 ( echo High Risk Port %%p is not listening. > nul ) else ( echo High Risk Port %%p is listening set count=0 for /f "tokens=5" %%ain ('netstat -aon ^| findstr ":%%p " ^| findstr "LISTENING"') do ( if!count!equ0 ( wmic process where processid="%%a" get processid, executablepath set /a count+=1 ) ) echo "------------------------------------------------------------------" ) ) pause
参数说明:
/c: 完全匹配
":%%p " –> ":139 " (注意空格)避免较长端口号中间包含139
errorlevel 1 判断命令执行的返回
bat同级目录输出文件
二、 Linux
## get high risk ports on Linux ## @author wanghuaizhuang ## @date 2024-4-8 ## @version V2.0 #! /bin/bash # high-risk ports valid_ports="21 22 23 25 53 69 110 111 135 139 143 161 389 445 873 1025 1099 1433 1521 2049 2181 2222 2375 2379 2888 3128 3306 3389 3690 3888 4000 4040 4440 4848 4899 5000 5005 5432 5601 5631 5632 5900 5984 6123 6379 7001 7051 7077 7180 7182 7848 8019 8020 8042 8048 8051 8069 8080 8081 8083 8086 8088 8161 8443 8649 8848 8880 8888 9000 9001 9042 9043 9083 9092 9100 9200 9300 9990 10000 11000 11111 11211 18080 19888 20880 25000 25010 27017 27018 28017 50030 50060 50070 50090 60000 60010 60030 " # get listening ports ports=$(ss -tuln | awk 'NR>1 {print $5}' | awk -F '[:]' '{print $NF}' | awk '!seen[$0]++') # iterate through ports for port in $ports; do # check whether the port is a high-risk port if echo "$valid_ports" | grep -q "\<$port\>"; then # print on terminal and save to file echo -e 高危端口: "\e[31m$port\e[0m"