Code Monkey home page Code Monkey logo

Comments (10)

negbie avatar negbie commented on May 8, 2024 2

Following worked for mips64

  1. You need docker and the xgo fork from ykyuen
  2. go get github.com/ykyuen/xgo
  3. create the folder xgo-dist and move the xgo binary there
  4. run:
    ./xgo -ldflags='-linkmode external -extldflags "-static -s -w"' --deps=http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz --depsargs=--with-pcap=linux --targets=linux/mips64 github.com/google/gopacket

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

if this works, you have no idea how simpler you just made my life, will test asap

from bettercap.

negbie avatar negbie commented on May 8, 2024

Just compiled bettercap-ng for mips64. This will give you a 15mb static binary

[root@negbie-pc xgo-dist]# ./xgo -ldflags='-linkmode external -extldflags "-static -s -w"' --deps=http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz --depsargs=--with-pcap=linux --targets=linux/mips64 github.com/evilsocket/bettercap-ng
Checking docker installation...
Client:
Version: 18.01.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: 03596f51b1
Built: Sun Jan 14 23:10:39 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm

Server:
Engine:
Version: 18.01.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: 03596f51b1
Built: Sun Jan 14 23:11:14 2018
OS/Arch: linux/amd64
Experimental: false

Checking for required docker image ykyuen/xgo-latest... found.
Dependency already cached: /root/.xgo-cache/libpcap-1.8.1.tar.gz.
Cross compiling github.com/evilsocket/bettercap-ng...
Fetching main repository github.com/evilsocket/bettercap-ng...
github.com/evilsocket/bettercap-ng (download)
github.com/chzyer/readline (download)
github.com/dustin/go-humanize (download)
github.com/google/gopacket (download)
github.com/mdlayher/dhcp6 (download)
github.com/elazarl/goproxy (download)
github.com/gin-gonic/gin (download)
github.com/gin-contrib/sse (download)
github.com/golang/protobuf (download)
github.com/ugorji/go (download)
Fetching https://gopkg.in/go-playground/validator.v8?go-get=1
Parsing meta tags from https://gopkg.in/go-playground/validator.v8?go-get=1 (status code 200)
get "gopkg.in/go-playground/validator.v8": found meta tag main.metaImport{Prefix:"gopkg.in/go-playground/validator.v8", VCS:"git", RepoRoot:"https://gopkg.in/go-playground/validator.v8"} at https://gopkg.in/go-playground/validator.v8?go-get=1
gopkg.in/go-playground/validator.v8 (download)
Fetching https://gopkg.in/yaml.v2?go-get=1
Parsing meta tags from https://gopkg.in/yaml.v2?go-get=1 (status code 200)
get "gopkg.in/yaml.v2": found meta tag main.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at https://gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)
github.com/mattn/go-isatty (download)
github.com/inconshreveable/go-vhost (download)
github.com/malfunkt/iprange (download)
github.com/pkg/errors (download)
github.com/olekukonko/tablewriter (download)
github.com/mattn/go-runewidth (download)
github.com/robertkrimen/otto (download)
Fetching https://gopkg.in/sourcemap.v1?go-get=1
Parsing meta tags from https://gopkg.in/sourcemap.v1?go-get=1 (status code 200)
get "gopkg.in/sourcemap.v1": found meta tag main.metaImport{Prefix:"gopkg.in/sourcemap.v1", VCS:"git", RepoRoot:"https://gopkg.in/sourcemap.v1"} at https://gopkg.in/sourcemap.v1?go-get=1
gopkg.in/sourcemap.v1 (download)
Fetching https://gopkg.in/unrolled/secure.v1?go-get=1
Parsing meta tags from https://gopkg.in/unrolled/secure.v1?go-get=1 (status code 200)
get "gopkg.in/unrolled/secure.v1": found meta tag main.metaImport{Prefix:"gopkg.in/unrolled/secure.v1", VCS:"git", RepoRoot:"https://gopkg.in/unrolled/secure.v1"} at https://gopkg.in/unrolled/secure.v1?go-get=1
gopkg.in/unrolled/secure.v1 (download)
Compiling for linux/mips64...
Configuring dependency libpcap-1.8.1 for mips64-linux-gnuabi64...
Building dependency libpcap-1.8.1 for mips64-linux-gnuabi64...
grammar.y: warning: 38 shift/reduce conflicts [-Wconflicts-sr]
config.status: creating pcap-config.tmp
Cleaning up build environment...
Copy the built binaries to the project xgo-dist folder...

[root@negbie-pc xgo-dist]# ls -lh
insgesamt 23M
-rwxr-xr-x 1 root root 15M 7. Feb 21:42 bettercap-ng-linux-mips64
-rwxr-xr-x 1 negbie negbie 7,5M 7. Feb 21:30 xgo

from bettercap.

negbie avatar negbie commented on May 8, 2024

Just make sure you create the xgo-dist folder and put the xgo binary in there otherwise you will get
cp: omitting directory '/build/xgo-dist'
2018/02/07 21:40:38 Failed to cross compile package: exit status 1.

from bettercap.

negbie avatar negbie commented on May 8, 2024

For windows I can recommend you to do this:
https://stackoverflow.com/questions/38047858/compile-gopacket-on-windows-64bit
Worked for me very well.

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

yes i know, i'm working on it on the windows branch

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

@negbie I managed to make it work for linux ( arm, arm64, mips and mips64 ), but not for android or osx or windows, any clue? (check recent Makefile additions about cross compilation rules)

from bettercap.

negbie avatar negbie commented on May 8, 2024

Cross compile libpcap stuff for windows is a pain. I gave up and now I use a vm with windows to do it. I have no clue about osx related stuff but if you can compile tcpdump on it I would dig a bit deeper. Never tried it for android either but since you can compile it for arm it should be possible.

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

see the build_*.sh files.

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

https://github.com/evilsocket/bettercap-ng/blob/master/build.sh

from bettercap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.