• Stars
    star
    1,897
  • Rank 24,451 (Top 0.5 %)
  • Language
    C++
  • License
    BSD 2-Clause "Sim...
  • Created almost 11 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

High-level, multiplatform C++ network packet sniffing and crafting library.

libtins

Build status Build status

libtins is a high-level, multiplatform C++ network packet sniffing and crafting library.

Its main purpose is to provide the C++ developer an easy, efficient, platform and endianess-independent way to create tools which need to send, receive and manipulate specially crafted packets.

In order to read tutorials, examples and checkout some benchmarks of the library, please visit:

http://libtins.github.io/

Compiling

libtins depends on libpcap and openssl, although the latter is not necessary if some features of the library are disabled.

In order to compile, execute:

# Create the build directory
mkdir build
cd build

# Configure the project. Add any relevant configuration flags
cmake ../

# Compile!
make

Static/shared build

Note that by default, only the shared object is compiled. If you would like to generate a static library file, run:

cmake ../ -DLIBTINS_BUILD_SHARED=0

The generated static/shared library files will be located in the build/lib directory.

C++11 support

libtins is noticeably faster if you enable C++11 support. Therefore, if your compiler supports this standard, then you should enable it. In order to do so, use the LIBTINS_ENABLE_CXX11 switch:

cmake ../ -DLIBTINS_ENABLE_CXX11=1

TCP ACK tracker

The TCP ACK tracker feature requires the boost.icl library (header only). This feature is enabled by default but will be disabled if the boost headers are not found. You can disable this feature by using:

cmake ../ -DLIBTINS_ENABLE_ACK_TRACKER=0

If your boost installation is on some non-standard path, use the parameters shown on the CMake FindBoost help

WPA2 decryption

If you want to disable WPA2 decryption support, which will remove openssl as a dependency for compilation, use the LIBTINS_ENABLE_WPA2 switch:

cmake ../ -DLIBTINS_ENABLE_WPA2=0

IEEE 802.11 support

If you want to disable IEEE 802.11 support(this will also disable RadioTap and WPA2 decryption), which will reduce the size of the resulting library in around 20%, use the LIBTINS_ENABLE_DOT11 switch:

cmake ../ -DLIBTINS_ENABLE_DOT11=0

Installing

Once you're done, if you want to install the header files and the shared object, execute as root:

make install

This will install the shared object typically in /usr/local/lib. Note that you might have to update ldconfig's cache before using it, so in order to invalidate it, you should run(as root):

ldconfig

Running tests

You may want to run the unit tests on your system so you make sure everything works. In order to do so, you need to follow these steps:

# This will fetch the googletest submodule, needed for tests
git submodule init
git submodule update

mkdir build
cd build

# Use any options you want
cmake .. 

# Compile tests
make tests

# Run them
make test

If you find that any tests fail, please create an ticket in the issue tracker indicating the platform and architecture you're using.

Examples

You might want to have a look at the examples located in the "examples" directory. The same samples can be found online at:

http://libtins.github.io/examples/

Contributing

If you want to report a bug or make a pull request, please have a look at the contributing file before doing so.

More Repositories

1

cppkafka

Modern C++ Apache Kafka client library (wrapper for librdkafka)
C++
557
star
2

presenterm

A terminal slideshow tool
Rust
487
star
3

Programs-Scripts

The tiny programs and scripts that don't deserve a project, but I still want to share.
C
214
star
4

dot11decrypt

An 802.11 WEP/WPA2 on-the-fly decrypter.
C++
135
star
5

ces

CLI for crypto exchanges
Python
49
star
6

packet-capture-benchmarks

Packet capture libraries benchmark
C++
31
star
7

sloth-fuzzer

A smart file fuzzer.
C++
26
star
8

blind-sqli

A simple python script that exploits blind SQL Injections. Useful for PoCs.
Python
24
star
9

trustrl

CLI tool to manipulate URLs
Rust
8
star
10

mergebro

The bro you need when you want to merge a pull request
Rust
5
star
11

pytins

Python bindings for libtins
C++
4
star
12

tcp-stream-assembler

C++
4
star
13

bogeyman-remote-cpp

C++ remote client for samelat/bogeyman
C++
2
star
14

libtins-sanitizers

Random short apps using libtins to find errors in packet parsing/serialization
C++
2
star
15

bgprust

Rust library to parse BGP (MRT/Zebra) files
Rust
2
star
16

DirHound

Crawler + Directory/file bruteforcer
Haskell
2
star
17

procmon

A tiny project to play around with eBPF
Rust
1
star
18

shaplim

Shared Playlist Manager
C++
1
star
19

dotfiles

m'dotfiles
Lua
1
star
20

roberto

Yet another Socks proxy server
C++
1
star
21

sockwho

Use eBPF tracepoints to inspect socketaddrs
Rust
1
star
22

brainchuck

A LLVM based brainfuck JIT compiler
Rust
1
star
23

SMTPPot

An extensible SPAMPot
Python
1
star
24

shaplim-gui

A shaplim GTK interface
Python
1
star
25

dns-metrics

A Rust toy project to capture DNS packets and expose metrics about them via a prometheus compatible endpoint
Rust
1
star