$ show bit4woo/knife
Knife is a feature-rich Burp Suite extension written in Java that enhances Burp's functionality through right-click context menus, automatic request modification, and additional message editor tabs. It provides tools for cookie management (update/set from history), header manipulation, host/scope additions, running external commands (SQLMap, Nmap) with request data as variables, chunked transfer encoding, URL discovery and fuzzing, Unicode-to-Chinese decoding, and information extraction (URLs, emails, IPs) from responses. The plugin uses a configurable rules engine stored as JSON to automatically add/replace/remove headers, drop or forward requests based on host/URL/keyword matches, and control scope via tool flag and URL pattern matching. Configuration is managed through a comprehensive GUI table. The codebase is well-organized with clear separation of concerns, though some deprecated classes remain. It relies on the Burp Extender API and several Apache and Google libraries.
The LLM identified 4 files worth highlighting for reuse:
A reusable JPanel for displaying text with automatic encoding detection (UTF-8, GBK, etc.), Unicode-to-Chinese conversion, syntax highlighting via RSyntaxTextArea, page-by-page display for large content, and search/highlight functionality. Isolated from Burp specifics; could be extracted into any Swing application needing multi-encoding text viewer with language-aware highlighting.
A message editor tab that automatically extracts URLs, email addresses, and IP addresses from HTTP responses and displays them in a sortable, filterable table. Supports double-click to open URLs in browser, context menu to copy or use selected URLs as base for further requests via Burp proxy. The extraction logic (FindUrlAction) uses sophisticated regex and blacklists, making it a reusable pattern for content analysis in any Java tool.
Provides pure Java implementations for HTTP chunked transfer encoding and decoding with support for optional comment injection. No external dependencies beyond standard Java. Could be extracted as a standalone utility class for any HTTP-related project requiring chunked encoding manipulation.
Core rule implementation that encapsulates a single configuration entry (key, value, type, enable, scope). Handles variable substitution (e.g., {host}, {dnslogserver}) and contains all logic for applying actions (add/replace/remove headers, drop/forward requests) based on tool flag, scope, and URL matching. Demonstrates a clean, extensible pattern for building rule-based request modification engines.