Skip to content

Commit 1aae8bd

Browse files
authored
Update build exe, use webview and hide console
1 parent 7bb0e53 commit 1aae8bd

File tree

14 files changed

+1048
-395
lines changed

14 files changed

+1048
-395
lines changed

Deadnet_Attacker/DeadNet.spec

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
block_cipher = None
4+
5+
# Collect all files from web folder
6+
web_datas = []
7+
web_datas.append(('web/templates/*', 'web/templates'))
8+
web_datas.append(('web/static/css/*', 'web/static/css'))
9+
web_datas.append(('web/static/js/*', 'web/static/js'))
10+
11+
# Collect utils module
12+
utils_datas = [('utils/*', 'utils')]
13+
14+
a = Analysis(
15+
['main_webview.py'],
16+
pathex=[],
17+
binaries=[],
18+
datas=web_datas + utils_datas,
19+
hiddenimports=[
20+
'scapy.all',
21+
'scapy.layers.inet',
22+
'scapy.layers.inet6',
23+
'scapy.layers.l2',
24+
'netifaces2',
25+
'flask',
26+
'flask_cors',
27+
'webview',
28+
'utils',
29+
'utils.attacker',
30+
'utils.api_routes',
31+
'utils.defines',
32+
'utils.misc_utils',
33+
'utils.network_utils',
34+
'utils.output_manager',
35+
],
36+
hookspath=[],
37+
hooksconfig={},
38+
runtime_hooks=[],
39+
excludes=[],
40+
win_no_prefer_redirects=False,
41+
win_private_assemblies=False,
42+
cipher=block_cipher,
43+
noarchive=False,
44+
)
45+
46+
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
47+
48+
exe = EXE(
49+
pyz,
50+
a.scripts,
51+
a.binaries,
52+
a.zipfiles,
53+
a.datas,
54+
[],
55+
name='DeadNet_Attacker',
56+
debug=False,
57+
bootloader_ignore_signals=False,
58+
strip=False,
59+
upx=True,
60+
upx_exclude=[],
61+
runtime_tmpdir=None,
62+
console=True, # Keep console=True, will hide programmatically after GUI launch
63+
disable_windowed_traceback=False,
64+
argv_emulation=False,
65+
target_arch=None,
66+
codesign_identity=None,
67+
entitlements_file=None,
68+
icon=None,
69+
uac_admin=True, # Request admin privileges
70+
)

Deadnet_Attacker/build_exe.cmd

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
@echo off
2+
REM Build script for DeadNet Attacker Executable
3+
REM This script compiles the application into a portable executable
4+
5+
REM Change to the script's directory
6+
cd /d "%~dp0"
7+
8+
echo.
9+
echo ========================================
10+
echo DeadNet Attacker - Build Script
11+
echo ========================================
12+
echo.
13+
echo Current directory: %CD%
14+
echo.
15+
16+
REM Check if running as administrator (warn if admin)
17+
net session >nul 2>&1
18+
if %errorLevel% equ 0 (
19+
echo [WARNING] Running as administrator!
20+
echo PyInstaller should NOT be run as admin.
21+
echo This may cause issues with PyInstaller 7.0+
22+
echo.
23+
echo Press Ctrl+C to cancel, or
24+
pause
25+
)
26+
27+
echo [+] Checking Python installation...
28+
python --version >nul 2>&1
29+
if %errorLevel% neq 0 (
30+
echo [ERROR] Python not found! Please install Python 3.8 or newer.
31+
pause
32+
exit /b 1
33+
)
34+
35+
echo [+] Installing/Updating dependencies...
36+
python -m pip install --upgrade pip
37+
python -m pip install -r requirements-webview.txt
38+
39+
if %errorLevel% neq 0 (
40+
echo [ERROR] Failed to install dependencies!
41+
pause
42+
exit /b 1
43+
)
44+
45+
echo.
46+
echo [+] Cleaning previous build artifacts...
47+
if exist "build" rmdir /s /q "build" 2>nul
48+
if exist "dist" rmdir /s /q "dist" 2>nul
49+
for /d /r . %%d in (__pycache__) do @if exist "%%d" rmdir /s /q "%%d" 2>nul
50+
del /s /q *.pyc 2>nul
51+
52+
echo [+] Building executable with PyInstaller...
53+
echo [*] This may take several minutes...
54+
echo.
55+
56+
pyinstaller --clean DeadNet.spec
57+
58+
if %errorLevel% neq 0 (
59+
echo.
60+
echo [ERROR] Build failed!
61+
pause
62+
exit /b 1
63+
)
64+
65+
echo.
66+
echo ========================================
67+
echo [SUCCESS] Build completed!
68+
echo ========================================
69+
echo.
70+
echo The executable is located at:
71+
echo dist\DeadNet_Attacker.exe
72+
echo.
73+
echo You can now run it as a portable application.
74+
echo Remember: This tool requires administrator privileges!
75+
echo.
76+
pause

Deadnet_Attacker/cleanup_build.cmd

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
@echo off
2+
REM Cleanup script for DeadNet Attacker build artifacts
3+
REM This removes all build-related temporary files and folders
4+
5+
REM Change to the script's directory
6+
cd /d "%~dp0"
7+
8+
echo.
9+
echo ========================================
10+
echo DeadNet Attacker - Build Cleanup
11+
echo ========================================
12+
echo.
13+
echo This will remove all build artifacts:
14+
echo - build/ folder
15+
echo - dist/ folder
16+
echo - __pycache__/ folders
17+
echo - *.pyc files
18+
echo - *.pyo files
19+
echo - *.spec backup files
20+
echo - PyInstaller cache
21+
echo.
22+
echo NOTE: venv/ folder will NOT be removed
23+
echo.
24+
echo Current directory: %CD%
25+
echo.
26+
27+
choice /C YN /M "Do you want to proceed with cleanup"
28+
if %errorLevel% neq 1 (
29+
echo.
30+
echo [*] Cleanup cancelled.
31+
pause
32+
exit /b 0
33+
)
34+
35+
echo.
36+
echo [*] Starting cleanup...
37+
echo.
38+
39+
REM Remove build folder
40+
if exist "build" (
41+
echo [+] Removing build/ folder...
42+
rmdir /s /q "build" 2>nul
43+
if %errorLevel% equ 0 (
44+
echo [+] build/ removed successfully
45+
) else (
46+
echo [!] Could not remove build/ folder
47+
)
48+
) else (
49+
echo [-] build/ folder not found
50+
)
51+
52+
REM Remove dist folder
53+
if exist "dist" (
54+
echo [+] Removing dist/ folder...
55+
rmdir /s /q "dist" 2>nul
56+
if %errorLevel% equ 0 (
57+
echo [+] dist/ removed successfully
58+
) else (
59+
echo [!] Could not remove dist/ folder
60+
)
61+
) else (
62+
echo [-] dist/ folder not found
63+
)
64+
65+
REM Remove __pycache__ folders
66+
echo [+] Removing __pycache__/ folders...
67+
for /d /r . %%d in (__pycache__) do @if exist "%%d" (
68+
echo [+] Removing: %%d
69+
rmdir /s /q "%%d" 2>nul
70+
)
71+
72+
REM Remove .pyc files
73+
echo [+] Removing .pyc files...
74+
del /s /q *.pyc 2>nul
75+
if %errorLevel% equ 0 (
76+
echo [+] .pyc files removed
77+
)
78+
79+
REM Remove .pyo files
80+
echo [+] Removing .pyo files...
81+
del /s /q *.pyo 2>nul
82+
if %errorLevel% equ 0 (
83+
echo [+] .pyo files removed
84+
)
85+
86+
REM Remove .spec backup files (but keep DeadNet.spec!)
87+
echo [+] Removing .spec backup files...
88+
if exist "*.spec.bak" (
89+
del /q *.spec.bak 2>nul
90+
echo [+] .spec backup files removed
91+
) else (
92+
echo [-] No .spec backup files found
93+
)
94+
95+
REM Remove PyInstaller cache
96+
if exist "%LOCALAPPDATA%\pyinstaller" (
97+
echo [+] Removing PyInstaller cache...
98+
rmdir /s /q "%LOCALAPPDATA%\pyinstaller" 2>nul
99+
if %errorLevel% equ 0 (
100+
echo [+] PyInstaller cache removed
101+
)
102+
)
103+
104+
echo.
105+
echo ========================================
106+
echo [SUCCESS] Cleanup completed!
107+
echo ========================================
108+
echo.
109+
echo Build artifacts have been removed.
110+
echo Your venv/ folder remains intact.
111+
echo You can now run build_exe.cmd for a fresh build.
112+
echo.
113+
pause

Deadnet_Attacker/launcher.cmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ echo Windows Port ^& Web UI: @risuncode
104104
echo.
105105
echo Starting web control panel...
106106
echo Open: http://localhost:5000
107-
echo.
108-
echo Press R to restart the application
107+
echo.
109108
echo.
110109

111110
REM Start the application
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
@echo off
2+
REM Launcher script for DeadNet Attacker (WebView Version)
3+
REM This launches the app with integrated webview (no browser needed)
4+
5+
REM Change to the script's directory
6+
cd /d "%~dp0"
7+
8+
REM Check if running as administrator
9+
net session >nul 2>&1
10+
if %errorLevel% neq 0 (
11+
echo Requesting administrator privileges...
12+
powershell -Command "Start-Process '%~f0' -Verb RunAs"
13+
exit /b
14+
)
15+
16+
echo.
17+
echo ========================================
18+
echo DeadNet Attacker - WebView Version
19+
echo ========================================
20+
echo.
21+
22+
REM Check Python installation
23+
python --version >nul 2>&1
24+
if %errorLevel% neq 0 (
25+
echo [ERROR] Python not found!
26+
echo Please install Python 3.8 or newer from python.org
27+
pause
28+
exit /b 1
29+
)
30+
31+
REM Check if Npcap is installed
32+
echo [*] Checking for Npcap installation...
33+
if not exist "C:\Windows\System32\Npcap\wpcap.dll" (
34+
if not exist "C:\Windows\SysWOW64\Npcap\wpcap.dll" (
35+
echo.
36+
echo [WARNING] Npcap not detected!
37+
echo Please install Npcap from: https://npcap.com
38+
echo.
39+
echo Install with "WinPcap API-compatible Mode" enabled!
40+
echo.
41+
pause
42+
)
43+
)
44+
45+
REM Check and install requirements if needed
46+
echo [*] Checking dependencies...
47+
python -c "import webview" >nul 2>&1
48+
if %errorLevel% neq 0 (
49+
echo [*] Installing missing dependencies...
50+
python -m pip install -r requirements.txt
51+
if %errorLevel% neq 0 (
52+
echo [ERROR] Failed to install dependencies!
53+
pause
54+
exit /b 1
55+
)
56+
)
57+
58+
REM Run the application
59+
echo [+] Starting DeadNet Attacker with WebView...
60+
echo.
61+
python main_webview.py
62+
63+
REM If script exits, pause to see any errors
64+
if %errorLevel% neq 0 (
65+
echo.
66+
echo [ERROR] Application exited with error code: %errorLevel%
67+
pause
68+
)

0 commit comments

Comments
 (0)