-
Notifications
You must be signed in to change notification settings - Fork 0
4. First start
If your weechat in not running, start it in terminal simply by command
weechat
All following commands will be performed in running weechat.
If the script is not started automatically, then load script by command
/script load wrecon.py
How to ensure script will be loaded automatically, see the installation, last section 3.5 Autoload of script.
When it is first time you start the script, then it will generate automatically BOT ID, BOT KEY and BOT NAME. This informations you can display by command
/wrecon me
and output will be similar like
12:33:42 [wrecon] | --- INFO (brad LrbOGJYSWt4qGT7k) ---
12:33:42 [wrecon] | Bot Name : brad
12:33:42 [wrecon] | Bot ID : LrbOGJYSWt4qGT7k
12:33:42 [wrecon] | Bot KEY : Lbo_L595UXKAqpJ_aUU_4SpWkedjpswtDMO9FlJDkwUYX_cEh8RxO14b590MTPh
12:33:42 [wrecon] | VERSION : 1.01
12:33:42 [wrecon] | TIMESTAMP : 20200206205000CET
Also for first time using wrecon script you do not have registered any #Channel on IRC server. So lets connect to an IRC server and join to a #Channel (choose a name you want, but verify if the #Channel is not occupied, and or owned by someone else). For example, you will choose a name #handyman
. Join to the channel
/join #handyman
Now you register your #handyman
with wrecon by command
/wrecon register NH03zoYbCkOfmHc yFmWiYuSUqXZ8DEzahxlAg4e7ueqJ6lvyyuxAeAy9VWwxgFvZCGfGZXieDhLpc0
where first argument is CHANNEL KEY and second one is CHANNEL ENCRYPTION KEY. If registration was successful, you have your channel #handyman
locked by key NH03zoYbCkOfmHc
, and also encrypted by key yFmWiYuSUqXZ8DEzahxlAg4e7ueqJ6lvyyuxAeAy9VWwxgFvZCGfGZXieDhLpc0
. The same procedure should be done on both PCs - on local and on remote - with the same parameters.
You can verify your registration again with command
/wrecon me
and result will be like following example
20:30:21 [wrecon] | --- INFO (brad LrbOGJYSWt4qGT7k) ---
20:30:21 [wrecon] | Bot Name : brad
20:30:21 [wrecon] | Bot ID : LrbOGJYSWt4qGT7k
20:30:21 [wrecon] | Bot KEY : Lbo_L595UXKAqpJ_aUU_4SpWkedjpswtDMO9FlJDkwUYX_cEh8RxO14b590MTPh
20:30:21 [wrecon] | VERSION : 1.02
20:30:21 [wrecon] | TIMESTAMP : 20200208182816CET
20:30:21 [wrecon] | --- REGISTERED SERVER and CHANNEL ---
20:30:21 [wrecon] | SERVER : efnet
20:30:21 [wrecon] | CHANNEL : #handyman
20:30:21 [wrecon] | CHANNEL KEY : NH03zoYbCkOfmHc
20:30:21 [wrecon] | CHANNEL ENCRYPTION KEY : yFmWiYuSUqXZ8DEzahxlAg4e7ueqJ6lvyyuxAeAy9VWwxgFvZCGfGZXieDhLpc0
On remote PC should be done the same procedure for IRC #Channel registration (channel #handyman
on IRC server efnet
) like on local PC. When all is done, verification (/wrecon me
) can be similar like
13:25:18 [wrecon] | --- INFO (john NR6YF7xT80HTdole) ---
13:25:18 [wrecon] | Bot Name : john
13:25:18 [wrecon] | Bot ID : NR6YF7xT80HTdole
13:25:18 [wrecon] | Bot KEY : KgYhlg3uazHl7V9YVhFHeRCrZwHc1V2i8xlpX7KqMiKRPhmEoA9vQcK_IPlRLEM
13:25:18 [wrecon] | VERSION : 1.02
13:25:18 [wrecon] | TIMESTAMP : 20200208182816CET
13:25:18 [wrecon] | --- REGISTERED SERVER and CHANNEL ---
13:25:18 [wrecon] | SERVER : efnet
13:25:18 [wrecon] | CHANNEL : #handyman
13:25:18 [wrecon] | CHANNEL KEY : NH03zoYbCkOfmHc
13:25:18 [wrecon] | CHANNEL ENCRYPTION KEY : yFmWiYuSUqXZ8DEzahxlAg4e7ueqJ6lvyyuxAeAy9VWwxgFvZCGfGZXieDhLpc0
To ensure we can 'control' remote PC from local PC, you have to add BOT ID of local PC on remote PC into GRANTed BOTs. Due to security reasons this command can be done on remote PC locally only. You need physical access on it, or someone who will do it on remote PC, and also should know your BOT ID of your local PC. Ensure this information is shared by secure way.
Lets perform GRANT command on remote PC
/wrecon grant LrbOGJYSWt4qGT7k Brad maintainer
We are done now. Then we can verify all GRANTed BOTs on remote PC by command
/wrecon list granted
Output can be similar
13:27:24 [wrecon] | --- LIST INFO GRANTED BOTS (john NR6YF7xT80HTdole) ---
13:27:24 [wrecon] | LrbOGJYSWt4qGT7k - Brad maintainer
On local PC we should know BOT ID and BOT KEY of remote PC. Ensure this information is shared by secure way.
We can ADD BOT of remote PC on local PC by command
/wrecon add NR6YF7xT80HTdole KgYhlg3uazHl7V9YVhFHeRCrZwHc1V2i8xlpX7KqMiKRPhmEoA9vQcK_IPlRLEM Jonh's PC in Nevada
All is done, for verification of ADDed BOTs of remote PC on local PC use command
/wrecon list added
Output can be similar like
15:45:02 [wrecon] | --- LIST INFO ADDED BOTS (brad LrbOGJYSWt4qGT7k) ---
15:45:02 [wrecon] | NR6YF7xT80HTdole - Jonh's PC in Nevada
When we have all prepared, then we can easily start 'tmate' session on remote PC from local PC by simple command
/wrecon ssh NR6YF7xT80HTdole
and when remote PC verified local PC successfully, you will receive message about prepared 'tmate' session, like in example
15:49:33 [wrecon] |
15:49:33 [wrecon] | --- SSH INFO (DATA) (brad LrbOGJYSWt4qGT7k) ---
15:49:33 [wrecon] | >>> START MESSAGE from NR6YF7xT80HTdole : 003-F1O
15:49:33 [wrecon] |
15:49:33 [wrecon] | https://tmate.io/t/ro-7TfVfeEYeNtCHR6hBPsrNEYeP
15:49:33 [wrecon] | https://tmate.io/t/y8PFn6DENHmWmw8tHUCwvFr2e
15:49:33 [wrecon] | ssh [email protected]
15:49:33 [wrecon] | ssh [email protected]
15:49:33 [wrecon] |
15:49:33 [wrecon] | END OF MESSAGE from NR6YF7xT80HTdole : 003-F1O <<<
15:49:33 [wrecon] |