Skip to main content

29 AWS EC2 WAF

  • 실습 환경 구축과 Acunetix(취약점 스캐너)

클라우드가 왜 필요할까

  • 클라우드 없이 직접 서버/인프라를 구축한다고 하면 너무 귀찮고 비용적 부담이 클 수 있음
  • 예 1) 네트워크 장비 구매 + 관련 직원 채용
  • 예 2) 클라우드는 서버의 성능(메모리 8GB>16GB)을 바꾸는 것도 버튼 클릭 몇 번이면 되지만, 클라우드가 없다고 하면 PC 끄고 메모리를 구매하고 택배로 받아서 장착하는 등 번거로움이 많음

EC2 세팅

Windows > DVWA 세팅

EC2 > 인스턴스 > 인스턴스 시작

애플리케이션 및 OS 이미지(Amazon Machine Image) 정보

AMI에는 인스턴스의 운영 체제, 애플리케이션 서버, 애플리케이션의 포함됩니다. 아래에 적합한 AMI가 보이지 않는 경우 검색 필드를 사용하거나 더 많은 AMI 찾아보기로 선택하세요.

수전 개의 애플리케이션 및 OS 이미지를 포함하는 전체 카탈로그 검색

최근 사용Quick Start
Amazon LinuxmacOS
macOSUbuntu
macOSUbuntu®
macOSUbuntu®
MacOSUbuntu®
MacOSUbuntu®

Amazon Machine Image(AMI)

  • Microsoft Windows Server 2025 Base: 2MB
  • Windows 10: 1000MB
  • Windows 10: 1000MB
  • Windows 10: 1000MB
  • Windows 10: 1000MB
  • MacOS: 1MB
  • MacOS: 1MB
  • MacOS: 1MB
  • MacOS: 1MB

설명

Microsoft Windows 2025 Datacenter edition. [English]

Microsoft Windows Server 2025 Full Locale English AMI provided by Amazon

요약

  • 인스턴스 개수: 1
  • 소프트웨어 이미지(AMI): Microsoft Windows Server 2025, 더 보기: amii-bideb231138004df2
  • 가상 서버 유형(인스턴스 유형): t3.micro
  • 방화벽(보안 그룹): 새 보안 그룹
  • 스토리지(물품): 1개의 물품 ~ 30GB

프리 티어: AWS 계정을 개설한 첫해에 프리 티어 AMI, 매월 750시간의 퍼블릭 IPv4 주소 사용량, 30GB의 EBS 스토리지, 2백만 UG, 1GB의 스냅샷 및 100GB의 인터넷 대역폭과 함께

  • 취소
  • 인스턴스 시작
  • 미리 보기 코드

Base / Core Base

  • GUI 추가 설치가 필요하다는 이유 하나만으로 Base를 써야됨 (초보로 공부할 때)
  • Core Base > CLI
구성순수 Windows Server OS만 설치OS + 필수 역할(Role) + 관리 툴 포함
설치 구성최소한의 기능만 설치.NET, PowerShell, AWS Tools 등 사전 포함
$\times$ 초기 설정사용자 직접 구성 필요대부분 기본 구성 완료
$\checkmark$ 용량작음약간 큼
$\Delta$ 대상인프라/보안 팀 (커스텀 목적)일반 개발/운영 팀 (즉시 활용 목적)

Base / Core Base

  • AMI(Amazon Machine Image) 선택할 때 기준
  • 리눅스와 달리 Windows는 License 요금이 중요
  • 2025 / 2022가 적합
  • 어차피 옛날 버전은 업데이트 지원이 끊길 수 있음
최근 사용Quick Start
Amazon
LinuxmacOSUbuntuWindowsRed HatSUSE LinuxDebian
AWS
LinuxMacUbuntu*MicrosoftRed HatSUSEDebian
Amazon Machine Image (AMI)
Microsoft Windows Server 2025 Base

Base / Core Base

  • 인스턴스 유형
  • 어차피 사양 낮아서 서버가 원활히 동작 안되면 쉽게 사양 변경 가능
인스턴스 유형정보조언 받기
인스턴스 유형
t3.micro프리 티어 사용 가능
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.

Base / Core Base

  • 기존에 EC2 사용한 경우 키를 사용해서 접근 가능함
  • 암호학 시간에 배웠던 rsa

▼ 키 페어(로그인) 정보

키 페어를 사용하여 인스턴스에 안전하게 연결할 수 있습니다. 인스턴스를 시작하기 전에 선택한 키 페어에 대한 액세스 권한이 있는지 확인하세요.

키 페어 이름 – 필수
선택
0
키 페어 없이 계속 진행(권장되지 않음)
aws_landingpage
유형: rsa

Base / Core Base

  • 보안 그룹 생성
네트워크정보
vpc-74fe9f1d

서브넷 | 정보

기본 설정 없음(가용 영역의 기본 서브넷)

퍼블릭 IP 자동 할당 | 정보

활성화

프리 티어 허용 범위를 벗어나는 경우 추가 요금이 적용됩니다.

방화벽(보안 그룹) | 정보

보안 그룹은 인스턴스에 대한 트래픽을 제어하는 방화벽 규칙 세트입니다. 특정 트래픽이 인스턴스에 도달하도록 허용하는 규칙을 추가합니다.

보안 그룹 생성 | 기존 보안 그룹 선택

다음 규칙을 사용하여 **'launch-wizard-18'(이)라는 새 보안 그룹을 생성합니다.

  • 다음에서 RDP 트래픽 허용: 인스턴스 연결에 도움
  • 위치 무관: 0.0.0.0/0
  • 인터넷에서 HTTPS 트래픽 허용: 에를 들어 웹 서버를 생성할 때 엔드포인트를 설정하려면
  • 인터넷에서 HTTP 트래픽 허용: 에를 들어 웹 서버를 생성할 때 엔드포인트를 설정하려면

Base / Core Base

  • 스토리지 구성
  • 볼륨 방식, 용량 크기에 따라 과금

Base / Core Base

  • 스토리지 구성
  • 프리티어는 마그네틱 불가
  • 마그네틱이 대체적으로 가격이 저렴함
▼ 스토리지 구성 정보
1x30GiBgp2루트 볼륨, 암호화되지 않음
Q
① 프리 티어를 사용할 수선택는 마그네틱 스토리지를 사용할 수 있습니다.
범용 SSD(gp3)
새 볼륨 추가범용 SSD(gp2)
선택한 AMI에는 인스턴스 지프로비저닝된 IOPS SSD(io1)
습니다.프로비저닝된 IOPS SSD(io2)
② 백업 정보를 보려면 새로
할당한 태그에 따라 Data 나
0 x 파일 시스템

Base / Core Base

  • 인스턴스 생성 (가상 PC 생성)

![[AWS_EC2_WAF-Acunetix_p11_img1.jpeg]]

  • EC2 > 인스턴스 > 인스턴스 시작

  • 인스턴스 시작 중 보안 그룹 생성

    • 세부 정보
      • 인스턴스를 시작하는 동안 기다려 주세요.
      • 로드하는 동안 브라우저를 닫지 마세요.

탄력적 IP = 고정 IP

- Elastic IP, 고정 IP

EC2 > 탄력적 IP 주소 > 탄력적 IP 주소 할당

탄력적 IP 주소 할당 정보

탄력적 IP 주소 설정 정보

퍼블릭 IPv4 주소 풀

Amazon의 IPv4 주소 풀 (1) BYOIP 방식으로 AWS 계정에 가져오는 퍼블릭 IPv4 주소입니다. (풀을 찾을 수 없어 옵션이 비활성화됨) 자세히 알아보기 $\square$ (1) Outpost에서 사용하기 위해 온프레미스 네트워크에서 생성한 고객 소유 IPv4 주소 풀입니다. (고객 소유 풀을 찾을 수 없어 옵션이 비활성화됨) 자세히 알아보기 $\square$ (1) IPv4 IPAM 풀을 사용하여 할당 (AWS 서비스를 EC2로 사용하는 퍼블릭 IPv4 IPAM 풀을 찾지 못해 옵션이 비활성화됨)

글로벌 정적 IP 주소

AWS Global Accelerator는 AWS 엣지 로케이션의 애니캐스트를 사용하여 전 세계에 발표된 글로벌 정적 IP 주소를 제공할 수 있습니다. 이를 통해 Amazon 글로벌 네트워크를 (1) 엑셀러레이터 생성 $\square$

태그 - 선택 사항

태그는 AWS 리소스에 할당하는 레이블입니다. 각 태그는 키와 선택적 값으로 구성됩니다. 태그를 사용하여 리소스를 검색 및 필터링하거나 AWS 비용을 추적할 수 있습니다. 리소스와 연결된 태그가 없습니다.

(1) 새 태그 추가

태그를 최대 50 개 더 추가할 수 있습니다.


탄력적 IP = 고정 IP

  • Elastic IP, 고정 IP

![[AWS_EC2_WAF-Acunetix_p13_img2.jpeg]]

탄력적 IP 주소 연결 정보

이 탄력적 IP 주소에 연결할 인스턴스 또는 네트워크 인터페이스를 선택합니다. (3.150.4.30)

탄력적 IP 주소: 3.150.4.30

리소스 유형

  • 탄력적 IP 주소를 연결할 리소스의 유형을 선택합니다.
  • 인스턴스
  • 네트워크 인터페이스

전력적 IP 주소를 탄력적 IP 주소가 이미 연결되어 있는 인스턴스와 연결하면 이전에 연결한 탄력적 IP 주소

프라이빗 IP 주소를 지정하지 않으면 탄력적 IP 주소가 기본 프라이빗 IP 주소와 연결됩니다.

인스턴스

  • C1: 048a6abf2c8c8aa8f

프라이빗 IP 주소

  • 탄력적 IP 주소를 연결할 프라이빗 IP 주소입니다.
  • C1: 172.31.18.0

재연결

이미 리소스에 연결되어 있는 탄력적 IP 주소를 다른 리소스에 재연결할 수 있는지를 지정합니다.

  • 이 탄력적 IP 주소를 재연결하도록 허용

AWS EC2

인스턴스 연결

  • EC2 > 인스턴스 > i-048a6abf2c8c8aa8f > 인스턴스에 연결

연결 정보

브라우저 기반 클라이언트를 사용하여 인스턴스에 연결합니다.

Session ManagerRDP 클라이언트EC2 직렬 콘솔
RDP 연결 기록
이제 AWS Systems Manager just-in-time 노드 액세스를 사용하여 RDP 연결을 기록할 수 있습니다. 자세히 알아보기
인스턴스 ID
i-048a6abf2c8c8aa8f (dvwa_251004)
연결 요청
RDP 클라이언트를 사용하여 연결
RDP 클라이언트에 사용할 파일을 다운로드하고 암호를 검색합니다.Fleet Manager를 사용하여 연결
Fleet Manager 원격 데스크톱을 사용하여 인스턴스에 연결
점포차에도 SSM Agent 작업
선택한 원격 데스크톱 클라이언트를 사용하고 아래의 RDP 바로 가기 파일을 다운로드하여 실행하면 Windows 인스턴스에 연결할 수 있습니다.
원격 데스크톱 파일 다운로드
메시지가 표시되면 다음의 사용자 이름과 암호를 사용하여 인스턴스에 연결합니다.
Public DNS
ec2-3-150-4-30.us-east-2.compute.amazonaws.com사용자 이름 정보
Administrator
암호 암호 가져오기

AWS EC2

  • [rsa] private key를 업로드하여 Windows 암호 확인 가능
EC2 > 인스턴스 > i-048a6abf2c8c8aa8f > Windows 암호 가져오기

Windows 암호 가져오기 정보

프라이빗 키를 사용하여 이 인스턴스에 대한 초기 Windows 관리자 암호를 검색하고 해독합니다. 인스턴스 ID i-048a6abf2c8c8aa8f (dvwa_251004) 이 인스턴스와 연결된 키 페어 aws_landingpage 프라이빗 키 프라이빗 키 파일을 업로드하거나 그 내용을 복사하여 아래 필드에 붙여 넣습니다.

프라이빗 키 파일 업로드 프라이빗 키 콘텐츠 - 선택 사항 프라이빗 키 콘텐츠


AWS EC2

  • 보통 pem 파일을 자주 잃어버리는 경우가 많음
  • Everything > 파일 검색 유틸리티

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |


AWS EC2

  • 보통 pem 파일을 자주 잃어버리는 경우가 많음
  • Everything > 파일 검색 유틸리티

EC2 > 인스턴스 > i-048a6abf2c8c8aa8f > Windows 암호 가져오기

Windows 암호 가져오기 정보

프라이빗 키를 사용하여 이 인스턴스에 대한 초기 Windows 관리자 암호를 검색하고 해독합니다.

인스턴스 ID ☐ i-048a6abf2c8c8aa8f (dvwa_251004)

이 인스턴스와 연결된 키 페어 ☐ aws_landingpage

프라이빗 키 프라이빗 키 파일을 업로드하거나 그 내용을 복사하여 아래 필드에 붙여 넣습니다.

☐ 프라이빗 키 파일 업로드 ☐ aws_landingpage.pem 1.678KB

프라이빗 키 콘텐츠 - 선택 사항

——BEGIN RSA PRIVATE KEY—— MIIEpAIBAAKCAQEAkrH70ZolzDmaCd7dhvZMNJKyQuJwrJaAPp63IcNZLGS5555NU T0LAIDsEGVn7RNhRjegDsrenzrjzTBrNeb1UNU9hohPA4pCuYvjC4TdhdGJaJFvZ mIIp63Ic4kxRJVx4Nj4wzIeLqxZ0w0Kwzxw0IuIeLj6Ew0iLqxZX52UJ16ZX9 1.678KB SSP60wmIBPNkVJt7H55Cyt3Gk20Nk6VX8hY3p79u0Q8SeHrT0RTLMJw6YvM6s+


AWS EC2

Pem 파일 통해 암호 해독 완료

