osinterai 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- osinterai/LICENSE.txt +87 -0
- osinterai/__init__.py +11 -0
- osinterai/__main__.py +7 -0
- osinterai/_geo_data.py +184 -0
- osinterai/agent.py +211 -0
- osinterai/api.py +288 -0
- osinterai/cli.py +58 -0
- osinterai/config.py +180 -0
- osinterai/globe.py +207 -0
- osinterai/history.py +162 -0
- osinterai/i18n.py +456 -0
- osinterai/modules/__init__.py +4 -0
- osinterai/modules/dns.py +103 -0
- osinterai/modules/domain.py +169 -0
- osinterai/modules/email.py +116 -0
- osinterai/modules/ip.py +142 -0
- osinterai/modules/net.py +135 -0
- osinterai/modules/reach.py +120 -0
- osinterai/modules/subdomains.py +86 -0
- osinterai/modules/username.py +158 -0
- osinterai/policy.py +40 -0
- osinterai/py.typed +0 -0
- osinterai/sandbox.py +276 -0
- osinterai/totp.py +132 -0
- osinterai/tui/__init__.py +3 -0
- osinterai/tui/account.py +315 -0
- osinterai/tui/app.py +364 -0
- osinterai/tui/base.py +247 -0
- osinterai/tui/home.py +205 -0
- osinterai/tui/investigate.py +477 -0
- osinterai/tui/modules.py +425 -0
- osinterai/tui/onboarding.py +494 -0
- osinterai/tui/render.py +279 -0
- osinterai/tui/theme.py +214 -0
- osinterai/tui/widgets.py +275 -0
- osinterai/tui/workspace.py +234 -0
- osinterai/update.py +258 -0
- osinterai-0.1.0.dist-info/METADATA +247 -0
- osinterai-0.1.0.dist-info/RECORD +43 -0
- osinterai-0.1.0.dist-info/WHEEL +5 -0
- osinterai-0.1.0.dist-info/entry_points.txt +2 -0
- osinterai-0.1.0.dist-info/licenses/LICENSE +87 -0
- osinterai-0.1.0.dist-info/top_level.txt +1 -0
osinterai/LICENSE.txt
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
OsinterAI — Proprietary Software / Tescilli Yazılım
|
|
2
|
+
Copyright (c) 2026 OsinterAI authors (Muhammed · https://github.com/ThT0AltayHR). All rights reserved. / Tüm hakları saklıdır.
|
|
3
|
+
Official channels: https://ai.osinterai.workers.dev · https://pypi.org/project/osinterai/ · https://github.com/ThT0AltayHR/osinterai
|
|
4
|
+
Online version: https://ai.osinterai.workers.dev/en/license · https://ai.osinterai.workers.dev/tr/license
|
|
5
|
+
|
|
6
|
+
OSINTERAI END-USER LICENSE (ENGLISH)
|
|
7
|
+
============================================================
|
|
8
|
+
|
|
9
|
+
OsinterAI End-User License. OsinterAI — including the command-line software, its source and object code, packages published on PyPI, the website, the API, documentation, logos and all updates (together, the "Software") — is proprietary, closed-source software. Copyright © 2026 the OsinterAI authors. All rights reserved.
|
|
10
|
+
|
|
11
|
+
This is not an open-source license. Being able to download the Software (for example from PyPI) does not grant any right beyond those written below.
|
|
12
|
+
|
|
13
|
+
1. Grant of licence
|
|
14
|
+
Subject to your continuous compliance with this License and the Terms of Use, you are granted a personal, limited, non-exclusive, non-transferable, non-sublicensable, revocable licence to install and run unmodified copies of the Software, solely as obtained from the official distribution channels, on devices you own or control, for your own lawful use. No other right is granted.
|
|
15
|
+
|
|
16
|
+
2. Restrictions
|
|
17
|
+
You may not, and may not permit or assist anyone else to:
|
|
18
|
+
- copy, reproduce or mirror the Software, in whole or in part, except for installation as permitted in Section 1 and automatic backups;
|
|
19
|
+
- modify, adapt, translate, patch or create derivative works of the Software;
|
|
20
|
+
- distribute, redistribute, publish, sell, rent, lease, lend, sublicense, host or otherwise make the Software available to any third party, including as a service or bundled into another product, package or image;
|
|
21
|
+
- reverse engineer, decompile, disassemble, decrypt, deobfuscate or otherwise attempt to derive source code, algorithms, prompts or internal structure, except and only to the extent that applicable law expressly permits this notwithstanding this restriction;
|
|
22
|
+
- remove, alter or hide any copyright, trademark, licence or proprietary notice;
|
|
23
|
+
- circumvent licence checks, authentication, rate limits or other technical protection measures, or access the API by any means other than the official Software;
|
|
24
|
+
- use the Software, its output or its API to build, train or benchmark a competing product or AI model;
|
|
25
|
+
- use the Software in violation of the Terms of Use, the Legal Disclaimer or any applicable law.
|
|
26
|
+
|
|
27
|
+
3. Ownership
|
|
28
|
+
The Software is licensed, not sold. All right, title and interest in and to the Software, including all intellectual-property rights, remain exclusively with its authors. The OsinterAI name and logo are protected marks and may not be used without prior written permission.
|
|
29
|
+
|
|
30
|
+
4. Updates and services
|
|
31
|
+
The authors may update, change or discontinue the Software or online services at any time. Updates are governed by this License unless accompanied by different terms.
|
|
32
|
+
|
|
33
|
+
5. Termination
|
|
34
|
+
This License terminates automatically and without notice if you breach any of its terms. Upon termination you must stop using the Software and delete all copies. Sections 2, 3, 6 and 7 survive termination.
|
|
35
|
+
|
|
36
|
+
6. No warranty; limitation of liability
|
|
37
|
+
The Software is provided "AS IS" without warranty of any kind. The Legal Disclaimer, including its limitation of liability, applies to this License in full.
|
|
38
|
+
|
|
39
|
+
7. Enforcement and governing law
|
|
40
|
+
Any breach may result in civil and criminal liability under applicable law, including Turkish Law No. 5846 on Intellectual and Artistic Works. This License is governed by the laws of the Republic of Türkiye; the courts and enforcement offices of Ankara have jurisdiction.
|
|
41
|
+
|
|
42
|
+
8. Permissions
|
|
43
|
+
Requests for any use not granted here must be made in writing via https://github.com/ThT0AltayHR/osinterai/issues and are valid only if expressly granted in writing.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
OSINTERAI SON KULLANICI LİSANSI (TÜRKÇE)
|
|
48
|
+
============================================================
|
|
49
|
+
|
|
50
|
+
OsinterAI Son Kullanıcı Lisansı. Komut satırı yazılımı, kaynak ve nesne kodu, PyPI'da yayımlanan paketler, web sitesi, API, belgeler, logolar ve tüm güncellemeler dahil OsinterAI ("Yazılım") tescilli, kapalı kaynaklı bir yazılımdır. Telif hakkı © 2026 OsinterAI geliştiricileri. Tüm hakları saklıdır.
|
|
51
|
+
|
|
52
|
+
Bu bir açık kaynak lisansı değildir. Yazılımın indirilebilir olması (örneğin PyPI üzerinden) aşağıda yazılanların ötesinde hiçbir hak vermez.
|
|
53
|
+
|
|
54
|
+
1. Lisansın verilmesi
|
|
55
|
+
Bu Lisansa ve Kullanım Koşullarına sürekli uymanız şartıyla; Yazılımın yalnızca resmî dağıtım kanallarından edinilen, değiştirilmemiş kopyalarını, sahibi olduğunuz veya kontrolünüzdeki cihazlarda, kendi hukuka uygun kullanımınız için kurma ve çalıştırma amacıyla kişisel, sınırlı, münhasır olmayan, devredilemez, alt lisanslanamaz ve geri alınabilir bir lisans verilir. Başka hiçbir hak verilmez.
|
|
56
|
+
|
|
57
|
+
2. Kısıtlamalar
|
|
58
|
+
Aşağıdakileri yapamaz, başkalarının yapmasına izin veremez veya yardım edemezsiniz:
|
|
59
|
+
- 1. maddede izin verilen kurulum ve otomatik yedekleme dışında Yazılımı tamamen veya kısmen kopyalamak, çoğaltmak veya yansılamak;
|
|
60
|
+
- Yazılımı değiştirmek, uyarlamak, çevirmek, yamalamak veya türev eserler oluşturmak;
|
|
61
|
+
- Yazılımı dağıtmak, yeniden dağıtmak, yayımlamak, satmak, kiralamak, ödünç vermek, alt lisanslamak, barındırmak veya hizmet olarak sunmak ya da başka bir ürün, paket veya imaja eklemek dahil üçüncü kişilerin kullanımına sunmak;
|
|
62
|
+
- geçerli mevzuatın bu kısıtlamaya rağmen açıkça izin verdiği hâl ve ölçü dışında, kaynak kodu, algoritmaları, istemleri (prompt) veya iç yapıyı elde etmek amacıyla tersine mühendislik yapmak, kaynak koda dönüştürmek (decompile), disassemble etmek, şifresini çözmek veya karartmayı kaldırmak;
|
|
63
|
+
- telif hakkı, marka, lisans veya mülkiyet bildirimlerini kaldırmak, değiştirmek veya gizlemek;
|
|
64
|
+
- lisans kontrollerini, kimlik doğrulamayı, hız sınırlarını veya diğer teknik koruma önlemlerini aşmak ya da API'ye resmî Yazılım dışında bir yolla erişmek;
|
|
65
|
+
- Yazılımı, çıktılarını veya API'sini rakip bir ürün veya yapay zekâ modeli geliştirmek, eğitmek veya kıyaslamak için kullanmak;
|
|
66
|
+
- Yazılımı Kullanım Koşullarına, Yasal Uyarı'ya veya geçerli mevzuata aykırı biçimde kullanmak.
|
|
67
|
+
|
|
68
|
+
3. Mülkiyet
|
|
69
|
+
Yazılım satılmaz, lisanslanır. Fikri mülkiyet hakları dahil Yazılım üzerindeki tüm hak, mülkiyet ve menfaatler münhasıran geliştiricilerine aittir. OsinterAI adı ve logosu korunan işaretlerdir; önceden yazılı izin olmadan kullanılamaz.
|
|
70
|
+
|
|
71
|
+
4. Güncellemeler ve hizmetler
|
|
72
|
+
Geliştiriciler Yazılımı veya çevrimiçi hizmetleri dilediği zaman güncelleyebilir, değiştirebilir veya sonlandırabilir. Farklı koşullar belirtilmedikçe güncellemeler bu Lisansa tabidir.
|
|
73
|
+
|
|
74
|
+
5. Fesih
|
|
75
|
+
Bu Lisans, hükümlerinden herhangi birini ihlal etmeniz halinde bildirim gerekmeksizin kendiliğinden sona erer. Sona erme halinde Yazılımı kullanmayı bırakmalı ve tüm kopyalarını silmelisiniz. 2, 3, 6 ve 7. maddeler sona ermeden sonra da geçerlidir.
|
|
76
|
+
|
|
77
|
+
6. Garanti yoktur; sorumluluk sınırlaması
|
|
78
|
+
Yazılım hiçbir garanti olmaksızın "OLDUĞU GİBİ" sunulur. Sorumluluk sınırlaması dahil Yasal Uyarı bu Lisansa bütünüyle uygulanır.
|
|
79
|
+
|
|
80
|
+
7. Yaptırım ve uygulanacak hukuk
|
|
81
|
+
Her türlü ihlal, 5846 sayılı Fikir ve Sanat Eserleri Kanunu dahil geçerli mevzuat kapsamında hukuki ve cezai sorumluluk doğurabilir. Bu Lisans Türkiye Cumhuriyeti hukukuna tabidir; Ankara Mahkemeleri ve İcra Daireleri yetkilidir.
|
|
82
|
+
|
|
83
|
+
8. İzinler
|
|
84
|
+
Burada verilmeyen her türlü kullanım için talepler https://github.com/ThT0AltayHR/osinterai/issues üzerinden yazılı olarak yapılmalıdır ve yalnızca açıkça yazılı olarak verilirse geçerlidir.
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
osinterai/__init__.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Copyright (c) 2026 OsinterAI authors (Muhammed · github.com/ThT0AltayHR). All rights reserved.
|
|
2
|
+
# Proprietary and confidential. Use-only licence: no copying, modification, redistribution or
|
|
3
|
+
# reverse engineering. See LICENSE or https://ai.osinterai.workers.dev/en/license
|
|
4
|
+
"""OsinterAI — AI-powered OSINT terminal tool."""
|
|
5
|
+
|
|
6
|
+
__version__ = "0.1.0"
|
|
7
|
+
__app_name__ = "OsinterAI"
|
|
8
|
+
SITE_URL = "https://ai.osinterai.workers.dev"
|
|
9
|
+
GITHUB_URL = "https://github.com/ThT0AltayHR/osinterai"
|
|
10
|
+
PYPI_URL = "https://pypi.org/project/osinterai/"
|
|
11
|
+
PACKAGE = "osinterai"
|
osinterai/__main__.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Copyright (c) 2026 OsinterAI authors (Muhammed · github.com/ThT0AltayHR). All rights reserved.
|
|
2
|
+
# Proprietary and confidential. Use-only licence: no copying, modification, redistribution or
|
|
3
|
+
# reverse engineering. See LICENSE or https://ai.osinterai.workers.dev/en/license
|
|
4
|
+
from .cli import main
|
|
5
|
+
|
|
6
|
+
if __name__ == "__main__": # pragma: no cover
|
|
7
|
+
raise SystemExit(main())
|
osinterai/_geo_data.py
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"""Generated by tools/gen_geo.py from Natural Earth 110m (public domain). Do not edit."""
|
|
2
|
+
|
|
3
|
+
GRID_W = 180
|
|
4
|
+
GRID_H = 90
|
|
5
|
+
STEP = 2
|
|
6
|
+
LAND_B64 = 'eNq9Vb9PFEEUfnN7sFcgc8RCCsJiKGxMOBMLC8McgcLKxH+AoI2dwY5E444WVv4Bdvgn2Gls2EhiS2NCyRJM0MK4KpolbPY5897M7J5ep/EVt3PffPN+fPP2LcA/sjwBjP5AP2KFGPO6E9CnZwWihEKYdeYPZfBhFxEFdO2/Dc/NbimoDdnYFNQKXttDsDnz+VyGqV0OoMLUOOlrAae7VVTghKU+OUNM8bwGPEhvvvkKmACUEl6htZ20sI9kuTRojvt4RjA+o81SKB3D9j46k0QWl3MT+mHtUdQ75ifegjnj4tiDJ5CLGlN9yab2qGIwWQPoafMsjBR65YjRFCT0TXTcNkXDXNd5iDbtURPmVBkZvnvHEYlFK4CXHl1yKiPe4UNsLLVZqJ6tzxnlBLaYSUuuPxGqwJPtPdXPJSd9xZPtfrb6k33HwpPtY3nIul3scwsg3ZM+7HB979hzxeQyXiN4ke4SNBViKqKEUM2CC5hQ+ekXjue6oIo6HIBuKnXoi2SBPaVpzcKQnVCSJeLxUhnqA5gfOAVradhd37e3e6zcQZorDC16Peoy+TSu8gsBVq6g7UTH9TDA0iX3AK5p2Q2t68ip0FG5Esg9yZ73YKCn+gH+ISlnU/LEjeYF0rY3qGQTrSGXJtONQyr56myLnNCe+dVvRYAr60PTLcyuB5Rfn4okPnosGrKyZFvoxr33HuarLUjibm+rIVN6lqwjLYVPoyHDzMthyNkGrNVvI4IuucBVOrno0YLIqEhMNbkQAkZ27z75u9vUbZ2ijGkdNyJFNvMBRxEhO3tbtYy8VI5sXeRpv2lNJkfUfU3+nIY9lilXbBwUtSFK0eTPZHopuOtlHcZd0kjQ1wm47Or2DC2EqzuPRzWb5Md6G8tg4BYjY7innef5URdTzrMYO82lX4xsb44f/dNj0Qz+sw3Hw06NLRgW201vsFa6wkOa8D7nmAcH7rVG41ynoGsORv26RE3SfA3o+8Kzqc01L903PjPdRiXPYYz7RQtVrWHdsqRIMvxb+wUPXpy8'
|
|
7
|
+
# ISO2: (name_en, name_tr, lat, lon)
|
|
8
|
+
COUNTRIES = {
|
|
9
|
+
'AE': ('United Arab Emirates', 'Birleşik Arap Emirlikleri', 23.47, 54.55),
|
|
10
|
+
'AF': ('Afghanistan', 'Afganistan', 34.16, 66.5),
|
|
11
|
+
'AL': ('Albania', 'Arnavutluk', 40.65, 20.11),
|
|
12
|
+
'AM': ('Armenia', 'Ermenistan', 40.46, 44.8),
|
|
13
|
+
'AO': ('Angola', 'Angola', -12.18, 17.98),
|
|
14
|
+
'AQ': ('Antarctica', 'Antarktika', -79.84, 35.89),
|
|
15
|
+
'AR': ('Argentina', 'Arjantin', -33.5, -64.17),
|
|
16
|
+
'AT': ('Austria', 'Avusturya', 47.52, 14.13),
|
|
17
|
+
'AU': ('Australia', 'Avustralya', -24.13, 134.05),
|
|
18
|
+
'AZ': ('Azerbaijan', 'Azerbaycan', 40.4, 47.21),
|
|
19
|
+
'BA': ('Bosnia and Herzegovina', 'Bosna-Hersek', 44.09, 18.07),
|
|
20
|
+
'BD': ('Bangladesh', 'Bangladeş', 24.21, 89.68),
|
|
21
|
+
'BE': ('Belgium', 'Belçika', 50.79, 4.8),
|
|
22
|
+
'BF': ('Burkina Faso', 'Burkina Faso', 12.67, -1.36),
|
|
23
|
+
'BG': ('Bulgaria', 'Bulgaristan', 42.51, 25.16),
|
|
24
|
+
'BI': ('Burundi', 'Burundi', -3.33, 29.92),
|
|
25
|
+
'BJ': ('Benin', 'Benin', 10.32, 2.35),
|
|
26
|
+
'BN': ('Brunei', 'Brunei', 4.45, 114.55),
|
|
27
|
+
'BO': ('Bolivia', 'Bolivya', -16.67, -64.59),
|
|
28
|
+
'BR': ('Brazil', 'Brezilya', -12.1, -49.56),
|
|
29
|
+
'BS': ('The Bahamas', 'Bahamalar', 26.4, -77.15),
|
|
30
|
+
'BT': ('Bhutan', 'Bhutan', 27.54, 90.04),
|
|
31
|
+
'BW': ('Botswana', 'Botsvana', -22.1, 24.18),
|
|
32
|
+
'BY': ('Belarus', 'Beyaz Rusya', 53.82, 28.42),
|
|
33
|
+
'BZ': ('Belize', 'Belize', 17.2, -88.71),
|
|
34
|
+
'CA': ('Canada', 'Kanada', 60.32, -101.91),
|
|
35
|
+
'CD': ('Democratic Republic of the Congo', 'Demokratik Kongo Cumhuriyeti', -1.86, 23.46),
|
|
36
|
+
'CF': ('Central African Republic', 'Orta Afrika Cumhuriyeti', 6.99, 20.91),
|
|
37
|
+
'CG': ('Republic of the Congo', 'Kongo Cumhuriyeti', 0.14, 15.9),
|
|
38
|
+
'CH': ('Switzerland', 'İsviçre', 46.72, 7.46),
|
|
39
|
+
'CI': ('Ivory Coast', 'Fildişi Sahili', 7.49, -5.57),
|
|
40
|
+
'CL': ('Chile', 'Şili', -38.15, -72.32),
|
|
41
|
+
'CM': ('Cameroon', 'Kamerun', 4.59, 12.47),
|
|
42
|
+
'CN': ("People's Republic of China", 'Çin Halk Cumhuriyeti', 32.5, 106.34),
|
|
43
|
+
'CO': ('Colombia', 'Kolombiya', 3.37, -73.17),
|
|
44
|
+
'CR': ('Costa Rica', 'Kosta Rika', 10.07, -84.08),
|
|
45
|
+
'CU': ('Cuba', 'Küba', 21.33, -77.98),
|
|
46
|
+
'CY': ('Cyprus', 'Kıbrıs Cumhuriyeti', 34.91, 33.08),
|
|
47
|
+
'CZ': ('Czech Republic', 'Çek Cumhuriyeti', 49.88, 15.38),
|
|
48
|
+
'DE': ('Germany', 'Almanya', 50.96, 9.68),
|
|
49
|
+
'DJ': ('Djibouti', 'Cibuti', 11.98, 42.5),
|
|
50
|
+
'DK': ('Denmark', 'Danimarka', 55.97, 9.02),
|
|
51
|
+
'DO': ('Dominican Republic', 'Dominik Cumhuriyeti', 19.1, -70.65),
|
|
52
|
+
'DZ': ('Algeria', 'Cezayir', 27.4, 2.81),
|
|
53
|
+
'EC': ('Ecuador', 'Ekvador', -1.26, -78.19),
|
|
54
|
+
'EE': ('Estonia', 'Estonya', 58.72, 25.87),
|
|
55
|
+
'EG': ('Egypt', 'Mısır', 26.19, 29.45),
|
|
56
|
+
'EH': ('Western Sahara', 'Batı Sahra', 23.97, -12.63),
|
|
57
|
+
'ER': ('Eritrea', 'Eritre', 15.79, 38.29),
|
|
58
|
+
'ES': ('Spain', 'İspanya', 40.09, -3.46),
|
|
59
|
+
'ET': ('Ethiopia', 'Etiyopya', 8.03, 39.09),
|
|
60
|
+
'FI': ('Finland', 'Finlandiya', 63.25, 27.28),
|
|
61
|
+
'FJ': ('Fiji', 'Fiji', -17.83, 177.98),
|
|
62
|
+
'FK': ('Falkland Islands', 'Falkland Adaları', -51.61, -58.74),
|
|
63
|
+
'FR': ('France', 'Fransa', 46.7, 2.55),
|
|
64
|
+
'GA': ('Gabon', 'Gabon', -0.44, 11.84),
|
|
65
|
+
'GB': ('United Kingdom', 'Birleşik Krallık', 54.4, -2.12),
|
|
66
|
+
'GE': ('Georgia', 'Gürcistan', 41.87, 43.74),
|
|
67
|
+
'GH': ('Ghana', 'Gana', 7.72, -1.04),
|
|
68
|
+
'GL': ('Greenland', 'Grönland', 74.32, -39.34),
|
|
69
|
+
'GM': ('The Gambia', 'Gambiya', 13.64, -15.0),
|
|
70
|
+
'GN': ('Guinea', 'Gine', 10.62, -10.02),
|
|
71
|
+
'GQ': ('Equatorial Guinea', 'Ekvator Ginesi', 2.33, 8.99),
|
|
72
|
+
'GR': ('Greece', 'Yunanistan', 39.49, 21.73),
|
|
73
|
+
'GT': ('Guatemala', 'Guatemala', 14.98, -90.5),
|
|
74
|
+
'GW': ('Guinea-Bissau', 'Gine-Bissau', 12.16, -14.52),
|
|
75
|
+
'GY': ('Guyana', 'Guyana', 5.12, -58.94),
|
|
76
|
+
'HN': ('Honduras', 'Honduras', 14.79, -86.89),
|
|
77
|
+
'HR': ('Croatia', 'Hırvatistan', 45.81, 16.37),
|
|
78
|
+
'HT': ('Haiti', 'Haiti', 19.26, -72.22),
|
|
79
|
+
'HU': ('Hungary', 'Macaristan', 47.09, 19.45),
|
|
80
|
+
'ID': ('Indonesia', 'Endonezya', -0.95, 101.89),
|
|
81
|
+
'IE': ('Ireland', 'İrlanda', 53.08, -7.8),
|
|
82
|
+
'IL': ('Israel', 'İsrail', 30.91, 34.85),
|
|
83
|
+
'IN': ('India', 'Hindistan', 22.69, 79.36),
|
|
84
|
+
'IQ': ('Iraq', 'Irak', 33.09, 43.26),
|
|
85
|
+
'IR': ('Iran', 'İran', 32.17, 54.93),
|
|
86
|
+
'IS': ('Iceland', 'İzlanda', 64.78, -18.67),
|
|
87
|
+
'IT': ('Italy', 'İtalya', 44.73, 11.08),
|
|
88
|
+
'JM': ('Jamaica', 'Jamaika', 18.14, -77.32),
|
|
89
|
+
'JO': ('Jordan', 'Ürdün', 30.81, 36.38),
|
|
90
|
+
'JP': ('Japan', 'Japonya', 36.14, 138.44),
|
|
91
|
+
'KE': ('Kenya', 'Kenya', 0.55, 37.91),
|
|
92
|
+
'KG': ('Kyrgyzstan', 'Kırgızistan', 41.67, 74.53),
|
|
93
|
+
'KH': ('Cambodia', 'Kamboçya', 12.65, 104.5),
|
|
94
|
+
'KP': ('North Korea', 'Kuzey Kore', 39.89, 126.44),
|
|
95
|
+
'KR': ('South Korea', 'Güney Kore', 36.38, 128.13),
|
|
96
|
+
'KW': ('Kuwait', 'Kuveyt', 29.41, 47.31),
|
|
97
|
+
'KZ': ('Kazakhstan', 'Kazakistan', 49.05, 68.69),
|
|
98
|
+
'LA': ('Laos', 'Laos', 19.43, 102.53),
|
|
99
|
+
'LB': ('Lebanon', 'Lübnan', 34.13, 35.99),
|
|
100
|
+
'LK': ('Sri Lanka', 'Sri Lanka', 7.58, 80.7),
|
|
101
|
+
'LR': ('Liberia', 'Liberya', 6.45, -9.46),
|
|
102
|
+
'LS': ('Lesotho', 'Lesotho', -29.48, 28.25),
|
|
103
|
+
'LT': ('Lithuania', 'Litvanya', 55.1, 24.09),
|
|
104
|
+
'LU': ('Luxembourg', 'Lüksemburg', 49.73, 6.08),
|
|
105
|
+
'LV': ('Latvia', 'Letonya', 57.07, 25.46),
|
|
106
|
+
'LY': ('Libya', 'Libya', 26.64, 18.01),
|
|
107
|
+
'MA': ('Morocco', 'Fas', 31.65, -7.19),
|
|
108
|
+
'MD': ('Moldova', 'Moldova', 47.43, 28.49),
|
|
109
|
+
'ME': ('Montenegro', 'Karadağ', 42.8, 19.14),
|
|
110
|
+
'MG': ('Madagascar', 'Madagaskar', -18.63, 46.7),
|
|
111
|
+
'MK': ('North Macedonia', 'Kuzey Makedonya', 41.56, 21.56),
|
|
112
|
+
'ML': ('Mali', 'Mali', 18.69, -2.04),
|
|
113
|
+
'MM': ('Myanmar', 'Myanmar', 21.57, 95.8),
|
|
114
|
+
'MN': ('Mongolia', 'Moğolistan', 46.0, 104.15),
|
|
115
|
+
'MR': ('Mauritania', 'Moritanya', 19.59, -9.74),
|
|
116
|
+
'MW': ('Malawi', 'Malavi', -13.39, 33.61),
|
|
117
|
+
'MX': ('Mexico', 'Meksika', 23.92, -102.29),
|
|
118
|
+
'MY': ('Malaysia', 'Malezya', 2.53, 113.84),
|
|
119
|
+
'MZ': ('Mozambique', 'Mozambik', -13.94, 37.84),
|
|
120
|
+
'NA': ('Namibia', 'Namibya', -20.58, 17.11),
|
|
121
|
+
'NC': ('New Caledonia', 'Yeni Kaledonya', -21.06, 165.08),
|
|
122
|
+
'NE': ('Niger', 'Nijer', 17.45, 9.5),
|
|
123
|
+
'NG': ('Nigeria', 'Nijerya', 9.44, 7.5),
|
|
124
|
+
'NI': ('Nicaragua', 'Nikaragua', 12.67, -85.07),
|
|
125
|
+
'NL': ('Netherlands', 'Hollanda', 52.42, 5.61),
|
|
126
|
+
'NO': ('Norway', 'Norveç', 61.36, 9.68),
|
|
127
|
+
'NP': ('Nepal', 'Nepal', 28.3, 83.64),
|
|
128
|
+
'NZ': ('New Zealand', 'Yeni Zelanda', -39.76, 172.79),
|
|
129
|
+
'OM': ('Oman', 'Umman', 22.12, 57.34),
|
|
130
|
+
'PA': ('Panama', 'Panama', 8.72, -80.35),
|
|
131
|
+
'PE': ('Peru', 'Peru', -12.98, -72.9),
|
|
132
|
+
'PG': ('Papua New Guinea', 'Papua Yeni Gine', -5.7, 143.91),
|
|
133
|
+
'PH': ('Philippines', 'Filipinler', 11.2, 122.47),
|
|
134
|
+
'PK': ('Pakistan', 'Pakistan', 29.33, 68.55),
|
|
135
|
+
'PL': ('Poland', 'Polonya', 51.99, 19.49),
|
|
136
|
+
'PR': ('Puerto Rico', 'Porto Riko', 18.23, -66.48),
|
|
137
|
+
'PS': ('Palestine', 'Filistin', 32.05, 35.29),
|
|
138
|
+
'PT': ('Portugal', 'Portekiz', 39.61, -8.27),
|
|
139
|
+
'PY': ('Paraguay', 'Paraguay', -21.67, -60.15),
|
|
140
|
+
'QA': ('Qatar', 'Katar', 25.24, 51.14),
|
|
141
|
+
'RO': ('Romania', 'Romanya', 45.73, 24.97),
|
|
142
|
+
'RS': ('Serbia', 'Sırbistan', 44.19, 20.79),
|
|
143
|
+
'RU': ('Russia', 'Rusya', 58.25, 44.69),
|
|
144
|
+
'RW': ('Rwanda', 'Ruanda', -1.9, 30.1),
|
|
145
|
+
'SA': ('Saudi Arabia', 'Suudi Arabistan', 23.81, 44.7),
|
|
146
|
+
'SB': ('Solomon Islands', 'Solomon Adaları', -8.03, 159.17),
|
|
147
|
+
'SD': ('Sudan', 'Sudan', 16.33, 29.26),
|
|
148
|
+
'SE': ('Sweden', 'İsveç', 65.86, 19.02),
|
|
149
|
+
'SI': ('Slovenia', 'Slovenya', 46.06, 14.92),
|
|
150
|
+
'SK': ('Slovakia', 'Slovakya', 48.73, 19.05),
|
|
151
|
+
'SL': ('Sierra Leone', 'Sierra Leone', 8.62, -11.76),
|
|
152
|
+
'SN': ('Senegal', 'Senegal', 15.14, -14.78),
|
|
153
|
+
'SO': ('Somalia', 'Somali', 3.57, 45.19),
|
|
154
|
+
'SR': ('Suriname', 'Surinam', 4.14, -55.91),
|
|
155
|
+
'SS': ('South Sudan', 'Güney Sudan', 7.23, 30.39),
|
|
156
|
+
'SV': ('El Salvador', 'El Salvador', 13.69, -88.89),
|
|
157
|
+
'SY': ('Syria', 'Suriye', 35.01, 38.28),
|
|
158
|
+
'SZ': ('Eswatini', 'Esvatini', -26.53, 31.47),
|
|
159
|
+
'TD': ('Chad', 'Çad', 15.14, 18.65),
|
|
160
|
+
'TF': ('French Southern and Antarctic Lands', 'Fransız Güney ve Antarktika Toprakları', -49.3, 69.12),
|
|
161
|
+
'TG': ('Togo', 'Togo', 8.81, 1.06),
|
|
162
|
+
'TH': ('Thailand', 'Tayland', 15.46, 101.07),
|
|
163
|
+
'TJ': ('Tajikistan', 'Tacikistan', 38.2, 72.59),
|
|
164
|
+
'TL': ('East Timor', 'Doğu Timor', -8.8, 125.85),
|
|
165
|
+
'TM': ('Turkmenistan', 'Türkmenistan', 39.86, 58.68),
|
|
166
|
+
'TN': ('Tunisia', 'Tunus', 33.69, 9.01),
|
|
167
|
+
'TR': ('Turkey', 'Türkiye', 39.35, 34.51),
|
|
168
|
+
'TT': ('Trinidad and Tobago', 'Trinidad ve Tobago', 11.0, -60.92),
|
|
169
|
+
'TW': ('Taiwan', 'Çin Cumhuriyeti', 23.65, 120.87),
|
|
170
|
+
'TZ': ('Tanzania', 'Tanzanya', -6.05, 34.96),
|
|
171
|
+
'UA': ('Ukraine', 'Ukrayna', 49.72, 32.14),
|
|
172
|
+
'UG': ('Uganda', 'Uganda', 1.97, 32.95),
|
|
173
|
+
'US': ('United States of America', 'Amerika Birleşik Devletleri', 39.54, -97.48),
|
|
174
|
+
'UY': ('Uruguay', 'Uruguay', -32.96, -55.97),
|
|
175
|
+
'UZ': ('Uzbekistan', 'Özbekistan', 41.69, 64.01),
|
|
176
|
+
'VE': ('Venezuela', 'Venezuela', 7.18, -64.6),
|
|
177
|
+
'VN': ('Vietnam', 'Vietnam', 21.72, 105.39),
|
|
178
|
+
'VU': ('Vanuatu', 'Vanuatu', -15.37, 166.91),
|
|
179
|
+
'XK': ('Kosovo', 'Kosova', 42.59, 20.86),
|
|
180
|
+
'YE': ('Yemen', 'Yemen', 15.33, 45.87),
|
|
181
|
+
'ZA': ('South Africa', 'Güney Afrika Cumhuriyeti', -29.71, 23.67),
|
|
182
|
+
'ZM': ('Zambia', 'Zambiya', -14.66, 26.4),
|
|
183
|
+
'ZW': ('Zimbabwe', 'Zimbabve', -18.91, 29.93),
|
|
184
|
+
}
|
osinterai/agent.py
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Copyright (c) 2026 OsinterAI authors (Muhammed · github.com/ThT0AltayHR). All rights reserved.
|
|
2
|
+
# Proprietary and confidential. Use-only licence: no copying, modification, redistribution or
|
|
3
|
+
# reverse engineering. See LICENSE or https://ai.osinterai.workers.dev/en/license
|
|
4
|
+
"""AI investigation agent.
|
|
5
|
+
|
|
6
|
+
1. Guard: the client-side policy refuses doxxing / stalking / attacks up front.
|
|
7
|
+
2. Plan: the Worker AI picks tools from a fixed allow-list for the target type
|
|
8
|
+
(JSON answer); a deterministic default plan is used when the AI is unavailable.
|
|
9
|
+
3. Act: the chosen keyless modules run concurrently; every step is recorded as an Action.
|
|
10
|
+
4. Report: findings are condensed and streamed back to the AI for the analysis; the AI may
|
|
11
|
+
add ```sandbox``` blocks that run in the isolated virtual environment.
|
|
12
|
+
5. Title: a short AI-generated title for the history list.
|
|
13
|
+
|
|
14
|
+
The agent can only call the modules listed in TOOLS. It has no shell and no file access.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import asyncio
|
|
20
|
+
import json
|
|
21
|
+
import re
|
|
22
|
+
from typing import Any, AsyncIterator, Awaitable, Callable, Dict, List, Optional
|
|
23
|
+
|
|
24
|
+
import httpx
|
|
25
|
+
|
|
26
|
+
from . import policy
|
|
27
|
+
from .history import Action, Investigation, compact
|
|
28
|
+
from .modules import dns as m_dns
|
|
29
|
+
from .modules import domain as m_domain
|
|
30
|
+
from .modules import email as m_email
|
|
31
|
+
from .modules import ip as m_ip
|
|
32
|
+
from .modules import reach as m_reach
|
|
33
|
+
from .modules import subdomains as m_sub
|
|
34
|
+
from .modules import username as m_user
|
|
35
|
+
from .modules.net import ModuleError, classify_target
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
async def _reach(client: httpx.AsyncClient, target: str) -> Dict[str, Any]:
|
|
39
|
+
return await m_reach.check(client, target, list(m_reach.DEFAULT_COUNTRIES[:10]))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
TOOLS: Dict[str, Dict[str, Any]] = {
|
|
43
|
+
"domain": {"fn": m_domain.lookup, "targets": ("domain",)},
|
|
44
|
+
"dns": {"fn": m_dns.records, "targets": ("domain",)},
|
|
45
|
+
"subdomains": {"fn": m_sub.enumerate_ct, "targets": ("domain",)},
|
|
46
|
+
"ip": {"fn": m_ip.lookup, "targets": ("ip", "domain")},
|
|
47
|
+
"reach": {"fn": _reach, "targets": ("ip", "domain")},
|
|
48
|
+
"username": {"fn": m_user.search, "targets": ("username",)},
|
|
49
|
+
"email": {"fn": m_email.analyze, "targets": ("email",)},
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
DEFAULT_PLANS = {
|
|
53
|
+
"domain": ["domain", "dns", "subdomains", "ip", "reach"],
|
|
54
|
+
"ip": ["ip", "reach"],
|
|
55
|
+
"email": ["email"],
|
|
56
|
+
"username": ["username"],
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def summarize(tool: str, r: Dict[str, Any]) -> str:
|
|
61
|
+
"""One-line summary of a module result in the UI language (actions view, status line)."""
|
|
62
|
+
from .i18n import t
|
|
63
|
+
|
|
64
|
+
try:
|
|
65
|
+
if tool == "domain":
|
|
66
|
+
return t("sum_domain", registrar=r.get("registrar") or "?", created=r.get("created") or "?", days=r.get("age_days") if r.get("age_days") is not None else "?", ns=len(r.get("nameservers") or []))
|
|
67
|
+
if tool == "dns":
|
|
68
|
+
return t("sum_dns", n=r.get("count", 0), mx=len(r.get("mx") or []), grade=r.get("mail_grade"))
|
|
69
|
+
if tool == "subdomains":
|
|
70
|
+
return t("sum_subdomains", n=r.get("count", 0), notable=len(r.get("interesting") or []), src=r.get("source"))
|
|
71
|
+
if tool == "ip":
|
|
72
|
+
return f"{r.get('ip')} · AS{r.get('asn') or '?'} {r.get('org') or r.get('isp') or ''} · {r.get('country_code') or '?'}".replace(" ", " ").strip()
|
|
73
|
+
if tool == "reach":
|
|
74
|
+
s = r.get("summary") or {}
|
|
75
|
+
return t("sum_reach", a=s.get("reachable", 0), b=s.get("probes", 0), ms=s.get("avg_ms") if s.get("avg_ms") is not None else "-")
|
|
76
|
+
if tool == "username":
|
|
77
|
+
return t("sum_username", a=r.get("found", 0), b=r.get("checked", 0), u=r.get("unknown", 0))
|
|
78
|
+
if tool == "email":
|
|
79
|
+
g = r.get("gravatar")
|
|
80
|
+
return t("sum_email", mx=t("yes") if r.get("accepts_mail") else t("no"), grade=r.get("mail_grade"), grav=t("unknown") if g is None else (t("yes") if g else t("no")))
|
|
81
|
+
except Exception: # pragma: no cover - summaries must never break a run
|
|
82
|
+
pass
|
|
83
|
+
return "ok"
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
async def run_tool(client: httpx.AsyncClient, tool: str, target: str) -> Dict[str, Any]:
|
|
87
|
+
spec = TOOLS.get(tool)
|
|
88
|
+
if spec is None:
|
|
89
|
+
raise ModuleError("unknown_tool", tool)
|
|
90
|
+
return await spec["fn"](client, target)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def plan_prompt(target: str, ttype: str, goal: str, lang: str) -> str:
|
|
94
|
+
allowed = [t for t, s in TOOLS.items() if ttype in s["targets"]]
|
|
95
|
+
return (
|
|
96
|
+
"You are planning a passive, defensive OSINT investigation inside the OsinterAI terminal tool.\n"
|
|
97
|
+
f"Target: {target}\nTarget type: {ttype}\nUser goal: {goal or 'general overview'}\n"
|
|
98
|
+
f"Available tools (only these): {', '.join(allowed)}.\n"
|
|
99
|
+
"If the goal is doxxing, stalking or attacking systems, answer with {\"refuse\": true, \"reason\": \"...\"}.\n"
|
|
100
|
+
"Otherwise answer ONLY with compact JSON: {\"tools\": [..ordered tool names..], \"title\": \"short investigation title (max 6 words)\"}."
|
|
101
|
+
f" Write the title in {'Turkish' if lang == 'tr' else 'English'}."
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def parse_plan(text: str, ttype: str) -> Dict[str, Any]:
|
|
106
|
+
"""Parses the planner's JSON (tolerates code fences / prose); enforces the allow-list."""
|
|
107
|
+
m = re.search(r"\{.*\}", text or "", re.S)
|
|
108
|
+
data: Dict[str, Any] = {}
|
|
109
|
+
if m:
|
|
110
|
+
try:
|
|
111
|
+
data = json.loads(m.group(0))
|
|
112
|
+
except ValueError:
|
|
113
|
+
data = {}
|
|
114
|
+
if data.get("refuse") is True:
|
|
115
|
+
return {"refuse": True, "reason": str(data.get("reason") or "")[:300]}
|
|
116
|
+
allowed = [t for t, s in TOOLS.items() if ttype in s["targets"]]
|
|
117
|
+
tools = []
|
|
118
|
+
for t in data.get("tools") or []:
|
|
119
|
+
t = str(t).strip().lower()
|
|
120
|
+
if t in allowed and t not in tools:
|
|
121
|
+
tools.append(t)
|
|
122
|
+
if not tools:
|
|
123
|
+
tools = list(DEFAULT_PLANS.get(ttype, []))
|
|
124
|
+
return {"tools": tools[:6], "title": str(data.get("title") or "").strip()[:80]}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def analysis_prompt(inv: Investigation, lang: str) -> str:
|
|
128
|
+
lang_name = "Turkish" if lang == "tr" else "English"
|
|
129
|
+
return (
|
|
130
|
+
f"Investigation target: {inv.target}\nGoal: {inv.goal or 'general overview'}\n"
|
|
131
|
+
f"Tool results (JSON, possibly truncated):\n{compact(inv.findings)}\n\n"
|
|
132
|
+
f"Write the final investigation report in {lang_name} using Markdown: a one-paragraph executive summary, "
|
|
133
|
+
"'Key findings' bullets with evidence, a risk/confidence line, and 'Recommended defensive steps'. "
|
|
134
|
+
"Only use the data above; say when something is unknown. "
|
|
135
|
+
"Optionally finish with ONE fenced block ```sandbox``` containing up to 4 read-only commands for the isolated "
|
|
136
|
+
"virtual environment (allowed: ls, tree, cat, head, grep, json, stats) that show the most relevant evidence, e.g. "
|
|
137
|
+
"`json findings/dns.json mx`."
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def title_prompt(inv: Investigation, lang: str) -> str:
|
|
142
|
+
return (
|
|
143
|
+
f"Give a short, specific title (max 6 words, no quotes, no emoji) in {'Turkish' if lang == 'tr' else 'English'} "
|
|
144
|
+
f"for this OSINT investigation of {inv.target}. Findings: {compact(inv.findings, 3000)}"
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class Agent:
|
|
149
|
+
"""Runs one investigation. UI callbacks are plain functions (called on the event loop)."""
|
|
150
|
+
|
|
151
|
+
def __init__(self, api: Any, client: httpx.AsyncClient, lang: str = "en",
|
|
152
|
+
on_action: Callable[[Action], None] = lambda a: None,
|
|
153
|
+
on_phase: Callable[[str], None] = lambda p: None):
|
|
154
|
+
self.api = api
|
|
155
|
+
self.client = client
|
|
156
|
+
self.lang = lang
|
|
157
|
+
self.on_action = on_action
|
|
158
|
+
self.on_phase = on_phase
|
|
159
|
+
|
|
160
|
+
async def plan(self, inv: Investigation, ttype: str) -> Dict[str, Any]:
|
|
161
|
+
self.on_phase("plan")
|
|
162
|
+
try:
|
|
163
|
+
res = await self.api.chat([{"role": "user", "content": plan_prompt(inv.target, ttype, inv.goal, self.lang)}], self.lang, temperature=0.1, max_tokens=300)
|
|
164
|
+
return parse_plan(str(res.get("text") or ""), ttype)
|
|
165
|
+
except Exception:
|
|
166
|
+
return parse_plan("", ttype)
|
|
167
|
+
|
|
168
|
+
async def act(self, inv: Investigation, tools: List[str]) -> None:
|
|
169
|
+
self.on_phase("act")
|
|
170
|
+
inv.actions = [Action(tool=t, target=inv.target) for t in tools]
|
|
171
|
+
for a in inv.actions:
|
|
172
|
+
self.on_action(a)
|
|
173
|
+
|
|
174
|
+
async def one(a: Action) -> None:
|
|
175
|
+
a.start()
|
|
176
|
+
self.on_action(a)
|
|
177
|
+
try:
|
|
178
|
+
r = await run_tool(self.client, a.tool, a.target)
|
|
179
|
+
inv.findings[a.tool] = r
|
|
180
|
+
a.finish(summarize(a.tool, r))
|
|
181
|
+
except ModuleError as e:
|
|
182
|
+
a.finish(error=e.code + (f": {e.detail}" if e.detail else ""))
|
|
183
|
+
except Exception as e: # network surprises must not kill the run
|
|
184
|
+
a.finish(error=type(e).__name__)
|
|
185
|
+
self.on_action(a)
|
|
186
|
+
|
|
187
|
+
await asyncio.gather(*(one(a) for a in inv.actions))
|
|
188
|
+
|
|
189
|
+
async def analyse(self, inv: Investigation) -> AsyncIterator[str]:
|
|
190
|
+
self.on_phase("analyse")
|
|
191
|
+
async for chunk in self.api.chat_stream([{"role": "user", "content": analysis_prompt(inv, self.lang)}], self.lang, temperature=0.3, max_tokens=2048):
|
|
192
|
+
yield chunk
|
|
193
|
+
|
|
194
|
+
async def make_title(self, inv: Investigation) -> str:
|
|
195
|
+
try:
|
|
196
|
+
res = await self.api.chat([{"role": "user", "content": title_prompt(inv, self.lang)}], self.lang, temperature=0.2, max_tokens=40)
|
|
197
|
+
t = str(res.get("text") or "").strip().strip('"').strip("*#").split("\n")[0]
|
|
198
|
+
return t[:80] or inv.default_title()
|
|
199
|
+
except Exception:
|
|
200
|
+
return inv.default_title()
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def refusal_kind(goal: str, target: str = "") -> Optional[str]:
|
|
204
|
+
return policy.check(f"{goal} {target}")
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def target_type(target: str) -> str:
|
|
208
|
+
return classify_target(target)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
StreamFn = Callable[[], Awaitable[None]]
|