mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-07-28 22:51:09 -07:00
Translated ['', 'src/pentesting-cloud/aws-security/aws-services/aws-ec2-
This commit is contained in:
+128
-54
@@ -4,7 +4,7 @@
|
||||
|
||||
## VPC & Networking
|
||||
|
||||
VPC가 무엇인지와 그 구성요소에 대해 알아보세요:
|
||||
VPC가 무엇인지와 그 구성 요소에 대해 여기에서 알아보세요:
|
||||
|
||||
{{#ref}}
|
||||
aws-vpc-and-networking-basic-information.md
|
||||
@@ -12,30 +12,30 @@ aws-vpc-and-networking-basic-information.md
|
||||
|
||||
## EC2
|
||||
|
||||
Amazon EC2는 **가상 서버**를 시작하는 데 사용됩니다. **보안**, **네트워킹** 구성과 **스토리지** 관리를 할 수 있습니다. Amazon EC2의 유연성은 리소스를 상하로 확장할 수 있는 능력에서 드러나며, 이는 요구사항 변화나 인기 급증에 효과적으로 대응할 수 있게 해줍니다. 이 기능은 정확한 트래픽 예측의 필요성을 줄여줍니다.
|
||||
Amazon EC2는 **virtual servers**를 시작하는 데 사용됩니다. 이는 **security**와 **networking**의 구성, 그리고 **storage**의 관리를 가능하게 합니다. Amazon EC2의 유연성은 리소스를 위아래로 확장할 수 있는 능력에서 잘 드러나며, 변화하는 요구 사항이나 인기 급증에 효과적으로 대응할 수 있습니다. 이 기능은 정확한 트래픽 예측의 필요성을 줄여줍니다.
|
||||
|
||||
EC2에서 열거할 만한 항목:
|
||||
EC2에서 열거할 만한 흥미로운 항목:
|
||||
|
||||
- 가상 머신
|
||||
- SSH 키
|
||||
- Virtual Machines
|
||||
- SSH Keys
|
||||
- User Data
|
||||
- 기존 EC2s/AMIs/Snapshots
|
||||
- 네트워킹
|
||||
- 네트워크
|
||||
- 서브넷
|
||||
- 퍼블릭 IP
|
||||
- 열린 포트
|
||||
- AWS 외부의 다른 네트워크와의 통합 연결
|
||||
- Existing EC2s/AMIs/Snapshots
|
||||
- Networking
|
||||
- Networks
|
||||
- Subnetworks
|
||||
- Public IPs
|
||||
- Open ports
|
||||
- Integrated connections with other networks outside AWS
|
||||
|
||||
### Instance Profiles
|
||||
|
||||
**roles**를 사용해 **EC2 instances**에서 실행되는 애플리케이션에 권한을 부여하려면 약간의 추가 구성이 필요합니다. EC2 인스턴스에서 실행되는 애플리케이션은 가상화된 운영체제에 의해 AWS로부터 추상화되어 있습니다. 이러한 추가 분리 때문에 AWS role과 관련 권한을 EC2 인스턴스에 할당하여 애플리케이션에서 사용 가능하게 하려면 추가 단계가 필요합니다.
|
||||
**EC2 instances**에서 실행되는 애플리케이션에 권한을 부여하기 위해 **roles**를 사용하는 것은 약간의 추가 구성이 필요합니다. EC2 instance에서 실행되는 애플리케이션은 가상화된 운영체제에 의해 AWS로부터 추상화됩니다. 이 추가적인 분리 때문에, AWS role과 그에 연결된 권한을 EC2 instance에 할당하고 애플리케이션에서 사용할 수 있게 만드는 추가 단계가 필요합니다.
|
||||
|
||||
이 추가 단계는 인스턴스에 연결된 **생성** [_**instance profile**_](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html)입니다. 그 **instance profile은 role을 포함하며**, 인스턴스에서 실행되는 애플리케이션에 역할의 임시 자격증명을 제공할 수 있습니다. 이러한 임시 자격증명은 애플리케이션의 API 호출에서 리소스에 접근하거나 역할이 지정한 리소스에만 접근을 제한하는 데 사용될 수 있습니다. 참고로 **한 번에 하나의 role만 EC2 인스턴스에 할당될 수 있으며**, 인스턴스의 모든 애플리케이션은 동일한 역할과 권한을 공유합니다.
|
||||
이 추가 단계가 instance에 연결된 [_**instance profile**_](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html)의 **creation of an** 입니다. **instance profile contains the role and** instance에서 실행되는 애플리케이션에 role의 임시 자격 증명을 제공할 수 있습니다. 그런 다음 그 임시 자격 증명은 애플리케이션의 API 호출에서 리소스에 접근하고, role이 지정한 리소스에만 접근을 제한하는 데 사용할 수 있습니다. **only one role can be assigned to an EC2 instance** at a time이며, instance의 모든 애플리케이션은 동일한 role과 권한을 공유한다는 점에 유의하세요.
|
||||
|
||||
### Metadata Endpoint
|
||||
|
||||
AWS EC2 metadata는 런타임에 인스턴스에서 접근 가능한 Amazon Elastic Compute Cloud (EC2) 인스턴스에 관한 정보입니다. 이 메타데이터는 인스턴스 ID, 인스턴스가 실행 중인 가용 영역(availability zone), 인스턴스에 연결된 IAM role, 인스턴스의 호스트명 등 인스턴스에 대한 정보를 제공합니다.
|
||||
AWS EC2 metadata는 Amazon Elastic Compute Cloud (EC2) instance에 대한 정보로, 실행 중일 때 해당 instance에서 사용할 수 있습니다. 이 metadata는 instance ID, 실행 중인 availability zone, instance와 연결된 IAM role, 그리고 instance의 hostname과 같은 정보를 제공하는 데 사용됩니다.
|
||||
|
||||
{{#ref}}
|
||||
https://book.hacktricks.wiki/en/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf.html
|
||||
@@ -130,7 +130,7 @@ aws ec2 describe-route-tables
|
||||
aws ec2 describe-vpcs
|
||||
aws ec2 describe-vpc-peering-connections
|
||||
```
|
||||
### 인증되지 않은 접근
|
||||
### Unauthenticated Access
|
||||
|
||||
{{#ref}}
|
||||
../../aws-unauthenticated-enum-access/aws-ec2-unauthenticated-enum/README.md
|
||||
@@ -138,7 +138,7 @@ aws ec2 describe-vpc-peering-connections
|
||||
|
||||
### Privesc
|
||||
|
||||
다음 페이지에서 **abuse EC2 permissions to escalate privileges** 방법을 확인할 수 있습니다:
|
||||
In the following page you can check how to **abuse EC2 permissions to escalate privileges**:
|
||||
|
||||
{{#ref}}
|
||||
../../aws-privilege-escalation/aws-ec2-privesc/README.md
|
||||
@@ -152,17 +152,17 @@ aws ec2 describe-vpc-peering-connections
|
||||
|
||||
## EBS
|
||||
|
||||
Amazon **EBS** (Elastic Block Store) **snapshots** 는 기본적으로 EBS 볼륨의 정적 **백업**입니다. 다시 말해, 특정 시점에 **EC2** 인스턴스에 연결된 **디스크**의 **복사본**입니다. EBS snapshots는 리전과 계정 간에 복사하거나 심지어 다운로드하여 로컬에서 실행할 수도 있습니다.
|
||||
Amazon **EBS** (Elastic Block Store) **snapshots** are basically static **backups** of aws EBS volumes. In other words, they are **copies** of the **disks** attached to an **EC2** Instance at a specific point in time. EBS snapshots can be copied across regions and accounts, or even downloaded and run locally.
|
||||
|
||||
스냅샷에는 **source code or APi keys** 와 같은 **민감한 정보**가 포함될 수 있으므로, 가능하다면 확인해보는 것이 권장됩니다.
|
||||
Snapshots can contain **sensitive information** such as **source code or APi keys**, therefore, if you have the chance, it's recommended to check it.
|
||||
|
||||
### Difference AMI & EBS
|
||||
|
||||
**AMI**는 **launch an EC2 instance** 하는 데 사용되는 반면, EC2 **Snapshot**은 EBS 볼륨에 저장된 데이터를 **backup and recover** 하는 데 사용됩니다. EC2 Snapshot으로 새 AMI를 만들 수는 있지만, AMI와 동일한 것은 아니며 운영 체제, application server 또는 애플리케이션 실행에 필요한 다른 소프트웨어에 대한 정보는 포함하지 않습니다.
|
||||
An **AMI** is used to **launch an EC2 instance**, while an EC2 **Snapshot** is used to **backup and recover data stored on an EBS volume**. While an EC2 Snapshot can be used to create a new AMI, it is not the same thing as an AMI, and it does not include information about the operating system, application server, or other software required to run an application.
|
||||
|
||||
### Privesc
|
||||
|
||||
다음 페이지에서 **abuse EBS permissions to escalate privileges** 방법을 확인할 수 있습니다:
|
||||
In the following page you can check how to **abuse EBS permissions to escalate privileges**:
|
||||
|
||||
{{#ref}}
|
||||
../../aws-privilege-escalation/aws-ebs-privesc/README.md
|
||||
@@ -170,13 +170,13 @@ Amazon **EBS** (Elastic Block Store) **snapshots** 는 기본적으로 EBS 볼
|
||||
|
||||
## SSM
|
||||
|
||||
**Amazon Simple Systems Manager (SSM)** 는 EC2 인스턴스 집단을 원격으로 관리하여 관리 작업을 훨씬 쉽게 합니다. 이러한 각 인스턴스는 **SSM Agent service as the service will be the one getting the actions and performing them** 가 실행 중이어야 합니다. 해당 서비스가 AWS API로부터 작업을 받아 이를 수행하기 때문입니다.
|
||||
**Amazon Simple Systems Manager (SSM)** allows to remotely manage floats of EC2 instances to make their administrations much more easy. Each of these instances need to be running the **SSM Agent service as the service will be the one getting the actions and performing them** from the AWS API.
|
||||
|
||||
**SSM Agent** 는 Systems Manager가 이러한 리소스를 업데이트, 관리 및 구성할 수 있게 합니다. 에이전트는 **processes requests from the Systems Manager service in the AWS Cloud** 하고, 요청에 지정된 대로 이를 실행합니다.
|
||||
**SSM Agent** makes it possible for Systems Manager to update, manage, and configure these resources. The agent **processes requests from the Systems Manager service in the AWS Cloud**, and then runs them as specified in the request.
|
||||
|
||||
The **SSM Agent comes**[ **preinstalled in some AMIs**](https://docs.aws.amazon.com/systems-manager/latest/userguide/ami-preinstalled-agent.html) or you need to [**manually install them**](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-manual-agent-install.html) on the instances. 또한, 인스턴스 내에서 사용되는 IAM Role에는 통신을 위해 **AmazonEC2RoleforSSM** 정책이 연결되어 있어야 합니다.
|
||||
The **SSM Agent comes**[ **preinstalled in some AMIs**](https://docs.aws.amazon.com/systems-manager/latest/userguide/ami-preinstalled-agent.html) or you need to [**manually install them**](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-manual-agent-install.html) on the instances. Also, the IAM Role used inside the instance needs to have the policy **AmazonEC2RoleforSSM** attached to be able to communicate.
|
||||
|
||||
### 열거
|
||||
### Enumeration
|
||||
```bash
|
||||
aws ssm describe-instance-information
|
||||
aws ssm describe-parameters
|
||||
@@ -185,13 +185,13 @@ aws ssm describe-instance-patches --instance-id <id>
|
||||
aws ssm describe-instance-patch-states --instance-ids <id>
|
||||
aws ssm describe-instance-associations-status --instance-id <id>
|
||||
```
|
||||
다음 명령을 실행하면 EC2 인스턴스에서 Systems Manager가 실행 중인지 확인할 수 있습니다:
|
||||
EC2 인스턴스에서 Systems Manager가 실행 중인지 다음을 실행해서 확인할 수 있습니다:
|
||||
```bash
|
||||
ps aux | grep amazon-ssm
|
||||
```
|
||||
### Privesc
|
||||
|
||||
다음 페이지에서 **abuse SSM permissions to escalate privileges** 방법을 확인할 수 있습니다:
|
||||
다음 페이지에서 **SSM permissions를 악용해 권한 상승**하는 방법을 확인할 수 있습니다:
|
||||
|
||||
{{#ref}}
|
||||
../../aws-privilege-escalation/aws-ssm-privesc/README.md
|
||||
@@ -199,7 +199,7 @@ ps aux | grep amazon-ssm
|
||||
|
||||
### Perssistence
|
||||
|
||||
다음 페이지에서 **abuse SSM permissions to achieve persistence** 방법을 확인할 수 있습니다:
|
||||
다음 페이지에서 **SSM permissions를 악용해 persistence를 달성**하는 방법을 확인할 수 있습니다:
|
||||
|
||||
{{#ref}}
|
||||
../../aws-persistence/aws-ssm-persistence/README.md
|
||||
@@ -207,7 +207,9 @@ ps aux | grep amazon-ssm
|
||||
|
||||
## ELB
|
||||
|
||||
**Elastic Load Balancing** (ELB)은 **load-balancing service for Amazon Web Services** (AWS) 배포용 서비스입니다. ELB는 수신되는 애플리케이션 트래픽을 자동으로 분산시키고 트래픽 수요를 충족하기 위해 리소스를 확장합니다.
|
||||
**Elastic Load Balancing** (ELB)는 **Amazon Web Services** (AWS) 배포를 위한 **load-balancing service**입니다. ELB는 들어오는 application traffic을 자동으로 **분산**하고 traffic demand를 충족하도록 resources를 확장합니다.
|
||||
|
||||
**Application Load Balancers (ALBs)**의 경우, listener rules, authentication actions, header handling, 그리고 동일한 targets로 향하는 alternative paths는 **security boundary**의 일부입니다. 하나의 listener rule만 따로 보지 말고, 전체 경로 **CloudFront --> ALB/NLB --> listeners --> rules --> target groups --> instances/IPs/ports/security groups**를 검토하세요.
|
||||
|
||||
### Enumeration
|
||||
```bash
|
||||
@@ -219,6 +221,73 @@ aws elb describe-load-balancers | jq '.LoadBalancerDescriptions[]| select( .Sche
|
||||
aws elbv2 describe-load-balancers
|
||||
aws elbv2 describe-load-balancers | jq '.LoadBalancers[].DNSName'
|
||||
aws elbv2 describe-listeners --load-balancer-arn <load_balancer_arn>
|
||||
aws elbv2 describe-rules --listener-arn <listener_arn>
|
||||
aws elbv2 describe-target-groups --load-balancer-arn <load_balancer_arn>
|
||||
aws elbv2 describe-target-health --target-group-arn <target_group_arn>
|
||||
aws elbv2 describe-load-balancer-attributes --load-balancer-arn <load_balancer_arn>
|
||||
```
|
||||
### ELB / ALB 노출 및 액세스 제어 우회
|
||||
|
||||
#### 직접 ALB origin access를 통한 CloudFront / WAF 우회
|
||||
|
||||
**CloudFront** distribution이 **internet-facing ALB** 앞에 있지만 ALB security group이 여전히 public inbound traffic을 허용하는 경우, 공격자는 종종 **ALB DNS name을 직접 요청**하여 **CloudFront WAF, geo restrictions, rate limits, 그리고 cache-layer controls**를 우회할 수 있습니다.
|
||||
```bash
|
||||
# Test the origin directly
|
||||
curl -isk https://<alb-dns-name>/
|
||||
|
||||
# If the ALB routes on Host, replay the expected hostname directly to the ALB
|
||||
curl -isk https://<alb-dns-name>/ -H 'Host: app.example.com'
|
||||
```
|
||||
**감사 노트:**
|
||||
|
||||
- CloudFront distributions와 그 origins를 열거한 다음, origin ALB가 여전히 **internet-facing**인지 확인한다.
|
||||
- ALB **security groups**를 검토한다. `0.0.0.0/0` 또는 광범위한 CIDR에서 inbound traffic이 허용되면, CloudFront가 유일한 reachable path가 아닐 가능성이 높다.
|
||||
- ALB로부터 직접 오는 **non-error** response는 보통 CloudFront/WAF layer가 bypass 가능함을 의미한다.
|
||||
|
||||
**Hardening:** CloudFront가 유일한 entry point여야 한다면, AWS-managed prefix list **`com.amazonaws.global.cloudfront.origin-facing`**에서만 ALB로의 inbound traffic을 허용한다.
|
||||
|
||||
#### Listener rule shadowing / auth bypass
|
||||
|
||||
ALB rules는 **ascending priority order**로 평가된다. 더 낮은 priority number를 가진 더 **broad**한 rule이 `authenticate-oidc`, `authenticate-cognito`, 또는 `source-ip`가 도달되기 전에 traffic을 capture할 수 있다.
|
||||
```text
|
||||
[10] path /* -> forward -> tg-app
|
||||
[20] path /admin* -> authenticate-oidc -> tg-app
|
||||
```
|
||||
A request to `/admin` matches `/*` first, so the authentication action never runs.
|
||||
|
||||
**Audit notes:**
|
||||
|
||||
- `aws elbv2 describe-rules --listener-arn <listener_arn>`로 모든 listener와 rule을 덤프합니다.
|
||||
- rule을 priority 오름차순으로 확인하고, 더 제한적인 rule보다 먼저 트래픽을 잡아야 할 넓은 **host/path/header/query** condition이 있는지 검사합니다.
|
||||
- listener 순서를 middleware 순서처럼 취급합니다: **먼저 매칭된 rule이 승리**합니다.
|
||||
|
||||
#### `source-ip` restrictions can be bypassed through alternate paths
|
||||
|
||||
`source-ip` condition은 설정된 **특정 listener rule**만 보호합니다. **같은 target group**, **같은 backend IPs/instances**, 또는 **다른 port의 같은 service**가 다른 ALB, 다른 listener, 혹은 더 약한 controls를 가진 NLB를 통해 접근 가능하다면, 그 대체 경로를 사용해 IP allowlist를 우회할 수 있는 경우가 많습니다.
|
||||
|
||||
**Audit notes:**
|
||||
|
||||
- 각 restrictive rule에 대해 **target group ARN**과 등록된 targets를 열거합니다.
|
||||
- 그 targets를 account/region의 **모든 다른 listener/load balancer**와 비교합니다.
|
||||
- 또한 **public instance IPs**, 허용적인 **security groups**, 또는 `80`, `443`, `8080`, `8443` 같은 port의 추가 listener를 통한 직접 노출도 확인합니다.
|
||||
|
||||
좋은 mental model은: **target을 보호하되, target으로 가는 한 경로만 보호하지 말 것**입니다.
|
||||
|
||||
#### Client-controlled `X-Forwarded-For` trust
|
||||
|
||||
`routing.http.xff_header_processing.mode`가 **internet-facing ALB**에서 **`preserve`**로 설정되어 있으면, backend는 **attacker-supplied** `X-Forwarded-For` 값을 그대로 받을 수 있습니다. application이 그 header를 **access control**, **rate limiting**, **logging**, 또는 **monitoring**에 신뢰하면, attacker는 인식되는 client IP를 spoof할 수 있습니다.
|
||||
```bash
|
||||
curl -isk https://<alb-dns-name>/ -H 'X-Forwarded-For: 127.0.0.1'
|
||||
aws elbv2 describe-load-balancer-attributes --load-balancer-arn <load_balancer_arn>
|
||||
```
|
||||
Prefer `append` or `remove` on internet-facing ALBs, and avoid using client-controlled forwarding headers as an authorization primitive.
|
||||
|
||||
#### Useful tool
|
||||
|
||||
[**ELBaph**](https://github.com/doyensec/ELBaph) is a read-only auditor that models **ALBs, NLBs, listeners, rules, target groups, and targets as a routing graph** and then probes for reachable exposures.
|
||||
```bash
|
||||
elbaph scan --region us-east-1
|
||||
elbaph scan --all-regions -p my-pentest-profile
|
||||
```
|
||||
## Launch Templates & Autoscaling Groups
|
||||
|
||||
@@ -239,9 +308,9 @@ aws autoscaling describe-load-balancers
|
||||
```
|
||||
## Nitro
|
||||
|
||||
AWS Nitro는 AWS EC2 인스턴스의 기반 플랫폼을 형성하는 **혁신적인 기술 모음**입니다. Amazon이 도입하여 **보안, 성능 및 신뢰성 향상**을 위해, Nitro는 맞춤형 **하드웨어 구성 요소와 경량 하이퍼바이저**를 활용합니다. 전통적인 가상화 기능의 상당 부분을 전용 하드웨어와 소프트웨어로 추상화하여, **공격 표면을 최소화**하고 리소스 효율을 개선합니다. 가상화 기능을 오프로드함으로써 Nitro는 EC2 인스턴스가 **거의 베어메탈에 가까운 성능**을 제공하도록 하여 리소스 집약적 애플리케이션에 특히 유리합니다. 또한 Nitro Security Chip은 하드웨어 및 펌웨어의 **보안**을 특별히 보장하여 그 견고한 아키텍처를 더욱 공고히 합니다.
|
||||
AWS Nitro는 AWS EC2 인스턴스의 기반 플랫폼을 형성하는 **혁신적인 기술**의 모음입니다. Amazon이 **보안, 성능, 신뢰성**을 향상시키기 위해 도입했으며, Nitro는 맞춤형 **하드웨어 구성 요소와 경량 hypervisor**를 활용합니다. 이는 기존 virtualization 기능의 많은 부분을 전용 하드웨어와 소프트웨어로 추상화하여 **attack surface를 최소화**하고 리소스 효율성을 향상시킵니다. virtualization 기능을 오프로딩함으로써 Nitro는 EC2 인스턴스가 **거의 bare-metal에 가까운 성능**을 제공할 수 있게 하며, 특히 리소스 집약적인 애플리케이션에 유리합니다. 또한 Nitro Security Chip은 특히 **하드웨어와 firmware의 보안**을 보장하여, 그 강력한 아키텍처를 더욱 공고히 합니다.
|
||||
|
||||
Get more information and how to enumerate it from:
|
||||
다음에서 더 많은 정보와 이를 enumerate하는 방법을 확인할 수 있습니다:
|
||||
|
||||
{{#ref}}
|
||||
aws-nitro-enum.md
|
||||
@@ -249,34 +318,34 @@ aws-nitro-enum.md
|
||||
|
||||
## VPN
|
||||
|
||||
VPN은 귀사의 **온프레미스 네트워크 (site-to-site VPN)** 또는 **작업자 노트북 (Client VPN)**을 **AWS VPC**에 연결하여 서비스들을 인터넷에 노출할 필요 없이 접근할 수 있게 해줍니다.
|
||||
VPN은 **on-premise network (site-to-site VPN)** 또는 **workers laptops (Client VPN)**를 **AWS VPC**에 연결할 수 있게 하여, 서비스를 인터넷에 노출하지 않고도 접근할 수 있게 합니다.
|
||||
|
||||
#### Basic AWS VPN Components
|
||||
|
||||
1. **Customer Gateway**:
|
||||
- A Customer Gateway is a resource that you create in AWS to represent your side of a VPN connection.
|
||||
- It is essentially a physical device or software application on your side of the Site-to-Site VPN connection.
|
||||
- You provide routing information and the public IP address of your network device (such as a router or a firewall) to AWS to create a Customer Gateway.
|
||||
- It serves as a reference point for setting up the VPN connection and doesn't incur additional charges.
|
||||
- Customer Gateway는 AWS에서 생성하여 VPN connection에서 여러분의 쪽을 나타내는 resource입니다.
|
||||
- 이는 본질적으로 Site-to-Site VPN connection의 여러분 쪽에 있는 physical device 또는 software application입니다.
|
||||
- 네트워크 장치(예: router 또는 firewall)의 routing 정보와 public IP address를 AWS에 제공하여 Customer Gateway를 생성합니다.
|
||||
- 이는 VPN connection 설정의 기준점 역할을 하며 추가 요금이 발생하지 않습니다.
|
||||
2. **Virtual Private Gateway**:
|
||||
- A Virtual Private Gateway (VPG) is the VPN concentrator on the Amazon side of the Site-to-Site VPN connection.
|
||||
- It is attached to your VPC and serves as the target for your VPN connection.
|
||||
- VPG is the AWS side endpoint for the VPN connection.
|
||||
- It handles the secure communication between your VPC and your on-premises network.
|
||||
- Virtual Private Gateway (VPG)는 Site-to-Site VPN connection에서 Amazon 쪽의 VPN concentrator입니다.
|
||||
- 이는 VPC에 연결되며 VPN connection의 target 역할을 합니다.
|
||||
- VPG는 VPN connection의 AWS 쪽 endpoint입니다.
|
||||
- VPC와 on-premises network 간의 secure communication을 처리합니다.
|
||||
3. **Site-to-Site VPN Connection**:
|
||||
- A Site-to-Site VPN connection connects your on-premises network to a VPC through a secure, IPsec VPN tunnel.
|
||||
- This type of connection requires a Customer Gateway and a Virtual Private Gateway.
|
||||
- It's used for secure, stable, and consistent communication between your data center or network and your AWS environment.
|
||||
- Typically used for regular, long-term connections and is billed based on the amount of data transferred over the connection.
|
||||
- Site-to-Site VPN connection은 secure한 IPsec VPN tunnel을 통해 on-premises network를 VPC에 연결합니다.
|
||||
- 이 유형의 connection에는 Customer Gateway와 Virtual Private Gateway가 필요합니다.
|
||||
- 데이터 센터 또는 네트워크와 AWS 환경 간의 secure하고 안정적이며 일관된 communication에 사용됩니다.
|
||||
- 일반적으로 정기적이고 장기적인 connection에 사용되며, connection을 통해 전송된 data 양에 따라 요금이 부과됩니다.
|
||||
4. **Client VPN Endpoint**:
|
||||
- A Client VPN endpoint is a resource that you create in AWS to enable and manage client VPN sessions.
|
||||
- It is used for allowing individual devices (like laptops, smartphones, etc.) to securely connect to AWS resources or your on-premises network.
|
||||
- It differs from Site-to-Site VPN in that it is designed for individual clients rather than connecting entire networks.
|
||||
- With Client VPN, each client device uses a VPN client software to establish a secure connection.
|
||||
- Client VPN endpoint는 client VPN session을 enable하고 관리하기 위해 AWS에서 생성하는 resource입니다.
|
||||
- 이는 개별 장치(예: laptop, smartphone 등)가 AWS resource 또는 on-premises network에 secure하게 연결할 수 있도록 하는 데 사용됩니다.
|
||||
- 전체 network를 연결하는 것이 아니라 개별 client를 대상으로 설계되었다는 점에서 Site-to-Site VPN과 다릅니다.
|
||||
- Client VPN에서는 각 client device가 VPN client software를 사용하여 secure connection을 수립합니다.
|
||||
|
||||
You can [**find more information about the benefits and components of AWS VPNs here**](aws-vpc-and-networking-basic-information.md#vpn).
|
||||
[**AWS VPN의 이점과 구성 요소에 대한 더 많은 정보는 여기에서 확인할 수 있습니다**](aws-vpc-and-networking-basic-information.md#vpn).
|
||||
|
||||
### 열거
|
||||
### Enumeration
|
||||
```bash
|
||||
# VPN endpoints
|
||||
## Check used subnetwork, authentication, SGs, connected...
|
||||
@@ -304,13 +373,13 @@ aws ec2 describe-vpn-connections
|
||||
|
||||
**Local Temporary Credentials**
|
||||
|
||||
AWS VPN Client가 VPN에 연결될 때, 사용자는 일반적으로 VPN에 접근하기 위해 **AWS에 로그인**합니다. 그 후, VPN 연결을 설정하기 위해 일부 **AWS credentials가 생성되어 로컬에 저장**됩니다. 해당 자격증명은 **`$HOME/.config/AWSVPNClient/TemporaryCredentials/<region>/temporary-credentials.txt`에 저장**되며 **AccessKey**, **SecretKey**, **Token**을 포함합니다.
|
||||
AWS VPN Client가 VPN에 연결하는 데 사용될 때, 사용자는 보통 VPN에 접근하기 위해 **AWS에 로그인**합니다. 그러면 VPN 연결을 설정하기 위해 일부 **AWS credentials가 생성되어 로컬에 저장**됩니다. 이 credentials는 `$HOME/.config/AWSVPNClient/TemporaryCredentials/<region>/temporary-credentials.txt`에 **저장**되며, **AccessKey**, **SecretKey**, **Token**을 포함합니다.
|
||||
|
||||
해당 자격증명은 사용자 `arn:aws:sts::<acc-id>:assumed-role/aws-vpn-client-metrics-analytics-access-role/CognitoIdentityCredentials`에 속합니다 (TODO: 이 자격증명의 권한에 대해 추가 조사 필요).
|
||||
이 credentials는 `arn:aws:sts::<acc-id>:assumed-role/aws-vpn-client-metrics-analytics-access-role/CognitoIdentityCredentials` 사용자에 속합니다( TODO: 이 credentials의 permissions에 대해 더 조사하기).
|
||||
|
||||
**opvn config files**
|
||||
|
||||
VPN 연결이 수립된 경우 시스템에서 **`.opvn`** 구성 파일을 찾아보세요. 또한 구성 파일을 찾을 수 있는 위치 중 하나는 **`$HOME/.config/AWSVPNClient/OpenVpnConfigs`**입니다.
|
||||
**VPN connection이 설정되었다면** 시스템에서 **`.opvn`** config files를 찾아야 합니다. 또한, **configurations**를 찾을 수 있는 한 곳은 **`$HOME/.config/AWSVPNClient/OpenVpnConfigs`**입니다.
|
||||
|
||||
#### **Post Exploitaiton**
|
||||
|
||||
@@ -320,6 +389,11 @@ VPN 연결이 수립된 경우 시스템에서 **`.opvn`** 구성 파일을 찾
|
||||
|
||||
## References
|
||||
|
||||
- [https://docs.aws.amazon.com/batch/latest/userguide/getting-started-ec2.html](https://docs.aws.amazon.com/batch/latest/userguide/getting-started-ec2.html)
|
||||
- [AWS Elastic Beanstalk and Amazon EC2 getting started](https://docs.aws.amazon.com/batch/latest/userguide/getting-started-ec2.html)
|
||||
- [Doyensec - Navigating Lax Load Balancers: When an Intersection Gets You Inside](https://blog.doyensec.com/2026/05/25/cloudsectidbits-elbaph-alb.html)
|
||||
- [AWS - Listener rules for your Application Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/listener-rules.html)
|
||||
- [AWS - HTTP headers and Application Load Balancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/x-forwarded-headers.html)
|
||||
- [AWS - CloudFront managed prefix list for origin-facing servers](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/LocationsOfEdgeServers.html)
|
||||
- [Doyensec - ELBaph](https://github.com/doyensec/ELBaph)
|
||||
|
||||
{{#include ../../../../banners/hacktricks-training.md}}
|
||||
|
||||
Reference in New Issue
Block a user