EC2 > 인스턴스 > +048a6abf2c8c8aa8f > 인스턴스에 연결

연결 정보

브라우저 기반 클라이언트를 사용하여 인스턴스에 연결합니다.

Session ManagerRDP 클라이언트EC2 직렬 콘솔
  • RDP 연결 기록

이제 AWS Systems Manager just-in-time 노드 액세스를 사용하여 RDP 연결을 기록할 수 있습니다. 자세히 알아보기

인스턴스 ID
+048a6abf2c8c8aa8f (drwa_251004)

연결 유형

  • RDP 클라이언트를 사용하여 연결

RDP 클라이언트에 사용할 파일을 다운로드하고 암호를 검색합니다.

  • Fleet Manager를 사용하여 연결

Fleet Manager 검색 데스크톱을 사용하여 인스턴스에 연결하

정도하세요. SSM Agent 작업

선택한 원격 데스크톱 클라이언트를 사용하고 아래의 RDP 바로 가기 파일을 다운로드하여 실행하면 Windows 인스턴스에 연결할 수 있습니다.

① 원격 데스크톱 파일 다운로드

메시지가 표시되면 다음의 사용자 이름과 암호를 사용하여 인스턴스에 연결합니다.

Public DNS
ec2-3-150-4-30.us-east-2.compute.amazonaws.com
암호
EswSYHLCrRZS-
사용자 이름
Administrator

AWS EC2

Windows 암호 입력

![[AWS_EC2_WAF-Acunetix_p19_img3.jpeg]]


AWS EC2

- 원격 데스크톱 연결

원격 데스크톱 연결
원격 컴퓨터의 ID를 확인할 수 없습니다. 연결하시겠습니까?
보안 인증서 문제로 인해 원격 컴퓨터를 인증할 수 없습니다. 계속 진행하면 안전하지 않을 수 있습니다.
인증서 이름
원격 컴퓨터의 인증서에 있는 이름: EC2AMAZ-4LIKCTS
인증서 오류
원격 컴퓨터의 인증서 유효성을 검사하는 동안 다음 오류가 발생했습니다.
이 인증서는 신뢰할 수 있는 인증 기관에서 발급되지 않았습니다.
이러한 인증서 오류가 발생해도 연결하시겠습니까?
이 컴퓨터로의 연결을 다시 묻지 않음(D)
인증서 보기(V)...예(Y)

AWS EC2

  • GUI가 원활히 동작되지 않음
  • t2.nano > t2.micro > t2.small (2GB)
  • GUI 기능이 들어가면 메모리 점유율이 많이 올라감
dvwa_251004i-048a6abf2c8c8aa8f중지 중t2.nano
dvwa_251004i-048a6abf2c8c8aa8f대기 중t2.micro

AWS EC2

  • Antimalware Service Executable
  • Set-MpPreference - DisableRealtimeMonitoring $true

![[AWS_EC2_WAF-Acunetix_p22_img4.jpeg]]

![[AWS_EC2_WAF-Acunetix_p22_img5.jpeg]]


AWS EC2

  • Antimalware Service Executable
  • Set-MpPreference - DisableRealtimeMonitoring $true

![[AWS_EC2_WAF-Acunetix_p23_img6.jpeg]]


AWS EC2

  • Antimalware Service Executable
  • GPO(그룹 정책)으로 끄기
    • gpedit.msc / 로컬 그룹 정책 편집기

![[AWS_EC2_WAF-Acunetix_p24_img7.jpeg]]


AWS EC2

  • Antimalware Service Executable
  • GPO(그룹 정책)으로 끄기
    • gpedit.msc / 로컬 그룹 정책 편집기
    • Computer Configuration
      • Administrative Templates
      • Windows Components
      • Microsoft Defender Antivirus

![[AWS_EC2_WAF-Acunetix_p25_img8.jpeg]]


AWS EC2

  • Computer Configuration
    • Administrative Templates
    • Windows Components
    • Microsoft Defender Antivirus
    • Turn off Microsoft Defender Antivirus

![[AWS_EC2_WAF-Acunetix_p26_img9.jpeg]]


AWS EC2

Turn off Microsoft Defender Antivirus

![[AWS_EC2_WAF-Acunetix_p27_img10.jpeg]]


AWS EC2

  • gpudate /force

![[AWS_EC2_WAF-Acunetix_p28_img11.jpeg]]


AWS EC2

- 재시작후 점검

  • Get-MpComputerStatus | Select AMServiceEnabled, RealTimeProtectionEnabled
항목의미
AMServiceEnabledFalse서비스 꺼짐
RealTimeProtectionEnabledFalse실시간 감시 꺼짐

![[AWS_EC2_WAF-Acunetix_p29_img12.jpeg]]


AWS EC2

  • 보안그룹 HTTP 포트 open

![[AWS_EC2_WAF-Acunetix_p30_img13.jpeg]]

인바운드 규칙 편집 성능 인바운드 규칙은 인스턴스에 도달하도록 허용된 수신 트래픽을 제어합니다.

인바운드 규칙 성능 보안 그룹 규칙 ID vgr-056ebcc74d4823e24


AWS EC2

- 보안그룹 HTTP 포트 open

Windows Defender Firewall with Advanced Security File Action View Help

Windows Defender Firewall with Inbound Rules

Inbound Rules

  • Outbound Rules
  • Connection Security Rules
  • Monitoring
NameGroupProfileActions
Alloyn Router (TCP-In)Alloyn RouterDomaInbound Rules
Alloyn Router (UDP-In)Alloyn RouterDomaNew Rule
BranchCache Content Retrieval (HTTP-In)BranchCache - Content RetrievalAllFilter by Profile
BranchCache Hosted Cache Server (HTTP-In)BranchCache - Hosted CacheAllFilter by State
BranchCache Peer Discovery (WSD-In)BranchCache - Peer DiscoveryAllFilter by Group
Cast to Device functionality (@Wave-TCP)Cast to Device functionalityPrivateView
Cast to Device functionality (@Wave-UDP)Cast to Device functionalityPrivateRefresh
Cast to Device DZIP Discovery (UDP-In)Cast to Device functionalityPublicExport List
Cast to Device streaming server (HTTP-St)Cast to Device functionalityDomainHelp
Cast to Device streaming server (HTTP-St)Cast to Device functionalityPublic
Cast to Device streaming server (HTTP-St)Cast to Device functionalityPrivate
Cast to Device streaming server (RTCP-St)Cast to Device functionalityPublic
Cast to Device streaming server (RTCP-St)Cast to Device functionalityDomain
Cast to Device streaming server (RTCP-St)Cast to Device functionalityPublic
Cast to Device streaming server (RTSP-St)Cast to Device functionalityPrivate
Cast to Device streaming server (RTSP-St)Cast to Device functionalityPublic
Cast to Device streaming server (RTSP-St)Cast to Device functionalityPublic
Cast to Device streaming server (RTSP-St)Cast to Device functionalityPublic
COM+ Network Access (DCOM-In)COM+ Network AccessAll
COM+ Remote Administration (DCOM-In)COM+ Remote AdministrationAll
Core Networking - Destination UnreachableCore NetworkingAll
Core Networking - Destination UnreachableCore NetworkingAll
Core Networking - Dynamic Host Config.Core NetworkingAll
Core Networking - Dynamic Host Config.Core NetworkingAll
Core Networking - Internet Group ManaCore NetworkingAll
Core Networking - IPHTTPS (TCP-In)Core NetworkingAll
Core Networking - IPv6 (IPv6-In)Core NetworkingAll

AWS EC2

- apmsetup

APMSETUP이 정상적으로 설치 되었습니다.

  • C:APM_Setup/htdocs 디렉터리에 홈페이지를 작성해서 넣으시기 바랍니다.
  • 지금 화면이 계속 보인다면 C:APM_Setup/htdocs/index.php 파일을 삭제해 주시기 바랍니다.
PHP 설정파일[설치디렉터리]APM_Setup.php.ini
3dySQL 설정파일[설치디렉터리]APM_Setup:Server3dySQL5:data:my.ini
3dySQL Data 파일 위치[설치디렉터리]APM_Setup:Server3dySQL7-data
Apache 설정파일[설치디렉터리]APM_Setup:Server:Apache:conf:httpd.conf
Apache 로그 위치[설치디렉터리]APM_Setup:Server:Apache:logs
PHP Infohttp://127.0.0.1/?page=plopinfo
phpMyAdminhttp://127.0.0.1/myadmin/

APMSETUP이 정상적으로 설치 되었습니다.

  • C:APM_Setup/htdocs 디렉터리에 홈페이지를 작성해서 넣으시기 바랍니다.
  • 지금 화면이 계속 보인다면 C:APM_Setup/htdocs/index.php 파일을 삭제해 주시기 바랍니다.
PHP 설정파일[설치디렉터리]APM_Setup.php.ini
MySQL 설정파일[설치디렉터리]APM_Setup:Server:MySQL5:data:my.ini
MySQL Data 파일 위치[설치디렉터리]APM_Setup:Server:MySQL5:data
Apache 설정파일[설치디렉터리]APM_Setup:Server:Apache:conf:httpd.conf
Apache 로그 위치[설치디렉터리]APM_Setup:Server:Apache:logs
PHP Infohttp://127.0.0.1/?page=phpinfo
phpMyAdminhttp://127.0.0.1/myadmin/

AWS EC2

  • Apmsetup + dvwa
  • array(); 를 []; 로 쓰는건 PHP 5.4 이상에서 허용
18.218.130.213

Parse error: syntax error, unexpected '(', expecting ')' in C:\APM_Setup\htdocs\dvwa\includes\dvwaPage.inc.php on line 72


AWS EC2

  • Xampp-5.6.3

![[AWS_EC2_WAF-Acunetix_p34_img14.jpeg]]


AWS EC2

- DVWA config

![[AWS_EC2_WAF-Acunetix_p35_img15.jpeg]]

DVWA System error - config file not found. Copy config/config.inc.php.dist to config/config.inc.php and configure to your environment.


AWS EC2

- DVWA config

![[AWS_EC2_WAF-Acunetix_p36_img16.jpeg]]

DVWA System error - config file not found. Copy config/config.inc.php.dist to config/config.inc.php and configure to your environment.


AWS EC2

  • DVWA config

![[AWS_EC2_WAF-Acunetix_p37_img17.jpeg]]

Database Setup

Click on the 'Create / Reset Database' button below to create or reset your data. If you get an error, make sure you have the correct user credentials in C:example in the database already exists. It will be cleared and the data will be reset. You can also use this to reset the administrator credentials ('admin / password').

Setup Check

General

  • Operating system: Windows
  • DVWA version: Unknown
  • reCAPTCHA key: Missing
  • Writable folder: C:\kampp\htdocs\hackable\uploads\ Yes
  • Writable folder: C:\kampp\htdocs\config Yes

Apache

  • Web Server: SERVER_NAME: localhost
  • mod_rewrite: Unknown
  • mod_rewrite is required for the AP labs.

PHP

  • PHP version: 5.6.3
  • Versions of PHP below 7.x are not supported, please upgrade.

PHP function

  • display_errors: Enabled
  • PHP function: display_status_errors Enabled
  • PHP function: allow_url_include Disabled
  • PHP function: allow_url_liqsen Enabled
  • PHP module: plt Installed
  • PHP module: mysql Installed
  • PHP module: pdc_mysql Installed

Database

  • Backend database: MySQL/MariaDB
  • Database username: dvwa
  • Database password: ******
  • Database database: dvwa
  • Database host: 127.0.0.1
  • Database port: 3306

API

This section is only important if you want to use the API module. Vendor files installed: Not Installed


AWS EC2

- DVWA phpmyadmin

![[AWS_EC2_WAF-Acunetix_p38_img18.jpeg]]


AWS EC2

  • ID / admin
  • PW / password

![[AWS_EC2_WAF-Acunetix_p39_img19.jpeg]]


AWS EC2

Loadbalancer > dvwa_251004 세팅

![[AWS_EC2_WAF-Acunetix_p40_img20.jpeg]]


AWS EC2

  • Loadbalancer > dvwa_251004 세팅

로드 밸런서: 251004-ALB-load-balancer

로드 밸런서의 아키텍처를 보고 탐색하고 문제를 해결하세요.

계산 | 비정상 대상 앱 | 리소스 세부 정보 보기

251004-ALB-load-balancer

리스너(1개)
HTTP:801개 규칙규칙(1개)대상 그룹(1개) 정보대상(1개)
린스턴스, HTTP1개 대상251001-251001-loadbalancer
group-ec2-251001-loadbalancer
0 0 0 0 1 0 0
251001-251001-loadbalancer
251001-251001-loadbalancer
251001-251001-loadbalancer

초 전에 마지막으로 가져옴

![[AWS_EC2_WAF-Acunetix_p41_img21.jpeg]]


AWS EC2

ALB (Application Load Balancer) + WAF

로드 밸런서

  • 시작 템플릿
  • 스팟 요청
  • Savings Plans
  • 제약 컨스캇스
  • 전용 호스트
  • 용량 계약

이미지

  • API
  • API 컨탈로그

Elastic Block Store

  • 콘솔
  • 스냅샷
  • 수명 추가 관리자

네트워크 및 보안

  • 보안 그룹
  • 단적적 IP
  • 배치 그룹
  • 키 페이
  • 네트워크 인터페이스

로드 밸런싱

  • 로드밸런서
  • 대상 그룹
  • Trust Store

Auto Scaling

  • Auto Scaling 그룹

로드 밸런서 (API)

Elastic Load Balancing은 수신 트래픽에 변화에 따라 자동으로 로드 밸런서 영향을 확장합니다.

  • 로드 밸런서 참이전

WAF 리소스 연결

  • AWS에서 권장하는 보안 보장기 포함된 사전 정의된 웹 ACL이나 사용자 지정 보호를 위한 기존 WAF 웹 ACL 중 하나를 선택하여 연결합니다.

