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

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

Open
NobinPegasus opened this issue May 29, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@NobinPegasus
Copy link

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 NobinPegasus added the bug Something isn't working label May 29, 2024
@oluceps
Copy link
Member

oluceps commented May 30, 2024

Seems to miss submodules. Try

git submodule init --update --recursive

@NobinPegasus
Copy link
Author

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

image

@oluceps
Copy link
Member

oluceps commented May 30, 2024

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

@NobinPegasus
Copy link
Author

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>...]

@oluceps
Copy link
Member

oluceps commented May 30, 2024

Or clone the entire repo with --recursive arg

@oluceps
Copy link
Member

oluceps commented May 30, 2024

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

@NobinPegasus
Copy link
Author

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

@oluceps
Copy link
Member

oluceps commented May 30, 2024

@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/

@NobinPegasus
Copy link
Author

@oluceps same result.
image

@Officeyutong
Copy link
Contributor

@oluceps same result. image

Try use the same user as sslsniff when running curl

@NobinPegasus
Copy link
Author

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

@Officeyutong
Copy link
Contributor

Officeyutong commented Jun 1, 2024

They are the same user.

What do you mean?

@Officeyutong

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

@NobinPegasus
Copy link
Author

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?

@Officeyutong
Copy link
Contributor

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

@yunwei37
Copy link
Member

yunwei37 commented Sep 7, 2024

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

@yunwei37
Copy link
Member

yunwei37 commented Sep 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants