
tl; dr : galah (/ 믿기는 'Guh-laa')는 다양한 응용 프로그램을 모방하고 임의의 HTTP 요청에 동적으로 대응하도록 설계된 LLM 기반 웹 허니 포트입니다. Galah는 OpenAi, GoogleAi, GCP의 정점 AI, Anthropic, Cohere 및 Ollama를 포함한 주요 LLM 제공 업체를 지원합니다.
특정 웹 애플리케이션 또는 취약점을 수동으로 모방하는 기존 웹 허니 팟과 달리 Galah는 HTTP 헤더 및 신체 컨텐츠를 포함한 관련 응답을 HTTP 요청으로 동적으로 공예합니다. LLM에 의해 생성 된 응답은 동일한 요청에 대한 반복 생성을 방지하여 API 비용을 줄이기 위해 구성 가능한 기간 동안 캐시됩니다. 캐싱은 포트 특정이며 특정 포트에 대해 생성 된 응답이 다른 포트에서 동일한 요청에 대해 재사용되지 않도록합니다.
이 허니 포트에서는 프롬프트 구성이 핵심입니다. 구성 파일에서 프롬프트를 업데이트 할 수는 있지만 LLM을 지정된 JSON 형식의 응답을 생성하도록 LLM을 지시하는 세그먼트를 유지하는 것이 중요합니다.
참고 : Galah는 HTTP 메시지를 제작할 때 LLM의 기능을 탐색하는 재미있는 주말 프로젝트로 개발되었으며 생산 사용을위한 것이 아닙니다. Honeypot은 네트워크 지문 기술, LLM 제공 업체 및 모델에 따른 연장 된 응답 시간 및 비표준 응답과 같은 다양한 방법을 통해 식별 할 수 있습니다. 지갑 공격 거부로부터 보호하려면 LLM API에 대한 사용 제한을 설정 하십시오.
config.yaml 파일을 업데이트하십시오.% git clone [email protected]:0x4D31/galah.git
% cd galah
% go mod download
% go build -o galah ./cmd/galah
% export LLM_API_KEY=your-api-key
% ./galah --help
██████ █████ ██ █████ ██ ██
██ ██ ██ ██ ██ ██ ██ ██
██ ███ ███████ ██ ███████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██ ██ ███████ ██ ██ ██ ██
llm-based web honeypot // version 1.0
author: Adel " 0x4D31 " Karimi
Usage: galah --provider PROVIDER --model MODEL [--server-url SERVER-URL] [--temperature TEMPERATURE] [--api-key API-KEY] [--cloud-location CLOUD-LOCATION] [--cloud-project CLOUD-PROJECT] [--interface INTERFACE] [--config-file CONFIG-FILE] [--event-log-file EVENT-LOG-FILE] [--cache-db-file CACHE-DB-FILE] [--cache-duration CACHE-DURATION] [--log-level LOG-LEVEL]
Options:
--provider PROVIDER, -p PROVIDER
LLM provider (openai, googleai, gcp-vertex, anthropic, cohere, ollama) [env: LLM_PROVIDER]
--model MODEL, -m MODEL
LLM model (e.g. gpt-3.5-turbo-1106, gemini-1.5-pro-preview-0409) [env: LLM_MODEL]
--server-url SERVER-URL, -u SERVER-URL
LLM Server URL (required for Ollama) [env: LLM_SERVER_URL]
--temperature TEMPERATURE, -t TEMPERATURE
LLM sampling temperature (0-2). Higher values make the output more random [default: 1, env: LLM_TEMPERATURE]
--api-key API-KEY, -k API-KEY
LLM API Key [env: LLM_API_KEY]
--cloud-location CLOUD-LOCATION
LLM cloud location region (required for GCP ' s Vertex AI) [env: LLM_CLOUD_LOCATION]
--cloud-project CLOUD-PROJECT
LLM cloud project ID (required for GCP ' s Vertex AI) [env: LLM_CLOUD_PROJECT]
--interface INTERFACE, -i INTERFACE
interface to serve on
--config-file CONFIG-FILE, -c CONFIG-FILE
Path to config file [default: config/config.yaml]
--event-log-file EVENT-LOG-FILE, -o EVENT-LOG-FILE
Path to event log file [default: event_log.json]
--cache-db-file CACHE-DB-FILE, -f CACHE-DB-FILE
Path to database file for response caching [default: cache.db]
--cache-duration CACHE-DURATION, -d CACHE-DURATION
Cache duration for generated responses (in hours). Use 0 to disable caching, and -1 for unlimited caching (no expiration). [default: 24]
--log-level LOG-LEVEL, -l LOG-LEVEL
Log level (debug, info, error, fatal) [default: info]
--help, -h display this help and exit% git clone [email protected]:0x4D31/galah.git
% cd galah
% mkdir logs
% export LLM_API_KEY=your-api-key
% docker build -t galah-image .
% docker run -d --name galah-container -p 8080:8080 -v $( pwd ) /logs:/galah/logs -e LLM_API_KEY galah-image -o logs/galah.json -p openai -m gpt-3.5-turbo-1106./galah -p gcp-vertex -m gemini-1.0-pro-002 --cloud-project galah-test --cloud-location us-central1 --temperature 0.2 --cache-duration 0 % curl -i http://localhost:8080/.aws/credentials
HTTP/1.1 200 OK
Date: Sun, 26 May 2024 16:37:26 GMT
Content-Length: 116
Content-Type: text/plain; charset=utf-8
[default]
aws_access_key_id = AKIAIOSFODNN7EXAMPLE
aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
JSON 이벤트 로그 :
{
"eventTime": "2024-05-26T18:37:26.742418+02:00",
"httpRequest": {
"body": "",
"bodySha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"headers": "User-Agent: [curl/7.71.1], Accept: [*/*]",
"headersSorted": "Accept,User-Agent",
"headersSortedSha256": "cf69e186169279bd51769f29d122b07f1f9b7e51bf119c340b66fbd2a1128bc9",
"method": "GET",
"protocolVersion": "HTTP/1.1",
"request": "/.aws/credentials",
"userAgent": "curl/7.71.1"
},
"httpResponse": {
"headers": {
"Content-Length": "127",
"Content-Type": "text/plain"
},
"body": "[default]naws_access_key_id = AKIAIOSFODNN7EXAMPLEnaws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYn"
},
"level": "info",
"llm": {
"model": "gemini-1.0-pro-002",
"provider": "gcp-vertex",
"temperature": 0.2
},
"msg": "successfulResponse",
"port": "8080",
"sensorName": "mbp.local",
"srcHost": "localhost",
"srcIP": "::1",
"srcPort": "51725",
"tags": null,
"time": "2024-05-26T18:37:26.742447+02:00"
}
여기에서 더 많은 예를보십시오.