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.
ku is fast, async, modern, little tcp man-in-the-middle proxy library, written in pure Python 3
ku is fast, async, modern, little tcp man-in-the-middle proxy library, written in pure Python 3.
Proxy speed comparison results
pip install -U ku-proxy
Try to run this script and open http://localhost:80 in you browser
from ku import ku, tcpsession
from time import sleep
proxy = ku(("localhost", 80, "[::1]", 80), ("g.co", 80))
while 7:
try:
sleep(0.07)
except KeyboardInterrupt:
proxy.shutdown() #proxy creates a thread to async poll for socket events
break #we need to call shutdown() to break the thread loop
from ku import ku, tcpsession, Pass, Reject
from time import sleep
class conn(tcpsession):
def __init__(self, client, server, proxy):
self.client = client
self.server = server
self.proxy = proxy
self.id = id(self)
print(F"#{self.id} new conn {client.getpeername()}->{client.getsockname()}::{server.getsockname()}->{server.getpeername()}")
def clientbound(self, data):
print(F"#{self.id} server->client {len(data)}")
print(data)
return Pass
def serverbound(self, data):
print(F"#{self.id} client->server {len(data)}")
print(data)
#return None
#in python None is returned by default, None == Pass
def connection_made(self):
print(F"#{self.id} connection_made")
def connection_lost(self, side, err):
side = 'client' if side is self.client else 'server' if side is not None else 'proxy'
print(F"#{self.id} connection_lost by {side} due to {err}")
print("Starting...")
proxy = ku(("localhost", 80), ("api.ipify.org", 80), conn)
print("Started")
while 1:
try:
sleep(0.07)
except KeyboardInterrupt:
print("Shutting down...")
proxy.shutdown()
print("Exiting...")
break
See examples/ for more
FAQs
ku is fast, async, modern, little tcp man-in-the-middle proxy library, written in pure Python 3
We found that ku-proxy 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.