Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MITM 프록시를 이용한 WebSocket Interceptor 구현 #83

Open
3 tasks
hsheric0210 opened this issue Dec 6, 2023 · 4 comments
Open
3 tasks

MITM 프록시를 이용한 WebSocket Interceptor 구현 #83

hsheric0210 opened this issue Dec 6, 2023 · 4 comments
Assignees
Labels
Category: Browser Browser related issue Category: Game Handler Game handler related issue Type: Feature request Request of new feature or function

Comments

@hsheric0210
Copy link
Owner

hsheric0210 commented Dec 6, 2023

이 방법의 최대 장점은, 바로 특수한 임베드 브라우저나 Selenium 같은 자동화 프레임워크를 사용하는 대신
사용자가 평상시에도 사용하는 '정상적인 브라우저'의 사이트 단에 직접적으로 스크립트를 삽입하여
그 어떤 '봇 감지' 비슷한 장치들도 쉽게 회피함과 동시에 거의 완벽한 상호운용성을 확보할 수 있다는 것이다.

원리는 AdGuard 등과 같은 '운영 체제 단'에서 동작하는 광고 차단 및 유저스크립트 제공 프로그램들과 완전 동일하다.

  • https://github.com/eger-geger/FryProxy

  • https://github.com/jimevans/BenderProxy

  • 자체 MitM 프록시 서버를 구축하여 모든 WebSocket 통신 내용들을 스니핑하여 작동할 수 있는 기능 추가.

    • 이를 위한 자체 제작 인증서 탑재 방법 및 설명 추가
  • MitM 프록시를 이용하여 작동 중일 때는 네이티브 자동 입력만을 사용할 수 있도록 수정.

    • 참고: MitM 프록시 사용 구현은 AutoKkutu가 브라우저 측과 그 어떤 직접적 연결도 가지지 않으므로 JavaScript 실행 등의 'AutoKkutu -> 브라우저' 간의 제어가 불가능함. 유일하게 가능한 것은 게임 측에서 사용하는 WebSocket의 MitM을 통한 게임 상태 파악 뿐임. (물론 그것만으로도 AutoKkutu의 대부분의 기능은 동작할 수 있음)

    • 생각해 보니까 MitM 프록시를 통해 DOM에 스크립트를 직접 삽입하면 이를 통해 로컬 WebSocket 서버로 통신을 하며 상호작용할 수 있네...?

      당장 AdGuard같은 MitM 프록시 기반 광고차단 및 유저스크립트 프로그램 하는 일이 그거니까...

      즉, MitM 프록시만으로도 임베드 브라우저 또는 다른 수단을 사용할 때의 기능들 모두를 구현해 낼 수 있다는 말이다.

@hsheric0210 hsheric0210 self-assigned this Dec 6, 2023
@hsheric0210
Copy link
Owner Author

  • 시스템 와이드 프록시를 설정하는 것은 보안 상 우려가 있으니 브라우저 커맨드 라인 파라미터로 프록시 서버 설정을 넘길 수 있도록 하는 방법 설명 추가하기.

@hsheric0210 hsheric0210 added Type: Feature request Request of new feature or function Category: Browser Browser related issue Category: Game Handler Game handler related issue labels Dec 6, 2023
@hsheric0210
Copy link
Owner Author

@hsheric0210
Copy link
Owner Author

hsheric0210 commented Dec 11, 2023

프록시 서버를 구축하는 것 외에도 TDI 또는 WFP 드라이버를 사용해도 된다고는 하는데...
아무리 생각해도 배보다 배꼽이 큰 처사인 것 같기는 하다...

https://blog.naver.com/kkan22/80087329641

당장 AdGuard도 기본적으로 TDI 기반, 선택적으로 WFP 기반으로 동작한다고 한다:
https://adguard.com/kb/ko/adguard-for-windows/solving-problems/wfp-driver/
(실제로도 adgnetworktdidrv.sys, adgnetworkwfpdrv.sys 라는 이름의 TDI, WFP 드라이버를 찾을 수 있다)

https://tdifw.sourceforge.net/
https://learn.microsoft.com/ko-kr/windows-hardware/drivers/network/roadmap-for-developing-wfp-callout-drivers

아니면 또 다른 하나의 선택지로 WinDivert나 TAP 등을 사용할 수도 있다.

WinDivert:
https://reqrypt.org/windivert.html
https://github.com/basil00/Divert

OpenVPN TAP:
https://community.openvpn.net/openvpn/wiki/ManagingWindowsTAPDrivers
https://docs.mudfish.net/ko/docs/mudfish-cloud-vpn/faq-tap-driver/
https://github.com/OpenVPN/tap-windows6

WinTun:
https://www.wintun.net/
https://github.com/WireGuard/wintun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Browser Browser related issue Category: Game Handler Game handler related issue Type: Feature request Request of new feature or function
Projects
None yet
Development

No branches or pull requests

1 participant