Skip to content
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers = [
]
dependencies = [
"chardet>=7.4.3",
"psutil>=7.0.0",
"requests>=2.34.2",
"rich>=15.0.0",
"scapy>=2.7.1rc1; python_version < '4'",
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Core dependencies for wifite2
# These should match pyproject.toml [project.dependencies]
chardet>=7.4.3
psutil>=7.0.0
requests>=2.34.2
rich>=15.0.0
scapy>=2.7.1rc1; python_version < '4'
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[install]
install_scripts=/usr/sbin

[tool:pytest]
flake8-ignore = E201 E231
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
except ImportError:
raise ImportError("setuptools is required to install wifite2")

from wifite.config import Configuration

with open('README.md', 'r', encoding='utf-8') as fh:
long_description = fh.read()

Expand All @@ -29,7 +27,7 @@ def _read_requirements():

setup(
name='wifite2',
version=Configuration.version,
version='2.9.9-beta',
author='kimocoder',
author_email='christian@aircrack-ng.org',
url='https://github.com/kimocoder/wifite2',
Expand All @@ -38,7 +36,6 @@ def _read_requirements():
'': ['wordlists/*.txt']
},
license='GNU GPLv2',
scripts=['bin/wifite'],
python_requires='>=3.10',
install_requires=_read_requirements(),
# Dev/test extras are defined once in pyproject.toml
Expand Down
5 changes: 2 additions & 3 deletions tests/demo_statistics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Demonstration of client monitoring and statistics tracking.
Expand Down Expand Up @@ -31,7 +30,7 @@ def demo_client_connection():
client.credential_submitted = True
client.credential_valid = True

print(f"\nAfter credential submission:")
print("\nAfter credential submission:")
print(f" Credentials submitted: {client.credential_submitted}")
print(f" Credentials valid: {client.credential_valid}")
print(f" Connection duration: {client.connection_duration():.2f}s")
Expand Down Expand Up @@ -59,7 +58,7 @@ def demo_attack_statistics():
# Second client connects
time.sleep(0.3)
stats.record_client_connect("11:22:33:44:55:66")
print(f" Client 2 connected")
print(" Client 2 connected")

# First client submits wrong password
time.sleep(0.5)
Expand Down
3 changes: 0 additions & 3 deletions tests/test_Airmon.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import unittest
from wifite.tools.airmon import Airmon

sys.path.insert(0, '..')


class TestAirmon(unittest.TestCase):
Expand Down
3 changes: 0 additions & 3 deletions tests/test_Airodump.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from wifite.tools.airodump import Airodump
import unittest

sys.path.insert(0, '..')


class TestAirodump(unittest.TestCase):
Expand Down
3 changes: 0 additions & 3 deletions tests/test_Handshake.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import unittest

import pytest

from wifite.model.handshake import Handshake
from wifite.util.process import Process

sys.path.insert(0, '..')

pytestmark = pytest.mark.timeout(30)

Expand Down
1 change: 0 additions & 1 deletion tests/test_Target.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import unittest
from wifite.tools.airodump import Airodump
Expand Down
4 changes: 1 addition & 3 deletions tests/test_adaptive_deauth_integration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Integration tests for adaptive deauth in Evil Twin attack.
Expand All @@ -9,8 +8,7 @@
"""

import unittest
import time
from unittest.mock import Mock, MagicMock, patch, call
from unittest.mock import Mock, patch


class TestAdaptiveDeauthIntegration(unittest.TestCase):
Expand Down
3 changes: 1 addition & 2 deletions tests/test_attack_view_start.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Tests to verify attack views start properly and don't conflict with scanner view.
"""

import unittest
from unittest.mock import Mock, MagicMock, patch
from unittest.mock import Mock


class MockTarget:
Expand Down
3 changes: 1 addition & 2 deletions tests/test_channel_synchronization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Unit tests for channel synchronization in dual interface WPA attacks.
Expand All @@ -12,7 +11,7 @@

import unittest
import sys
from unittest.mock import Mock, patch, MagicMock, call
from unittest.mock import Mock, patch, MagicMock

# Mock sys.argv to prevent argparse from reading test arguments
original_argv = sys.argv
Expand Down
5 changes: 1 addition & 4 deletions tests/test_cleanup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Tests for cleanup utilities.
Expand All @@ -8,11 +7,9 @@
import unittest
import tempfile
import os
from unittest.mock import Mock, patch, MagicMock
from unittest.mock import Mock, patch

# Add parent directory to path
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from wifite.util.cleanup import CleanupManager, kill_orphaned_processes, check_conflicting_processes

Expand Down
3 changes: 0 additions & 3 deletions tests/test_client_monitor.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Tests for client monitoring and statistics tracking.
"""

import unittest
import time
import tempfile
import os
from wifite.util.client_monitor import ClientConnection, ClientMonitor, AttackStatistics


Expand Down
1 change: 0 additions & 1 deletion tests/test_config_refactor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the refactored config package structure.

Verifies that:
Expand Down
6 changes: 2 additions & 4 deletions tests/test_config_restoration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Tests for configuration restoration from session.
Expand All @@ -8,8 +7,7 @@
import unittest
import tempfile
import shutil
import os
from unittest.mock import Mock, patch, MagicMock
from unittest.mock import Mock, patch
from wifite.util.session import SessionManager, SessionState, TargetState


Expand Down Expand Up @@ -258,7 +256,7 @@ def test_restore_with_missing_config_values(self):
)

# Restore configuration
result = self.session_mgr.restore_configuration(session, self.config)
self.session_mgr.restore_configuration(session, self.config)

# Original values should be preserved when not in session
self.assertEqual(self.config.wordlist, original_wordlist)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_eviltwin_attack_view.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Tests for Evil Twin Attack View TUI integration.
"""

import unittest
from unittest.mock import Mock, MagicMock
from unittest.mock import Mock
import time


Expand Down
21 changes: 9 additions & 12 deletions tests/test_eviltwin_e2e.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
End-to-end simulation tests for Evil Twin attack.
Expand All @@ -12,12 +11,10 @@
"""

import unittest
import tempfile
import shutil
import os
import time
import sys
from unittest.mock import Mock, patch, MagicMock
from unittest.mock import Mock, patch

# Mock sys.argv to prevent argparse from reading test arguments
original_argv = sys.argv
Expand All @@ -32,7 +29,7 @@
Configuration.eviltwin_template = 'generic'
Configuration.eviltwin_deauth_interval = 5

from wifite.attack.eviltwin import EvilTwin, AttackState
from wifite.attack.eviltwin import EvilTwin
from wifite.model.target import Target
from wifite.attack.portal.templates import TemplateRenderer
from wifite.util.credential_validator import CredentialValidator
Expand Down Expand Up @@ -265,7 +262,7 @@ def test_standard_alphanumeric_password(self):
try:
self.assertTrue(os.path.exists(config_file))

with open(config_file, 'r') as f:
with open(config_file) as f:
content = f.read()

self.assertIn('psk="Password123"', content)
Expand All @@ -289,7 +286,7 @@ def test_special_characters_password(self):
try:
self.assertTrue(os.path.exists(config_file))

with open(config_file, 'r') as f:
with open(config_file) as f:
content = f.read()

self.assertIn(f'psk="{password}"', content)
Expand All @@ -312,7 +309,7 @@ def test_unicode_password(self):
try:
self.assertTrue(os.path.exists(config_file))

with open(config_file, 'r') as f:
with open(config_file) as f:
content = f.read()

# Password should be in config
Expand All @@ -329,7 +326,7 @@ def test_minimum_length_password(self):
try:
self.assertTrue(os.path.exists(config_file))

with open(config_file, 'r') as f:
with open(config_file) as f:
content = f.read()

self.assertIn('psk="12345678"', content)
Expand All @@ -345,7 +342,7 @@ def test_maximum_length_password(self):
try:
self.assertTrue(os.path.exists(config_file))

with open(config_file, 'r') as f:
with open(config_file) as f:
content = f.read()

self.assertIn(f'psk="{password}"', content)
Expand All @@ -361,7 +358,7 @@ def test_spaces_in_password(self):
try:
self.assertTrue(os.path.exists(config_file))

with open(config_file, 'r') as f:
with open(config_file) as f:
content = f.read()

self.assertIn('psk="My Password 123"', content)
Expand All @@ -377,7 +374,7 @@ def test_quotes_in_password(self):
try:
self.assertTrue(os.path.exists(config_file))

with open(config_file, 'r') as f:
with open(config_file) as f:
content = f.read()

# Password should be in config (may be escaped)
Expand Down
5 changes: 1 addition & 4 deletions tests/test_eviltwin_session.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Tests for Evil Twin session management integration.
Expand All @@ -9,12 +8,10 @@
import tempfile
import shutil
import os
from unittest.mock import Mock, MagicMock
from unittest.mock import Mock

from wifite.util.session import (
SessionManager,
SessionState,
TargetState,
EvilTwinAttackState,
EvilTwinClientState,
EvilTwinCredentialAttempt
Expand Down
9 changes: 3 additions & 6 deletions tests/test_eviltwin_unit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Unit tests for Evil Twin attack components.
Expand All @@ -9,8 +8,6 @@

import unittest
import os
import tempfile
from unittest.mock import Mock, patch, MagicMock

import pytest

Expand Down Expand Up @@ -107,7 +104,7 @@ def test_hostapd_config_file_creation(self):
self.assertTrue(os.path.exists(config_file))

# Check file content
with open(config_file, 'r') as f:
with open(config_file) as f:
content = f.read()

self.assertIn('interface=wlan0', content)
Expand Down Expand Up @@ -177,7 +174,7 @@ def test_dnsmasq_config_file_creation(self):
self.assertTrue(os.path.exists(dnsmasq.lease_file))

# Check config content
with open(config_file, 'r') as f:
with open(config_file) as f:
content = f.read()

self.assertIn('interface=wlan0', content)
Expand Down Expand Up @@ -340,7 +337,7 @@ def test_wpa_config_generation(self):
self.assertTrue(os.path.exists(config_file))

# Check content
with open(config_file, 'r') as f:
with open(config_file) as f:
content = f.read()

self.assertIn('ssid="TestNetwork"', content)
Expand Down
Loading