Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/tcp_save_syn_listen
listen() with TCP_SAVE_SYN using LD_PRELOAD
https://github.com/matsumotory/tcp_save_syn_listen
Last synced: about 2 months ago
JSON representation
listen() with TCP_SAVE_SYN using LD_PRELOAD
- Host: GitHub
- URL: https://github.com/matsumotory/tcp_save_syn_listen
- Owner: matsumotory
- License: mit
- Created: 2020-07-31T02:48:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-31T06:18:21.000Z (over 4 years ago)
- Last Synced: 2024-10-18T18:19:03.635Z (3 months ago)
- Language: C
- Size: 8.79 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tcp_save_syn_listen
Change sys_listen() to listen() with TCP_SAVE_SYN using LD_PRELOAD
## Build
```
make
```## Usage
```
LD_PRELOAD=src/tcp_save_syn_listen.so ./your_app
```## Example
```
cd test
make
# server don't use TCP_SAVE_SYN
./server
```- other terminal
```
cd test
./client
```- result
```
./server
tcpriv[info]: waiting...
tcpriv[info]: connected: 192.168.0.2
tcpriv[info]: syn_len: 0
server: server.c:112: read_saved_syn: Assertion `syn_len == 60' failed.
Aborted (core dumped)
```However, if you use tcp_save_syn_listen, ./server's listen() set TCP_SAVE_SYN to socket automatically
```
LD_PRELOAD=./tcp_save_syn_listen/src/tcp_save_syn_listen.so ./server
tcpriv[info]: waiting...
tcpriv[info]: connected: 192.168.0.2
tcpriv[info]: syn_len: 60
tcpriv[info]: found tcpriv's information: kind=254 length=10 ExID=0xf991 uid=1000
tcpriv[info]: all test success.
```