-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 2.62 KB
/
explore.yml
File metadata and controls
60 lines (54 loc) · 2.62 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Su Explorer
on:
push:
branches: [main]
schedule:
- cron: '*/30 * * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
explore:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Tools
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq nmap netcat-openbsd dnsutils curl tor torsocks
- name: Probe Environment
run: |
echo "=== Actions Runner Probe ==="
echo "timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "runner: $(hostname)"
echo "ip_direct: $(curl -s https://httpbin.org/ip 2>/dev/null | grep -o '"origin": "[^"]*"' | cut -d'"' -f4 || echo unknown)"
echo "location: $(curl -s https://ipinfo.io/json 2>/dev/null | grep -o '"city": "[^"]*"' | cut -d'"' -f4 || echo unknown)"
echo ""
echo "=== network ==="
echo "dns: $(dig +short github.com 2>/dev/null | head -1 || echo fail)"
echo "ping_cf: $(ping -c 1 -W 3 1.1.1.1 2>/dev/null | grep 'ttl=' | head -1 || echo fail)"
echo "smtp_25: $( (echo 'QUIT'; sleep 1) | nc -w 3 smtp.gmail.com 25 2>/dev/null | head -1 || echo blocked)"
echo "http_lobsters: $(curl -s -o /dev/null -w '%{http_code}' https://lobste.rs 2>/dev/null || echo fail)"
echo ""
echo "=== tor test ==="
tor --RunAsDaemon 1 --PidFile /tmp/tor.pid --SocksPort 9050 2>/dev/null || echo "tor start failed"
sleep 5
ss -tlnp | grep 9050 || echo "tor port not listening"
echo "tor_ip: $(torsocks curl -s --connect-timeout 10 https://httpbin.org/ip 2>/dev/null | grep -o '"origin": "[^"]*"' | cut -d'"' -f4 || echo tor_failed)"
kill $(cat /tmp/tor.pid 2>/dev/null) 2>/dev/null || true
echo "=== Done ==="
- name: Save Results
run: |
mkdir -p probe_results
TS=$(date -u +%Y%m%d-%H%M%S)
IP=$(curl -s https://httpbin.org/ip 2>/dev/null | grep -o '"origin": "[^"]*"' | cut -d'"' -f4 || echo unknown)
LOC=$(curl -s https://ipinfo.io/json 2>/dev/null | grep -o '"city": "[^"]*"' | cut -d'"' -f4 || echo unknown)
echo "{\"node\": \"github-actions\", \"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\", \"ip\": \"$IP\", \"location\": \"$LOC\"}" > probe_results/actions_probe_$TS.json
- name: Commit
run: |
git config user.name "su-bot"
git config user.email "su@localhost"
git add probe_results/
git diff --cached --quiet || git commit -m "probe: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
git push