Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnPacket conflict between gopacket.example.go and tls.downgrade.go #2

Open
monyettenyom opened this issue Nov 28, 2019 · 13 comments
Open

Comments

@monyettenyom
Copy link

monyettenyom commented Nov 28, 2019

Hey all,
so I did build two paket.proxy-plugins you had provided, which are gopacket.example.go and tls.downgrade.go.

tls.downgrade.go is fixed by @buffermet . Thanks, boss!

gopacket.example.go and tls.downgrad.go were built successfully.

But as I tried to build bettercap with this:
make build

I got these:
go build -o bettercap .
./tls.downgrade.go:74:6: OnPacket redeclared in this block
previous declaration at ./gopacket.example.go:11:41
make: *** [Makefile:10: build] Error 2

What did I do wrong?

Environment:
OS version and architecture you are using: Kali GNU/Linux Rolling 2019.4
Go version if building from sources: go version go1.13.4 linux/amd64

@buffermet
Copy link
Member

In which directory did you place and build the tls.downgrade.go file?

@buffermet
Copy link
Member

Go plugins for the packet.proxy module should be built in the $GOPATH/src/github.com/bettercap/bettercap directory.

@monyettenyom
Copy link
Author

Also, if I didn't misunderstand, I have to pull the source code with:
go get -u github.com/bettercap/bettercap
The plugins should be downloaded directly in the folder, right? Or did I misunderstand?
Please tell me step by step how to download and install bettercap with the plugins, I'm very confused because of too many steps I have to do.

@monyettenyom
Copy link
Author

I did both sample steps I found on this:
https://www.bettercap.org/installation/

I downloaded the source code and its dependencies, just like the steps "Compiling from sources"

Because I got problems with downloading the dependencies, I have done the steps "Linux deploy method"
At the end of the step of Linux deploy method, I got problem with packet proxy plugins. I downloaded the plugins independently and changed the lines, just like you had suggested this morning west Europe time. And then I compiled the plugins independently. I had no problem with compiling the plugins.

Soon as I tried to compile bettercap, I got the error message.

I mixed up the steps, I know. How can I undo this?

@buffermet
Copy link
Member

The plugins are in the bettercap/packet.proxy-plugins repository. You can clone it with git or go get.

To install a packet.proxy plugin, you have to build it yourself inside bettercap's source directory at $GOPATH/src/github.com/bettercap/bettercap.

Follow the build instructions from the documentation and you will find a new .so file in bettercap's source directory. Set this file's path as the value of bettercap's packet.proxy.plugin environment variable. Then you can start using the packet.proxy module.

@buffermet
Copy link
Member

You still had the gopacket.example.go file in bettercap's source directory when you tried to build bettercap.

@monyettenyom
Copy link
Author

Should I delete the gopacket.example.go?

@buffermet
Copy link
Member

buffermet commented Nov 28, 2019

You should only have 1 packet.proxy .go plugin file in the source directory, otherwise compilation fails. You shouldn't have any packet.proxy .go files in the source directory when you build bettercap in case of duplicate declarations.

@monyettenyom
Copy link
Author

monyettenyom commented Nov 28, 2019

I can't find the bettercap folder.

locate bettercap
/usr/lib/libettercap.so
/usr/lib/libettercap.so.0
/usr/lib/libettercap.so.0.0.0
/usr/share/icons/hicolor/16x16/apps/kali-bettercap.png
/usr/share/icons/hicolor/22x22/apps/kali-bettercap.png
/usr/share/icons/hicolor/24x24/apps/kali-bettercap.png
/usr/share/icons/hicolor/256x256/apps/kali-bettercap.png
/usr/share/icons/hicolor/32x32/apps/kali-bettercap.png
/usr/share/icons/hicolor/48x48/apps/kali-bettercap.png
/usr/share/kali-menu/applications/kali-bettercap.desktop

@buffermet
Copy link
Member

It's in your $GOPATH folder..

Can you please give us the output of which bettercap?

@monyettenyom
Copy link
Author

root@lenovo:# ls
1 capture-01.kismet.netxml ettercaplog Pictures
bettercap.history capture-01.log.csv getmecamtool Public
build Desktop go Templates
capture-01.cap Documents hashcat Videos
capture-01.csv Downloads intel wget-log
capture-01.kismet.csv dsniff.services Music wget-log.1
root@lenovo:
# cd go
root@lenovo:/go# ls
bin pkg src
root@lenovo:
/go# cd bin
root@lenovo:/go/bin# ls
bettercap
root@lenovo:
/go/bin# which bettercap
root@lenovo:~/go/bin#

@buffermet
Copy link
Member

Your go path is in your home folder, so you can find bettercap's source folder at ~/go/src/github.com/bettercap/bettercap.

@monyettenyom
Copy link
Author

I've installed successfully, thanks a lot. I've found the tls.downgrade.so, which I had compiled and I found bettercap folder in the github.com folder. I ran make build and make install in the folder and bettercap is installed.

output of which bettercap is now:
root@lenovo:~# which bettercap
/usr/local/bin/bettercap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants