diff --git a/config/__pycache__/__init__.cpython-311.pyc b/config/__pycache__/__init__.cpython-311.pyc index 423a636..5496d74 100644 Binary files a/config/__pycache__/__init__.cpython-311.pyc and b/config/__pycache__/__init__.cpython-311.pyc differ diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index 96bce55..e9a3f75 100644 Binary files a/config/__pycache__/settings.cpython-311.pyc and b/config/__pycache__/settings.cpython-311.pyc differ diff --git a/config/__pycache__/urls.cpython-311.pyc b/config/__pycache__/urls.cpython-311.pyc index 0b85e94..3b0d3e2 100644 Binary files a/config/__pycache__/urls.cpython-311.pyc and b/config/__pycache__/urls.cpython-311.pyc differ diff --git a/config/__pycache__/wsgi.cpython-311.pyc b/config/__pycache__/wsgi.cpython-311.pyc index 9c49e09..dcc5b24 100644 Binary files a/config/__pycache__/wsgi.cpython-311.pyc and b/config/__pycache__/wsgi.cpython-311.pyc differ diff --git a/core/__pycache__/__init__.cpython-311.pyc b/core/__pycache__/__init__.cpython-311.pyc index 74b1112..6b40baa 100644 Binary files a/core/__pycache__/__init__.cpython-311.pyc and b/core/__pycache__/__init__.cpython-311.pyc differ diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index a5ed392..907f2df 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/apps.cpython-311.pyc b/core/__pycache__/apps.cpython-311.pyc index 6f131d4..27ea22c 100644 Binary files a/core/__pycache__/apps.cpython-311.pyc and b/core/__pycache__/apps.cpython-311.pyc differ diff --git a/core/__pycache__/context_processors.cpython-311.pyc b/core/__pycache__/context_processors.cpython-311.pyc index 75bf223..3073655 100644 Binary files a/core/__pycache__/context_processors.cpython-311.pyc and b/core/__pycache__/context_processors.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index e061640..85f270a 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/osint_services.cpython-311.pyc b/core/__pycache__/osint_services.cpython-311.pyc new file mode 100644 index 0000000..f73da35 Binary files /dev/null and b/core/__pycache__/osint_services.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 5a69659..20daf39 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 2a36fd6..778c7f9 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..4acd382 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# Generated by Django 5.2.7 on 2026-02-28 01:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Scan', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('target_type', models.CharField(choices=[('phone', 'Phone Number'), ('email', 'Email Address'), ('name', 'Person Name'), ('username', 'Username'), ('ip', 'IP Address')], max_length=20)), + ('target_value', models.CharField(max_length=255)), + ('results_json', models.TextField(default='{}')), + ('risk_score', models.IntegerField(default=0)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ], + options={ + 'ordering': ['-created_at'], + }, + ), + ] diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..7e8f1c1 Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/migrations/__pycache__/__init__.cpython-311.pyc b/core/migrations/__pycache__/__init__.cpython-311.pyc index 9c833c8..c6652d1 100644 Binary files a/core/migrations/__pycache__/__init__.cpython-311.pyc and b/core/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..87e5d2e 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,29 @@ from django.db import models +import json -# Create your models here. +class Scan(models.Model): + SCAN_TYPES = ( + ('phone', 'Phone Number'), + ('email', 'Email Address'), + ('name', 'Person Name'), + ('username', 'Username'), + ('ip', 'IP Address'), + ) + + target_type = models.CharField(max_length=20, choices=SCAN_TYPES) + target_value = models.CharField(max_length=255) + results_json = models.TextField(default='{}') + risk_score = models.IntegerField(default=0) # 0 to 100 + created_at = models.DateTimeField(auto_now_add=True) + + def get_results(self): + try: + return json.loads(self.results_json) + except: + return {} + + def __str__(self): + return f"{self.target_type}: {self.target_value} ({self.created_at})" + + class Meta: + ordering = ['-created_at'] \ No newline at end of file diff --git a/core/osint_services.py b/core/osint_services.py new file mode 100644 index 0000000..4b358fd --- /dev/null +++ b/core/osint_services.py @@ -0,0 +1,80 @@ +import requests +import json +import logging + +logger = logging.getLogger(__name__) + +# Keys provided in the user prompt +KEYS = { + "NUMLOOKUP": "num_live_iViCHWVuE5tWiAsSBimesKfrD3w2VDgA748z9Btw", + "ABSTRACT": "bdf209a5a133453cbf82f4a0f098773d", + "VERIPHONE": "885174620DD34D3A80B4E57BA05036E3", + "HUNTERIO": "374d3258ec737081b981b693ac6590661c87c60d", + "OPENCELLID": "1f8f328afa8ba5", + "OPENCAGE": "f8c073589bca4d09b09a50e7c600ee10", + "SERPAPI": "eee2937a45ff20f37c91be7f73f8264ed2b4c07c7e58e6a4348ab84e249ee72b", +} + +def phone_lookup(number): + """Unified phone lookup from multiple sources""" + results = {} + + # 1. NumLookup + try: + url = f"https://api.numlookupapi.com/v1/validate/{number}?apikey={KEYS['NUMLOOKUP']}" + resp = requests.get(url, timeout=5) + if resp.status_code == 200: + results['numlookup'] = resp.json() + except Exception as e: + logger.error(f"NumLookup error: {e}") + + # 2. Veriphone + try: + url = f"https://veriphone.com/api/v1/verify?phone={number}&key={KEYS['VERIPHONE']}" + resp = requests.get(url, timeout=5) + if resp.status_code == 200: + results['veriphone'] = resp.json() + except Exception as e: + logger.error(f"Veriphone error: {e}") + + return results + +def email_lookup(email): + """Unified email lookup""" + results = {} + + # 1. Hunter.io + try: + url = f"https://api.hunter.io/v2/email-verifier?email={email}&api_key={KEYS['HUNTERIO']}" + resp = requests.get(url, timeout=5) + if resp.status_code == 200: + results['hunter'] = resp.json().get('data', {}) + except Exception as e: + logger.error(f"Hunter.io error: {e}") + + # 2. Abstract API + try: + url = f"https://emailvalidation.abstractapi.com/v1/?api_key={KEYS['ABSTRACT']}&email={email}" + resp = requests.get(url, timeout=5) + if resp.status_code == 200: + results['abstract'] = resp.json() + except Exception as e: + logger.error(f"Abstract error: {e}") + + return results + +def serp_search(query): + """Google search via SerpAPI for public mentions""" + try: + url = "https://serpapi.com/search.json" + params = { + "q": query, + "api_key": KEYS['SERPAPI'], + "engine": "google" + } + resp = requests.get(url, params=params, timeout=10) + if resp.status_code == 200: + return resp.json().get('organic_results', []) + except Exception as e: + logger.error(f"SerpAPI error: {e}") + return [] diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..f85c8b3 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,52 @@ +{% load static %} -
- -