OpenCanary 열 시트
OpenCanary는 (ab)use에 방아쇠를 놓는 다에몬입니다. 네트워크에서 알 수없는 사용자에 의해 트리거하도록 설계되어 잠재적 인 침입의 조기 경고를 제공합니다. OpenCanary는 합법적인 서비스로 나타나는 허니팟을 생성하지만, 권한이 없는 사용자가 접근할 때 관리자를 경고합니다.
## 설치 및 설치
### Ubuntu/Debian 설치
** 포장 임명: **
카지노사이트
** 출처에서:**
카지노사이트
### 제품 설명
**기본 설정:**
카지노사이트
**기본 설정:**
카지노사이트
## 서비스 구성
### SSH 허니팟
호텔 위치 구성:**
카지노사이트
** 사용자 정의 SSH 배너 : **
카지노사이트
### HTTP/HTTPS 허니팟
**HTTP 구성:**
카지노사이트
**Available HTTP 스킨:**
카지노사이트
**HTTPS 구성:**
카지노사이트
### SMB 허니팟
**SMB 구성:**
카지노사이트
**SMB 설정 공유:**
ο 회원 관리
### 데이터베이스 Honeypots
**MySQL 구성:**
카지노사이트
**MSSQL 구성:**
카지노사이트
**Redis 구성: 더 보기
카지노사이트
### 네트워크 서비스 Honeypots
** Telnet 구성: **
카지노사이트
** FTP 구성:**
카지노사이트
** SNMP 구성:**
카지노사이트
## 고급 구성
### 항구 검사 탐지
** 포트 스캔 구성:**
카지노사이트
### 사용자 정의 TCP 배너
**TCP 배너 구성: 더 보기
카지노사이트
### Logging 구성
** 고급 로깅: 더 보기
오프화이트
## OpenCanary 실행
### 수동 실행
**OpenCanary 시작:**
카지노사이트
** OpenCanary 중지:**
오프화이트
### 서비스 관리
**시스템 서비스:**
카지노사이트
**Init 스크립트 (SysV): *필수 *필수
카지노사이트
## 모니터링 및 Alerting
### 로그 분석
**Parse OpenCanary 로그:**
카지노사이트
**로그 형식 예:**
카지노사이트
### 사이트맵 통합
**Syslog 통합:**
카지노사이트
**Splunk 통합:**
카지노사이트
**ELK 스택 통합:**
```json
# Filebeat configuration
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/opencanary.log
fields:
logtype: opencanary
fields_under_root: true
output.elasticsearch:
hosts: ["elasticsearch:9200"]
index: "opencanary-%\\\{+yyyy.MM.dd\\\}"
# Logstash filter
filter \\\{
if [logtype] == "opencanary" \\\{
grok \\\{
match =>`` \\\\{
"message" => "%\\\\{TIMESTAMP_ISO8601:timestamp\\\\} %\\\\{WORD:service\\\\}\[%\\\\{NUMBER:pid\\\\}\]: %\\\\{LOGLEVEL:level\\\\} %\\\\{GREEDYDATA:event_data\\\\}"
\\\\}
\\\\}
if "src_host=" in [event_data] \\\\{
grok \\\\{
match => \\\\{
"event_data" => "src_host=%\\\\{IP:src_ip\\\\}"
\\\\}
\\\\}
\\\\}
date \\\\{
match => [ "timestamp", "yyyy-MM-dd HH:mm:ss,SSS" ]
\\\\}
\\\\}
\\\\}
```의 경우
### Alerting 스크립트
**이메일 경고:**
```python
#!/usr/bin/env python3
import re
import smtplib
import subprocess
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
def send_alert(subject, body, to_email):
"""Send email alert"""
smtp_server = "smtp.company.com"
smtp_port = 587
from_email = "alerts@company.com"
password = "your_password"
msg = MIMEMultipart()
msg['From'] = from_email
msg['To'] = to_email
msg['Subject'] = subject
msg.attach(MIMEText(body, 'plain'))
server = smtplib.SMTP(smtp_server, smtp_port)
server.starttls()
server.login(from_email, password)
text = msg.as_string()
server.sendmail(from_email, to_email, text)
server.quit()
def monitor_opencanary_log():
"""Monitor OpenCanary log for new alerts"""
log_file = "/var/log/opencanary.log"
# Use tail to follow log file
process = subprocess.Popen(['tail', '-F', log_file],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
while True:
line = process.stdout.readline().decode('utf-8').strip()
if line:
# Parse log entry
if "ssh" in line.lower() or "http" in line.lower():
# Extract source IP
ip_match = re.search(r'(\d+\.\d+\.\d+\.\d+)', line)
if ip_match:
src_ip = ip_match.group(1)
# Send alert
subject = f"OpenCanary Alert: Activity from \\\\{src_ip\\\\}"
body = f"OpenCanary detected activity:\n\n\\\\{line\\\\}"
send_alert(subject, body, "security@company.com")
if __name__ == "__main__":
monitor_opencanary_log()
```에 대하여
**Slack 통합:**
```python
#!/usr/bin/env python3
import json
import requests
import subprocess
import re
def send_slack_alert(webhook_url, message):
"""Send alert to Slack"""
payload = \\\\{
"text": message,
"username": "OpenCanary",
"icon_emoji": ":warning:"
\\\\}
response = requests.post(webhook_url, json=payload)
return response.status_code == 200
def monitor_and_alert():
"""Monitor OpenCanary and send Slack alerts"""
webhook_url = "https://hooks.slack.com/services/YOUR/WEBHOOK/URL"
log_file = "/var/log/opencanary.log"
process = subprocess.Popen(['tail', '-F', log_file],
stdout=subprocess.PIPE)
while True:
line = process.stdout.readline().decode('utf-8').strip()
if line and ("ssh" in line.lower() or "http" in line.lower()):
# Extract details
ip_match = re.search(r'(\d+\.\d+\.\d+\.\d+)', line)
| service_match = re.search(r'(ssh | http | smb | ftp)', line.lower()) |
if ip_match and service_match:
src_ip = ip_match.group(1)
service = service_match.group(1).upper()
message = f":warning: *OpenCanary Alert*\n" \
f"Service: \\\\{service\\\\}\n" \
f"Source IP: \\\\{src_ip\\\\}\n" \
f"Time: \\\\{line.split()[0]\\\\} \\\\{line.split()[1]\\\\}"
send_slack_alert(webhook_url, message)
if __name__ == "__main__":
monitor_and_alert()
```의 경우
## 보안 고려 사항
### 네트워크 배치
**DMZ 배포:**
```bash
# Place OpenCanary in DMZ
# Configure firewall rules to allow specific traffic
# Allow SSH from management network
iptables -A INPUT -s 10.0.0.0/8 -p tcp --dport 22 -j ACCEPT
# Allow HTTP/HTTPS from internet
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
# Log and drop everything else
iptables -A INPUT -j LOG --log-prefix "CANARY-DROP: "
iptables -A INPUT -j DROP
```에 대하여
** 내부 네트워크 배포:**
```bash
# Deploy multiple canaries in different network segments
# Segment 1: 192.168.1.0/24 (User network)
# Segment 2: 192.168.10.0/24 (Server network)
# Segment 3: 192.168.100.0/24 (Management network)
# Configure different services per segment
# User network: HTTP, SMB, SSH
# Server network: MySQL, MSSQL, Redis
# Management network: SNMP, Telnet, SSH
```의 경우
### 제품정보
** 시스템 경화 : 더 보기
카지노사이트
사이트맵 구성:**
카지노사이트
## 문제 해결
### 일반적인 문제
**Port 바인딩 문제:**
카지노사이트
**출발 문제:**
카지노사이트
**서비스 개시 문제:**
카지노사이트
### 관련 링크
** 디버그 로깅:**
카지노사이트
**테스트 개인 서비스:**
```bash
# Test SSH honeypot
ssh -p 22 localhost
# Test HTTP honeypot
curl -v http://localhost/
# Test SMB honeypot
smbclient -L localhost
# Test MySQL honeypot
mysql -h localhost -u root -p
```의 경우
**네트워크 테스트:**
```bash
# Test from external host
nmap -sS -O target_honeypot_ip
# Test specific services
nc -v target_honeypot_ip 22
nc -v target_honeypot_ip 80
nc -v target_honeypot_ip 3306
# Monitor network traffic
sudo tcpdump -i any -n host target_honeypot_ip
```의 경우
이 포괄적 인 OpenCanary 속임수 시트는 설치, 구성, 서비스 설정, 모니터링, 경고, 및 효과적인 허니팟 배포 및 위협 감지에 대한 보안 고려사항을 다룹니다.