사전 정의된 WAF 자동 생성

  • 다음을 보충하기 위한 2가지 관리 규칙이 포함되어 있습니다.
    • 웹 애플리케이션에서 가장 흔히 발견되는 최적점.
    • 애플리케이션 최적점을 발견한 적막적인 행위자.
    • Amazon 내부 작업 진행자전스를 기반으로 전 잠재적 위험.

규칙 작업

  • 규칙 작업은 요청이 규칙에 정의된 기존과 일치하는 경우 요청을 어떻게 처리할지 AWS WAF에 알려줍니다.

차단

  • 가상 트래픽을 탐지하고 차단합니다.

개수

  • 규칙의 효과를 피의 보거나 테스트하기 위한 방법으로 일치하는 요청을 로그 및 계산합니다.

리소스 이름

  • 자동 생성
  • AWS 리소스의 이름을 "CruetadByALB" 뒤에 로드 밸런서 이름이 오도록 지정합니다.

사용자 지정 이름

  • AWS WAF 웹 ACL을 생성한 후 로드 밸런서에 연결하는 데 2-3분이 소요될 수 있습니다. 이 기간 동안에는 Elastic Load Balancing 콘솔에서 계속 작업할 수 있고 진행 메시지와의 연결 상태를 계속 알려드리겠습니다.

WAF 리소스 연결


AWS EC2

  • ALB (Application Load Balancer) + WAF
  • Active under DDoS

AWS WAF & Shield

  • ALB (Application Load Balancer) + WAF
  • Rules

![[AWS_EC2_WAF-Acunetix_p44_img22.jpeg]]


AWS WAF & Shield

  • AWS-AWSManagedRulesAmazonIpReputationList
  • 악성 IP 차단 툴셋(리스트)
  • 전 세계에서 수집한 위협 인텔리전스(TI) 실시간 반영

![[AWS_EC2_WAF-Acunetix_p45_img23.jpeg]]


AWS WAF & Shield

AWS-AWSManagedRulesCommonRuleSet

  • 웹 애플리케이션 공격 중에서 가장 흔하고 위험한 패턴 (OWASP Top 10 등)을 자동으로 차단하는 관리형 규칙 그룹
    • SQLI / XSS / LFI

![[AWS_EC2_WAF-Acunetix_p46_img24.jpeg]]


AWS WAF & Shield

AWS-AWSManagedRulesCommonRuleSet

  • Core rule set rules
  • Count 해보고 오탐 여부 확인

Core rule set rules

The rules apply actions and labels to requests that match their criteria. Learn More

By default, the rule group uses its configured rule actions. You can override the actions for all rules and for individual rules. For a single rule, use the rule dropdown to specify an override action or to remove an override.

Allow and Block actions terminate web ACL evaluation for matching requests. Count action counts matching requests and continues the web ACL evaluation. Learn More

Override all rule actions

Common RuleCommon Rule
Choose rule action overrideRemove all overrides
Override to AllowUserAgent_BadBots_HEADER
Override to BlockRule action: Block
Override to CountChoose rule action override
Override to CAPTCHASizeRestrictions_BODY
Override to ChallengeRule action: Block

SizeRestrictions_QUERYSTRING

Rule action: Block

Choose rule action override

SizeRestrictions_URIPATH Rule action: Block


AWS WAF & Shield

  • ALB
  • Enable CloudWatch logs

![[AWS_EC2_WAF-Acunetix_p48_img25.jpeg]]


AWS WAF & Shield

  • ALB
  • Enable CloudWatch logs

AWS WAF > Web ACLs > CreatedByALB-251004-ALB-load-balancer > Enable logging

Enable logging Info

Logging destination

Select a destination for your web ACL traffic logs.

  • CloudWatch Logs log group
  • Amazon Data Firehose stream
  • S3 bucket

Amazon CloudWatch Logs log group

Select a log group in your account that begins with 'aws-waf-logs-' or create one in the Amazon CloudWatch console. You must use a log group that's associated with your account.

Select a log group
☐ Filter log groups
aws-waf-logs-251005
Standard
End of log groups

AWS WAF & Shield

  • ALB (Application Load Balancer) + WAF
  • Traffic Overview

Action totals for the specified time range - All traffic

Request counts for all traffic during the specified time range. This shows counts for all possible terminating actions, while the rest of the dashboard shows only the actions that you've selected in the filters. If you're filtering on a relative time range, each action also shows the percentage change from the prior, equivalent-length time range. For example, if you've chosen 1 day as the time range, the percentage change reflects the difference between 48-24 hours ago and 24-0 hours ago.

TotalBlockedAllowedCaptchaChallenge
00000

Action summary for the specified time range - All traffic

This shows the actions that you've selected in the filters. If you're filtering on a relative time range, each action shows the total traffic based on a the selected action and top rules.

