id: privesc-torsocks info: name: Torsocks - Privilege Escalation author: daffainfo severity: high description: | torsocks is a wrapper that enables the use of the Tor network for any program, including those that do not natively support proxy settings. It intercepts and redirects network calls from the target program through the Tor network, providing a way to anonymize the network traffic of various applications. reference: - https://gtfobins.github.io/gtfobins/torsocks/ metadata: verified: true tags: code,linux,torsocks,privesc self-contained: true code: - engine: - sh - bash source: | whoami - engine: - sh - bash source: | torsocks whoami - engine: - sh - bash source: | sudo torsocks whoami matchers-condition: and matchers: - type: word part: code_1_response words: - "root" negative: true - type: dsl dsl: - 'contains(code_2_response, "root")' - 'contains(code_3_response, "root")' condition: or # digest: 4b0a004830460221009ccfb6a8d991e200d8f5780d56ba3db6d46cdc82fa3e7d9c57d6ac5605db4844022100c99b0af514c9a8414f12c721bcde734f01c1e2ac279ae97ee9a5ec4acd7254e2:922c64590222798bb761d5b6d8e72950