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.
github.com/MarinX/kit-payment
Clone the repo
git clone https://github.com/MarinX/kit-payment
Fetch dependencies
go get ./...
Build as any other go project
go build
Usage of ./kit-payment:
-http.addr string
HTTP listen address (default ":8080")
Kit-payment is using embedded key/value database called boltdb.
curl -H "Content-Type: application/json" -X POST http://localhost:8080/accounts
curl -H "Content-Type: application/json" -X GET http://localhost:8080/accounts
Example addding $100 to account id 3479d3a8-42c4-4b40-8a1d-1b1661d7b6ef
curl -d '{"currency":"USD", "amount":100}' -H "Content-Type: application/json" -X POST http://localhost:8080/accounts/3479d3a8-42c4-4b40-8a1d-1b1661d7b6ef/balances
curl -H "Content-Type: application/json" -X GET http://localhost:8080/transactions
Example of moving $50 from account 3479d3a8-42c4-4b40-8a1d-1b1661d7b6ef
to account 06e39e77-776a-4694-bc59-fea69bc8afd8
curl -d '{"from":"3479d3a8-42c4-4b40-8a1d-1b1661d7b6ef", "to":"06e39e77-776a-4694-bc59-fea69bc8afd8", "currency":"USD", "amount":50}' -H "Content-Type: application/json" -X POST http://localhost:8080/transactions
If success, it will return a created transaction object
{"transaction":{"id":"fecf39a1-c4f2-4706-8eca-bc71f310eeb6","from":"3479d3a8-42c4-4b40-8a1d-1b1661d7b6ef","to":"06e39e77-776a-4694-bc59-fea69bc8afd8","status":"created","amount":50,"currency":"USD"}}
Example of getting single transaction by id fecf39a1-c4f2-4706-8eca-bc71f310eeb6
curl -H "Content-Type: application/json" -X GET http://localhost:8080/transactions/fecf39a1-c4f2-4706-8eca-bc71f310eeb6
Once the transaction is created, you need to commit.
Example is commiting created transaction fecf39a1-c4f2-4706-8eca-bc71f310eeb6
curl -H "Content-Type: application/json" -X PUT http://localhost:8080/transactions/fecf39a1-c4f2-4706-8eca-bc71f310eeb6/commit
Now you can check the status with Get Transaction
method.
If account has enough balance, you will see the change on amount when listing accounts.
It provides a interface for merkle tree so we can check if all transactions are verified.
Example of checking our last transaction fecf39a1-c4f2-4706-8eca-bc71f310eeb6
curl -H "Content-Type: application/json" -X GET http://localhost:8080/transactions/fecf39a1-c4f2-4706-8eca-bc71f310eeb6/hash
will return the hash for verification
{"hash":"fdf227bade5496e59824a4c9ef59ec992c61b4521fe0003c5be4d79cec3c885c"}
Nothing fancy, just run
go test -v ./...
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
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.