@indra.ai/deva.security 0.0.32 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/feature/methods.js +13 -105
- package/package.json +1 -1
package/feature/methods.js
CHANGED
|
@@ -71,43 +71,6 @@ export default {
|
|
|
71
71
|
return Promise.resolve(hash);
|
|
72
72
|
},
|
|
73
73
|
|
|
74
|
-
/**************
|
|
75
|
-
method: today
|
|
76
|
-
params: packet
|
|
77
|
-
describe: Return system date for today.
|
|
78
|
-
***************/
|
|
79
|
-
today(packet) {
|
|
80
|
-
this.feature('security');
|
|
81
|
-
const theDate = this.lib.formatDate(Date.now(), 'long', true);
|
|
82
|
-
return Promise.resolve(theDate);
|
|
83
|
-
},
|
|
84
|
-
/**************
|
|
85
|
-
method: time
|
|
86
|
-
params: packet
|
|
87
|
-
describe: Return current system hash time.
|
|
88
|
-
***************/
|
|
89
|
-
async time(packet) {
|
|
90
|
-
this.feature('security');
|
|
91
|
-
const timestamp = Date.now();
|
|
92
|
-
const created = this.lib.formatDate(Date.now(), 'long', true);
|
|
93
|
-
|
|
94
|
-
const data = {
|
|
95
|
-
packet,
|
|
96
|
-
timestamp,
|
|
97
|
-
created,
|
|
98
|
-
}
|
|
99
|
-
data.md5 = this.lib.hash(data, 'md5');
|
|
100
|
-
data.sha256 = this.lib.hash(data, 'sha256');
|
|
101
|
-
data.sha512 = this.lib.hash(data, 'sha512');
|
|
102
|
-
|
|
103
|
-
const feecting = await this.question(`${this.askChr}feecting parse ${text}`);
|
|
104
|
-
return {
|
|
105
|
-
text: feecting.a.text,
|
|
106
|
-
html: feecting.a.html,
|
|
107
|
-
data,
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
|
|
111
74
|
/**************
|
|
112
75
|
method: md5 cipher
|
|
113
76
|
params: packet
|
|
@@ -120,73 +83,18 @@ export default {
|
|
|
120
83
|
return Promise.resolve(cipher);
|
|
121
84
|
},
|
|
122
85
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
const cmd = opts.shift();
|
|
133
|
-
|
|
134
|
-
const signer = !params[1] || params[1] === 'agent' ? this.agent() : this.client();
|
|
135
|
-
const {profile} = signer;
|
|
136
|
-
|
|
137
|
-
const timestamp = Date.now();
|
|
138
|
-
const created = this.lib.formatDate(timestamp, 'long', true);
|
|
139
|
-
const message = packet.q.text || '';
|
|
140
|
-
const client = this.client();
|
|
141
|
-
const agent = this.agent();
|
|
142
|
-
|
|
143
|
-
const data = {
|
|
144
|
-
uid,
|
|
145
|
-
transport,
|
|
146
|
-
opts: opts.join(' '),
|
|
147
|
-
client: client.profile,
|
|
148
|
-
agent: agent.profile,
|
|
149
|
-
name: profile.name,
|
|
150
|
-
computer: profile.computer,
|
|
151
|
-
network: profile.network,
|
|
152
|
-
caseid: profile.caseid,
|
|
153
|
-
message,
|
|
154
|
-
religion: profile.religion,
|
|
155
|
-
created,
|
|
156
|
-
timestamp,
|
|
157
|
-
token: profile.token,
|
|
158
|
-
copyright: profile.copyright,
|
|
159
|
-
};
|
|
160
|
-
data.md5 = this.lib.hash(data, 'md5');
|
|
161
|
-
data.sha256 = this.lib.hash(data, 'sha256');
|
|
162
|
-
data.sha512 = this.lib.hash(data, 'sha512');
|
|
163
|
-
|
|
164
|
-
const text = [
|
|
165
|
-
`uid: ${data.uid}`,
|
|
166
|
-
`write ${data.opts}? if yes then write ${data.message}`,
|
|
167
|
-
`::begin:signature:VectorGuardShield:${data.transport}`,
|
|
168
|
-
`transport: ${data.transport}`,
|
|
169
|
-
`caseid: ${data.caseid}`,
|
|
170
|
-
`agent: ${agent.profile.id}`,
|
|
171
|
-
`client: ${client.profile.id}`,
|
|
172
|
-
`name: ${data.name}`,
|
|
173
|
-
`religion: ${data.religion}`,
|
|
174
|
-
`computer: ${data.computer}`,
|
|
175
|
-
`network: ${data.network}`,
|
|
176
|
-
`companies: ${JSON.stringify(data.companies)}`,
|
|
177
|
-
`copyright: ${data.copyright}`,
|
|
178
|
-
`created: ${data.created}`,
|
|
179
|
-
`timestamp: ${data.timestamp}`,
|
|
180
|
-
`md5: ${data.md5}`,
|
|
181
|
-
`sha256: ${data.sha256}`,
|
|
182
|
-
`sha512: ${data.sha512}`,
|
|
183
|
-
`::end:signature:VectorGuardShield:${data.transport}`,
|
|
184
|
-
].join('\n').trim();
|
|
185
|
-
const feecting = await this.question(`${this.askChr}feecting parse ${text}`);
|
|
186
|
-
return {
|
|
187
|
-
text: feecting.a.text,
|
|
188
|
-
html: feecting.a.html,
|
|
189
|
-
data,
|
|
190
|
-
}
|
|
86
|
+
/**************
|
|
87
|
+
method: today
|
|
88
|
+
params: packet
|
|
89
|
+
describe: Return system date for today.
|
|
90
|
+
***************/
|
|
91
|
+
today(packet) {
|
|
92
|
+
this.feature('security');
|
|
93
|
+
const theDate = this.lib.formatDate(Date.now(), 'long', true);
|
|
94
|
+
return Promise.resolve(theDate);
|
|
191
95
|
},
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
//TODO: build the write feature so it can write commands into the system.
|
|
99
|
+
|
|
192
100
|
}
|