Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Control wifi, hotspot and hostname of Raspberry Pi
Python3.10+
pip3 install rpi-networking
poetry add rpi-networking
Via curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/MarkParker5/rpi-networking/master/setup.sh)"
Or via wget
sh -c "$(wget https://raw.githubusercontent.com/MarkParker5/rpi-networking/master/setup.sh -O -)"
sudo apt update ; \
sudo apt upgrade -y ; \
sudo apt install dnsmasq hostapd dhcpd -y
Give user permission to edit configuration files so python doesn't have to be run as root (sudo)
files=(
"/etc/dnsmasq.conf"
"/etc/hosts"
"/etc/default/hostapd"
"/etc/hostapd/hostapd.conf"
"/etc/network/interfaces"
"/etc/network/interfaces.d"
"/etc/wpa_supplicant/wpa_supplicant.conf"
)
for file in "${files[@]}"; do
sudo chown "$USER" "$file"
sudo chmod 644 "$file"
done;
There are functions for initial configuration setup.
# rpi_networking.configuraion
def write_interfaces():
def write_default_hostapd():
def write_hostapd_conf():
def write_dnsmasq_conf():
def write_wpa_supplicant(country: str = "GB"):
def write_hosts():
def write_all(): # calls all functions above
In most cases you only need to call write_all()
once to setup all configuration files.
# rpi_networking.hostname
def set_hostname(hostname: str):
def restart_interfaces(): # apply new hostname without reboot
# rpi_networking.hotspot
def is_hotspot_up() -> bool:
def start_hotspot() -> bool:
def stop_hotspot() -> bool:
The bool
return value is True
if function finished without errors (exit code 0), else False
# rpi_networking.status
def is_wlan_connected() -> bool:
def is_eth_connected() -> bool:
def is_wlan_global_connected() -> bool: # 'global' means internet access
def is_eth_global_connected() -> bool:
def is_wps_running() -> bool:
# rpi_networking.wifi
country: str = 'GB' # country code for wpa_supplicant
class InterfaceBusyException(Exception):
pass
class Cell:
ssid: str
quality: float
frequency: str
encrypted: bool
class Network:
ssid: str
psk: str
id_str: str
# Functions
def read_networks() -> list[Network]:
def write_networks(networks: list[Network]):
def add_network(ssid: str, psk: str):
def reconnect() -> bool: # connect to the best available network
def scan() -> Generator[Cell, None, None]:
def start_wps() -> bool:
FAQs
Control wifi, hotspot and hostname of Raspberry Pi
We found that rpi-networking demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.