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.
github.com/orcatools/shaman
Small, clusterable, lightweight, api-driven dns server.
# Start shaman with defaults (requires admin privileges (port 53))
shaman -s
# register a new domain
shaman add -d nanopack.io -A 127.0.0.1
# perform dns lookup
# OR `nslookup -port=53 nanopack.io 127.0.0.1`
dig @localhost nanopack.io +short
# 127.0.0.1
# Congratulations!
Simply run shaman <COMMAND>
shaman
or shaman -h
will show usage and a list of commands:
shaman - api driven dns server
Usage:
shaman [flags]
shaman [command]
Available Commands:
add Add a domain to shaman
delete Remove a domain from shaman
list List all domains in shaman
get Get records for a domain
update Update records for a domain
reset Reset all domains in shaman
Flags:
-C, --api-crt string Path to SSL crt for API access
-k, --api-key string Path to SSL key for API access
-p, --api-key-password string Password for SSL key
-H, --api-listen string Listen address for the API (ip:port) (default "127.0.0.1:1632")
-c, --config-file string Configuration file to load
-O, --dns-listen string Listen address for DNS requests (ip:port) (default "127.0.0.1:53")
-d, --domain string Parent domain for requests (default ".")
-i, --insecure Disable tls key checking (client) and listen on http (api)
-2, --l2-connect string Connection string for the l2 cache (default "scribble:///var/db/shaman")
-l, --log-level string Log level to output [fatal|error|info|debug|trace] (default "INFO")
-s, --server Run in server mode
-t, --token string Token for API Access (default "secret")
-T, --ttl int Default TTL for DNS records (default 60)
-v, --version Print version info and exit
Use "shaman [command] --help" for more information about a command.
For usage examples, see api and/or cli readme
To start shaman as a server run:
shaman --server
An optional config file can also be passed on startup:
shaman -c config.json
config.json
{ "api-crt": "", "api-key": "", "api-key-password": "", "api-listen": "127.0.0.1:1632", "token": "secret", "insecure": false, "l2-connect": "scribble:///var/db/shaman", "ttl": 60, "domain": ".", "dns-listen": "127.0.0.1:53", "log-level": "info", "server": true }
#### L2 connection strings
##### Scribble Cacher
The connection string looks like `scribble://localhost/path/to/data/store`.
<!--
#### Redis Cacher
The connection string looks like `redis://[user:password@]host:port/`.
#### Postgresql Cacher
The connection string looks like `postgres://[user@]host/database`.
-->
## API:
| Route | Description | Payload | Output |
| --- | --- | --- | --- |
| **POST** /records | Adds the domain and full record | json domain object | json domain object |
| **PUT** /records | Update all domains and records (replaces all) | json array of domain objects | json array of domain objects |
| **GET** /records | Returns a list of domains we have records for | nil | string array of domains |
| **PUT** /records/{domain} | Update domain's records (replaces all) | json domain object | json domain object |
| **GET** /records/{domain} | Returns the records for that domain | nil | json domain object |
| **DELETE** /records/{domain} | Delete a domain | nil | success message |
**note:** The API requires a token to be passed for authentication by default and is configurable at server start (`--token`). The token is passed in as a custom header: `X-AUTH-TOKEN`.
For examples, see [the api's readme](api/README.md)
## Overview
```sh
+------------+ +----------+ +-----------------+
| +-----> +-----> |
| API Server | | | | Short-Term |
| <-----+ Caching <-----+ (in-memory) |
+------------+ | And | +-----------------+
| Database |
+------------+ | Manager | +-----------------+
| +-----> +-----> |
| DNS Server | | | | Long-Term (L2) |
| <-----+ <-----+ |
+------------+ +----------+ +-----------------+
json:
{
"domain": "nanopack.io.",
"records": [
{
"ttl": 60,
"class": "IN",
"type": "A",
"address": "127.0.0.1"
},
{
"ttl": 60,
"class": "IN",
"type": "A",
"address": "127.0.0.2"
}
]
}
Fields:
json:
{
"err": "exit status 2: unexpected argument"
}
Fields:
json:
{
"msg": "Success"
}
Fields:
Contributions to shaman are welcome and encouraged. Shaman is a Nanobox project and contributions should follow the Nanobox Contribution Process & Guidelines.
FAQs
Unknown package
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.