
Microsoft Graph API를 사용하여 Microsoft Teams 채널을 통해 에이전트 트래픽을 터널링하는 Mythic C2 프로필로, AES256 암호화, 지터, 킬 데이트, 프록시 지원을 제공합니다.
Microsoft Graph API를 사용하여 Microsoft Teams 채널을 통해 통신하는 Mythic C2 프로필입니다.
Agent <---> Microsoft Teams Channel <---> C2 Server <---> Mythic
통신은 일반적인 Teams 채널 활동으로 보입니다.
이 프로필이 지원하는 기능:
Mythic 서버에서:
sudo ./mythic-cli install github https://github.com/Whispergate/msteams
또는 로컬 폴더에서:
sudo ./mythic-cli install folder /path/to/msteams
ChannelMessage.Read.All - 채널 메시지 읽기ChannelMessage.Send - 채널 메시지 보내기ChannelMessage.Send를 사용할 수 없는 경우 Group.ReadWrite.All을 사용하거나 webhook URL을 구성하세요.
전체 설정 지침은 설치 후 Mythic 문서 페이지 https://<your-mythic-server>:7443/docs/c2-profiles/msteams에서 확인할 수 있습니다.
Mythic UI에서 편집: C2 Profiles > msteams > View/Edit Config.
msteams C2 프로필 매개변수를 구현하는 모든 Mythic 에이전트가 이 프로필을 사용할 수 있습니다. 에이전트는 다음을 수행해야 합니다:
Azure 또는 M365 계정 없이 로컬 테스트를 위한 모의 테스트 인프라가 test/에 포함되어 있습니다. 이를 통해 컴파일된 임플란트를 포함한 전체 C2 파이프라인을 로컬 가짜 Graph API에 대해 테스트할 수 있습니다.
test/mock_server.py를 Mythic 호스트에 복사하고 시작합니다:
python3 mock_server.py
이는 포트 8443에서 가짜 Graph API를 시작합니다.
Mythic에서 msteams C2 프로필을 모의 값으로 구성합니다:
{
"tenant_id": "fake-tenant-id",
"client_id": "fake-client-id",
"client_secret": "fake-client-secret",
"team_id": "fake-team-id",
"channel_id": "fake-channel-id",
"graph_base": "http://<mythic-host-ip>:8443/v1.0",
"login_base": "http://<mythic-host-ip>:8443",
"poll_interval": 3,
"clear_messages": true,
"debug": true
}
Mythic UI에서 msteams 프로필을 시작합니다.
모의 서버에 대해 실제 컴파일된 에이전트를 테스트하려면, 에이전트 바이너리가 실제 Graph API 엔드포인트 대신 모의 서버의 IP와 포트를 하드코딩하여 빌드되어야 합니다. Starburst 에이전트 코드(agent_code/src/transport/msteams.cc)에서:
// Change these for mock testing:
#define GRAPH_API_HOST "<mythic-host-ip>"
#define LOGIN_HOST "<mythic-host-ip>"
#define API_PORT 8443
// And change WINHTTP_FLAG_SECURE to 0 in WinHttpOpenRequest
// since the mock server uses plain HTTP:
WINHTTP_DEFAULT_ACCEPT_TYPES,
0
그런 다음 Starburst를 재설치하고, msteams 프로필(동일한 가짜 tenant/client/team/channel ID 사용)로 페이로드를 빌드하고, Mythic 호스트에 접근할 수 있는 Windows VM에서 실행합니다.
프로덕션 페이로드를 빌드하기 전에 이러한 변경 사항을 되돌리는 것을 잊지 마세요:
#define GRAPH_API_HOST "graph.microsoft.com"
#define LOGIN_HOST "login.microsoftonline.com"
#define API_PORT 443
WINHTTP_DEFAULT_ACCEPT_TYPES,
WINHTTP_FLAG_SECURE
에이전트를 컴파일하지 않고 빠른 파이프라인 테스트를 하려면:
GRAPH_URL=http://<mythic-host-ip>:8443 python test/fake_agent.py
자세한 내용은 test/README.md를 참조하세요.
clear_messages 활성화poll_interval을 적절하게 유지 (10-30초)msteams/
config.json # Mythic container config
C2_Profiles/msteams/
Dockerfile # Container image
main.py # Mythic service entrypoint
requirements.txt # Python dependencies
rabbitmq_config.json # RabbitMQ settings
msteams/
c2_functions/msteams.py # C2Profile class + parameters
c2_code/
server.py # Main polling loop
graph_client.py # MS Graph API client
mythic_client.py # Mythic API forwarder
config.py # Config singleton
config.json # Default config values
documentation-c2/msteams/_index.md # Mythic docs page
test/
mock_server.py # Mock Graph API server
fake_agent.py # Simulated agent for testing
test_c2_server.py # Standalone C2 server test harness
test_config.json # Test config with fake values
| 매개변수 | 설명 | 기본값 |
|---|
tenant_id | Entra ID 테넌트(디렉터리) ID | |
client_id | 앱 등록 클라이언트 ID | |
client_secret | 앱 등록 클라이언트 암호 | |
team_id | Teams 팀 ID | |
channel_id | Teams 채널 ID | |
webhook_url | 전송을 위한 선택적 webhook URL | |
graph_base | Graph API 기본 URL | https://graph.microsoft.com/v1.0 |
login_base | 로그인 엔드포인트 기본 URL | https://login.microsoftonline.com |
poll_interval | 폴링 간격(초) | 10 |
clear_messages | 처리 후 메시지 삭제 | false |
debug | 상세 로깅 활성화 | false |