Action totals ☐1Top 10 rules ☐Switch to count action ☐
Request counts for each selected terminating action. View in CloudWatch ☑Requests counts for the ten rules that matched the most requests during the selected time range. View in CloudWatch ☑
No data for the selected time frame and action filters.No data for the selected time frame and action filters.

AWS WAF & Shield

  • WAF (Region > us-east-2 / Ohio)
  • ALB (Ohio)
  • WAF와 ALB Region은 동일하게 맞춰야 함

AWS WAF & Shield

![[AWS_EC2_WAF-Acunetix_p52_img26.jpeg]]


AWS WAF & Shield

![[AWS_EC2_WAF-Acunetix_p53_img27.jpeg]]


AWS WAF & Shield

  • ALB 접속 테스트 [ALB DNS]
    • Bot detection

![[AWS_EC2_WAF-Acunetix_p54_img28.jpeg]]


AWS WAF & Shield

  • ALB 접속 테스트 [ALB DNS]
    • Top 10 rules

![[AWS_EC2_WAF-Acunetix_p55_img29.jpeg]]


AWS WAF & Shield

  • ALB 접속 테스트 [ALB DNS]
    • Client device types

![[AWS_EC2_WAF-Acunetix_p56_img30.jpeg]]


AWS WAF & Shield

  • ALB 접속 테스트 [ALB DNS]
    • Top 10 countries

![[AWS_EC2_WAF-Acunetix_p57_img31.jpeg]]


AWS WAF & Shield

  • ALB 접속 테스트 [ALB DNS]
    • Top 10 countries

![[AWS_EC2_WAF-Acunetix_p58_img32.jpeg]]


AWS WAF & Shield - 미국 IP로 .env 확인하는 크롤러(취약점 스캐너) 로그 확인

CreatedByALB-251004-ALB-load-balancer Download web ACL as .00096

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |


DVWA


DVWA

  • Localhost/DVWA/login.php
  • ID: admin
  • PW: password

DVWA

  • EC2 접속

![[AWS_EC2_WAF-Acunetix_p62_img33.jpeg]]


Acunetix

  • Get a Demo of Acunetix Web Vulnerability Scanner | Acunetix

![[AWS_EC2_WAF-Acunetix_p63_img34.jpeg]]


Acunetix

  • Get a Demo of Acunetix Web Vulnerability Scanner | Acunetix

![[AWS_EC2_WAF-Acunetix_p64_img35.jpeg]]


Acunetix

  • Get a Demo of Acunetix Web Vulnerability Scanner | Acunetix

![[AWS_EC2_WAF-Acunetix_p65_img36.jpeg]]


Acunetix

  • Download Acunetix Web Vulnerability Scanner by Acunetix
  • Acunetix 11 trial

![[AWS_EC2_WAF-Acunetix_p66_img37.jpeg]]


Acunetix

Acunetix 11 trial

![[AWS_EC2_WAF-Acunetix_p67_img38.jpeg]]


Acunetix

  • Login (admin/password) 卒 scan

http://18.117.175.173/

http://18.117.175.173/ config docs drwa icons vulnerabilities about.php compose.yml fevicon.ico index.php instructions.php login.php logout.php phpinfo.php readme.ar.md readme.es.md readme.fa.md readme.fr.md readme.id.md readme.it.md readme.ko.md readme.pl.md readme.pt.md readme.tr.md readme.vi.md readme.zh.md robots.txt security.php setup.php

http://18.117.175.173/

Se...VulnerabilityURLParameterStatus
1HTML form without CSRF protectionhttp://18.117.175.173/Open
2HTML form without CSRF protectionhttp://18.117.175.173/Open
3HTML form without CSRF protectionhttp://18.117.175.173/Open
4Password field submitted using GET methodhttp://18.117.175.173/Open
5User credentials are sent in clear texthttp://18.117.175.173/Open
6User credentials are sent in clear texthttp://18.117.175.173/Open
7User credentials are sent in clear texthttp://18.117.175.173/Open
8User credentials are sent in clear texthttp://18.117.175.173/Open
9File uploadhttp://18.117.175.173/Open
10Session token in URLhttp://18.117.175.173/Open
11Content type is not specifiedhttp://18.117.175.173/Open
12Content type is not specifiedhttp://18.117.175.173/Open
13Content type is not specifiedhttp://18.117.175.173/Open
14Content type is not specifiedhttp://18.117.175.173/Open
15Content type is not specifiedhttp://18.117.175.173/Open

Reference

  • Installing DVWA in Windows with XAMPP (윈도우 환경에서 DVWA)
  • Amazon AWS ELB와 EC2 인스턴스 연결
  • ACM(Amazon Certificate Manager)
  • apmsetup을 활용한 https 서버 설치하기
  • apmsetup