misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2018-02-23 00:07:09 +01:00
parent f3dd84ebc4
commit 63cea73f8e
75 changed files with 179 additions and 179 deletions

4
.gitignore vendored
View file

@ -3,6 +3,6 @@
*.prof* *.prof*
pcaps pcaps
build build
bettercap-ng*.* bettercap*.*
bettercap-ng* bettercap*
bettercap.history bettercap.history

View file

@ -13,7 +13,7 @@ before_install:
install: install:
- make deps - make deps
go_import_path: github.com/evilsocket/bettercap-ng go_import_path: github.com/bettercap/bettercap
script: script:
- make test - make test

View file

@ -2,7 +2,7 @@ FROM iron/go:dev
MAINTAINER Simone Margaritelli <https://evilsocket.net/> MAINTAINER Simone Margaritelli <https://evilsocket.net/>
ENV GOPATH=/gocode ENV GOPATH=/gocode
ENV SRC_DIR=/gocode/src/github.com/evilsocket/bettercap-ng ENV SRC_DIR=/gocode/src/github.com/bettercap/bettercap
COPY . $SRC_DIR COPY . $SRC_DIR
WORKDIR $SRC_DIR WORKDIR $SRC_DIR
@ -13,4 +13,4 @@ RUN make deps
RUN make RUN make
EXPOSE 80 443 53 5300 8080 8081 8082 8083 8000 EXPOSE 80 443 53 5300 8080 8081 8082 8083 8000
ENTRYPOINT ["./bettercap-ng"] ENTRYPOINT ["./bettercap"]

View file

