프록시에서 가능한 모든 것(정방향 프록시)
나는 이것들을 통해 내 생각과 배움을 표현하고, 확장하고, 설명하려고 노력하고 있다
Posts
> 제가 실수한 부분이 있으면 지적해주세요.
프록시로 시작(만약
Proxy
이라고 하면 대부분 Forward Proxy
을 의미합니다.)이것에 대해 이미 많은 설명이 다루어져 있으며 내가 읽고 매우 흥미로운 링크와 리소스를 추가할 것입니다.
이 게시물에 무엇을 추가할 것인지로 돌아갑니다.
모든 것이 될 것입니다
정방향 프록시란?
할 수 있는,
그것이 할 수 있는 것,
할 수 없는 것(구성, 사용 및 기능에 따라 다름)
내 위의 링크를 통과했기 때문에 짧은 이야기입니다(^)
시작하자
Now The Proxy Works and Provides Features depends on where it is Placed.
이것을 분해하자
1) 프록시가 네트워크 내부에 있는 경우(기본적으로 학교, 기관, 사무실(모든 사무실일 수 있음)의 시나리오), 프록시를 사용하는 이유는 클라이언트가 프록시를 사용하고
Caching
Website Access Blocking (Well it Fall inside Filtering But There is a Reason Why I kept it over here)
Filtering
Identification (Basically Knowing Which User and Based on that Filtering)
Other Activity (Logging, Alerting)
.......
2) 프록시가 네트워크 외부에 있는 경우(기본적으로 온라인 프록시, 무료 프록시 서버, 브라우저 프록시 확장(예: Hola , HotSpotShield), 브라우저 VPN 확장(* 자세한 내용은 여기)), 사용 이유는 다음과 같습니다. 인터넷을 통해 클라이언트를 익명으로 만드십시오.
이는 이 프록시가 나에게 익명성을 제공하고 내 ISP에 의해 차단된 항목에 액세스할 수 있음을 의미합니다.
[자 이것은 위의 펀치 라인을 말한 이유인 위의 약간의 모순입니다.]
따라서 여기에서 프록시에 대해 명확하고 배치 위치에 따라 어떻게 다른지 알 수 있습니다.
다른 곳으로 가자
프록시가 사용자가 연결하려는 호스트를 결정하는 것이 얼마나 쉬운가요?
Based on the
Host
Header
For Plain HTTP Website it is Easy to Get the Host Header because anybody can see that, same ways even Proxy can see it Very Easily
HTTPS 웹 사이트의 경우 브라우저는 먼저 원격 웹 사이트와의 SSL 연결을 시작할 것임을 나타내는 요청
CONNECT
을 보냅니다.이렇게 생겼어요
CONNECT b.config.skype.com:443 HTTP/1.1
Host: b.config.skype.com:443
Proxy-Connection: keep-alive
User-Agent: curl/7.58.0
중요한 헤더는 하나 아래에만 있습니다. 나머지
Proxy-Connection
, User-Agent
는 중요하지만 필수는 아닙니다/CONNECT
요청에 대해 필수가 아닙니다.CONNECT b.config.skype.com:443 HTTP/1.1
Host: b.config.skype.com:443
User-Agent
또한 표준 또는 다른 포트에서 연결할지 여부를 나타내는 포트를 지정합니다.따라서 Simple에서는 이렇게 작동합니다.
아래 시나리오에서는 Firefox를 사용하고 있으며 브라우저에 설정이 있습니다
Connect
.내 컴퓨터에서 로컬로 프록시를 실행하고 있습니다. [실행 중인 프록시는 나중에 업데이트하겠습니다.]
Plain HTTP Site
연결 대상: http://example.com/
브라우저는 다음과 같이 프록시에 HTTP 요청을 보냅니다.
hmmm@demo:~# curl -vk "http://example.com/" -x 127.0.0.1:8080
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET http://example.com/ HTTP/1.1
> Host: example.com
> User-Agent: curl/7.58.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 OK
< Age: 341302
< Cache-Control: max-age=604800
< Content-Type: text/html; charset=UTF-8
< Date: Fri, 01 Jan 2021 13:50:29 GMT
< Etag: "3147526947+ident"
< Expires: Fri, 08 Jan 2021 13:50:29 GMT
< Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT
< Server: ECS (nyb/1D2C)
< Vary: Accept-Encoding
< X-Cache: HIT
< Content-Length: 1256
그러면 프록시가 원격 서버에 요청을 합니다(호스트 헤더에서 수집,
The Proxy Setting
에서 추출할 수 있지만 호스트 헤더가 표준임)살펴보자
간단한 DIRECT 요청은 다음과 같습니다.
hmmm@demo:~# curl -vk "http://example.com/"
* Trying 2606:2800:220:1:248:1893:25c8:1946...
* TCP_NODELAY set
* Trying 93.184.216.34...
> GET / HTTP/1.1
> Host: example.com
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Age: 341302
< Cache-Control: max-age=604800
< Content-Type: text/html; charset=UTF-8
< Date: Fri, 01 Jan 2021 13:50:31 GMT
< Etag: "3147526947+ident"
< Expires: Fri, 08 Jan 2021 13:50:31 GMT
< Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT
< Server: ECS (nyb/1D2C)
< Vary: Accept-Encoding
< X-Cache: HIT
< Content-Length: 1256
HTTPS Request
연결 대상: https://example.com/
hmmm@demo:~# curl -vk "https://example.com/" -x 127.0.0.1:8080
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to example.com:443
> CONNECT example.com:443 HTTP/1.1
> Host: example.com:443
> User-Agent: curl/7.58.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection Established
< Connection: Keep-Alive
< Proxy-Connection: Keep-Alive
<
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CONNECT phase completed!
* CONNECT phase completed!
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (OUT), TLS change cipher, Client hello (1):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Unknown (8):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS Unknown, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=California; L=Los Angeles; O=Internet Corporation for Assigned Names and Numbers; CN=www.example.org
* start date: Nov 24 00:00:00 2020 GMT
* expire date: Dec 25 23:59:59 2021 GMT
* issuer: C=US; O=DigiCert Inc; CN=DigiCert TLS RSA SHA256 2020 CA1
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* Using Stream ID: 1 (easy handle 0x56435e5025c0)
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
> GET / HTTP/2
> Host: example.com
> User-Agent: curl/7.58.0
> Accept: */*
>
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
< HTTP/2 200
< age: 87233
< cache-control: max-age=604800
< content-type: text/html; charset=UTF-8
< date: Fri, 01 Jan 2021 14:04:25 GMT
< etag: "3147526947+ident"
< expires: Fri, 08 Jan 2021 14:04:25 GMT
< last-modified: Thu, 17 Oct 2019 07:18:26 GMT
< server: ECS (nyb/1D0D)
< vary: Accept-Encoding
< x-cache: HIT
< content-length: 1256
<
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
<!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
padding: 2em;
background-color: #fdfdff;
border-radius: 0.5em;
box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
div {
margin: 0 auto;
width: auto;
}
}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents. You may use this
domain in literature without prior coordination or asking for permission.</p>
<p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
* Connection #0 to host 127.0.0.1 left intact
위에서 볼 수 있듯이 Curl은
Request Line
Request Prior를 보냅니다.따라서 프록시가 사용자가 연결하려는 원격 서버를 식별하는 것이 매우 쉽다는 것을 알았습니다.
그리고 이를 기반으로 Proxy는 사용자가 원격 서버에 액세스할 수 있도록 허용할지 또는 허용하지 않을지 여부에 대한 조건을 추가할 수 있습니다.
얼마나 효율적이고, 쉽고, 유용한지는 프록시에 달려 있습니다.
간단한 예: Squid에서 도메인을 차단하려면 Squid 서비스를 다시 시작해야 합니다.
다른 프록시에서 그렇게 하면 도메인을 추가하고 실시간으로 차단할 수 있는 대시보드를 제공합니다.
.......... 게시물이 곧 업데이트됩니다 .........
Reference
이 문제에 관하여(프록시에서 가능한 모든 것(정방향 프록시)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/aashishrbhandari/what-all-things-are-possible-in-a-proxy-forward-proxy-4ba1텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)