● Notice //GitHub (@shehzade) is temporarily suspended pending an automated false-positive review. All tools are hosted on this Code Mirror and available on request (contact); GitHub links will return once reinstated.
PUBLIC MIRRORPython

AI-driven badge OSINT, credential harvesting, and calibrated CR80 card cloning for physical red teams.

$ git clone https://shehzade.io/repos/lanyard.git Copy
Source ZIP (1.35 MB)
Code 35 Commits 2
lanyard / setup.sh
← Back to directory
119 lines · 3.9 KB
Raw
1#!/usr/bin/env bash
2set -euo pipefail
3
4# Lanyard automated setup script
5# Configures Python virtual environment, dependencies, and Camoufox stealth browser.
6
7SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8cd "$SCRIPT_DIR"
9
10echo "=================================================="
11echo " Lanyard Setup & Installation "
12echo "=================================================="
13
14# 1. Check Python version
15PYTHON_BIN=""
16for cmd in python3.14 python3.13 python3.12 python3 python; do
17 if command -v "$cmd" >/dev/null 2>&1; then
18 PY_VER=$("$cmd" -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
19 MAJOR=$(echo "$PY_VER" | cut -d. -f1)
20 MINOR=$(echo "$PY_VER" | cut -d. -f2)
21 if [ "$MAJOR" -ge 3 ] && [ "$MINOR" -ge 12 ]; then
22 PYTHON_BIN=$(command -v "$cmd")
23 echo "[+] Found compatible Python: $PYTHON_BIN (v$PY_VER)"
24 break
25 fi
26 fi
27done
28
29if [ -z "$PYTHON_BIN" ]; then
30 echo "[-] Error: Python 3.12 or newer is required." >&2
31 echo " Please install Python 3.12+ and rerun this script." >&2
32 exit 1
33fi
34
35# 2. Check for uv or fallback to standard venv + pip
36USE_UV=false
37if command -v uv >/dev/null 2>&1; then
38 USE_UV=true
39 echo "[+] Found uv package manager (fast install mode)"
40else
41 echo "[*] uv not found; proceeding with standard pip and venv"
42fi
43
44# 3. Create or reuse virtual environment
45if [ "$USE_UV" = true ]; then
46 echo "[*] Syncing project dependencies with uv..."
47 uv sync
48 VENV_DIR="$SCRIPT_DIR/.venv"
49else
50 VENV_DIR="$SCRIPT_DIR/.venv"
51 if [ ! -d "$VENV_DIR" ]; then
52 echo "[*] Creating virtual environment in .venv..."
53 "$PYTHON_BIN" -m venv "$VENV_DIR"
54 else
55 echo "[+] Reusing existing virtual environment in .venv"
56 fi
57
58 echo "[*] Upgrading pip and build tools..."
59 "$VENV_DIR/bin/pip" install --upgrade pip setuptools wheel --quiet
60
61 echo "[*] Installing lanyard in editable mode..."
62 "$VENV_DIR/bin/pip" install -e . --quiet
63fi
64
65# 4. Fetch Camoufox browser binaries
66echo "[*] Fetching Camoufox stealth browser binaries..."
67if [ -f "$VENV_DIR/bin/camoufox" ]; then
68 "$VENV_DIR/bin/camoufox" fetch
69elif [ "$USE_UV" = true ]; then
70 uv run camoufox fetch
71else
72 echo "[-] Warning: camoufox executable not found in $VENV_DIR/bin"
73fi
74
75# 5. Install Playwright browser system dependencies on Linux if apt is present
76if [ "$(uname -s)" = "Linux" ] && command -v apt-get >/dev/null 2>&1 && [ -f "$VENV_DIR/bin/playwright" ]; then
77 if [ "${INSTALL_SYSTEM_DEPS:-0}" = "1" ]; then
78 echo "[*] Installing system dependencies for Playwright/Camoufox..."
79 sudo "$VENV_DIR/bin/playwright" install-deps firefox || true
80 fi
81fi
82
83# 6. Initialize local configuration and templates
84LANYARD_HOME="$HOME/.lanyard"
85mkdir -p "$LANYARD_HOME/session"
86echo "[+] Initialized directory: $LANYARD_HOME"
87
88if [ ! -f .env ] && [ -f .env.example ]; then
89 cp .env.example .env
90 echo "[+] Created default .env from .env.example"
91fi
92
93# 7. Verification check
94echo "[*] Verifying CLI installation..."
95if "$VENV_DIR/bin/lanyard" --help >/dev/null 2>&1; then
96 echo "[+] Lanyard CLI verified successfully!"
97else
98 echo "[-] Warning: CLI verification test failed. Check installation logs." >&2
99fi
100
101echo ""
102echo "=================================================="
103echo " Setup Completed Successfully "
104echo "=================================================="
105echo ""
106echo "To get started, activate your virtual environment:"
107echo " source .venv/bin/activate"
108echo ""
109echo "Next steps:"
110echo " 1. Authenticate with LinkedIn:"
111echo " lanyard login"
112echo " # or: lanyard cookie \"AQED...\""
113echo ""
114echo " 2. Configure your vision provider:"
115echo " lanyard config --provider gemini --gemini-key \"AIzaSy...\""
116echo ""
117echo " 3. Launch a badge hunt:"
118echo " lanyard hunt -c \"Target Company\" --depth 5"
119echo ""