Skip to content

Add Harish Srinivasan to CONTRIBUTORS.md for GSoC 2025 participation #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: v2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@
- Special thanks to Dr. Emmanouil Vasilomanolakis for guidance and support.
- The Honeynet Project for hosting and maintaining the repository.

- **Harish Srinivasan** – Implemented basic DICOM honeypot and alert logger.


29 changes: 29 additions & 0 deletions canary_logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import requests
import logging

# Set up logging
logger = logging.getLogger("DICOMHawk-CanaryLogger")
logger.setLevel(logging.INFO)

# Log to file
file_handler = logging.FileHandler('dicomhawk_alerts.log')
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)

# Dummy CanaryToken webhook URL (replace with actual one later)
CANARYTOKEN_URL = "https://canarytokens.com/some-fake-token-url"

def alert_admin(event_type, details=""):
"""
Logs suspicious DICOM activity and sends a CanaryToken webhook.
"""
message = f"[ALERT] {event_type} - {details}"
logger.warning(message)

# Send Canary webhook
try:
requests.get(CANARYTOKEN_URL, timeout=3)
logger.info("Webhook sent to CanaryToken.")
except Exception as e:
logger.error(f"Failed to send webhook: {e}")
2 changes: 2 additions & 0 deletions dicomhawk_alerts.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2025-04-08 00:04:55,428 - WARNING - [ALERT] Suspicious Upload - Data length: 0 bytes
2025-04-08 00:04:55,974 - INFO - Webhook sent to CanaryToken.
18 changes: 18 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from flask import Flask, request
from canary_logger import alert_admin

app = Flask(__name__)

@app.route("/")
def home():
return "DICOMHawk CanaryLogger is active!"

@app.route("/upload", methods=["POST"])
def upload():
data = request.data
# Simulate detecting a suspicious upload
alert_admin("Suspicious Upload", f"Data length: {len(data)} bytes")
return "Upload received and logged!"

if __name__ == "__main__":
app.run(debug=True)