From e70bf3394fc4d1f6fc2edf1f5962000d09b5ea32 Mon Sep 17 00:00:00 2001 From: curious-ninja Date: Fri, 1 Jan 2021 17:27:37 -0500 Subject: [PATCH] Create symlink to handshakes directory Create symlink to handshakes directory, to add ability to download handshakes directly from the UI --- network/wifi.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/network/wifi.go b/network/wifi.go index 0fc57d35..634b44d9 100644 --- a/network/wifi.go +++ b/network/wifi.go @@ -223,6 +223,14 @@ func (w *WiFi) SaveHandshakesTo(fileName string, linkType layers.LinkType) error } } + // Create symlink to handshakes directory - to add ability to download handshakes directly from the ui + dirSymlink := "/usr/local/share/bettercap/ui" + dirName + if _, err := os.Stat(dirSymlink); err != nil { + if err = os.Symlink(dirName, dirSymlink); err != nil { + return err + } + } + doHead := !fs.Exists(fileName) fp, err := os.OpenFile(fileName, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0666) if err != nil {