mosers
/
eaas-vde-proxy
Archiviert
1
0
Fork 0

Test environment added

main
Simon Moser vor 3 Jahren
Ursprung 2375f6fa84
Commit 46e497d36e
Signiert von: mosers
GPG-Schlüssel-ID: 96B3365A234B500C

37
.gitignore vendored

@ -1,17 +1,20 @@
# ---> Go # ---> Go
# Binaries for programs and plugins # Binaries for programs and plugins
*.exe *.exe
*.exe~ *.exe~
*.dll *.dll
*.so *.so
*.dylib *.dylib
# Test binary, built with `go test -c` # Test binary, built with `go test -c`
*.test *.test
# Output of the go coverage tool, specifically when used with LiteIDE # Output of the go coverage tool, specifically when used with LiteIDE
*.out *.out
# Dependency directories (remove the comment below to include it) # Dependency directories (remove the comment below to include it)
# vendor/ # vendor/
# Images
*.iso
*.qcow2

@ -1,9 +1,9 @@
MIT License MIT License
Copyright (c) <year> <copyright holders> Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -1,74 +1,74 @@
# eaas-vde-proxy # eaas-vde-proxy
## Overview ## Overview
![overview](README.assets/overview.png) ![overview](README.assets/overview.png)
## Pseudocode ## Pseudocode
```python ```python
class vde_proxy: class vde_proxy:
def handle_frame(frame): def handle_frame(frame):
try: try:
frame.mac = self.new_mac frame.mac = self.new_mac
except NameError: except NameError:
self.new_mac = random_mac() self.new_mac = random_mac()
self.new_ip = do_dhcp(new_mac) self.new_ip = do_dhcp(new_mac)
finally: finally:
frame.mac = self.new_mac frame.mac = self.new_mac
frame.packet = handle_packet(frame.packet) frame.packet = handle_packet(frame.packet)
def handle_packet(packet): def handle_packet(packet):
protocols = { protocols = {
"ip" : handle_ip, "ip" : handle_ip,
"arp": handle_arp, "arp": handle_arp,
} }
return protocols[packet.protocol](packet) return protocols[packet.protocol](packet)
def handle_ip(packet): def handle_ip(packet):
# Todo: Check DHCP lease and get new one if necessary # Todo: Check DHCP lease and get new one if necessary
packet.ip = self.new_ip packet.ip = self.new_ip
if is_dhcp(packet): if is_dhcp(packet):
packet = handle_dhcp(packet) packet = handle_dhcp(packet)
return packet return packet
def handle_arp(packet): def handle_arp(packet):
pass pass
def handle_dhcp(packet): def handle_dhcp(packet):
pass pass
def do_dhcp(mac): def do_dhcp(mac):
# Do DHCP # Do DHCP
return ip return ip
``` ```
## Problematic protocols ## Problematic protocols
Important: Important:
* DHCP * DHCP
* ARP * ARP
Nice to have: Nice to have:
* NetBEUI / NetBIOS * NetBEUI / NetBIOS
Keep in mind: Keep in mind:
* IPv6 (NDP, Interface Identifier, ...) * IPv6 (NDP, Interface Identifier, ...)
* IPSec * IPSec
* 802.1X * 802.1X
## Library support ## Library support
### Go: ### Go:
* Internet layer packet modification: https://github.com/google/gopacket / https://pkg.go.dev/github.com/google/gopacket * Internet layer packet modification: https://github.com/google/gopacket / https://pkg.go.dev/github.com/google/gopacket
* Link layer frame modification: https://github.com/mdlayher/ethernet / https://pkg.go.dev/github.com/mdlayher/ethernet (not recently updated, alternative?) * Link layer frame modification: https://github.com/mdlayher/ethernet / https://pkg.go.dev/github.com/mdlayher/ethernet (not recently updated, alternative?)
### Rust: ### Rust:
* https://docs.rs/etherparse/0.9.0/etherparse * https://docs.rs/etherparse/0.9.0/etherparse