teserakt-io / c2 Goto Github PK
View Code? Open in Web Editor NEWE4's C2 server
Home Page: https://teserakt.io/e4
License: Apache License 2.0
E4's C2 server
Home Page: https://teserakt.io/e4
License: Apache License 2.0
All outputs are currently sent to stderr by default, no matter if it's a regular command output or an error.
We must properly forward the regular outputs to stdout instead of stderr, and keep errors on stderr.
example:
$ ./bin/c2cli client list | head -n 2
client1
client2
client3 # head filter stdout, not stderr, so we get more
client4
$ ./bin/c2cli client list 2>&1 | head -n 2
client1
client2
$ ./bin/c2cli client list 2>/dev/null | head -n 2
# <empty>
expected:
$ ./bin/c2cli client list | head -n 2
client1
client2
$ ./bin/c2cli client list 2>/dev/null | head -n 2
client1
client2
We would need the C2 to have a /check or similar endpoint allowing to check the application availability
Can just reply with a {"status":"ok"}
for now, and later provide additionnal health metrics. But for now an endpoint allowing a load balancer / heartbeat service / docker daemon to check for the application status would be great.
The C2 currently does not, and should, support the RemovePubKey
, ResetPubKeys
and SetC2Keys
command documented in the specification here.
From the spec:
RemovePubKey:
0x04 | ID (16)
: removes the given client id and associated public key from the client's clientkeys table.
ResetPubKeys:0x05
: Empties the client's clientkeys table.
SetC2Key:0x07 | PubKey (32)
: Instructs the device to replace the current C2 public key with the newly transmitted one (must be use with care).
While testing, I ran several time in an issue, where I was creating clients with symmetric keys, with a C2 server running in pubkey mode.
$ cat configs/config.yaml | grep crypto-mode
crypto-mode: pubkey
$ ./bin/c2cli -c ./configs/c2-cert.pem -e 127.0.0.1:5555 client create --name testClient --password <(echo -n superSecretPassword)
Client testClient created successfully
With current develop, the password is only derived to a symkey, and #17 added an extra --pubkey flag allowing to derive the password into a ed25519 key. But forgetting this flag won't throw any error until the client receive commands from the C2, which is not ideal.
Instead, we could improve by replacing the --pubkey flag by a call to the C2 server via a new http GET /e4/crypto-mode
or a grpc getCryptoMode()
endpoint, and deduce the derivation function to use from the response we get, and avoid any user errors.
Hello Team,
I'm having difficulty setting up the server as shown in the website main page video.
can you please help? ๐
I have followed bellow steps:
./script/build.sh
docker-compose up -d
./bin/c2
P.S: If this is not the correct repo to report. please guide. Thank you. ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.