-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patholeander.py
More file actions
35 lines (26 loc) · 1.03 KB
/
oleander.py
File metadata and controls
35 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import sys
from scanner import scan_directory
def main():
#command-line interface for the environment variable leak scanner, oleander.
if len(sys.argv) !=2 or sys.argv[1] in ("--help", "-h"):
print("""
oleander: an Environment Variable Leak Detector.
Usage:
python oleander.py <directory>
Example:
python oleander.py ./test_data
Scans the specified directory for environment variable leaks and high-entropy secrets.
""")
return
#scans the given directory and prints results to the user in a readable format.
directory = sys.argv[1]
results = scan_directory(directory)
if not results:
print("[+] No high-risk environment variable leaks found.")
else:
for r in results:
print(f"[!] {r['file']}:{r['line']} - Entropy: {r['entropy']}")
print(f" {r['content']}\n")
print(f"[!] Total potential leaks found: {len(results)}")
if __name__ == "__main__":
main()