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.
A lightweight python socket library. You can create a TCP/UDP connection easily.
pip install cushy-socket --upgrade
Here are some minimal example programs using the cushy-socket
: a server that echoes all data that it receives back(servicing only one client), and a client using it.
# echo tcp server program
import socket
from cushy_socket.tcp import CushyTCPServer
cushy_tcp_server = CushyTCPServer(host='localhost', port=7777)
cushy_tcp_server.run()
@cushy_tcp_server.on_connected()
def handle_on_connected(sock: socket.socket):
print(f"[server decorator callback] new client connected.")
print(sock)
@cushy_tcp_server.on_disconnected()
def handle_on_disconnected(sock: socket.socket):
print(f"[server decorator callback] a client disconnected.")
print(sock)
@cushy_tcp_server.on_message()
def handle_msg_from_client(msg: str, socket: socket.socket):
print(f"[server decorator callback] cushy_tcp_server rec msg: {msg}")
cushy_tcp_server.send("hello, I am server")
# echo tcp client program
from cushy_socket.tcp import CushyTCPClient
cushy_tcp_client = CushyTCPClient(host='localhost', port=7777)
cushy_tcp_client.run()
@cushy_tcp_client.on_connected()
def handle_on_connected():
print(f"[client decorator callback] connect to server.")
@cushy_tcp_client.on_disconnected()
def handle_on_disconnected():
print(f"[client decorator callback] server disconnected.")
@cushy_tcp_client.on_message()
def handle_msg_from_server(msg: str):
print(f"[client decorator callback] cushy_tcp_client rec msg: {msg}")
cushy_tcp_client.send("hello, here is CSTCP client")
cushy_tcp_client.close()
If you want to contribute to this project, you can submit pr or issue. I am glad to see more people involved and optimize it.
FAQs
A lightweight socket library
We found that cushy-socket 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.