bntoolkit

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

BNToolkit

[TOC]

Install

Install Docker
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
sudo apt install docker-ce

REF: https://www.digitalocean.com/community/tutorials/como-instalar-y-usar-docker-en-ubuntu-18-04-1-es

Install Golang
sudo apt-get update
sudo apt-get -y upgrade
wget https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz #Check latest in https://golang.org/dl/
sudo tar -xvf go1.12.9.linux-amd64.tar.gz
sudo mv go /usr/local
mkdir ~/work
echo 'export GOROOT=/usr/local/go
export GOPATH=$HOME/work
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> ~/.profile
source ~/.profile

REF: https://tecadmin.net/install-go-on-ubuntu/

Install bntoolkit
sudo apt install gcc g++
From github (if it's public)
go install github.com/RaulCalvoLaorden/bntoolkit
From local file (problem with anacrolix library )
mkdir -p $GOPATH/src/github.com/RaulCalvoLaorden/
cp -r bntoolkit $GOPATH/src/github.com/RaulCalvoLaorden/bntoolkit
cd $GOPATH/src/github.com/RaulCalvoLaorden/bntoolkit
go get .

OR

bash installLocal.sh
installLocal.sh:
#!/bin/bash
mkdir -p $GOPATH/src/github.com
cp -r * $GOPATH/src/github.com/
cd $GOPATH/src/github.com/RaulCalvoLaorden/bntoolkit/
ls
go get .
go install
bntoolkit
Execute
Start PostgreSQL
mkdir ~/postgres #or any folder to store data
sudo docker stop hashpostgres ; sudo docker rm hashpostgres #delete if it exists
sudo docker run -d -p 5432:5432 --mount type=bind,source=$HOME/postgres/,target=/var/lib/postgresql/data --name hashpostgres -e POSTGRES_PASSWORD=postgres99 postgres
Configure configFile.toml

Default:

host="localhost"
port=5432
user="postgres"
password="postgres99"
dbname="hash"

You can change this file or change create a new file and use the FLAG: --config

Don't change the dbname. But if you do it you should change the sql.sql file too.

help

Help about any command

bntoolkit help 

help

version

Print the version number

bntoolkit version

version

initDB

Create the database and it's tables

bntoolkit initDB
create

Create a .torrent file. You can specify the output file, the pieze size, the tracker and a comment

Flags:

  • --help
  • --comment
  • --outfile
  • --piecesize
  • --tracker
bntoolkit create go1.12.9.linux-amd64.tar.gz -o output

create

download

Download a file from a hash, a magnet or a Torrent file.

Flags:

  • --help
  • --path
bntoolkit download e84213a794f3ccd890382a54a64ca68b7e925433

download

getTorrent

Get torrent file from a hash or magnet.

Flags:

  • --help
  • --path
bntoolkit getTorrent e84213a794f3ccd890382a54a64ca68b7e925433 -p .

getTorrent

addAlert and deleteAlert

Add an IP or range to the database alert table and remove it.

Flags:

  • --help
  • --projectName
bntoolkit addAlert 8.8.8.0/24
bntoolkit deleteAlert 8.8.8.0/24

alert

addMonitor and deleteMonitor

Add a hash to the database monitor table and remove it.

Flags:

  • --help
  • --projectName
  • --userName
bntoolkit addMonitor e84213a794f3ccd890382a54a64ca68b7e925433
bntoolkit deleteMonitor e84213a794f3ccd890382a54a64ca68b7e925433

monitor

crawl

Crawl the BitTorrent Network to find hashes and storage it in the DB.

Flags:

  • --help
  • --threads
bntoolkit crawl

crawl

daemon

Start the daemon to monitor the files in the monitor table, notify alerts and optionally crape DHT

Flags:

  • --help
  • --project
  • --scrape
bntoolkit daemon

daemon

find

Find the file in Bittorrent network using the DHT, a trackers list and the local database. In this command the hashes can be: Possibles, Valid or Downloaded. The first are the ones that could exist because they are valid, the second are the ones that have been found in BitTorrent and the third is that it has peers and can be downloaded.

Flags:

  • --help
  • --mode
  • --no-add
  • --projectName
  • --timeout
  • --tracker
bntoolkit find 

find

insert

Insert a hash or a file of hashes in the DB.

Flags:

  • --help
bntoolkit insert 65145ed4d745cfc93f5ffe3492e9cde599999999
show

Show the database data

Flags:

  • --help
  • --where
hash

Flags:

  • --help
  • --hash
  • --source
bntoolkit show hash --hash 65145ed4d745cfc93f5ffe3492e9cde599999999
alert

Flags:

  • --help
  • --ip
bntoolkit show alert
count

Flags:

  • --help
bntoolkit show count
ip

Flags:

  • --help
  • --ip
bntoolkit show ip
monitor

Flags:

  • --help
  • --user
bntoolkit show monitor
possibles

Flags:

  • --help
  • --hash
bntoolkit show possibles
project

Flags:

  • --help
  • --projectName
bntoolkit show project

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL