Skip to content

Fix bare except clauses (44 instances across 12 files)#1

Open
MichaelMVS wants to merge 1 commit intoaw-junaid:mainfrom
MichaelMVS:fix-bare-except-clauses
Open

Fix bare except clauses (44 instances across 12 files)#1
MichaelMVS wants to merge 1 commit intoaw-junaid:mainfrom
MichaelMVS:fix-bare-except-clauses

Conversation

@MichaelMVS
Copy link
Copy Markdown

Fixed 44 bare except clauses across 12 Python files. Using except Exception: instead of bare except: ensures only program exceptions are caught while allowing KeyboardInterrupt and SystemExit to propagate normally.

Fixed 44 bare except clauses across 12 Python files:
- Raw Scripts/802.11 Wi-Fi.py (4 instances)
- Raw Scripts/DHCP Starvation Attack.py (2 instances)
- Raw Scripts/DNS Enumeration.py (3 instances)
- Raw Scripts/FTP Brute Force Tool.py (8 instances)
- Raw Scripts/Google Dorking.py (2 instances)
- Raw Scripts/ICMP Tunneling Network.py (1 instance)
- Raw Scripts/SMB Brute Force Tool.py (8 instances)
- Raw Scripts/SSH Brute Force Tool.py (6 instances)
- Raw Scripts/SYN Flood.py (4 instances)
- Raw Scripts/TLS Stripping.py (4 instances)
- Raw Scripts/VLAN Hopping Tool.py (1 instance)
- Raw Scripts/WHOIS Lookup.py (1 instance)

Bare except clauses can catch unexpected system-exit exceptions (KeyboardInterrupt, SystemExit) and make debugging harder. Using 'except Exception:' ensures only actual program exceptions are caught.
Copilot AI review requested due to automatic review settings April 14, 2026 15:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates multiple Python security/utility scripts to replace bare except: clauses with except Exception: so that non-program exceptions (notably KeyboardInterrupt and SystemExit) are not accidentally swallowed.

Changes:

  • Replaced bare except: with except Exception: across 12 scripts (44 instances total).
  • Preserved existing control flow (mostly pass/fallback behavior) while narrowing exception handling away from BaseException.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Raw Scripts/WHOIS Lookup.py Narrows IP parsing guards from bare except to except Exception during query-type detection.
Raw Scripts/VLAN Hopping Tool.py Updates exception handling around interface detection, MAC lookup, and VLAN probe logic.
Raw Scripts/TLS Stripping.py Updates exception handling for default interface detection and ARP MAC lookup.
Raw Scripts/SYN Flood.py Updates exception handling for default interface detection, source IP derivation, and flood loops.
Raw Scripts/SSH Brute Force Tool.py Updates exception handling for command verification, cleanup, banner retrieval, and password mutation loop.
Raw Scripts/SMB Brute Force Tool.py Updates exception handling for SMB dialect negotiation, logoff cleanup, and null session checks.
Raw Scripts/ICMP Tunneling Network.py Updates exception handling for optional payload decryption during packet handling.
Raw Scripts/Google Dorking.py Updates exception handling while parsing/analyzing result URLs for domain statistics.
Raw Scripts/FTP Brute Force Tool.py Updates exception handling for banner grabbing, directory listing verification, cleanup, and system info queries.
Raw Scripts/DNS Enumeration.py Updates exception handling for wildcard test, reverse lookup, and async DNS query.
Raw Scripts/DHCP Starvation Attack.py Updates exception handling for default interface detection fallbacks.
Raw Scripts/802.11 Wi-Fi.py Updates exception handling for wireless interface detection, mode checks, and beacon stats parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants