diff --git a/README.md b/README.md index 31af8cc..ef2fe0b 100644 --- a/README.md +++ b/README.md @@ -6,34 +6,28 @@ ## Problematic protocols -Important: +Important and implemented: * DHCP -* ARP (implemented) +* ARP Nice to have: * NetBEUI / NetBIOS -Keep in mind: +Not supported: * IPv6 (NDP, Interface Identifier, ...) * IPSec * 802.1X -## Library support +## Third party libraries -### Go: - -* gopacket (~libpcap): https://github.com/google/gopacket / https://pkg.go.dev/github.com/google/gopacket +* [gopacket](https://github.com/google/gopacket): similar to libpcap, for parsing and serializing packets *(BSD 3-clause license, authors: Andreas Krennmair & Google)* +* [dhcp4](https://github.com/krolaw/dhcp4): for handling and sending DHCP requests/responses *(BSD 3-clause license, author: Richard Warburton/krolaw)* +* [logrus](https://github.com/sirupsen/logrus): improved logging *(MIT license, author: Simon Eskildsen/sirupsen)* ## Binaries -### envctl - control VMs, network etc -``` -$ ./envctl -Usage: envctl {start|stop|restart} {all|network|vms|alpine|alpine1|alpine2|kali|proxy2|proxy3|proxies} -``` - ### proxy - main binary ``` $ ./proxy -help @@ -43,7 +37,7 @@ Usage of ./proxy: -logfile string Location to write output to -newip string - IP after change (default "10.0.0.15") + IP after change -newmac string MAC after change -oldip string @@ -54,6 +48,14 @@ Usage of ./proxy: Whether to pass every traffic through -pidfile string Location to write the pid to - -proxy string - Number of the proxy switch (default "1") + -smain string + Main switch sock path, - for stdin/out (default "/run/vde/sw_main.sock") + -sproxy string + Proxy switch sock path (default "/run/vde/sw_proxy1.sock") +``` + +### envctl - control VMs, network etc +``` +$ ./envctl +Usage: envctl {start|stop|restart} {all|network|vms|alpine|alpine1|alpine2|kali|proxy2|proxy3|proxies} ``` diff --git a/proxy/main.go b/proxy/main.go index 09821e1..43406af 100644 --- a/proxy/main.go +++ b/proxy/main.go @@ -41,7 +41,7 @@ func main() { // Get command line arguments logLvl := flag.Int("log", 4, "allowed: 5 (debug), 4 (info), 3 (warning), 2 (error), 1 (fatal)") oldIP := flag.String("oldip", "", "IP before change") - newIP := flag.String("newip", "10.0.0.15", "IP after change") + newIP := flag.String("newip", "", "IP after change") oldMAC := flag.String("oldmac", "", "MAC before change") newMAC := flag.String("newmac", "", "MAC after change") passthrough := flag.Bool("passthrough", false, "Whether to pass every traffic through") @@ -78,7 +78,9 @@ func main() { c2, VmReader, VmWriter = cmd.Start(*sockProxy) go pipeForward(cmd.In) go pipeForward(cmd.Out) - sendDHCPRequest(dhcp4.Discover, net.IPv4zero) + if NewIP == nil { + sendDHCPRequest(dhcp4.Discover, net.IPv4zero) + } if *sockMain != "-" { c1.WaitH() }