본문 바로가기
OffSec

[Blue Teams Academy] 모듈 24 - Azure Sentinel - 사용자 지정 로그 및 DNSTwist를 사용하여 악의적인 유사 도메인 모니터링

by 10th doctrine 2021. 3. 19.
728x90

이 기사에서는 소셜 엔지니어링 공격으로부터 사용자를 보호하기 위해 귀하와 유사한 도메인을 모니터링하는 방법에 대해 알아보려고 한다.

피싱과 같은 컴퓨터 기반 소셜 엔지니어링 공격을 수행할 때 공격자는 사용자를 속이기 위해 사용자와 유사한 도메인을 구입한다. 이런 공격을 피하기 위해서는 비슷한 영역을 감시하는 것이 필수적인 이유다.

우선 우리는 이 도메인들을 찾아야 한다. 유사한 도메인을 생성하는 데 도움이 되는 도구 중 하나는 "DNS 트위스트"이다. 여기서 찾을 수 있다: https://github.com/elceef/dnstwist

DNS Twist 개발자에 따르면:

"DNS 솜털은 조직을 대상으로 하는 잠재적으로 악의적인 도메인을 발견하기 위한 자동화된 워크플로우 입니다. 이 도구는 사용자가 제공한 도메인 이름에 따라 많은 순열 목록을 생성한 다음 순열 중 사용 중인지 확인하는 방식으로 작동한다. 게다가, 그것은 웹 페이지들이 현재 진행중인 피싱 공격이나 브랜드 사칭의 일부인지 확인하기 위해 퍼지 해시를 생성할 수 있다.

https://dnstwist.it에서 온라인으로 일부 도메인을 생성해 보십시오.

이 데모에서는 Windows에서 python을 사용하여 유사한 도메인을 생성하십시오.

다음 명령을 입력하여 파이썬 모듈을 설치하십시오.

py -m pip install dnstwist

유사한 도메인을 생성하려면 python 터미널을 열고 다음을 입력하십시오.

import dnstwist fuzz = dnstwist.DomainFuzz(“<YOUR DOMAIN HERE>”) fuzz.generate() fuzz.domains

예를 들어 도메인 이름만 구문 분석하면 "google.com"과 유사한 도메인:

이 API도 사용할 수 있다: https://dnstwister.report/api/

유사한 도메인을 저장하려면 이를 위해 작은 스크립트를 작성하십시오. 예를 들어, 다음 코드 조각은 유사한 도메인을 "Similar-Domains"라는 파일에 저장한다.txt"

일단 비슷한 도메인이 들어 있는 파일을 가지고 있는데, 나중에 그것들을 기반으로 규칙을 만들 수 있도록 우리는 그것들을 센티넬로 보내야 한다.

사용자 정의 로그 섹션으로 이동하여 로그 샘플 업로드(유사한 도메인 파일의 조각)

제한 구분 기호 선택: 뉴 라인

파일 경로를 추가하십시오. 제 경우 "C:\Users\Computer\유사-Domains.txt". 로그 파일이 많은 경우 *: C:와 같은 정규식을 사용할 수 있다.\Users\Computer*.txt

사용자 정의 로그 원본에 이름 및 설명 추가

Vaila! 사용자 지정 로그가 성공적으로 생성됨

Sentinel 로그 섹션으로 이동하면 사용자 정의 로그에서 찾을 수 있음

해당 이름을 쿼리하려면 다음과 같이 이름을 선택하십시오.

마지막으로 사용자가 유사한 도메인 중 하나를 방문했는지 여부를 탐지하는 규칙을 만들 수 있다. 예를 들어, DNS이벤트 소스와 함께 JOIN 기능을 사용할 수 있다.

 

더보기

Azure Sentinel: Using Custom Logs and DNSTwist to Monitor Malicious Similar Domains

In this article, we are going to explore how to monitor similar domains to yours, in order to protect your users from being victims of social engineering attacks.

When performing computer-based social engineering attacks such as phishing, attackers buy similar domains to yours in order to trick your users. This is why keeping an eye on similar domains is essential to avoid such attacks.

First we need to find these domains. One of the tools that helps you to generate similar domains is "DNS Twist". You can find it here: https://github.com/elceef/dnstwist

According to DNS Twist developers:

"DNS fuzzing is an automated workflow for discovering potentially malicious domains targeting your organisation. This tool works by generating a large list of permutations based on a domain name you provide and then checking if any of those permutations are in use. Additionally, it can generate fuzzy hashes of the web pages to see if they are part of an ongoing phishing attack or brand impersonation, and much more!"

You can even try to generate some domains online here: https://dnstwist.it

In this demonstration, we are going to use python on Windows to generate similar domains:

Type the following command to install the python module:

py -m pip install dnstwist

To generate similar domains, open python terminal and type:

import dnstwist fuzz = dnstwist.DomainFuzz(“<YOUR DOMAIN HERE>”) fuzz.generate() fuzz.domains

For example these are some similar domains to "google.com" after parsing only the domain names:

You can also use this API: https://dnstwister.report/api/

To store the similar domains you can build a small script to achieve that. For example the following snippet stores similar domains in a file called "Similar-Domains.txt"

Once, we have a file that contains the similar domains, now we need to send them to sentinel so later we can create rules based on them.

Go to "Custom logs" sections and upload a log sample (a snippet from your similar domains file)

Select the limit delimiter: New Line

Add the file path. In my case "C:\Users\Computer\Similar-Domains.txt". If you have many log files you can use regular expression such as * eg: C:\Users\Computer*.txt

Add a name and description to your custom log source

Voila! Your custom log is created successfully

Go to Sentinel log section and you will find it under Custom Logs

To query it, simply select its name as follows:

Finally, now you can create a rule to detect if a user visited one of the similar domains. For example, you can use the JOIN function with DNSevents source.

 

 

※ 출처 : Blue Teams Academy | www.blueteamsacademy.com/dnstwist/

반응형

댓글