fazer-lang 3.2.0 → 3.3.0
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/README.md +38 -3
- package/docs/GUIDE.md +5 -2
- package/fazer.js +59 -1
- package/package.json +1 -1
- package/tools/builder.js +78 -53
package/README.md
CHANGED
|
@@ -6,6 +6,21 @@ Conçu pour l'automatisation, la sécurité et le traitement de données, Fazer
|
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
+
### Windows
|
|
10
|
+
1. Téléchargez ou clonez le dépôt.
|
|
11
|
+
2. Double-cliquez sur `install_system.ps1`.
|
|
12
|
+
3. Redémarrez votre terminal.
|
|
13
|
+
|
|
14
|
+
### Linux / Mac
|
|
15
|
+
1. Téléchargez ou clonez le dépôt.
|
|
16
|
+
2. Rendez le script d'installation exécutable et lancez-le :
|
|
17
|
+
```bash
|
|
18
|
+
chmod +x install_system.sh
|
|
19
|
+
./install_system.sh
|
|
20
|
+
```
|
|
21
|
+
3. Redémarrez votre terminal ou faites `source ~/.bashrc` (ou `.zshrc`).
|
|
22
|
+
|
|
23
|
+
### Via NPM (Global)
|
|
9
24
|
Installez Fazer globalement via npm :
|
|
10
25
|
|
|
11
26
|
```bash
|
|
@@ -31,16 +46,36 @@ fazer scan google.com
|
|
|
31
46
|
fazer whois microsoft.com
|
|
32
47
|
```
|
|
33
48
|
|
|
34
|
-
##
|
|
49
|
+
## Cryptage / Protection de Code
|
|
50
|
+
|
|
51
|
+
Pour distribuer un script sans révéler son code source (obfuscation/cryptage) :
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
fazer compile mon_script.fz
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Cela génère un fichier `mon_script.fzc` (Fazer Compiled/Crypted).
|
|
58
|
+
Ce fichier est chiffré (AES-256) mais peut être exécuté directement par n'importe quel interpréteur Fazer :
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
fazer mon_script.fzc
|
|
62
|
+
```
|
|
35
63
|
|
|
36
|
-
|
|
64
|
+
Cela permet de partager des outils "privés" tout en gardant la portabilité du fichier.
|
|
65
|
+
|
|
66
|
+
## Création d'Exécutable (.exe / Binaire)
|
|
67
|
+
|
|
68
|
+
Transformez vos scripts Fazer en applications portables et natives :
|
|
37
69
|
|
|
38
70
|
1. (Optionnel) Placez une icône `app.ico` dans le dossier.
|
|
39
71
|
2. Lancez la commande de build :
|
|
40
72
|
```bash
|
|
41
73
|
fazer build mon_script.fz
|
|
42
74
|
```
|
|
43
|
-
3. Récupérez votre application dans `dist/mon_script
|
|
75
|
+
3. Récupérez votre application dans `dist/mon_script/`.
|
|
76
|
+
|
|
77
|
+
* **Sur Windows** : Crée un fichier `.exe` autonome.
|
|
78
|
+
* **Sur Linux/Mac** : Crée un binaire exécutable (script shell + runtime).
|
|
44
79
|
|
|
45
80
|
Le dossier généré est **portable** : zippez-le et envoyez-le à n'importe qui, aucune installation n'est requise !
|
|
46
81
|
|
package/docs/GUIDE.md
CHANGED
|
@@ -283,12 +283,15 @@ Pour plus de détails, voir le [Guide Moteur 3D](3D_ENGINE.md).
|
|
|
283
283
|
|
|
284
284
|
---
|
|
285
285
|
|
|
286
|
-
## Annexe : Compiler en .EXE
|
|
286
|
+
## Annexe : Compiler en .EXE / Binaire
|
|
287
287
|
|
|
288
|
-
Transformez n'importe quel script `.fz` en un exécutable
|
|
288
|
+
Transformez n'importe quel script `.fz` en un exécutable autonome que vous pouvez partager.
|
|
289
289
|
|
|
290
290
|
```bash
|
|
291
291
|
fazer build mon_script.fz
|
|
292
292
|
```
|
|
293
293
|
|
|
294
294
|
L'exécutable sera généré dans le dossier `dist/`. Il contient tout le nécessaire pour fonctionner sans installer Fazer sur la machine cible.
|
|
295
|
+
|
|
296
|
+
* **Windows** : Génère `mon_script.exe`.
|
|
297
|
+
* **Linux/Mac** : Génère un script de lancement `mon_script` (exécutable directement via `./mon_script`).
|
package/fazer.js
CHANGED
|
@@ -8846,6 +8846,45 @@ async function main() {
|
|
|
8846
8846
|
console.log(require("crypto").randomUUID());
|
|
8847
8847
|
},
|
|
8848
8848
|
|
|
8849
|
+
"compile": async (args) => {
|
|
8850
|
+
if (!args[0]) return console.log(`${colors.red}Usage: fazer compile <file.fz> [-o output.fzc]${colors.reset}`);
|
|
8851
|
+
const fs = require("fs");
|
|
8852
|
+
const path = require("path");
|
|
8853
|
+
const crypto = require("crypto");
|
|
8854
|
+
|
|
8855
|
+
const inputFile = args[0];
|
|
8856
|
+
if (!fs.existsSync(inputFile)) return console.error(`${colors.red}[!] File not found: ${inputFile}${colors.reset}`);
|
|
8857
|
+
|
|
8858
|
+
let outputFile = inputFile.replace(/\.fz$/i, ".fzc");
|
|
8859
|
+
if (args[1] === "-o" && args[2]) outputFile = args[2];
|
|
8860
|
+
|
|
8861
|
+
console.log(`${colors.cyan}[*] Compiling/Encrypting ${inputFile}...${colors.reset}`);
|
|
8862
|
+
|
|
8863
|
+
try {
|
|
8864
|
+
const content = fs.readFileSync(inputFile, "utf8");
|
|
8865
|
+
// Simple obfuscation/encryption using a hardcoded key (Security through obscurity, but sufficient for basic protection)
|
|
8866
|
+
// We use AES-256-CTR with a fixed key/iv derived from a salt, or just a simple key.
|
|
8867
|
+
// To make it portable, the interpreter must know the key. We'll use a hardcoded key in the interpreter.
|
|
8868
|
+
const KEY = Buffer.from("46617a65724c616e675365637265743132334b6579214023", "hex"); // "FazerLangSecret123Key!@#" in hex (24 bytes) - wait, needs 32 for AES-256 or 16 for AES-128
|
|
8869
|
+
// Let's use a simpler XOR-based or standard AES approach.
|
|
8870
|
+
// We'll use a static key for now so any Fazer interpreter can run it.
|
|
8871
|
+
const STATIC_KEY = crypto.createHash('sha256').update("FazerLangPublicRuntimeKey2026").digest();
|
|
8872
|
+
const iv = crypto.randomBytes(16);
|
|
8873
|
+
const cipher = crypto.createCipheriv('aes-256-cbc', STATIC_KEY, iv);
|
|
8874
|
+
let encrypted = cipher.update(content, 'utf8', 'hex');
|
|
8875
|
+
encrypted += cipher.final('hex');
|
|
8876
|
+
|
|
8877
|
+
// File Format: FZC01[IV_HEX][ENCRYPTED_HEX]
|
|
8878
|
+
const data = `FZC01${iv.toString('hex')}${encrypted}`;
|
|
8879
|
+
fs.writeFileSync(outputFile, data, "utf8");
|
|
8880
|
+
|
|
8881
|
+
console.log(`${colors.green}[+] Success! Compiled to: ${outputFile}${colors.reset}`);
|
|
8882
|
+
console.log(`${colors.yellow}[i] You can now distribute '${outputFile}'. It can be run with 'fazer ${outputFile}' but cannot be easily read.${colors.reset}`);
|
|
8883
|
+
} catch(e) {
|
|
8884
|
+
console.error(`${colors.red}[!] Error: ${e.message}${colors.reset}`);
|
|
8885
|
+
}
|
|
8886
|
+
},
|
|
8887
|
+
|
|
8849
8888
|
// --- SYSTEM / UTILS ---
|
|
8850
8889
|
"ls": async (args) => {
|
|
8851
8890
|
const fs = require("fs");
|
|
@@ -9009,7 +9048,26 @@ async function main() {
|
|
|
9009
9048
|
process.exit(1);
|
|
9010
9049
|
}
|
|
9011
9050
|
|
|
9012
|
-
|
|
9051
|
+
let code = fs.readFileSync(filePath, "utf8");
|
|
9052
|
+
|
|
9053
|
+
// --- DECRYPT IF FZC ---
|
|
9054
|
+
if (code.startsWith("FZC01")) {
|
|
9055
|
+
try {
|
|
9056
|
+
const crypto = require("crypto");
|
|
9057
|
+
const STATIC_KEY = crypto.createHash('sha256').update("FazerLangPublicRuntimeKey2026").digest();
|
|
9058
|
+
const iv = Buffer.from(code.substring(5, 37), 'hex');
|
|
9059
|
+
const encryptedText = code.substring(37);
|
|
9060
|
+
const decipher = crypto.createDecipheriv('aes-256-cbc', STATIC_KEY, iv);
|
|
9061
|
+
let decrypted = decipher.update(encryptedText, 'hex', 'utf8');
|
|
9062
|
+
decrypted += decipher.final('utf8');
|
|
9063
|
+
code = decrypted;
|
|
9064
|
+
} catch(e) {
|
|
9065
|
+
console.error("Error: Failed to decrypt .fzc file. It might be corrupted or version mismatch.");
|
|
9066
|
+
process.exit(1);
|
|
9067
|
+
}
|
|
9068
|
+
}
|
|
9069
|
+
// ----------------------
|
|
9070
|
+
|
|
9013
9071
|
const lex = lexer.tokenize(code);
|
|
9014
9072
|
if (lex.errors.length) {
|
|
9015
9073
|
console.error("Lexer error:", lex.errors[0].message || String(lex.errors[0]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fazer-lang",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Fazer — The Red Team Language. Native modules for C2 Implant, WiFi Recon, Steganography (LSB), Process Injection, Crypto, 3D Game Engine, and Automation. Secure, powerful, standalone.",
|
|
5
5
|
"main": "fazer.js",
|
|
6
6
|
"types": "index.d.ts",
|
package/tools/builder.js
CHANGED
|
@@ -70,10 +70,13 @@ const build = async function(inputFile, args) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
// 5. Generate Launcher (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
// 5. Generate Launcher (Platform Specific)
|
|
74
|
+
const isWin = process.platform === "win32";
|
|
75
|
+
log(`Generating Launcher for ${process.platform}...`);
|
|
76
|
+
|
|
77
|
+
if (isWin) {
|
|
78
|
+
// --- WINDOWS (C# / .EXE) ---
|
|
79
|
+
const launcherCs = `
|
|
77
80
|
using System;
|
|
78
81
|
using System.Diagnostics;
|
|
79
82
|
using System.IO;
|
|
@@ -123,59 +126,81 @@ class Program {
|
|
|
123
126
|
}
|
|
124
127
|
}
|
|
125
128
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
`;
|
|
130
|
+
|
|
131
|
+
const csPath = path.join(distDir, 'Launcher.cs');
|
|
132
|
+
fs.writeFileSync(csPath, launcherCs);
|
|
130
133
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
134
|
+
const exeName = `${appName}.exe`;
|
|
135
|
+
const exePath = path.join(distDir, exeName);
|
|
136
|
+
|
|
137
|
+
let iconArg = "";
|
|
138
|
+
if (iconPath && fs.existsSync(iconPath)) {
|
|
139
|
+
const distIcon = path.join(distDir, 'app.ico');
|
|
140
|
+
fs.copyFileSync(iconPath, distIcon);
|
|
141
|
+
iconArg = `-Win32Icon "${distIcon}"`;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
log("Compiling EXE...");
|
|
145
|
+
|
|
146
|
+
const psScript = `
|
|
147
|
+
$csc = (Get-ChildItem -Path "$env:windir\\Microsoft.NET\\Framework64\\v4*" -Filter csc.exe | Select-Object -Last 1).FullName
|
|
148
|
+
if (-not $csc) {
|
|
149
|
+
$csc = (Get-ChildItem -Path "$env:windir\\Microsoft.NET\\Framework\\v4*" -Filter csc.exe | Select-Object -Last 1).FullName
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if ($csc) {
|
|
153
|
+
Write-Host "Compiling with CSC: $csc"
|
|
154
|
+
$args = @("/target:winexe", "/out:${exePath}", "${csPath}")
|
|
155
|
+
if ("${iconArg}") { $args += "/win32icon:${path.join(distDir, 'app.ico')}" }
|
|
156
|
+
& $csc $args
|
|
157
|
+
} else {
|
|
158
|
+
Write-Error "CSC.exe not found. Cannot compile."
|
|
159
|
+
exit 1
|
|
160
|
+
}
|
|
161
|
+
`;
|
|
162
|
+
|
|
163
|
+
const psBuildPath = path.join(distDir, 'build_exe.ps1');
|
|
164
|
+
fs.writeFileSync(psBuildPath, psScript);
|
|
165
|
+
|
|
166
|
+
try {
|
|
167
|
+
execSync(`powershell -ExecutionPolicy Bypass -File "${psBuildPath}"`, { stdio: 'inherit' });
|
|
168
|
+
} catch(e) {
|
|
169
|
+
log("Compilation failed.");
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (fs.existsSync(exePath)) {
|
|
174
|
+
fs.unlinkSync(csPath);
|
|
175
|
+
fs.unlinkSync(psBuildPath);
|
|
176
|
+
log("Build Success!");
|
|
177
|
+
log(`Created: ${exePath}`);
|
|
178
|
+
} else {
|
|
179
|
+
error("EXE file was not created.");
|
|
180
|
+
}
|
|
141
181
|
|
|
142
|
-
log("Compiling EXE...");
|
|
143
|
-
|
|
144
|
-
// Using PowerShell to find CSC and compile
|
|
145
|
-
const psScript = `
|
|
146
|
-
$csc = (Get-ChildItem -Path "$env:windir\\Microsoft.NET\\Framework64\\v4*" -Filter csc.exe | Select-Object -Last 1).FullName
|
|
147
|
-
if (-not $csc) {
|
|
148
|
-
$csc = (Get-ChildItem -Path "$env:windir\\Microsoft.NET\\Framework\\v4*" -Filter csc.exe | Select-Object -Last 1).FullName
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if ($csc) {
|
|
152
|
-
Write-Host "Compiling with CSC: $csc"
|
|
153
|
-
$args = @("/target:winexe", "/out:${exePath}", "${csPath}")
|
|
154
|
-
if ("${iconArg}") { $args += "/win32icon:${path.join(distDir, 'app.ico')}" }
|
|
155
|
-
& $csc $args
|
|
156
182
|
} else {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
fs.
|
|
174
|
-
|
|
183
|
+
// --- LINUX / MAC (Bash Script) ---
|
|
184
|
+
|
|
185
|
+
const launcherSh = `#!/bin/bash
|
|
186
|
+
DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
|
187
|
+
# Use embedded node if available, else system node
|
|
188
|
+
if [ -f "$DIR/node" ]; then
|
|
189
|
+
NODE="$DIR/node"
|
|
190
|
+
else
|
|
191
|
+
NODE="node"
|
|
192
|
+
fi
|
|
193
|
+
|
|
194
|
+
"$NODE" "$DIR/fazer.js" "$DIR/app.fz" "$@"
|
|
195
|
+
`;
|
|
196
|
+
|
|
197
|
+
const shPath = path.join(distDir, appName);
|
|
198
|
+
fs.writeFileSync(shPath, launcherSh);
|
|
199
|
+
fs.chmodSync(shPath, 0o755);
|
|
200
|
+
|
|
175
201
|
log("Build Success!");
|
|
176
|
-
log(`Created: ${
|
|
177
|
-
|
|
178
|
-
error("EXE file was not created.");
|
|
202
|
+
log(`Created: ${shPath}`);
|
|
203
|
+
log("You can now zip the folder '${distDir}' and share it.");
|
|
179
204
|
}
|
|
180
205
|
};
|
|
181
206
|
|