bpf-developer-tutorial icon indicating copy to clipboard operation
bpf-developer-tutorial copied to clipboard

[BUG] 30-sslsniff: make: *** [Makefile:86: /home/pegasus/Documents/bpf-developer-tutorial/src/30-sslsniff/.output/libbpf.a] Error 2

Open NobinPegasus opened this issue 1 year ago • 17 comments

Describe the bug When I'm trying to build the sslsniff tool from lesson 30 I face the following error: make: *** [Makefile:86: /home/pegasus/Documents/bpf-developer-tutorial/src/30-sslsniff/.output/libbpf.a] Error 2

To Reproduce

use make from the 30-sslsniff directory.

pegasus@pegasus:~/Documents/bpf-developer-tutorial/src/30-sslsniff$ make
  MKDIR    .output
  MKDIR    .output/libbpf
  LIB      libbpf.a
make[1]: *** /home/pegasus/Documents/bpf-developer-tutorial/src/third_party/libbpf/src: No such file or directory.  Stop.
make: *** [Makefile:86: /home/pegasus/Documents/bpf-developer-tutorial/src/30-sslsniff/.output/libbpf.a] Error 2

Expected behavior It should build the tool properly

Screenshots image

Desktop (please complete the following information):

pegasus@pegasus:~$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 24.04 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
pegasus@pegasus:~$ uname -a
Linux pegasus 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

NobinPegasus avatar May 29 '24 20:05 NobinPegasus

Seems to miss submodules. Try

git submodule init --update --recursive

oluceps avatar May 30 '24 03:05 oluceps

I already have my libbpf inside the 30-sslsniff directory and built it there. Where should I have it?

image

NobinPegasus avatar May 30 '24 06:05 NobinPegasus

Where should I have it?

git submodule update --init --recursive

Run this under the top-level of bpf-developer-tutorial directory. This will init the git submodule in ./src/thirdparty/libbpf

oluceps avatar May 30 '24 06:05 oluceps

The output

pegasus@pegasus:~/Documents/bpf-developer-tutorial$ git submodule init --update --recursive
usage: git submodule [--quiet] [--cached]
   or: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
   or: git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] [--] [<path>...]
   or: git submodule [--quiet] set-branch (--default|--branch <branch>) [--] <path>
   or: git submodule [--quiet] set-url [--] <path> <newurl>
   or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
   or: git submodule [--quiet] absorbgitdirs [--] [<path>...]

NobinPegasus avatar May 30 '24 06:05 NobinPegasus

Or clone the entire repo with --recursive arg

oluceps avatar May 30 '24 06:05 oluceps

The output

pegasus@pegasus:~/Documents/bpf-developer-tutorial$ git submodule init --update --recursive
usage: git submodule [--quiet] [--cached]
   or: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
   or: git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] [--] [<path>...]
   or: git submodule [--quiet] set-branch (--default|--branch <branch>) [--] <path>
   or: git submodule [--quiet] set-url [--] <path> <newurl>
   or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
   or: git submodule [--quiet] absorbgitdirs [--] [<path>...]

sry it should be git submodule update --init --recursive I made a typo

oluceps avatar May 30 '24 06:05 oluceps

@oluceps Thanks I was able to run it. Following the suggestions you provided. But sslsniff is unable to provide any output. image

NobinPegasus avatar May 30 '24 06:05 NobinPegasus

@oluceps Thanks I was able to run it. Following the suggestions you provided. But sslsniff is unable to provide any output.

Try curl --tlsv1.2 https://example.com/

oluceps avatar May 30 '24 07:05 oluceps

@oluceps same result. image

NobinPegasus avatar May 30 '24 23:05 NobinPegasus

@oluceps same result. image

Try use the same user as sslsniff when running curl

Officeyutong avatar May 31 '24 06:05 Officeyutong

They are the same user. What do you mean? @Officeyutong

NobinPegasus avatar May 31 '24 19:05 NobinPegasus

They are the same user.

What do you mean?

@Officeyutong

You are using root to run sslsniff but using pegasus to run curl

Officeyutong avatar Jun 01 '24 05:06 Officeyutong

Without using sudo ./sslsniff It doesn't work. image

The documentation also suggests to use sudo sslsniff in one terminal and in another terminal use curl. image

It works fine with sudo curl though. But I want to also capture normal firefox or curl traffic from sslsniff. Without using sudo. How can I achieve it?

NobinPegasus avatar Jun 01 '24 20:06 NobinPegasus

Without using sudo ./sslsniff It doesn't work. image

The documentation also suggests to use sudo sslsniff in one terminal and in another terminal use curl. image

It works fine with sudo curl though. But I want to also capture normal firefox or curl traffic from sslsniff. Without using sudo. How can I achieve it?

It's an issue to be solved...I don't know how to capture traffic by other users. If you are interested in it, you may try to research on it

Officeyutong avatar Jun 02 '24 05:06 Officeyutong

It should be able to capture traffic by other users. Let's see what happend.

yunwei37 avatar Sep 07 '24 05:09 yunwei37

The cilium slack has some discussion about that. Maybe we can add them in the tutorial.

yunwei37 avatar Sep 08 '24 21:09 yunwei37

Can you speak chinese? 我试了chrome也是无法获取到流量,看到chrome使用的是/lib/x86_64-linux-gnu/libgnutls.so,不过在sslsniff开始的输出中,看到了对gnutls的支持

AnInteger avatar Mar 11 '25 16:03 AnInteger