https://github.com/torxed/rawstock
A promiscuous raw socket framework for Python.
https://github.com/torxed/rawstock
Last synced: about 2 months ago
JSON representation
A promiscuous raw socket framework for Python.
- Host: GitHub
- URL: https://github.com/torxed/rawstock
- Owner: Torxed
- Created: 2016-11-02T20:36:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-02T20:48:48.000Z (over 8 years ago)
- Last Synced: 2025-01-25T17:09:21.805Z (4 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
rawstock
========A promiscuous raw socket framework for Python.
What's it do?
================Re-invents the wheel (not for the better cowboy, this is the wild side of the internet).
It creates a raw socket without any automated header builds.
The framework can be used to create basic Ethernet, IP and TCP/UDP headers.
It also features the option to set the socket in promiscuous mode.How to use it?
==============Kinda limited atm.
import rawstock
new_sock = rawstock.rawstock(b'eth0')
print(new_sock.recv()) # No bufsize needed, yet..
new_sock.close()Trying to keep it as similar as possible to the standard sock lib.
There's also a `promisc=True` parameter to `rawstock()`, set to false if you do not wish to use that feature. Why you wouldn't is a mystery when using a raw socket, especially since I haven't implemented a `.bind()` feature yet - heh..TODO's
======This is a never ending section, there's literally countless of hours left on this project.
Odds are I'm never gona' finish it, but it's a fun little side project.
Things I'd like to finish:* More detailed parsing of the IP headers
* More detailed parameters for IP packaging
* Error handling in terms of actually parsing the protocol flags and unpacking the last slice of a network frame (assumed UDP today)
* Encryption (MAC-sec and optional payload encryption in TCP/UDP)
* A neat way to filter out sent packages which today will trigger a recv() because of promisc mode.