Serangan ini biasanya akan dikirim melalui pesan WhatsApp karena jelas bahwa para korban lebih sering mengklik secara langsung dari pesan tanpa memindahkan ke browser seperti Chrome Firefox atau yang lainnya.
Inilah celah keamanan yang sebenarnya, ada beberapa kasus yang bisa terjadi:
- Apps tidak menggunakan browser yang matang (chrome, firefox, dsb) tapi malah menggunakan browser bawaan (in-app browser), yang tidak dibekali pengamanan.
- Tidak mengecek address bar, padahal kalau pakai browser yang matang, sudah menampilkan punycode
Kalau pakai desktop, ane kira sudah terlihat jelas di browser, dan pengamanan sudah cukup untuk kebanyakan kasus.
Kalau masih kurang bisa pakai userscript violentmonkey/greasemonkey berikut:
// ==UserScript==
// @name Anti-Homograph Guard
// @namespace anti-homograph-guard
// @version 1.0.0
// @description Warn about IDN/Punycode hostnames and links.
// @match http://*/*
// @match https://*/*
// @run-at document-start
// @grant none
// @inject-into content
// @noframes
// ==/UserScript==
(() => {
'use strict';
// Exact hostnames only. Unicode or Punycode entries are accepted.
const TRUSTED_HOSTS = [
// 'bücher.example',
];
function normalizeHost(host) {
return host.toLowerCase().replace(/\.$/, '');
}
const trusted = new Set(TRUSTED_HOSTS.map(host =>
normalizeHost(new URL(`https://${host}`).hostname)
));
function suspiciousHost(url) {
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
return null;
}
const host = normalizeHost(url.hostname);
if (trusted.has(host)) return null;
return host.split('.').some(label => label.startsWith('xn--'))
? host : null;
}
function confirmVisit(host, action) {
return window.confirm(
'ANTI-HOMOGRAPH GUARD\n\n' +
action + '\n\n' +
'Actual hostname:\n' + host + '\n\n' +
'This internationalized domain may resemble another website. ' +
'It is not necessarily malicious.\n\n' +
'OK: Continue\nCancel: Block'
);
}
// Direct visits, redirects, and ordinary page navigations.
const current = suspiciousHost(new URL(location.href));
if (current && !confirmVisit(current, 'IDN domain detected.')) {
window.stop();
location.replace('about:blank');
return;
}
// Capture normal, modified, keyboard-generated and middle clicks.
// Delegation also covers dynamically added links.
function inspectLink(event) {
if (event.type === 'auxclick' && event.button !== 1) return;
if (event.type === 'click' && event.button !== 0) return;
const anchor = event.composedPath().find(node =>
node && node.nodeType === 1 &&
(node.localName === 'a' || node.localName === 'area') &&
typeof node.getAttribute === 'function' &&
node.hasAttribute('href')
);
if (!anchor) return;
let url;
try {
url = new URL(anchor.getAttribute('href'), anchor.baseURI);
} catch {
return;
}
const host = suspiciousHost(url);
if (!host || host === normalizeHost(location.hostname)) return;
if (!confirmVisit(host, 'Suspicious destination detected.')) {
event.preventDefault();
event.stopImmediatePropagation();
}
}
window.addEventListener('click', inspectLink, true);
window.addEventListener('auxclick', inspectLink, true);
})();
Sumur: ChatGPT
Hasil scan:
https://www.virustotal.com/gui/file/5e42bad8f89e2462906b7e8dd53a91dc57a083d8389e48da63e099c1a081503dNanti akan ada popup ketika domain yang diakses pakai homograph.