Small C++ Plain HTTP interceptor written in C++17.
Please, before using this program, install the Conan package manager and the CMake build tool.
In-code dependencies will be installed later using Conan.
- The Conan package manager.
- CMake as building tool.
- PcapPlusPlus for network packets capture.
- spdlog for fast logging.
- TCLAP for command line argument parsing.
- Tabulate for pretty table formatting.
If you're running a Linux machine, you will need libpcap for development and building PcapPlusPlus from source.
# Debian/Ubuntu based distributions
sudo apt install libpcap-dev
# Fedora/CentOS/RHEL based distributions
sudo dnf install libpcap-develIf you're running a MacOS machine, you will need to install Xcode. After that, make sure to install Xcode command line tools:
xcode-select --installIf you're running a Windows machine, make sure to install a Pcap API implementation such as NpCap (recommended) or WinPcap (deprecated). Also, you will need a compiler. I recommend you to use Visual Studio latest version.
# 1. Clone the project to your computer
git clone https://github.com/pr1s10n3r/CppHttpInterceptor.git
# 2. Create a build directory and enter it
mkdir build && cd build
# 3. Install dependencies using the Conan package manager
conan install .. --build=missing
# 4. Generate CMake files.
cmake .. -G "Unix Makefiles"
# 4.1 If you are on Windows, generate CMake files using Visual Studio 17 2022 generator
cmake .. -G "Visual Studio 17 2022"
# 5. Compile project using generated make files
cmake --build . --config ReleaseIf you gave your build directory another name rather than
build. PLEASE DO NOT PUSH IT TO GITHUB.
If for some reason you want to build the program using Visual Studio, make sure you're using the Release profile.
If the build was successful, you should find an executable file named chi or chi.exe if you're on Windows inside the
bin library inside your build directory. You can use that executable in the following way:
# General program syntax:
$ chi <-i INTERFACE_TO_INTERCEPT> [-o PATH_TO_OUTPUT_FILE] <-l TIME_IN_SECONDS>
# For example, intercept the interface "en0" for 10 seconds and save the result to a file called output.txt
$ chi -i en0 -o output.txt -l 10
# For more information, you can run the program with the --help argument:
$ ./chi_mac_arm64.o --help
USAGE:
./chi_mac_arm64.o [-o <string>] -l <non-negative integer> -i <string>
[--] [--version] [-h]
Where:
-o <string>, --output <string>
output filepath where results will be written
-l <non-negative integer>, --lapse <non-negative integer>
(required) duration in seconds interception will last
-i <string>, --interface <string>
(required) network interface to intercept
--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.
--version
Displays version information and exits.
-h, --help
Displays usage information and exits.
small C++ command line tool for HTTP interception- This program does not support
HTTPspackets capture although its support should be easy to implement. - If you are on a Windows platform, it is recommended to generate CMake files using Visual Studio rather than other generators.
- For most of users, this program should be running as privileged user (
rootfor friends).
- For some reason, if the program is run using the Visual Studio Code terminal, the program will crash when building the Tabulate table. Just use other terminal like Windows Terminal, iTerm or Alacritty.
See the LICENSE file.