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

Support tracee-launched Tor daemon #62

Open
JeremyRand opened this issue May 2, 2023 · 4 comments
Open

Support tracee-launched Tor daemon #62

JeremyRand opened this issue May 2, 2023 · 4 comments

Comments

@JeremyRand
Copy link
Member

Some applications (e.g. Tor Browser, Brave, and OnionShare) support launching their own bundled Tor instance. It would be nice if we could optionally detect such cases, and avoid treating connections issued by that Tor instance as a proxy leak.

@JeremyRand
Copy link
Member Author

Since Horklump can see the process ID of each intercepted syscall, it seems that we should be able to key our behavior on that. Detecting the program name, given a PID, is doable in Linux AFAIK. So we should be able to detect the program name of the PID, and whitelist the PID if its program name is tor.

@robertmin1
Copy link
Collaborator

pid := record.PID

// read the process name from /proc/<pid>/comm
commPath := fmt.Sprintf("/proc/%d/comm", pid)
commBytes, err := ioutil.ReadFile(commPath)
if err != nil {
     panic(err)
}
comm := string(commBytes)

 // check if the process name is "tor" and whitelist the PID if it is
if comm == "tor\n" {
      fmt.Printf("PID %d is a Tor process\n", pid)
      // whitelist the PID
}

@robertmin1
Copy link
Collaborator

Alright, I was thinking of such as implementation. But for the tracee only right? Checking all sub-processes might be repetitive.

@robertmin1
Copy link
Collaborator

robertmin1 commented May 17, 2023

@JeremyRand Suggested to use cmdline since it provides additional information, such as arguments

robertmin1 added a commit that referenced this issue May 18, 2023
robertmin1 added a commit that referenced this issue May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants