mirror of
				https://github.com/HackTricks-wiki/hacktricks.git
				synced 2025-10-10 18:36:50 +00:00 
			
		
		
		
	Translated ['src/generic-methodologies-and-resources/phishing-methodolog
This commit is contained in:
		
							parent
							
								
									4b36dea5e9
								
							
						
					
					
						commit
						261a9a3bc4
					
				| @ -31,6 +31,7 @@ additional-js = [ | ||||
|     "theme/tabs.js", | ||||
|     "theme/ht_searcher.js", | ||||
|     "theme/sponsor.js", | ||||
|     "theme/ai.js" | ||||
| ] | ||||
| no-section-label = true | ||||
| preferred-dark-theme = "hacktricks-dark" | ||||
|  | ||||
| @ -561,6 +561,7 @@ | ||||
| - [CSRF (Cross Site Request Forgery)](pentesting-web/csrf-cross-site-request-forgery.md) | ||||
| - [Dangling Markup - HTML scriptless injection](pentesting-web/dangling-markup-html-scriptless-injection/README.md) | ||||
|   - [SS-Leaks](pentesting-web/dangling-markup-html-scriptless-injection/ss-leaks.md) | ||||
| - [DApps - Decentralized Applications](pentesting-web/dapps-DecentralizedApplications.md) | ||||
| - [Dependency Confusion](pentesting-web/dependency-confusion.md) | ||||
| - [Deserialization](pentesting-web/deserialization/README.md) | ||||
|   - [NodeJS - \_\_proto\_\_ & prototype Pollution](pentesting-web/deserialization/nodejs-proto-prototype-pollution/README.md) | ||||
| @ -625,6 +626,7 @@ | ||||
| - [Regular expression Denial of Service - ReDoS](pentesting-web/regular-expression-denial-of-service-redos.md) | ||||
| - [Reset/Forgotten Password Bypass](pentesting-web/reset-password.md) | ||||
| - [Reverse Tab Nabbing](pentesting-web/reverse-tab-nabbing.md) | ||||
| - [RSQL Injection](pentesting-web/rsql-injection.md) | ||||
| - [SAML Attacks](pentesting-web/saml-attacks/README.md) | ||||
|   - [SAML Basics](pentesting-web/saml-attacks/saml-basics.md) | ||||
| - [Server Side Inclusion/Edge Side Inclusion Injection](pentesting-web/server-side-inclusion-edge-side-inclusion-injection.md) | ||||
|  | ||||
| @ -6,11 +6,11 @@ | ||||
| 
 | ||||
| 1. 피해자 조사 | ||||
| 1. **피해자 도메인** 선택. | ||||
| 2. 피해자가 사용하는 **로그인 포털**을 찾기 위해 기본 웹 열거 작업 수행 후 **사칭할 것** 결정. | ||||
| 3. **OSINT**를 사용하여 **이메일 찾기**. | ||||
| 2. 피해자가 사용하는 **로그인 포털**을 찾기 위해 기본 웹 열거 수행하고 **어떤 것을** **가장하는지** **결정**합니다. | ||||
| 3. **OSINT**를 사용하여 **이메일** 찾기. | ||||
| 2. 환경 준비 | ||||
| 1. 피싱 평가에 사용할 **도메인 구매**. | ||||
| 2. 관련 기록(SPF, DMARC, DKIM, rDNS)으로 **이메일 서비스 구성**. | ||||
| 2. 관련 기록의 **이메일 서비스** 구성 (SPF, DMARC, DKIM, rDNS). | ||||
| 3. **gophish**로 VPS 구성. | ||||
| 3. 캠페인 준비 | ||||
| 1. **이메일 템플릿** 준비. | ||||
| @ -21,18 +21,18 @@ | ||||
| 
 | ||||
| ### 도메인 이름 변형 기법 | ||||
| 
 | ||||
| - **키워드**: 도메인 이름에 원래 도메인의 중요한 **키워드** 포함 (예: zelster.com-management.com). | ||||
| - **키워드**: 도메인 이름에 원래 도메인의 중요한 **키워드**가 포함됨 (예: zelster.com-management.com). | ||||
| - **하이픈 서브도메인**: 서브도메인의 **점**을 **하이픈**으로 변경 (예: www-zelster.com). | ||||
| - **새 TLD**: **새 TLD**를 사용하는 동일 도메인 (예: zelster.org). | ||||
| - **호모글리프**: 도메인 이름의 문자를 **유사한 문자**로 **대체** (예: zelfser.com). | ||||
| - **새 TLD**: **새 TLD**를 사용하는 동일한 도메인 (예: zelster.org). | ||||
| - **호모글리프**: 도메인 이름의 문자를 **비슷하게 보이는 문자**로 **대체** (예: zelfser.com). | ||||
| - **전치**: 도메인 이름 내에서 두 문자를 **교환** (예: zelsetr.com). | ||||
| - **단수화/복수화**: 도메인 이름 끝에 “s”를 추가하거나 제거 (예: zeltsers.com). | ||||
| - **생략**: 도메인 이름에서 **하나의 문자**를 **제거** (예: zelser.com). | ||||
| - **반복**: 도메인 이름에서 **하나의 문자**를 **반복** (예: zeltsser.com). | ||||
| - **대체**: 호모글리프와 유사하지만 덜 은밀함. 도메인 이름의 문자 중 하나를 원래 문자와 가까운 키보드의 문자로 대체 (예: zektser.com). | ||||
| - **생략**: 도메인 이름에서 **하나의** 문자를 **제거** (예: zelser.com). | ||||
| - **반복**: 도메인 이름에서 **하나의** 문자를 **반복** (예: zeltsser.com). | ||||
| - **대체**: 호모글리프와 비슷하지만 덜 은밀함. 도메인 이름의 문자를 원래 문자와 키보드에서 가까운 문자로 대체 (예: zektser.com). | ||||
| - **서브도메인화**: 도메인 이름 내에 **점**을 추가 (예: ze.lster.com). | ||||
| - **삽입**: 도메인 이름에 **문자 삽입** (예: zerltser.com). | ||||
| - **누락된 점**: 도메인 이름에 TLD 추가 (예: zelstercom.com). | ||||
| - **삽입**: 도메인 이름에 **문자**를 **삽입** (예: zerltser.com). | ||||
| - **누락된 점**: 도메인 이름에 TLD를 추가 (예: zelstercom.com). | ||||
| 
 | ||||
| **자동 도구** | ||||
| 
 | ||||
| @ -45,13 +45,13 @@ | ||||
| - [https://dnstwister.report/](https://dnstwister.report) | ||||
| - [https://www.internetmarketingninjas.com/tools/free-tools/domain-typo-generator/](https://www.internetmarketingninjas.com/tools/free-tools/domain-typo-generator/) | ||||
| 
 | ||||
| ### 비트 플리핑 | ||||
| ### 비트플리핑 | ||||
| 
 | ||||
| **저장되거나 통신 중인 일부 비트가 자동으로 뒤집힐 가능성**이 있습니다. 이는 태양 플레어, 우주선, 하드웨어 오류와 같은 다양한 요인으로 인해 발생할 수 있습니다. | ||||
| 
 | ||||
| 이 개념이 **DNS 요청에 적용될 때**, **DNS 서버에서 수신된 도메인**이 처음 요청한 도메인과 다를 수 있습니다. | ||||
| 
 | ||||
| 예를 들어, "windows.com" 도메인에서 단일 비트 수정이 "windnws.com"으로 변경될 수 있습니다. | ||||
| 예를 들어, "windows.com"의 단일 비트 수정은 "windnws.com"으로 변경할 수 있습니다. | ||||
| 
 | ||||
| 공격자는 **피해자의 도메인과 유사한 여러 비트 플리핑 도메인을 등록하여 이를 이용할 수 있습니다**. 그들의 의도는 합법적인 사용자를 자신의 인프라로 리디렉션하는 것입니다. | ||||
| 
 | ||||
| @ -73,8 +73,8 @@ | ||||
| - [https://hunter.io/](https://hunter.io) | ||||
| - [https://anymailfinder.com/](https://anymailfinder.com) | ||||
| 
 | ||||
| **더 많은** 유효한 이메일 주소를 **발견하거나** 이미 발견한 이메일 주소를 **검증**하기 위해 피해자의 SMTP 서버를 브루트포스할 수 있는지 확인할 수 있습니다. [여기에서 이메일 주소를 검증/발견하는 방법을 배우세요](../../network-services-pentesting/pentesting-smtp/index.html#username-bruteforce-enumeration).\ | ||||
| 또한 사용자가 **메일에 접근하기 위해 웹 포털을 사용하는 경우**, 해당 포털이 **사용자 이름 브루트포스**에 취약한지 확인하고 가능하다면 취약점을 악용하는 것을 잊지 마세요. | ||||
| **더 많은** 유효한 이메일 주소를 **발견하거나** 이미 발견한 이메일 주소를 **검증**하기 위해 피해자의 SMTP 서버를 브루트 포스할 수 있는지 확인할 수 있습니다. [여기에서 이메일 주소를 검증/발견하는 방법을 배우세요](../../network-services-pentesting/pentesting-smtp/index.html#username-bruteforce-enumeration).\ | ||||
| 또한 사용자가 **메일에 접근하기 위해 웹 포털을 사용하는 경우**, 해당 포털이 **사용자 이름 브루트 포스**에 취약한지 확인하고 가능하다면 취약점을 이용하는 것을 잊지 마세요. | ||||
| 
 | ||||
| ## GoPhish 구성 | ||||
| 
 | ||||
| @ -91,7 +91,7 @@ ssh -L 3333:127.0.0.1:3333 <user>@<ip> | ||||
| 
 | ||||
| **TLS 인증서 구성** | ||||
| 
 | ||||
| 이 단계 전에 **사용할 도메인을 이미 구매해야** 하며, 해당 도메인은 **gophish**를 구성하고 있는 **VPS의 IP**를 **가리키고 있어야** 합니다. | ||||
| 이 단계 전에 **사용할 도메인을 이미 구매해야** 하며, 해당 도메인은 **gophish**를 구성하고 있는 **VPS의 IP**를 **가리켜야** 합니다. | ||||
| ```bash | ||||
| DOMAIN="<domain>" | ||||
| wget https://dl.eff.org/certbot-auto | ||||
| @ -117,14 +117,14 @@ cp "/etc/letsencrypt/live/$DOMAIN/fullchain.pem" /opt/gophish/ssl_keys/key.crt | ||||
| - **/etc/postfix/transport** | ||||
| - **/etc/postfix/virtual_regexp** | ||||
| 
 | ||||
| **/etc/postfix/main.cf** 내부의 다음 변수 값도 변경합니다. | ||||
| **/etc/postfix/main.cf** 내의 다음 변수 값도 변경합니다. | ||||
| 
 | ||||
| `myhostname = <domain>`\ | ||||
| `mydestination = $myhostname, <domain>, localhost.com, localhost` | ||||
| 
 | ||||
| 마지막으로 **`/etc/hostname`** 및 **`/etc/mailname`** 파일을 도메인 이름으로 수정하고 **VPS를 재시작합니다.** | ||||
| 
 | ||||
| 이제 **DNS A 레코드**를 `mail.<domain>`으로 생성하고 **VPS의 IP 주소**를 가리키며, **DNS MX** 레코드를 `mail.<domain>`으로 설정합니다. | ||||
| 이제 **DNS A 레코드**를 `mail.<domain>`으로 생성하여 **VPS의 IP 주소**를 가리키고, **DNS MX** 레코드를 `mail.<domain>`으로 설정합니다. | ||||
| 
 | ||||
| 이제 이메일을 보내는 테스트를 해봅시다: | ||||
| ```bash | ||||
| @ -134,7 +134,7 @@ echo "This is the body of the email" | mail -s "This is the subject line" test@e | ||||
| **Gophish 구성** | ||||
| 
 | ||||
| gophish의 실행을 중지하고 구성합시다.\ | ||||
| `/opt/gophish/config.json`을 다음과 같이 수정합니다 (https 사용에 유의하세요): | ||||
| `/opt/gophish/config.json`을 다음과 같이 수정합니다 (https 사용에 유의): | ||||
| ```bash | ||||
| { | ||||
| "admin_server": { | ||||
| @ -161,7 +161,7 @@ gophish의 실행을 중지하고 구성합시다.\ | ||||
| ``` | ||||
| **gophish 서비스 구성** | ||||
| 
 | ||||
| gophish 서비스를 자동으로 시작하고 관리할 수 있도록 하려면 다음 내용을 포함하는 파일 `/etc/init.d/gophish`를 생성할 수 있습니다: | ||||
| gophish 서비스를 자동으로 시작하고 관리할 수 있도록 하려면 `/etc/init.d/gophish` 파일을 다음 내용으로 생성할 수 있습니다: | ||||
| ```bash | ||||
| #!/bin/bash | ||||
| # /etc/init.d/gophish | ||||
| @ -208,7 +208,7 @@ case $1 in | ||||
| start|stop|status) "$1" ;; | ||||
| esac | ||||
| ``` | ||||
| 서비스 구성을 마치고 다음을 확인하세요: | ||||
| 서비스 구성을 완료하고 다음을 수행하여 확인합니다: | ||||
| ```bash | ||||
| mkdir /var/log/gophish | ||||
| chmod +x /etc/init.d/gophish | ||||
| @ -223,19 +223,19 @@ service gophish stop | ||||
| 
 | ||||
| ### 기다리고 합법적으로 행동하기 | ||||
| 
 | ||||
| 도메인이 오래될수록 스팸으로 잡힐 가능성이 낮아집니다. 따라서 피싱 평가 전에 가능한 한 오랫동안 (최소 1주일) 기다려야 합니다. 또한, 평판이 좋은 분야에 대한 페이지를 만들면 얻는 평판이 더 좋습니다. | ||||
| 도메인이 오래될수록 스팸으로 잡힐 가능성이 낮아집니다. 따라서 피싱 평가 전에 가능한 한 오랫동안 기다려야 합니다(최소 1주). 또한, 평판이 좋은 분야에 대한 페이지를 만들면 얻는 평판이 더 좋습니다. | ||||
| 
 | ||||
| 1주일을 기다려야 하더라도 지금 모든 구성을 마칠 수 있다는 점에 유의하세요. | ||||
| 1주를 기다려야 하더라도 지금 모든 구성을 마칠 수 있다는 점에 유의하세요. | ||||
| 
 | ||||
| ### 역방향 DNS (rDNS) 레코드 구성 | ||||
| ### 역 DNS (rDNS) 레코드 구성 | ||||
| 
 | ||||
| VPS의 IP 주소를 도메인 이름으로 해석하는 rDNS (PTR) 레코드를 설정하세요. | ||||
| VPS의 IP 주소를 도메인 이름으로 해석하는 rDNS (PTR) 레코드를 설정합니다. | ||||
| 
 | ||||
| ### 발신자 정책 프레임워크 (SPF) 레코드 | ||||
| 
 | ||||
| 새 도메인에 대해 **SPF 레코드를 구성해야 합니다**. SPF 레코드가 무엇인지 모른다면 [**이 페이지를 읽어보세요**](../../network-services-pentesting/pentesting-smtp/index.html#spf). | ||||
| 
 | ||||
| [https://www.spfwizard.net/](https://www.spfwizard.net) 를 사용하여 SPF 정책을 생성할 수 있습니다 (VPS 머신의 IP를 사용하세요). | ||||
| [https://www.spfwizard.net/](https://www.spfwizard.net) 를 사용하여 SPF 정책을 생성할 수 있습니다(사용할 VPS 머신의 IP를 입력하세요). | ||||
| 
 | ||||
| .png>) | ||||
| 
 | ||||
| @ -247,7 +247,7 @@ v=spf1 mx a ip4:ip.ip.ip.ip ?all | ||||
| 
 | ||||
| 새 도메인에 대해 **DMARC 레코드를 구성해야 합니다**. DMARC 레코드가 무엇인지 모른다면 [**이 페이지를 읽어보세요**](../../network-services-pentesting/pentesting-smtp/index.html#dmarc). | ||||
| 
 | ||||
| 호스트 이름 `_dmarc.<domain>`을 가리키는 새로운 DNS TXT 레코드를 다음 내용으로 생성해야 합니다: | ||||
| 다음 내용을 포함하여 호스트 이름 `_dmarc.<domain>`을 가리키는 새로운 DNS TXT 레코드를 생성해야 합니다: | ||||
| ```bash | ||||
| v=DMARC1; p=none | ||||
| ``` | ||||
| @ -266,12 +266,12 @@ v=DMARC1; p=none | ||||
| 
 | ||||
| ### 이메일 구성 점수 테스트 | ||||
| 
 | ||||
| [https://www.mail-tester.com/](https://www.mail-tester.com) 를 사용하여 테스트할 수 있습니다.\ | ||||
| [https://www.mail-tester.com/](https://www.mail-tester.com) 를 사용하여 이를 수행할 수 있습니다.\ | ||||
| 페이지에 접속하여 그들이 제공하는 주소로 이메일을 보내세요: | ||||
| ```bash | ||||
| echo "This is the body of the email" | mail -s "This is the subject line" test-iimosa79z@srv1.mail-tester.com | ||||
| ``` | ||||
| 당신은 또한 **이메일 구성을 확인할 수 있습니다** `check-auth@verifier.port25.com`으로 이메일을 보내고 **응답을 읽는 것** (이를 위해서는 **포트 25**를 **열고** 이메일을 루트로 보냈을 경우 _/var/mail/root_ 파일에서 응답을 확인해야 합니다).\ | ||||
| 당신은 또한 **이메일 구성을 확인할 수 있습니다** `check-auth@verifier.port25.com`으로 이메일을 보내고 **응답을 읽는 것** (이를 위해서는 **포트 25를 열고** 이메일을 루트로 보냈을 경우 _/var/mail/root_ 파일에서 응답을 확인해야 합니다).\ | ||||
| 모든 테스트를 통과하는지 확인하세요: | ||||
| ```bash | ||||
| ========================================================== | ||||
| @ -291,7 +291,7 @@ dkim=pass header.i=@example.com; | ||||
| ``` | ||||
| ### 스팸하우스 블랙리스트에서 제거하기 | ||||
| 
 | ||||
| 페이지 [www.mail-tester.com](https://www.mail-tester.com)은 귀하의 도메인이 스팸하우스에 의해 차단되고 있는지 확인할 수 있습니다. 귀하의 도메인/IP를 제거 요청할 수 있는 곳: [https://www.spamhaus.org/lookup/](https://www.spamhaus.org/lookup/) | ||||
| 페이지 [www.mail-tester.com](https://www.mail-tester.com)에서 귀하의 도메인이 스팸하우스에 의해 차단되고 있는지 확인할 수 있습니다. 귀하의 도메인/IP를 제거 요청할 수 있는 곳: [https://www.spamhaus.org/lookup/](https://www.spamhaus.org/lookup/) | ||||
| 
 | ||||
| ### 마이크로소프트 블랙리스트에서 제거하기 | ||||
| 
 | ||||
| @ -308,13 +308,13 @@ dkim=pass header.i=@example.com; | ||||
|  (1) (2) (1) (1) (2) (2) (3) (3) (5) (3) (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) (10) (15) (2).png>) | ||||
| 
 | ||||
| > [!NOTE] | ||||
| > "**테스트 이메일 보내기**" 기능을 사용하여 모든 것이 작동하는지 테스트하는 것이 좋습니다.\ | ||||
| > 모든 것이 작동하는지 테스트하기 위해 "**테스트 이메일 보내기**" 기능을 사용하는 것이 좋습니다.\ | ||||
| > 테스트를 진행할 때 블랙리스트에 올라가는 것을 피하기 위해 **10분 메일 주소로 테스트 이메일을 보내는 것을 추천합니다.** | ||||
| 
 | ||||
| ### 이메일 템플릿 | ||||
| 
 | ||||
| - 템플릿을 식별할 **이름**을 설정합니다. | ||||
| - 그런 다음 **제목**을 작성합니다 (이상한 것이 아닌, 일반 이메일에서 읽을 수 있는 내용). | ||||
| - 그런 다음 **제목**을 작성합니다 (이상한 내용이 아닌, 일반 이메일에서 읽을 수 있는 내용). | ||||
| - "**추적 이미지 추가**"를 체크했는지 확인합니다. | ||||
| - **이메일 템플릿**을 작성합니다 (다음 예제와 같이 변수를 사용할 수 있습니다): | ||||
| ```html | ||||
| @ -335,7 +335,7 @@ WRITE HERE SOME SIGNATURE OF SOMEONE FROM THE COMPANY | ||||
| </body> | ||||
| </html> | ||||
| ``` | ||||
| **이메일의 신뢰성을 높이기 위해**, 클라이언트의 이메일 서명을 사용하는 것이 권장됩니다. 제안 사항: | ||||
| **이메일의 신뢰성을 높이기 위해** 클라이언트의 이메일 서명을 사용하는 것이 권장됩니다. 제안 사항: | ||||
| 
 | ||||
| - **존재하지 않는 주소**로 이메일을 보내고 응답에 서명이 있는지 확인합니다. | ||||
| - info@ex.com, press@ex.com 또는 public@ex.com과 같은 **공개 이메일**을 검색하고 이메일을 보내고 응답을 기다립니다. | ||||
| @ -344,23 +344,23 @@ WRITE HERE SOME SIGNATURE OF SOMEONE FROM THE COMPANY | ||||
| .png>) | ||||
| 
 | ||||
| > [!NOTE] | ||||
| > 이메일 템플릿은 **전송할 파일을 첨부**할 수 있습니다. NTLM 챌린지를 도용하기 위해 특별히 제작된 파일/문서를 사용하고 싶다면 [이 페이지를 읽어보세요](../../windows-hardening/ntlm/places-to-steal-ntlm-creds.md). | ||||
| > 이메일 템플릿은 **전송할 파일을 첨부**할 수 있습니다. NTLM 챌린지를 훔치기 위해 특별히 제작된 파일/문서를 사용하고 싶다면 [이 페이지를 읽어보세요](../../windows-hardening/ntlm/places-to-steal-ntlm-creds.md). | ||||
| 
 | ||||
| ### 랜딩 페이지 | ||||
| 
 | ||||
| - **이름**을 작성합니다. | ||||
| - 웹 페이지의 **HTML 코드를 작성**합니다. 웹 페이지를 **가져올 수** 있습니다. | ||||
| - 웹 페이지의 **HTML 코드를 작성**합니다. 웹 페이지를 **가져올** 수 있습니다. | ||||
| - **제출된 데이터 캡처** 및 **비밀번호 캡처**를 선택합니다. | ||||
| - **리디렉션**을 설정합니다. | ||||
| 
 | ||||
| .png>) | ||||
| 
 | ||||
| > [!NOTE] | ||||
| > 일반적으로 페이지의 HTML 코드를 수정하고 로컬에서 몇 가지 테스트를 수행해야 합니다(아마도 Apache 서버를 사용하여) **결과가 마음에 들 때까지**. 그런 다음 해당 HTML 코드를 상자에 작성합니다.\ | ||||
| > HTML에 **정적 리소스**(아마도 CSS 및 JS 페이지)를 사용해야 하는 경우 _**/opt/gophish/static/endpoint**_에 저장한 다음 _**/static/\<filename>**_에서 액세스할 수 있습니다. | ||||
| > 일반적으로 페이지의 HTML 코드를 수정하고 로컬에서 몇 가지 테스트를 수행해야 합니다(아마도 Apache 서버를 사용하여) **결과가 마음에 들 때까지**. 그런 다음 그 HTML 코드를 상자에 작성합니다.\ | ||||
| > HTML에 **정적 리소스**(아마도 CSS 및 JS 페이지)를 사용해야 하는 경우 _**/opt/gophish/static/endpoint**_에 저장한 후 _**/static/\<filename>**_에서 액세스할 수 있습니다. | ||||
| 
 | ||||
| > [!NOTE] | ||||
| > 리디렉션을 위해 **사용자를 피해자의 합법적인 메인 웹 페이지로 리디렉션**하거나 예를 들어 _/static/migration.html_로 리디렉션하여 **5초 동안 회전하는 휠**([**https://loading.io/**](https://loading.io)**)을 표시한 후 프로세스가 성공적으로 완료되었음을 알릴 수 있습니다.** | ||||
| > 리디렉션을 위해 **사용자를 피해자의 정품 메인 웹 페이지로 리디렉션**하거나 예를 들어 _/static/migration.html_로 리디렉션하여 **5초 동안 회전하는 휠**(**[**https://loading.io/**](https://loading.io)**)을 표시한 후 프로세스가 성공적으로 완료되었음을 알릴 수 있습니다. | ||||
| 
 | ||||
| ### 사용자 및 그룹 | ||||
| 
 | ||||
| @ -378,7 +378,7 @@ WRITE HERE SOME SIGNATURE OF SOMEONE FROM THE COMPANY | ||||
| .png>) | ||||
| 
 | ||||
| > [!NOTE] | ||||
| > 테스트 이메일을 **10분 메일 주소**로 보내는 것이 좋습니다. 테스트를 진행하는 동안 블랙리스트에 오르는 것을 피할 수 있습니다. | ||||
| > 테스트 이메일을 **10분 메일 주소**로 보내는 것이 좋습니다. 테스트를 하면서 블랙리스트에 오르는 것을 피할 수 있습니다. | ||||
| 
 | ||||
| 모든 준비가 완료되면 캠페인을 시작하세요! | ||||
| 
 | ||||
| @ -392,7 +392,7 @@ clone-a-website.md | ||||
| 
 | ||||
| ## 백도어가 포함된 문서 및 파일 | ||||
| 
 | ||||
| 일부 피싱 평가(주로 레드 팀의 경우)에서는 **백도어가 포함된 파일을 전송**하고 싶을 수 있습니다(아마도 C2 또는 인증을 트리거하는 무언가일 수 있습니다).\ | ||||
| 일부 피싱 평가(주로 레드 팀의 경우)에서는 **백도어가 포함된 파일을 전송**하고 싶을 수 있습니다(아마도 C2 또는 인증을 트리거하는 것일 수 있습니다).\ | ||||
| 다음 페이지에서 몇 가지 예를 확인하세요: | ||||
| 
 | ||||
| {{#ref}} | ||||
| @ -403,32 +403,32 @@ phishing-documents.md | ||||
| 
 | ||||
| ### 프록시 MitM를 통한 | ||||
| 
 | ||||
| 이전 공격은 실제 웹사이트를 가장하고 사용자가 설정한 정보를 수집하는 매우 영리한 방법입니다. 불행히도 사용자가 올바른 비밀번호를 입력하지 않거나 가장한 애플리케이션이 2FA로 구성된 경우, **이 정보로 속은 사용자를 가장할 수 없습니다**. | ||||
| 이전 공격은 실제 웹사이트를 가장하고 사용자가 설정한 정보를 수집하는 매우 영리한 방법입니다. 불행히도 사용자가 올바른 비밀번호를 입력하지 않거나 가장한 애플리케이션이 2FA로 구성된 경우, **이 정보로는 속은 사용자를 가장할 수 없습니다**. | ||||
| 
 | ||||
| 이럴 때 [**evilginx2**](https://github.com/kgretzky/evilginx2)**,** [**CredSniper**](https://github.com/ustayready/CredSniper) 및 [**muraena**](https://github.com/muraenateam/muraena)와 같은 도구가 유용합니다. 이 도구는 MitM 공격을 생성할 수 있게 해줍니다. 기본적으로 공격은 다음과 같이 작동합니다: | ||||
| 이때 [**evilginx2**](https://github.com/kgretzky/evilginx2)**,** [**CredSniper**](https://github.com/ustayready/CredSniper) 및 [**muraena**](https://github.com/muraenateam/muraena)와 같은 도구가 유용합니다. 이 도구는 MitM과 같은 공격을 생성할 수 있게 해줍니다. 기본적으로 공격은 다음과 같은 방식으로 작동합니다: | ||||
| 
 | ||||
| 1. 실제 웹페이지의 로그인 양식을 **가장합니다**. | ||||
| 1. 실제 웹페이지의 로그인 양식을 **가장**합니다. | ||||
| 2. 사용자가 **자신의 자격 증명**을 가짜 페이지로 **전송**하고 도구는 이를 실제 웹페이지로 전송하여 **자격 증명이 작동하는지 확인**합니다. | ||||
| 3. 계정이 **2FA**로 구성된 경우, MitM 페이지는 이를 요청하고 사용자가 **입력**하면 도구는 이를 실제 웹페이지로 전송합니다. | ||||
| 4. 사용자가 인증되면 공격자는 **자격 증명, 2FA, 쿠키 및 도구가 MitM을 수행하는 동안의 모든 상호작용 정보를 캡처**하게 됩니다. | ||||
| 
 | ||||
| ### VNC를 통한 | ||||
| 
 | ||||
| 피해자를 **원본과 동일한 모습의 악성 페이지**로 보내는 대신, **실제 웹 페이지에 연결된 브라우저가 있는 VNC 세션**으로 보낸다면 어떻게 될까요? 사용자가 하는 일을 보고 비밀번호, 사용된 MFA, 쿠키 등을 도용할 수 있습니다.\ | ||||
| 피해자를 **원본과 동일한 모습의 악성 페이지**로 보내는 대신, **실제 웹 페이지에 연결된 브라우저가 있는 VNC 세션**으로 보낸다면 어떻게 될까요? 사용자가 하는 일을 보고 비밀번호, 사용된 MFA, 쿠키 등을 훔칠 수 있습니다.\ | ||||
| 이것은 [**EvilnVNC**](https://github.com/JoelGMSec/EvilnoVNC)로 수행할 수 있습니다. | ||||
| 
 | ||||
| ## 탐지 감지 | ||||
| 
 | ||||
| 당연히 자신이 발각되었는지 아는 가장 좋은 방법 중 하나는 **블랙리스트에서 자신의 도메인을 검색하는 것**입니다. 목록에 나타나면, 어떤 식으로든 귀하의 도메인이 의심스럽다고 감지된 것입니다.\ | ||||
| 당연히 자신이 발각되었는지 아는 가장 좋은 방법 중 하나는 **블랙리스트에서 도메인을 검색**하는 것입니다. 목록에 나타나면, 어떤 식으로든 귀하의 도메인이 의심스럽다고 감지된 것입니다.\ | ||||
| 도메인이 블랙리스트에 나타나는지 확인하는 쉬운 방법은 [https://malwareworld.com/](https://malwareworld.com) 를 사용하는 것입니다. | ||||
| 
 | ||||
| 그러나 피해자가 **실제로 의심스러운 피싱 활동을 찾고 있는지** 아는 다른 방법도 있습니다. 이는 다음과 같이 설명됩니다: | ||||
| 그러나 피해자가 **야생에서 의심스러운 피싱 활동을 적극적으로 찾고 있는지** 아는 다른 방법도 있습니다: | ||||
| 
 | ||||
| {{#ref}} | ||||
| detecting-phising.md | ||||
| {{#endref}} | ||||
| 
 | ||||
| 피해자의 도메인과 **매우 유사한 이름의 도메인을 구매**하거나 **귀하가 제어하는 도메인의 서브도메인에 대한 인증서를 생성**할 수 있습니다. 피해자의 도메인의 **키워드**를 포함하는 경우, 피해자가 **DNS 또는 HTTP 상호작용**을 수행하면 **그가 의심스러운 도메인을 적극적으로 찾고 있다는 것을 알 수 있습니다**. 이 경우 매우 은밀해야 합니다. | ||||
| 피해자의 도메인과 **매우 유사한 이름의 도메인을 구매**하거나 **귀하가 제어하는 도메인의 서브도메인에 대한 인증서를 생성**할 수 있습니다. 피해자의 도메인의 **키워드**를 포함하는 경우, 피해자가 이들과 **DNS 또는 HTTP 상호작용**을 수행하면 **그가 의심스러운 도메인을 적극적으로 찾고 있다는 것을 알 수 있으며** 매우 은밀해야 합니다. | ||||
| 
 | ||||
| ### 피싱 평가 | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										141
									
								
								theme/ai.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										141
									
								
								theme/ai.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,141 @@ | ||||
| /** | ||||
|  * HackTricks AI Chat Widget v1.14 – animated typing indicator | ||||
|  * ------------------------------------------------------------------------ | ||||
|  * • Replaces the static “…” placeholder with a three‑dot **bouncing** loader | ||||
|  *   while waiting for the assistant’s response. | ||||
|  * ------------------------------------------------------------------------ | ||||
|  */ | ||||
| (function () { | ||||
|     const LOG = "[HackTricks-AI]"; | ||||
|    | ||||
|     /* ---------------- User‑tunable constants ---------------- */ | ||||
|     const MAX_CONTEXT  = 3000;     // highlighted‑text char limit
 | ||||
|     const MAX_QUESTION = 500;      // question char limit
 | ||||
|     const TOOLTIP_TEXT = | ||||
|       "💡 Highlight any text on the page,\nthen click to ask HackTricks AI about it"; | ||||
|    | ||||
|     const API_BASE   = "https://www.hacktricks.ai/api/assistants/threads"; | ||||
|     const BRAND_RED  = "#b31328"; // HackTricks brand
 | ||||
|    | ||||
|     /* ------------------------------ State ------------------------------ */ | ||||
|     let threadId  = null; | ||||
|     let isRunning = false; | ||||
|    | ||||
|     const $ = (sel, ctx = document) => ctx.querySelector(sel); | ||||
|     if (document.getElementById("ht-ai-btn")) { console.warn(`${LOG} Widget already injected.`); return; } | ||||
|     (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", init) : init()); | ||||
|    | ||||
|     /* ==================================================================== */ | ||||
|     async function init() { | ||||
|       console.log(`${LOG} Injecting widget… v1.14`); | ||||
|       await ensureThreadId(); | ||||
|       injectStyles(); | ||||
|    | ||||
|       const btn      = createFloatingButton(); | ||||
|       createTooltip(btn); | ||||
|       const panel    = createSidebar(); | ||||
|       const chatLog  = $("#ht-ai-chat"); | ||||
|       const sendBtn  = $("#ht-ai-send"); | ||||
|       const inputBox = $("#ht-ai-question"); | ||||
|       const resetBtn = $("#ht-ai-reset"); | ||||
|       const closeBtn = $("#ht-ai-close"); | ||||
|    | ||||
|       /* ------------------- Selection snapshot ------------------- */ | ||||
|       let savedSelection = ""; | ||||
|       btn.addEventListener("pointerdown", () => { savedSelection = window.getSelection().toString().trim(); }); | ||||
|    | ||||
|       /* ------------------- Helpers ------------------------------ */ | ||||
|       function addMsg(text, cls) { | ||||
|         const b = document.createElement("div"); | ||||
|         b.className = `ht-msg ${cls}`; | ||||
|         b.textContent = text; | ||||
|         chatLog.appendChild(b); | ||||
|         chatLog.scrollTop = chatLog.scrollHeight; | ||||
|         return b; | ||||
|       } | ||||
|       const LOADER_HTML = '<span class="ht-loading"><span></span><span></span><span></span></span>'; | ||||
|    | ||||
|       function setInputDisabled(d) { inputBox.disabled = d; sendBtn.disabled = d; } | ||||
|       function clearThreadCookie() { document.cookie = "threadId=; Path=/; Max-Age=0"; threadId = null; } | ||||
|       function resetConversation() { chatLog.innerHTML=""; clearThreadCookie(); panel.classList.remove("open"); } | ||||
|    | ||||
|       /* ------------------- Panel open / close ------------------- */ | ||||
|       btn.addEventListener("click", () => { | ||||
|         if (!savedSelection) { alert("Please highlight some text first to then ask Hacktricks AI about it."); return; } | ||||
|         if (savedSelection.length > MAX_CONTEXT) { alert(`Highlighted text is too long (${savedSelection.length} chars). Max allowed: ${MAX_CONTEXT}.`); return; } | ||||
|         chatLog.innerHTML=""; addMsg(savedSelection, "ht-context"); panel.classList.add("open"); inputBox.focus(); | ||||
|       }); | ||||
|       closeBtn.addEventListener("click", resetConversation); | ||||
|       resetBtn.addEventListener("click", resetConversation); | ||||
|    | ||||
|       /* --------------------------- Messaging --------------------------- */ | ||||
|       async function sendMessage(question, context=null) { | ||||
|         if (!threadId) await ensureThreadId(); | ||||
|         if (isRunning) { addMsg("Please wait until the current operation completes.", "ht-ai"); return; } | ||||
|    | ||||
|         isRunning = true; setInputDisabled(true); | ||||
|         const loadingBubble = addMsg("", "ht-ai"); | ||||
|         loadingBubble.innerHTML = LOADER_HTML; | ||||
|    | ||||
|         const content = context ? `### Context:\n${context}\n\n### Question to answer:\n${question}` : question; | ||||
|         try { | ||||
|           const res = await fetch(`${API_BASE}/${threadId}/messages`, { method:"POST", credentials:"include", headers:{"Content-Type":"application/json"}, body:JSON.stringify({content}) }); | ||||
|           if (!res.ok) { | ||||
|             let err=`Unknown error: ${res.status}`; | ||||
|             try { const e=await res.json(); if(e.error) err=`Error: ${e.error}`; else if(res.status===429) err="Rate limit exceeded. Please try again later."; } catch(_){} | ||||
|             loadingBubble.textContent = err; return; } | ||||
|           const data = await res.json(); | ||||
|           loadingBubble.remove(); | ||||
|           if (Array.isArray(data.response)) data.response.forEach(p=>{ addMsg( p.type==="text"&&p.text&&p.text.value ? p.text.value : JSON.stringify(p), "ht-ai"); }); | ||||
|           else if (typeof data.response === "string") addMsg(data.response, "ht-ai"); | ||||
|           else addMsg(JSON.stringify(data,null,2), "ht-ai"); | ||||
|         } catch (e) { console.error("Error sending message:",e); loadingBubble.textContent="An unexpected error occurred."; } | ||||
|         finally { isRunning=false; setInputDisabled(false); chatLog.scrollTop=chatLog.scrollHeight; } | ||||
|       } | ||||
|    | ||||
|       async function handleSend(){ const q=inputBox.value.trim(); if(!q)return; if(q.length>MAX_QUESTION){alert(`Your question is too long (${q.length} chars). Max allowed: ${MAX_QUESTION}.`); return;} inputBox.value=""; addMsg(q,"ht-user"); await sendMessage(q,savedSelection||null);}     | ||||
|       sendBtn.addEventListener("click", handleSend); | ||||
|       inputBox.addEventListener("keydown", e=>{ if(e.key==="Enter"&&!e.shiftKey){ e.preventDefault(); handleSend(); } }); | ||||
|     } | ||||
|    | ||||
|     /* ==================================================================== */ | ||||
|     async function ensureThreadId(){ const m=document.cookie.match(/threadId=([^;]+)/); if(m&&m[1]){threadId=m[1];return;} try{ const r=await fetch(API_BASE,{method:"POST",credentials:"include"}); const d=await r.json(); if(!r.ok||!d.threadId) throw new Error(`${r.status} ${r.statusText}`); threadId=d.threadId; document.cookie=`threadId=${threadId}; Path=/; Secure; SameSite=Strict; Max-Age=7200`; }catch(e){ console.error("Error creating threadId:",e); alert("Failed to initialise the conversation. Please refresh and try again."); throw e; }} | ||||
|    | ||||
|     /* ==================================================================== */ | ||||
|     function injectStyles(){ const css=` | ||||
|         #ht-ai-btn{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);width:60px;height:60px;border-radius:50%;background:#1e1e1e;color:#fff;font-size:28px;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:99999;box-shadow:0 2px 8px rgba(0,0,0,.4);transition:opacity .2s} | ||||
|         #ht-ai-btn:hover{opacity:.85} | ||||
|         @media(max-width:768px){#ht-ai-btn{display:none}} | ||||
|         #ht-ai-tooltip{position:fixed;padding:6px 8px;background:#111;color:#fff;border-radius:4px;font-size:13px;white-space:pre-wrap;pointer-events:none;opacity:0;transform:translate(-50%,-8px);transition:opacity .15s ease,transform .15s ease;z-index:100000} | ||||
|         #ht-ai-tooltip.show{opacity:1;transform:translate(-50%,-12px)} | ||||
|         #ht-ai-panel{position:fixed;top:0;right:0;height:100%;width:350px;max-width:90vw;background:#000;color:#fff;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .3s ease;z-index:100000;font-family:system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial,sans-serif} | ||||
|         #ht-ai-panel.open{transform:translateX(0)} | ||||
|         @media(max-width:768px){#ht-ai-panel{display:none}} | ||||
|         #ht-ai-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #333} | ||||
|         #ht-ai-header .ht-actions{display:flex;gap:8px;align-items:center} | ||||
|         #ht-ai-close,#ht-ai-reset{cursor:pointer;font-size:18px;background:none;border:none;color:#fff;padding:0} | ||||
|         #ht-ai-close:hover,#ht-ai-reset:hover{opacity:.7} | ||||
|         #ht-ai-chat{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;font-size:14px} | ||||
|         .ht-msg{max-width:90%;line-height:1.4;padding:10px 12px;border-radius:8px;white-space:pre-wrap;word-wrap:break-word} | ||||
|         .ht-user{align-self:flex-end;background:${BRAND_RED}} | ||||
|         .ht-ai{align-self:flex-start;background:#222} | ||||
|         .ht-context{align-self:flex-start;background:#444;font-style:italic;font-size:13px} | ||||
|         #ht-ai-input{display:flex;gap:8px;padding:12px 16px;border-top:1px solid #333} | ||||
|         #ht-ai-question{flex:1;min-height:40px;max-height:120px;resize:vertical;padding:8px;border-radius:6px;border:none;font-size:14px} | ||||
|         #ht-ai-send{padding:0 18px;border:none;border-radius:6px;background:${BRAND_RED};color:#fff;font-size:14px;cursor:pointer} | ||||
|         #ht-ai-send:disabled{opacity:.5;cursor:not-allowed} | ||||
|         /* Loader animation */ | ||||
|         .ht-loading{display:inline-flex;align-items:center;gap:4px} | ||||
|         .ht-loading span{width:6px;height:6px;border-radius:50%;background:#888;animation:ht-bounce 1.2s infinite ease-in-out} | ||||
|         .ht-loading span:nth-child(2){animation-delay:0.2s} | ||||
|         .ht-loading span:nth-child(3){animation-delay:0.4s} | ||||
|         @keyframes ht-bounce{0%,80%,100%{transform:scale(0);}40%{transform:scale(1);} } | ||||
|         ::selection{background:#ffeb3b;color:#000} | ||||
|         ::-moz-selection{background:#ffeb3b;color:#000}`;
 | ||||
|       const s=document.createElement("style"); s.id="ht-ai-style"; s.textContent=css; document.head.appendChild(s);}   | ||||
|    | ||||
|     function createFloatingButton(){ const d=document.createElement("div"); d.id="ht-ai-btn"; d.textContent="🤖"; document.body.appendChild(d); return d; } | ||||
|     function createTooltip(btn){ const t=document.createElement("div"); t.id="ht-ai-tooltip"; t.textContent=TOOLTIP_TEXT; document.body.appendChild(t); btn.addEventListener("mouseenter",()=>{const r=btn.getBoundingClientRect(); t.style.left=`${r.left+r.width/2}px`; t.style.top=`${r.top}px`; t.classList.add("show");}); btn.addEventListener("mouseleave",()=>t.classList.remove("show")); } | ||||
|     function createSidebar(){ const p=document.createElement("div"); p.id="ht-ai-panel"; p.innerHTML=`<div id="ht-ai-header"><strong>HackTricksAI Chat</strong><div class="ht-actions"><button id="ht-ai-reset" title="Reset">↺</button><span id="ht-ai-close" title="Close">✖</span></div></div><div id="ht-ai-chat"></div><div id="ht-ai-input"><textarea id="ht-ai-question" placeholder="Type your question…"></textarea><button id="ht-ai-send">Send</button></div>`; document.body.appendChild(p); return p; } | ||||
|   })(); | ||||
|    | ||||
| @ -1,3 +1,26 @@ | ||||
| /* ──────────────────────────────────────────────────────────────── | ||||
|    Polyfill so requestIdleCallback works everywhere (IE 11/Safari) | ||||
|    ─────────────────────────────────────────────────────────────── */ | ||||
| if (typeof window.requestIdleCallback !== "function") { | ||||
| window.requestIdleCallback = function (cb) { | ||||
|     const start = Date.now(); | ||||
|     return setTimeout(function () { | ||||
|     cb({ | ||||
|         didTimeout: false, | ||||
|         timeRemaining: function () { | ||||
|         return Math.max(0, 50 - (Date.now() - start)); | ||||
|         } | ||||
|     }); | ||||
|     }, 1); | ||||
| }; | ||||
| window.cancelIdleCallback = window.clearTimeout; | ||||
| } | ||||
| 
 | ||||
|    | ||||
| /* ──────────────────────────────────────────────────────────────── | ||||
|    search.js | ||||
|    ─────────────────────────────────────────────────────────────── */ | ||||
| 
 | ||||
| "use strict"; | ||||
| window.search = window.search || {}; | ||||
| (function search(search) { | ||||
| @ -471,64 +494,58 @@ window.search = window.search || {}; | ||||
|         showResults(true); | ||||
|     } | ||||
| 
 | ||||
|     (async function loadSearchIndex(lang = window.lang || 'en') { | ||||
|         /* ───────── paths ───────── */ | ||||
|         const branch      = lang === 'en' ? 'master' : lang; | ||||
|         const baseRemote  = `https://raw.githubusercontent.com/HackTricks-wiki/hacktricks/${branch}`; | ||||
|         const remoteJson  = `${baseRemote}/searchindex.json`; | ||||
|         const remoteJs    = `${baseRemote}/searchindex.js`; | ||||
|         const localJson   = './searchindex.json'; | ||||
|         const localJs     = './searchindex.js'; | ||||
|         const TIMEOUT_MS  = 5_000; | ||||
|          | ||||
|         /* ───────── helpers ───────── */ | ||||
|         const fetchWithTimeout = (url, opt = {}) => | ||||
|             Promise.race([ | ||||
|             fetch(url, opt), | ||||
|             new Promise((_, r) => setTimeout(() => r(new Error('timeout')), TIMEOUT_MS)) | ||||
|             ]); | ||||
|          | ||||
|         const loadScript = src => | ||||
|             new Promise((resolve, reject) => { | ||||
|             const s = document.createElement('script'); | ||||
|             s.src      = src; | ||||
|             s.onload   = resolve; | ||||
|             s.onerror  = reject; | ||||
|     (async function loadSearchIndex(lang = window.lang || "en") { | ||||
|         const branch  = lang === "en" ? "master" : lang; | ||||
|         const rawUrl  = | ||||
|           `https://raw.githubusercontent.com/HackTricks-wiki/hacktricks/refs/heads/${branch}/searchindex.js`; | ||||
|         const localJs = "/searchindex.js"; | ||||
|         const TIMEOUT_MS = 10_000; | ||||
| 
 | ||||
|         const injectScript = (src) => | ||||
|           new Promise((resolve, reject) => { | ||||
|             const s   = document.createElement("script"); | ||||
|             s.src     = src; | ||||
|             s.onload  = () => resolve(src); | ||||
|             s.onerror = (e) => reject(e); | ||||
|             document.head.appendChild(s); | ||||
|             }); | ||||
|          | ||||
|         /* ───────── 1. remote JSON ───────── */ | ||||
|           }); | ||||
| 
 | ||||
|         try { | ||||
|             const r = await fetchWithTimeout(remoteJson); | ||||
|             if (!r.ok) throw new Error(r.status); | ||||
|             return init(await r.json()); | ||||
|         } catch (e) { | ||||
|             console.warn('Remote JSON failed →', e); | ||||
|           /* 1 — download raw JS from GitHub */ | ||||
|           const controller = new AbortController(); | ||||
|           const timer      = setTimeout(() => controller.abort(), TIMEOUT_MS); | ||||
| 
 | ||||
|           const res  = await fetch(rawUrl, { signal: controller.signal }); | ||||
|           clearTimeout(timer); | ||||
|           if (!res.ok) throw new Error(`HTTP ${res.status}`); | ||||
| 
 | ||||
|           /* 2 — wrap in a Blob so the browser sees application/javascript */ | ||||
|           const code     = await res.text(); | ||||
|           const blobUrl  = URL.createObjectURL( | ||||
|                             new Blob([code], { type: "application/javascript" }) | ||||
|                           ); | ||||
| 
 | ||||
|           /* 3 — execute it */ | ||||
|           await injectScript(blobUrl); | ||||
| 
 | ||||
|           /* ───────────── PATCH ───────────── | ||||
|              heavy parsing now deferred to idle time | ||||
|           */  | ||||
|           requestIdleCallback(() => init(window.search)); | ||||
|           return;  // ✔ UI remains responsive
 | ||||
|         } catch (eRemote) { | ||||
|           console.warn("Remote JS failed →", eRemote); | ||||
|         } | ||||
|          | ||||
|         /* ───────── 2. remote JS ───────── */ | ||||
| 
 | ||||
|         /* ───────── fallback: local copy ───────── */ | ||||
|         try { | ||||
|             await loadScript(remoteJs); | ||||
|             return init(window.search); | ||||
|         } catch (e) { | ||||
|             console.warn('Remote JS failed →', e); | ||||
|         } | ||||
|          | ||||
|         /* ───────── 3. local JSON ───────── */ | ||||
|         try { | ||||
|             const r = await fetch(localJson); | ||||
|             if (!r.ok) throw new Error(r.status); | ||||
|             return init(await r.json()); | ||||
|         } catch (e) { | ||||
|             console.warn('Local JSON failed →', e); | ||||
|         } | ||||
|          | ||||
|         /* ───────── 4. local JS ───────── */ | ||||
|         try { | ||||
|             await loadScript(localJs); | ||||
|             return init(window.search); | ||||
|         } catch (e) { | ||||
|             console.error('Local JS failed →', e); | ||||
|           await injectScript(localJs); | ||||
| 
 | ||||
|           /* ───────────── PATCH ───────────── */ | ||||
|           requestIdleCallback(() => init(window.search)); | ||||
|           return; | ||||
|         } catch (eLocal) { | ||||
|           console.error("Local JS failed →", eLocal); | ||||
|         } | ||||
|     })(); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user