@ -1,8 +1,8 @@
### Prerequisites ### Prerequisites
* [ ] I read the [README](https://github.com/evilsocket/bettercap-ng/blob/master/README.md). * [ ] I read the [README](https://github.com/bettercap/bettercap/blob/master/README.md).
* [ ] I am running the [latest source code version](https://github.com/evilsocket/bettercap-ng). * [ ] I am running the [latest source code version](https://github.com/bettercap/bettercap).
* [ ] I already searched [other issues](https://github.com/evilsocket/bettercap-ng/issues?q=is%3Aopen+is%3Aissue+label%3Abug) to see if this problem was already reported. * [ ] I already searched [other issues](https://github.com/bettercap/bettercap/issues?q=is%3Aopen+is%3Aissue+label%3Abug) to see if this problem was already reported.
### Description ### Description
@ -16,7 +16,7 @@ Please provide:
* Command line arguments you are using. * Command line arguments you are using.
* Caplet code you are using (if any). * Caplet code you are using (if any).
* Interactive session commands you are using (if any). * Interactive session commands you are using (if any).
* **Full debug output** while reproducing the issue ( `bettercap-ng -debug ...` ). * **Full debug output** while reproducing the issue ( `bettercap -debug ...` ).
### Steps to Reproduce ### Steps to Reproduce

View file

@ -1,4 +1,4 @@
TARGET=bettercap-ng TARGET=bettercap
all: fmt vet build all: fmt vet build
@echo "@ Done" @echo "@ Done"

View file

@ -1,14 +1,14 @@
<p align="center"> <p align="center">
<img alt="BetterCap" src="https://raw.githubusercontent.com/evilsocket/bettercap-ng/master/media/logo.png" height="140" /> <img alt="BetterCap" src="https://raw.githubusercontent.com/bettercap/bettercap/master/media/logo.png" height="140" />
<p align="center"> <p align="center">
<a href="https://github.com/evilsocket/bettercap-ng/releases/latest"><img alt="Release" src="https://img.shields.io/github/release/evilsocket/bettercap-ng.svg?style=flat-square"></a> <a href="https://github.com/bettercap/bettercap/releases/latest"><img alt="Release" src="https://img.shields.io/github/release/bettercap/bettercap.svg?style=flat-square"></a>
<a href="/LICENSE"><img alt="Software License" src="https://img.shields.io/badge/license-GPL3-brightgreen.svg?style=flat-square"></a> <a href="/LICENSE"><img alt="Software License" src="https://img.shields.io/badge/license-GPL3-brightgreen.svg?style=flat-square"></a>
<a href="https://travis-ci.org/evilsocket/bettercap-ng"><img alt="Travis" src="https://img.shields.io/travis/evilsocket/bettercap-ng/master.svg?style=flat-square"></a> <a href="https://travis-ci.org/bettercap/bettercap"><img alt="Travis" src="https://img.shields.io/travis/bettercap/bettercap/master.svg?style=flat-square"></a>
<a href="https://goreportcard.com/report/github.com/evilsocket/bettercap-ng"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/evilsocket/bettercap-ng?style=flat-square&fuckgithubcache=1"></a> <a href="https://goreportcard.com/report/github.com/bettercap/bettercap"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/bettercap/bettercap?style=flat-square&fuckgithubcache=1"></a>
</p> </p>
</p> </p>
**bettercap-ng** is a complete reimplementation of bettercap, the Swiss army knife for network attacks and monitoring. It is faster, stabler, smaller, easier to install and to use. **bettercap** is a complete reimplementation of bettercap, the Swiss army knife for network attacks and monitoring. It is faster, stabler, smaller, easier to install and to use.
## Using it with Docker ## Using it with Docker
@ -16,25 +16,25 @@ In this repository, BetterCAP is containerized using [Alpine Linux](https://alpi
To pull latest BetterCAP version of the image: To pull latest BetterCAP version of the image:
$ docker pull evilsocket/bettercap-ng $ docker pull bettercap/bettercap
To run: To run:
$ docker run -it --privileged --net=host evilsocket/bettercap-ng -h $ docker run -it --privileged --net=host bettercap/bettercap -h
## Compilation ## Compilation
Make sure you have a correctly configured **Go >= 1.8** environment, that `$GOPATH/bin` is in `$PATH` and the `libpcap-dev` package installed for your system, then: Make sure you have a correctly configured **Go >= 1.8** environment, that `$GOPATH/bin` is in `$PATH` and the `libpcap-dev` package installed for your system, then:
$ go get github.com/evilsocket/bettercap-ng $ go get github.com/bettercap/bettercap
This command will download bettercap-ng, install its dependencies, compile it and move the `bettercap-ng` executable to `$GOPATH/bin`. This command will download bettercap, install its dependencies, compile it and move the `bettercap` executable to `$GOPATH/bin`.
Now you can use `sudo bettercap-ng -h` to show the basic command line options and just `sudo bettercap-ng` to start an interactive session on your default network interface. Now you can use `sudo bettercap -h` to show the basic command line options and just `sudo bettercap` to start an interactive session on your default network interface.
## Compilation on Windows ## Compilation on Windows
Despite Windows support [is not yet 100% complete](https://github.com/evilsocket/bettercap-ng/issues/45), it is possible to build bettercap-ng for Microsoft platforms and enjoy 99.99% of the experience. The steps to prepare the building environment are: Despite Windows support [is not yet 100% complete](https://github.com/bettercap/bettercap/issues/45), it is possible to build bettercap for Microsoft platforms and enjoy 99.99% of the experience. The steps to prepare the building environment are:
- Install [go amd64](https://golang.org/dl/) (add go binaries to your `%PATH%`). - Install [go amd64](https://golang.org/dl/) (add go binaries to your `%PATH%`).
- Install [TDM GCC for amd64](http://tdm-gcc.tdragon.net/download) (add TDM-GCC binaries to your `%PATH%`). - Install [TDM GCC for amd64](http://tdm-gcc.tdragon.net/download) (add TDM-GCC binaries to your `%PATH%`).
@ -51,7 +51,7 @@ This will generate `.def` files, now we'll generate the static libraries files:
- and `dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libpacket.a --input-def packet.def`. - and `dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libpacket.a --input-def packet.def`.
- Copy both `libwpcap.a` and `libpacket.a` to `c:\WpdPack\Lib\x64`. - Copy both `libwpcap.a` and `libpacket.a` to `c:\WpdPack\Lib\x64`.
And eventually just `go get github.com/evilsocket/bettercap-ng` as you would do on other platforms. And eventually just `go get github.com/bettercap/bettercap` as you would do on other platforms.
## Cross Compilation ## Cross Compilation
@ -68,14 +68,14 @@ Download and cross compile libpcap-1.8.1 for ARM (adjust `PCAPV` to use a differ
./configure --host=arm-linux --with-pcap=linux ./configure --host=arm-linux --with-pcap=linux
make make
Cross compile bettercap-ng itself: Cross compile bettercap itself:
cd $GOPATH/src/github.com/evilsocket/bettercap-ng cd $GOPATH/src/github.com/bettercap/bettercap
env CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm CGO_LDFLAGS="-L/tmp/libpcap-$PCAPV" make env CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm CGO_LDFLAGS="-L/tmp/libpcap-$PCAPV" make
## Interactive Mode ## Interactive Mode
If no `-caplet` option is specified, bettercap-ng will start in interactive mode, allowing you to start and stop modules manually, change options and apply new firewall rules on the fly. If no `-caplet` option is specified, bettercap will start in interactive mode, allowing you to start and stop modules manually, change options and apply new firewall rules on the fly.
To get a grasp of what you can do, type `help` and the general help menu will be shown, you can also have module specific help by using `help module-name` (for instance try with `help net.recon`), to see which modules are running and their configuration at any time, you can use the `active` command. To get a grasp of what you can do, type `help` and the general help menu will be shown, you can also have module specific help by using `help module-name` (for instance try with `help net.recon`), to see which modules are running and their configuration at any time, you can use the `active` command.
@ -131,7 +131,7 @@ Execute an ARP spoofing attack on the whole network (by default) or on a host (u
```sh ```sh
# targeting the whole subnet by default, to make it selective: # targeting the whole subnet by default, to make it selective:
# #
# sudo ./bettercap-ng -caplet caplets/http-req-dump.cap -eval "set arp.spoof.targets 192.168.1.64" # sudo ./bettercap -caplet caplets/http-req-dump.cap -eval "set arp.spoof.targets 192.168.1.64"
# to make it less verbose # to make it less verbose
# events.stream off # events.stream off
@ -284,7 +284,7 @@ Use a proxy script to inject a BEEF javascript hook:
```sh ```sh
# targeting the whole subnet by default, to make it selective: # targeting the whole subnet by default, to make it selective:
# #
# sudo ./bettercap-ng -caplet caplets/beef-active.cap -eval "set arp.spoof.targets 192.168.1.64" # sudo ./bettercap -caplet caplets/beef-active.cap -eval "set arp.spoof.targets 192.168.1.64"
# inject beef hook # inject beef hook
set http.proxy.script caplets/beef-inject.js set http.proxy.script caplets/beef-inject.js
@ -374,4 +374,4 @@ clear
## License ## License
`bettercap` and `bettercap-ng` are made with ♥ by [Simone Margaritelli](https://www.evilsocket.net/) and they're released under the GPL 3 license. `bettercap` and `bettercap` are made with ♥ by [Simone Margaritelli](https://www.evilsocket.net/) and they're released under the GPL 3 license.

View file

@ -116,7 +116,7 @@ build_linux_mips64le() {
build_macos_amd64() { build_macos_amd64() {
vm_dep 'osxvm' vm_dep 'osxvm'
DIR=/Users/evilsocket/gocode/src/github.com/evilsocket/bettercap-ng DIR=/Users/evilsocket/gocode/src/github.com/bettercap/bettercap
OUTPUT=$1 OUTPUT=$1
echo "@ Updating repo on MacOS VM ..." echo "@ Updating repo on MacOS VM ..."
@ -132,7 +132,7 @@ build_macos_amd64() {
build_windows_amd64() { build_windows_amd64() {
vm_dep 'winvm' vm_dep 'winvm'
DIR=c:/Users/evilsocket/gopath/src/github.com/evilsocket/bettercap-ng DIR=c:/Users/evilsocket/gopath/src/github.com/bettercap/bettercap
OUTPUT=$1 OUTPUT=$1
echo "@ Updating repo on Windows VM ..." echo "@ Updating repo on Windows VM ..."
@ -149,14 +149,14 @@ rm -rf $BUILD_FOLDER
mkdir $BUILD_FOLDER mkdir $BUILD_FOLDER
cd $BUILD_FOLDER cd $BUILD_FOLDER
build_linux_amd64 bettercap-ng_linux_amd64_$VERSION build_linux_amd64 bettercap_linux_amd64_$VERSION
build_linux_arm7 bettercap-ng_linux_arm7_$VERSION build_linux_arm7 bettercap_linux_arm7_$VERSION
build_linux_mips bettercap-ng_linux_mips_$VERSION build_linux_mips bettercap_linux_mips_$VERSION
build_linux_mipsle bettercap-ng_linux_mipsle_$VERSION build_linux_mipsle bettercap_linux_mipsle_$VERSION
build_linux_mips64 bettercap-ng_linux_mips64_$VERSION build_linux_mips64 bettercap_linux_mips64_$VERSION
build_linux_mips64le bettercap-ng_linux_mips64le_$VERSION build_linux_mips64le bettercap_linux_mips64le_$VERSION
build_macos_amd64 bettercap-ng_macos_amd64_$VERSION build_macos_amd64 bettercap_macos_amd64_$VERSION
build_windows_amd64 bettercap-ng_windows_amd64_$VERSION.exe build_windows_amd64 bettercap_windows_amd64_$VERSION.exe
sha256sum * > checksums.txt sha256sum * > checksums.txt
echo echo

View file

@ -1,6 +1,6 @@
# targeting the whole subnet by default, to make it selective: # targeting the whole subnet by default, to make it selective:
# #
# sudo ./bettercap-ng -caplet caplets/beef-active.cap -eval "set arp.spoof.targets 192.168.1.64" # sudo ./bettercap -caplet caplets/beef-active.cap -eval "set arp.spoof.targets 192.168.1.64"
# inject beef hook # inject beef hook
set http.proxy.script caplets/beef-inject.js set http.proxy.script caplets/beef-inject.js

View file

@ -1,6 +1,6 @@
# targeting the whole subnet by default, to make it selective: # targeting the whole subnet by default, to make it selective:
# #
# sudo ./bettercap-ng -caplet caplets/http-req-dump.cap -eval "set arp.spoof.targets 192.168.1.64" # sudo ./bettercap -caplet caplets/http-req-dump.cap -eval "set arp.spoof.targets 192.168.1.64"
# to make it less verbose # to make it less verbose
# events.stream off # events.stream off

View file

@ -1,6 +1,6 @@
# targeting the whole subnet by default, to make it selective: # targeting the whole subnet by default, to make it selective:
# #
# sudo ./bettercap-ng -caplet caplets/login-man-abuse.cap -eval "set arp.spoof.targets 192.168.1.53" # sudo ./bettercap -caplet caplets/login-man-abuse.cap -eval "set arp.spoof.targets 192.168.1.53"
set http.proxy.script caplets/login-man-abuse.js set http.proxy.script caplets/login-man-abuse.js
http.proxy on http.proxy on

View file

@ -8,14 +8,14 @@ function onRequest(req, res) {
if( req.Path == "/test-page" ){ if( req.Path == "/test-page" ){
res.Status = 200; res.Status = 200;
res.ContentType = "text/html"; res.ContentType = "text/html";
res.Headers = "Server: bettercap-ng\r\n" + res.Headers = "Server: bettercap\r\n" +
"Connection: close"; "Connection: close";
res.Body = "<html>" + res.Body = "<html>" +
"<head>" + "<head>" +
"<title>Test Page</title>" + "<title>Test Page</title>" +
"</head>" + "</head>" +
"<body>" + "<body>" +
"<div align=\"center\">Hello world from bettercap-ng!</div>" + "<div align=\"center\">Hello world from bettercap!</div>" +
"</body>" + "</body>" +
"</html>"; "</html>";
} }
@ -25,14 +25,14 @@ function onRequest(req, res) {
function onResponse(req, res) { function onResponse(req, res) {
if( res.Status == 404 ){ if( res.Status == 404 ){
res.ContentType = "text/html"; res.ContentType = "text/html";
res.Headers = "Server: bettercap-ng\r\n" + res.Headers = "Server: bettercap\r\n" +
"Connection: close"; "Connection: close";
res.Body = "<html>" + res.Body = "<html>" +
"<head>" + "<head>" +
"<title>Test 404 Page</title>" + "<title>Test 404 Page</title>" +
"</head>" + "</head>" +
"<body>" + "<body>" +
"<div align=\"center\">Custom 404 from bettercap-ng.</div>" + "<div align=\"center\">Custom 404 from bettercap.</div>" +
"</body>" + "</body>" +
"</html>"; "</html>";
} }

View file

@ -1,6 +1,6 @@
# targeting the whole subnet by default, to make it selective: # targeting the whole subnet by default, to make it selective:
# #
# sudo ./bettercap-ng -caplet caplets/web-override.cap -eval "set arp.spoof.targets 192.168.1.64" # sudo ./bettercap -caplet caplets/web-override.cap -eval "set arp.spoof.targets 192.168.1.64"
set http.proxy.script caplets/web-override.js set http.proxy.script caplets/web-override.js
http.proxy on http.proxy on

View file

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>You've just been RickRoll'd</title> <title>You've just been RickRoll'd</title>
<meta name="description" content="You've just been RickRoll'd"> <meta name="description" content="You've just been RickRoll'd">
<meta name="author" content="bettercap-ng"> <meta name="author" content="bettercap">
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
<![endif]--> <![endif]-->

View file

@ -1,7 +1,7 @@
package core package core
const ( const (
Name = "bettercap-ng" Name = "bettercap"
Version = "2.0.0RC1" Version = "2.0.0RC1"
Author = "Simone 'evilsocket' Margaritelli" Author = "Simone 'evilsocket' Margaritelli"
Website = "https://bettercap.org/" Website = "https://bettercap.org/"

View file

@ -9,8 +9,8 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
) )
var ( var (

View file

@ -5,8 +5,8 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
) )
type LinuxFirewall struct { type LinuxFirewall struct {

View file

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
) )
type WindowsFirewall struct { type WindowsFirewall struct {

View file

@ -1,8 +1,8 @@
package log package log
import ( import (
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
func Debug(format string, args ...interface{}) { func Debug(format string, args ...interface{}) {

View file

@ -5,10 +5,10 @@ import (
"io" "io"
"os" "os"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/modules" "github.com/bettercap/bettercap/modules"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
var sess *session.Session var sess *session.Session

View file

@ -6,10 +6,10 @@ import (
"net/http" "net/http"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/evilsocket/bettercap-ng/tls" "github.com/bettercap/bettercap/tls"
) )
type RestAPI struct { type RestAPI struct {

View file

@ -6,7 +6,7 @@ import (
"net/http" "net/http"
"strconv" "strconv"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
var ( var (

View file

@ -5,9 +5,9 @@ import (
"net" "net"
"time" "time"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/malfunkt/iprange" "github.com/malfunkt/iprange"
) )

View file

@ -8,10 +8,10 @@ import (
"strings" "strings"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/google/gopacket" "github.com/google/gopacket"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"

View file

@ -6,10 +6,10 @@ import (
"net" "net"
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/google/gopacket" "github.com/google/gopacket"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"

View file

@ -3,8 +3,8 @@ package modules
import ( import (
"strconv" "strconv"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
type EventsStream struct { type EventsStream struct {

View file

@ -5,9 +5,9 @@ import (
// "sort" // "sort"
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
const eventTimeFormat = "2006-01-02 15:04:05" const eventTimeFormat = "2006-01-02 15:04:05"

View file

@ -1,7 +1,7 @@
package modules package modules
import ( import (
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
type HttpProxy struct { type HttpProxy struct {

View file

@ -15,11 +15,11 @@ import (
"strings" "strings"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/firewall" "github.com/bettercap/bettercap/firewall"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
btls "github.com/evilsocket/bettercap-ng/tls" btls "github.com/bettercap/bettercap/tls"
"github.com/elazarl/goproxy" "github.com/elazarl/goproxy"
"github.com/inconshreveable/go-vhost" "github.com/inconshreveable/go-vhost"

View file

@ -9,7 +9,7 @@ import (
"github.com/elazarl/goproxy" "github.com/elazarl/goproxy"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
type JSResponse struct { type JSResponse struct {

View file

@ -5,8 +5,8 @@ import (
"net/http" "net/http"
"sync" "sync"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/robertkrimen/otto" "github.com/robertkrimen/otto"
) )

View file

@ -3,7 +3,7 @@ package modules
import ( import (
"io/ioutil" "io/ioutil"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/robertkrimen/otto" "github.com/robertkrimen/otto"
) )

View file

@ -4,8 +4,8 @@ import (
"net/http" "net/http"
"testing" "testing"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
func getScript(src string) *ProxyScript { func getScript(src string) *ProxyScript {

View file

@ -7,9 +7,9 @@ import (
"strings" "strings"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
type HttpServer struct { type HttpServer struct {

View file

@ -1,10 +1,10 @@
package modules package modules
import ( import (
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/evilsocket/bettercap-ng/tls" "github.com/bettercap/bettercap/tls"
) )
type HttpsProxy struct { type HttpsProxy struct {

View file

@ -6,10 +6,10 @@ import (
"runtime" "runtime"
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
bnet "github.com/evilsocket/bettercap-ng/network" bnet "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
type MacChanger struct { type MacChanger struct {

View file

@ -5,9 +5,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/malfunkt/iprange" "github.com/malfunkt/iprange"
) )

View file

@ -5,7 +5,7 @@ import (
"net" "net"
"sync/atomic" "sync/atomic"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
) )
func (p *Prober) sendProbeUDP(from net.IP, from_hw net.HardwareAddr, ip net.IP) { func (p *Prober) sendProbeUDP(from net.IP, from_hw net.HardwareAddr, ip net.IP) {

View file

@ -3,9 +3,9 @@ package modules
import ( import (
"time" "time"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
type Discovery struct { type Discovery struct {

View file

@ -8,9 +8,9 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/dustin/go-humanize" "github.com/dustin/go-humanize"
"github.com/olekukonko/tablewriter" "github.com/olekukonko/tablewriter"

View file

@ -1,9 +1,9 @@
package modules package modules
import ( import (
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
type ByAddressSorter []*network.Endpoint type ByAddressSorter []*network.Endpoint

View file

@ -6,7 +6,7 @@ import (
"net" "net"
"time" "time"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/google/gopacket" "github.com/google/gopacket"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"

View file

@ -4,9 +4,9 @@ import (
"os" "os"
"regexp" "regexp"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/google/gopacket/pcap" "github.com/google/gopacket/pcap"
"github.com/google/gopacket/pcapgo" "github.com/google/gopacket/pcapgo"

View file

@ -3,7 +3,7 @@ package modules
import ( import (
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/google/gopacket" "github.com/google/gopacket"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
type SniffData map[string]interface{} type SniffData map[string]interface{}

View file

@ -3,7 +3,7 @@ package modules
import ( import (
"fmt" "fmt"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"regexp" "regexp"
"github.com/google/gopacket" "github.com/google/gopacket"

View file

@ -3,8 +3,8 @@ package modules
import ( import (
"encoding/asn1" "encoding/asn1"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/google/gopacket" "github.com/google/gopacket"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"

View file

@ -4,8 +4,8 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/google/gopacket" "github.com/google/gopacket"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"

View file

@ -3,9 +3,9 @@ package modules
import ( import (
"fmt" "fmt"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/google/gopacket" "github.com/google/gopacket"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"

View file

@ -3,7 +3,7 @@ package modules
import ( import (
"fmt" "fmt"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"regexp" "regexp"
"github.com/google/gopacket" "github.com/google/gopacket"

View file

@ -1,7 +1,7 @@
package modules package modules
import ( import (
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"time" "time"
) )

View file

@ -7,8 +7,8 @@ import (
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
func vTime(t time.Time) string { func vTime(t time.Time) string {

View file

@ -6,11 +6,11 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/google/gopacket" "github.com/google/gopacket"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"

View file

@ -1,8 +1,8 @@
package modules package modules
import ( import (
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
type SynScanEvent struct { type SynScanEvent struct {

View file

@ -3,8 +3,8 @@ package modules
import ( import (
"time" "time"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
type Ticker struct { type Ticker struct {

View file

@ -5,10 +5,10 @@ import (
"net" "net"
"time" "time"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
) )
func findMAC(s *session.Session, ip net.IP, probe bool) (net.HardwareAddr, error) { func findMAC(s *session.Session, ip net.IP, probe bool) (net.HardwareAddr, error) {

View file

@ -8,11 +8,11 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/google/gopacket" "github.com/google/gopacket"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"

View file

@ -1,7 +1,7 @@
package modules package modules
import ( import (
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
) )
type ByRSSISorter []*network.Station type ByRSSISorter []*network.Station

View file

@ -5,10 +5,10 @@ import (
"net" "net"
"regexp" "regexp"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
"github.com/evilsocket/bettercap-ng/session" "github.com/bettercap/bettercap/session"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"
) )

View file

@ -8,7 +8,7 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
var fileName, _ = core.ExpandPath("~/bettercap.aliases") var fileName, _ = core.ExpandPath("~/bettercap.aliases")

View file

@ -5,7 +5,7 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
type ArpTable map[string]string type ArpTable map[string]string

View file

@ -6,7 +6,7 @@ import (
"net" "net"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
type OnHostResolvedCallback func(e *Endpoint) type OnHostResolvedCallback func(e *Endpoint)

View file

@ -7,7 +7,7 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
type Meta struct { type Meta struct {

View file

@ -7,7 +7,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
const ( const (

View file

@ -5,7 +5,7 @@ import (
"net" "net"
"regexp" "regexp"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
const airPortPath = "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport" const airPortPath = "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"

View file

@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
// only matches gateway lines // only matches gateway lines

View file

@ -7,7 +7,7 @@ import (
"sync" "sync"
"sync/atomic" "sync/atomic"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/google/gopacket" "github.com/google/gopacket"
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"

View file

@ -6,7 +6,7 @@ import (
"strconv" "strconv"
"sync" "sync"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
type SetCallback func(newValue string) type SetCallback func(newValue string)

View file

@ -7,7 +7,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
type Event struct { type Event struct {

View file

@ -6,7 +6,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
type Module interface { type Module interface {

View file

@ -5,7 +5,7 @@ import (
"regexp" "regexp"
"strconv" "strconv"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
const IPv4Validator = `^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$` const IPv4Validator = `^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$`

View file

@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
) )
type ParamType int type ParamType int

View file

@ -5,7 +5,7 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/dustin/go-humanize" "github.com/dustin/go-humanize"
) )

View file

@ -17,10 +17,10 @@ import (
"github.com/evilsocket/readline" "github.com/evilsocket/readline"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/firewall" "github.com/bettercap/bettercap/firewall"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/bettercap-ng/packets" "github.com/bettercap/bettercap/packets"
) )
const HistoryFile = "~/bettercap.history" const HistoryFile = "~/bettercap.history"

View file

@ -7,8 +7,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/evilsocket/bettercap-ng/core" "github.com/bettercap/bettercap/core"
"github.com/evilsocket/bettercap-ng/network" "github.com/bettercap/bettercap/network"
"github.com/evilsocket/readline" "github.com/evilsocket/readline"
) )

View file

@ -13,7 +13,7 @@ import (
"sort" "sort"
"time" "time"
"github.com/evilsocket/bettercap-ng/log" "github.com/bettercap/bettercap/log"
) )
func hashSorted(lst []string) []byte { func hashSorted(lst []string) []byte {