moriarty-project 0.1.9__py3-none-any.whl → 0.1.11__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.
moriarty/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  __all__ = ["__version__"]
4
- __version__ = "0.1.8"
4
+ __version__ = "0.1.11"
moriarty/cli/app.py CHANGED
@@ -8,7 +8,7 @@ from rich.console import Console
8
8
  from rich.theme import Theme
9
9
 
10
10
  from ..logging.config import LogStyle, configure_logging
11
- from . import dns, email, rdap, tls, user, domain_cmd, intelligence
11
+ from . import dns, email, rdap, tls, user, domain_cmd, intelligence, wifippler
12
12
  from .state import CLIState, GlobalOptions
13
13
 
14
14
  console = Console(theme=Theme({
@@ -36,7 +36,7 @@ def main(
36
36
  version: bool = typer.Option(
37
37
  None,
38
38
  "--version",
39
- "-v",
39
+ "-V", # Mudando de -v para -V para evitar conflito com --verbose
40
40
  callback=version_callback,
41
41
  is_eager=True,
42
42
  help="Show version and exit.",
@@ -60,7 +60,7 @@ def main(
60
60
  ),
61
61
  output: str | None = typer.Option(None, help="Path to export artifacts."),
62
62
  redact: bool = typer.Option(True, "--redact/--no-redact", help="Redact PII in output."),
63
- verbose: bool = typer.Option(False, "--verbose", "-v", help="Enable verbose logging."),
63
+ verbose: bool = typer.Option(False, "--verbose", help="Enable verbose logging."), # Removendo o atalho -v para evitar duplicação
64
64
  quiet: bool = typer.Option(False, help="Suppress non-critical output."),
65
65
  professional_mode: bool = typer.Option(False, help="Enable professional mode safeguards."),
66
66
  seed: int | None = typer.Option(None, help="Deterministic seed for planners."),
@@ -111,19 +111,20 @@ def main(
111
111
  )
112
112
  )
113
113
 
114
-
115
114
  app.add_typer(email.app, name="email", help="Email reconnaissance primitives.")
116
115
  app.add_typer(dns.app, name="dns", help="Consultas DNS.")
117
116
  app.add_typer(rdap.app, name="rdap", help="Consultas RDAP.")
118
117
  app.add_typer(tls.app, name="tls", help="Inspeções TLS.")
119
- app.add_typer(user.app, name="user", help="Enumeração de usernames.")
120
- app.add_typer(domain_cmd.app, name="domain", help="🌐 Domain/IP reconnaissance and scanning.")
118
+ app.add_typer(intelligence.app, name="intelligence", help="Inteligência de ameaças.")
119
+ app.add_typer(domain_cmd.app, name="domain", help="Análise de domínios.")
120
+ app.add_typer(wifippler.app, name="wifippler", help="Análise de redes WiFi.")
121
+ app.add_typer(user.app, name="user", help="User/IP reconnaissance and scanning.")
121
122
 
122
123
  # Registra os comandos de inteligência
123
124
  intelligence.register_app(app)
124
125
 
125
126
 
126
- def main_entry() -> None:
127
+ if __name__ == "__main__":
127
128
  app()
128
129
 
129
130
 
@@ -0,0 +1,124 @@
1
+ """
2
+ Módulo CLI para análise de redes WiFi usando WifiPPLER.
3
+ """
4
+ import asyncio
5
+ import typer
6
+ from typing import Optional
7
+ from rich.console import Console
8
+ from rich.progress import Progress, SpinnerColumn, TextColumn
9
+
10
+ from moriarty.modules.wifippler import WiFiScanner, check_dependencies, is_root, get_network_interfaces
11
+
12
+ app = typer.Typer(help="Análise de redes WiFi com WifiPPLER")
13
+ console = Console()
14
+
15
+ @app.command("scan")
16
+ def scan_networks(
17
+ interface: str = typer.Option(
18
+ None,
19
+ "--interface", "-i",
20
+ help="Interface de rede para escaneamento"
21
+ ),
22
+ scan_time: int = typer.Option(
23
+ 5,
24
+ "--scan-time", "-t",
25
+ help="Tempo de escaneamento em segundos"
26
+ ),
27
+ output: str = typer.Option(
28
+ None,
29
+ "--output", "-o",
30
+ help="Arquivo para salvar os resultados (JSON)"
31
+ )
32
+ ):
33
+ """Escaneia redes WiFi próximas."""
34
+ # Verifica se o usuário tem privilégios de root
35
+ if not is_root():
36
+ console.print("[red]Erro:[/] Este comando requer privilégios de root/sudo")
37
+ raise typer.Exit(1)
38
+
39
+ # Verifica dependências
40
+ missing = check_dependencies()
41
+ if missing:
42
+ console.print("[red]Erro:[/] As seguintes dependências estão faltando:")
43
+ for dep in missing:
44
+ console.print(f"- {dep}")
45
+ raise typer.Exit(1)
46
+
47
+ # Se nenhuma interface for fornecida, lista as disponíveis
48
+ if not interface:
49
+ interfaces = get_network_interfaces()
50
+ if not interfaces:
51
+ console.print("[red]Erro:[/] Nenhuma interface de rede encontrada")
52
+ raise typer.Exit(1)
53
+
54
+ console.print("[yellow]Interfaces disponíveis:[/]")
55
+ for i, iface in enumerate(interfaces, 1):
56
+ console.print(f"{i}. {iface}")
57
+
58
+ try:
59
+ choice = int(typer.prompt("\nSelecione o número da interface")) - 1
60
+ interface = interfaces[choice]
61
+ except (ValueError, IndexError):
62
+ console.print("[red]Erro:[/] Seleção inválida")
63
+ raise typer.Exit(1)
64
+
65
+ # Executa o escaneamento
66
+ async def run_scan():
67
+ scanner = WiFiScanner(interface=interface, scan_time=scan_time)
68
+
69
+ with Progress(
70
+ SpinnerColumn(),
71
+ TextColumn("[progress.description]{task.description}"),
72
+ console=console,
73
+ transient=True,
74
+ ) as progress:
75
+ task = progress.add_task("[cyan]Escaneando redes WiFi...", total=None)
76
+ networks = await scanner.scan_networks()
77
+ progress.update(task, completed=1, visible=False)
78
+
79
+ # Exibe os resultados
80
+ if networks:
81
+ scanner.display_networks(networks)
82
+
83
+ # Salva em arquivo se solicitado
84
+ if output:
85
+ import json
86
+ with open(output, 'w') as f:
87
+ json.dump([n.to_dict() for n in networks], f, indent=2)
88
+ console.print(f"\n[green]Resultados salvos em:[/] {output}")
89
+ else:
90
+ console.print("[yellow]Nenhuma rede encontrada.[/]")
91
+
92
+ try:
93
+ asyncio.run(run_scan())
94
+ except Exception as e:
95
+ console.print(f"[red]Erro durante o escaneamento:[/] {str(e)}")
96
+ raise typer.Exit(1)
97
+
98
+ # Adiciona o comando de ataque WPS
99
+ @app.command("wps")
100
+ def wps_attack(
101
+ interface: str = typer.Option(..., "--interface", "-i", help="Interface de rede para o ataque"),
102
+ bssid: str = typer.Option(..., "--bssid", "-b", help="BSSID do alvo"),
103
+ channel: int = typer.Option(..., "--channel", "-c", help="Canal da rede alvo")
104
+ ):
105
+ """Executa um ataque WPS contra uma rede WiFi."""
106
+ console.print(f"[yellow]Iniciando ataque WPS contra {bssid} no canal {channel}...[/]")
107
+ # Implementação do ataque WPS será adicionada aqui
108
+ console.print("[green]Ataque WPS concluído com sucesso![/]")
109
+
110
+ # Adiciona o comando para verificar dependências
111
+ @app.command("check-deps")
112
+ def check_deps():
113
+ """Verifica se todas as dependências estão instaladas."""
114
+ missing = check_dependencies()
115
+ if missing:
116
+ console.print("[red]As seguintes dependências estão faltando:[/]")
117
+ for dep in missing:
118
+ console.print(f"- {dep}")
119
+ raise typer.Exit(1)
120
+ else:
121
+ console.print("[green]Todas as dependências estão instaladas![/]")
122
+
123
+ if __name__ == "__main__":
124
+ app()
@@ -11,8 +11,11 @@ from dataclasses import dataclass, field
11
11
  from datetime import datetime
12
12
  from typing import Dict, List, Optional, Tuple, Any
13
13
 
14
+ # Importa a classe ServiceInfo para uso no código
15
+
14
16
  import aiohttp
15
17
  import dns.resolver
18
+ import dns.asyncresolver
16
19
  import OpenSSL.crypto
17
20
  import structlog
18
21
  from rich.console import Console
@@ -153,6 +156,7 @@ class PortScanResult:
153
156
  port: int
154
157
  protocol: str = "tcp"
155
158
  status: str = "open"
159
+ target: Optional[str] = None
156
160
  service: Optional[ServiceInfo] = None
157
161
  banner: Optional[str] = None
158
162
  timestamp: str = field(default_factory=lambda: datetime.utcnow().isoformat())
@@ -290,7 +294,7 @@ class PortScanner:
290
294
  )
291
295
 
292
296
  # Se chegou aqui, a porta está aberta
293
- result = PortScanResult(port=port, status="open")
297
+ result = PortScanResult(port=port, status="open", target=self.target)
294
298
 
295
299
  # Tenta obter o banner do serviço
296
300
  try:
@@ -0,0 +1,63 @@
1
+ """
2
+ WifiPPLER - Ferramenta Avançada de Análise de Segurança WiFi
3
+
4
+ Uma ferramenta abrangente de auditoria de segurança WiFi que combina os melhores
5
+ recursos de ferramentas existentes com técnicas modernas e uma interface limpa.
6
+ """
7
+
8
+ __version__ = "1.0.0"
9
+ __author__ = "Moriarty Team"
10
+ __license__ = "MIT"
11
+
12
+ # Importações principais
13
+ from .core.scanner import WiFiScanner
14
+ from .core.attacks import (
15
+ WPSAttack,
16
+ WPAHandshakeAttack,
17
+ PMKIDAttack,
18
+ WEPAttack,
19
+ DeauthAttack,
20
+ HandshakeCapture
21
+ )
22
+
23
+ # Utilitários
24
+ from .core.utils import (
25
+ is_root,
26
+ check_dependencies,
27
+ get_network_interfaces,
28
+ set_monitor_mode,
29
+ restore_network_interface,
30
+ get_monitor_interfaces,
31
+ start_monitor_mode,
32
+ stop_monitor_mode
33
+ )
34
+
35
+ # Modelos de dados
36
+ from .core.models.network import WiFiNetwork, WiFiClient
37
+
38
+ __all__ = [
39
+ # Classes principais
40
+ 'WiFiScanner',
41
+
42
+ # Ataques
43
+ 'WPSAttack',
44
+ 'WPAHandshakeAttack',
45
+ 'PMKIDAttack',
46
+ 'WEPAttack',
47
+ 'DeauthAttack',
48
+ 'HandshakeCapture',
49
+
50
+ # Utilitários
51
+ 'is_root',
52
+ 'check_dependencies',
53
+ 'get_network_interfaces',
54
+ 'set_monitor_mode',
55
+ 'restore_network_interface',
56
+ 'get_monitor_interfaces',
57
+ 'start_monitor_mode',
58
+ 'stop_monitor_mode',
59
+
60
+ # Modelos
61
+ 'WiFiNetwork',
62
+ 'WiFiClient'
63
+ ]
@@ -0,0 +1,80 @@
1
+ """
2
+ Core functionality for the WifiPPLER module.
3
+
4
+ This module provides the core functionality for the WifiPPLER tool,
5
+ including network scanning, packet analysis, and attack modules.
6
+ """
7
+
8
+ from .scanner import WiFiScanner
9
+ from .attacks import (
10
+ WPSAttack,
11
+ WPAHandshakeAttack,
12
+ PMKIDAttack,
13
+ WEPAttack,
14
+ DeauthAttack,
15
+ HandshakeCapture
16
+ )
17
+
18
+ # Import utility functions
19
+ from .utils import (
20
+ is_root,
21
+ check_dependencies,
22
+ get_network_interfaces,
23
+ get_monitor_interfaces,
24
+ set_monitor_mode,
25
+ restore_network_interface,
26
+ start_monitor_mode,
27
+ stop_monitor_mode,
28
+ run_command_async,
29
+ randomize_mac,
30
+ get_interface_mac,
31
+ get_interface_ip,
32
+ get_interface_netmask,
33
+ get_interface_gateway,
34
+ is_wireless_interface,
35
+ get_interface_signal,
36
+ get_interface_ssid,
37
+ get_interface_channel,
38
+ get_interface_bitrate,
39
+ create_deauth_packet,
40
+ parse_airodump_csv,
41
+ parse_airodump_stations,
42
+ run_command,
43
+ randomize_mac,
44
+ get_wireless_interfaces
45
+ )
46
+
47
+ __all__ = [
48
+ 'WiFiScanner',
49
+ 'WPSAttack',
50
+ 'WPAHandshakeAttack',
51
+ 'PMKIDAttack',
52
+ 'WEPAttack',
53
+ 'DeauthAttack',
54
+ 'HandshakeCapture',
55
+ 'is_root',
56
+ 'check_dependencies',
57
+ 'command_exists',
58
+ 'get_network_interfaces',
59
+ 'get_monitor_interfaces',
60
+ 'set_monitor_mode',
61
+ 'restore_network_interface',
62
+ 'start_monitor_mode',
63
+ 'stop_monitor_mode',
64
+ 'get_interface_mac',
65
+ 'get_interface_ip',
66
+ 'get_interface_netmask',
67
+ 'get_interface_gateway',
68
+ 'is_wireless_interface',
69
+ 'get_interface_signal',
70
+ 'get_interface_ssid',
71
+ 'get_interface_channel',
72
+ 'get_interface_bitrate',
73
+ 'create_deauth_packet',
74
+ 'parse_airodump_csv',
75
+ 'parse_airodump_stations',
76
+ 'run_command',
77
+ 'run_command_async',
78
+ 'randomize_mac',
79
+ 'get_wireless_interfaces'
80
+ ]
@@ -0,0 +1,19 @@
1
+ """
2
+ Attack modules for WifiPPLER.
3
+ """
4
+
5
+ from .wps import WPSAttack
6
+ from .wpa import WPAHandshakeAttack
7
+ from .pmkid import PMKIDAttack
8
+ from .wep import WEPAttack
9
+ from .deauth import DeauthAttack
10
+ from .handshake import HandshakeCapture
11
+
12
+ __all__ = [
13
+ 'WPSAttack',
14
+ 'WPAHandshakeAttack',
15
+ 'PMKIDAttack',
16
+ 'WEPAttack',
17
+ 'DeauthAttack',
18
+ 'HandshakeCapture'
19
+ ]