Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Turq is a small HTTP server that can be scripted in a Python-based language. Use it to set up mock HTTP resources that respond with the status, headers, and body of your choosing. Turq is designed for quick interactive testing, but can be used in automated scenarios as well.
"RESTful API" resource with cross-origin support::
if route('/v1/products/:product_id'):
if GET or HEAD:
json({'id': product_id, 'inStock': True})
elif PUT:
json(request.json) # As if we saved it
elif DELETE:
status(204)
cors() # Handles preflight requests automatically
Redirect to an index.php
, which serves a gzipped, cacheable page
after 3 seconds of "loading"::
if path == '/':
redirect('/index.php')
if path == '/index.php':
sleep(3)
html()
gzip()
header('Cache-Control', 'max-age=3600')
Stream server-sent events
_::
header('Content-Type', 'text/event-stream')
for i in range(9000):
sleep(1)
chunk('data: event number %d\r\n\r\n' % i)
.. _server-sent events: https://en.wikipedia.org/wiki/Server-sent_events
You don't even need to create any files, just use the built-in Web editor:
.. image:: screenshot.png
In any Python 3.4+ environment::
$ pip3 install turq
$ turq
Read the docs <http://turq.readthedocs.io/en/stable/>
_ for more.
BrowserStack
_ have kindly provided a free subscription for testing Turq.
.. _BrowserStack: https://www.browserstack.com/
FAQs
Mock HTTP server
We found that turq 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.