[WUISP 25] ModSecurity Rocky Linux 설치 및 DVWA 연결

Entity08·2025년 9월 29일

WUISP 25

목록 보기
1/4

Rocky 피해자에 설치합니다.

기본 파일 다운로드

sudo su
mkdir ~/modsec
cd ~/modsec
wget -P ~/modsec https://github.com/SpiderLabs/ModSecurity/releases/download/v3.0.5/modsecurity-v3.0.5.tar.gz
tar xzf modsecurity-v3.0.5.tar.gz
cd modsecurity-v3.0.5

파일 설치

dnf config-manager --set-enabled crb
dnf install autoconf automake libtool pkgconfig curl-devel rajl-devel ssdeep-devel lua-devel lmdb-devel libxml2-devel git wget -y
git init
./build.sh
./configure --with-maxmind=no

중간에 fatal 에러 뜨는 것들 모두 무시하시면 됩니다.

설치 확인

cd /etc/httpd/modules
ls -l

리스트에 mod-security2.so 가 있다면 설치가 잘 된 것입니다.

아파치-ModSecurity 연결

cd /etc/httpd/conf
vim httpd.conf

LoadModule security2_module modules/mod_security2.so 추가

ModSecurity 룰 변경

cd /etc/httpd/conf.d
vim mod_security.conf

# Block it when the input includes word "test"
SecRule ARGS|ARGS_NAMES|REQUEST_HEADERS|REQUEST_URI "@rx (?i)\btest\b" \
	"id:1000001,phase:2,deny,status:403,log,auditlog,msg:'Blocked: input contains test',severity:2,tag:'custom/test=block'"
	
# Debug path
SecAuditEngine RelevantOnly
SecAuditLog /var/log/modsec_audit.log

위 라인 추가(위치 무관)

아파치 서버 재시작

systemctl restart httpd

Kali 접속 테스트


profile
되면 한다

0개의 댓글