minor formatting changes
This commit is contained in:
parent
1ffadf5c86
commit
344d874c02
@ -31,5 +31,4 @@ hypd generate defaultconfig | tee hypdconfig.json`,
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
generateCmd.AddCommand(defaultconfigCmd)
|
generateCmd.AddCommand(defaultconfigCmd)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,14 +31,4 @@ hypd generate secret > hyp.secret`,
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
generateCmd.AddCommand(secretCmd)
|
generateCmd.AddCommand(secretCmd)
|
||||||
|
|
||||||
// Here you will define your flags and configuration settings.
|
|
||||||
|
|
||||||
// Cobra supports Persistent Flags which will work for this command
|
|
||||||
// and all subcommands, e.g.:
|
|
||||||
// secretCmd.PersistentFlags().String("foo", "", "A help for foo")
|
|
||||||
|
|
||||||
// Cobra supports local flags which will only run when this command
|
|
||||||
// is called directly, e.g.:
|
|
||||||
// secretCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,6 @@ Example Usage:
|
|||||||
hypd server /etc/hyp/hypdconfig.json
|
hypd server /etc/hyp/hypdconfig.json
|
||||||
`,
|
`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
||||||
currentUser, err := user.Current()
|
currentUser, err := user.Current()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("could not determine current user: %w", err))
|
panic(fmt.Errorf("could not determine current user: %w", err))
|
||||||
@ -54,7 +53,6 @@ Example Usage:
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("failed to start packet server: %w", err))
|
panic(fmt.Errorf("failed to start packet server: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,6 @@ var (
|
|||||||
// it sets up the pcap on the capture device and starts a goroutine
|
// it sets up the pcap on the capture device and starts a goroutine
|
||||||
// to rotate the knock sequence
|
// to rotate the knock sequence
|
||||||
func PacketServer(config *configuration.HypdConfiguration) error {
|
func PacketServer(config *configuration.HypdConfiguration) error {
|
||||||
|
|
||||||
iface, err := net.InterfaceByName(config.NetworkInterface)
|
iface, err := net.InterfaceByName(config.NetworkInterface)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("lookup network iface %q: %v", config.NetworkInterface, err)
|
log.Fatalf("lookup network iface %q: %v", config.NetworkInterface, err)
|
||||||
@ -148,8 +147,6 @@ func handleKnock(knockEvent hyp_bpfKnockData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if it's wrong, reset progress
|
// if it's wrong, reset progress
|
||||||
// TBD: vulnerable to sweep attack - this won't be triggered if a wrong packet doesn't match BPF filter
|
|
||||||
// TBD: make the sweep attack fix on by default, but configurable to be off to allow for limited BPF filter for extremely low overhead as compromise.
|
|
||||||
if knockEvent.Dstport != client.Sequence[client.Progress] {
|
if knockEvent.Dstport != client.Sequence[client.Progress] {
|
||||||
delete(clients, knockEvent.Srcip)
|
delete(clients, knockEvent.Srcip)
|
||||||
fmt.Printf("port '%d' is in sequence, but came at unexpected order - resetting progress", knockEvent.Dstport)
|
fmt.Printf("port '%d' is in sequence, but came at unexpected order - resetting progress", knockEvent.Dstport)
|
||||||
|
Loading…
Reference in New Issue
Block a user