- Цена
- 500-3000
- Контакты
- pm forum
Ищу генератор-обфускатор js кода для отдачи полезной нагрузки через повершелл.
Чат гптИщу генератор-обфускатор js кода для отдачи полезной нагрузки через повершелл.
function obfuscate(code) {
const replacements = {
'function': 'f',
'var': 'v',
'let': 'l',
'const': 'c',
'console.log': 'cl',
'return': 'r',
'if': 'i',
'else': 'e',
'for': 'fo',
'while': 'wh',
'try': 't',
'catch': 'c',
'finally': 'f',
'true': 't',
'false': 'f',
'null': 'n'
};
// Замена ключевых слов
for (const key in replacements) {
const regex = new RegExp(\\b${key}\\b, 'g');
code = code.replace(regex, replacements[key]);
}
// Заменяем строки на индексы массива
const stringArray = [];
const stringRegex = /"([^"]?)"|\'([^']?)\'/g;
code = code.replace(stringRegex, (match) => {
const str = match.slice(1, -1);
if (!stringArray.includes(str)) {
stringArray.push(str);
}
return s[${stringArray.indexOf(str)}];
});
// Создаем массив строк
const stringArrayCode = const s = [${stringArray.map(s => "${s}").join(', ')}];;
// Добавляем динамические элементы
let dynamicCode = `
function randomExecute(fn) {
const randomCondition = Math.random() < 0.5;
if (randomCondition) {
fn();
} else {
cl("Skipped execution.");
}
}`;
// Убираем пробелы и добавляем дополнительные символы
code = code.replace(/\s+/g, '')
.replace(/;/g, '!')
.replace(/(?<=\w)\(/g, 'randomExecute(');
return ${stringArrayCode}${dynamicCode}${code};
}
const originalCode = `
function sendPayload() {
const payload = "Hello, World!";
console.log(payload);
return payload;
}
`;
const obfuscatedCode = obfuscate(originalCode);
console.log(obfuscatedCode);
node -e "const s=['Hello, World!'];function randomExecute(fn){const randomCondition=Math.random()<0.5;if(randomCondition){fn();}else{console.log('Skipped execution.');}}randomExecute(()=>{console.log(s[0]);return s[0];});"