mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-04-22 02:08:00 +00:00
213 lines
7.9 KiB
HTML
213 lines
7.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="initial-scale=0.5, maximum-scale=1">
|
|
<link rel="shortcut icon" href="favicon.ico">
|
|
<title>polkadot{.js}/phishing</title>
|
|
<style>
|
|
a { color: #ff8c00 !important; text-decoration: none }
|
|
body { color: #4e4e4e; font-family: "-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; height: 100vh; overflow-x: hidden; padding: 0 }
|
|
h3 { font-family: "-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-weight: 400; margin: 1rem 0; opacity: 0.95; text-transform: lowercase }
|
|
p { line-height: 1.5rem; margin: 0.75rem 0 }
|
|
|
|
.box { background: rgba(255, 255, 255, 0.85); border-radius: 0.25rem; flex: 1 1; margin: 0.5rem; min-width: 15rem; max-width: 40rem; padding: 0 1.5rem; text-align: center; white-space: nowrap; width: 40rem; z-index: 2 }
|
|
.buttons { margin: 2rem 0 1.5rem }
|
|
.buttons a { border: 1px solid #eee; border-radius: 0.25rem; margin: 0 0.25rem; padding: 0.5rem 0.75rem }
|
|
.buttons .invert { color: rgba(255, 255, 255, 0.85) !important }
|
|
.container { align-items: center; display: flex; flex-direction: column; justify-content: center; margin-top: 4rem; padding-bottom: 2rem }
|
|
.desc { font-size: 0.95rem; opacity: 0.85; white-space: normal }
|
|
.dot { border-radius: 50%; position: absolute; z-index: 0 }
|
|
.header { align-items: center; background: rgba(255, 255, 255, 0.85); display: flex; left: 0; justify-content: space-between; padding: 0.5rem 1rem; position: fixed; right: 0; top: 0; z-index: 1 }
|
|
.header div.logo { display: flex; align-items: center }
|
|
.header img { height: 1.5rem; margin-right: 0.5rem; width: 1.5rem }
|
|
.row { align-items: center; display: flex; justify-content: center }
|
|
table { margin: 0 0 1rem }
|
|
td { font-family: monospace; padding: 0.25rem 0.5rem; text-align: right }
|
|
td:nth-child(2) { width: 100% }
|
|
td > h3 { margin: 0; opacity: 0.25 }
|
|
tr + tr > td > h3 { margin-top: 0.5rem }
|
|
td > span { border-radius: 0.25em; color: white; font-size: 0.75rem; padding: 0.125em 0.375em }
|
|
td > span.active { background: darkred }
|
|
td > span.inactive { background: darkgrey }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="box">
|
|
<h3>phishing</h3>
|
|
<p class="desc">A community driven curated list of known less-than-honest operators.</p>
|
|
<p class="desc">Any additions can be made by editing <a href="https://github.com/polkadot-js/phishing/edit/master/all.json">phishing/all.json</a> and adding any new sites in alphabetical order. In the same vein addresses can be added in <a href="https://github.com/polkadot-js/phishing/edit/master/address.json">phishing/address.json</a>. For any discrepancies or requests <a href="https://github.com/polkadot-js/phishing/issues">log an issue</a>.</p>
|
|
<p class="buttons"><a href="#" id="btn-sites" onclick="fillTable('sites')">Sites</a><a href="#" id="btn-addresses" onclick="fillTable('addresses')">Addresses</a></p>
|
|
<table>
|
|
<tbody id="table">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="header">
|
|
<div class="logo">
|
|
<img src="https://polkadot.js.org/logo.svg" />
|
|
<div>polkadot{.js}/phishing</div>
|
|
</div>
|
|
<a href="https://github.com/polkadot-js/phishing">view on github</a>
|
|
</div>
|
|
<script>
|
|
if (window.self !== window.top) {
|
|
window.top.location.href = window.location.href;
|
|
}
|
|
|
|
const style = document.createElement('style');
|
|
const table = document.getElementById('table');
|
|
|
|
document.head.appendChild(style);
|
|
|
|
let hue = Math.floor(Math.random() * 359);
|
|
let counter = 0;
|
|
let navTo = '';
|
|
let metaJson;
|
|
let addrJson;
|
|
let urlStatus;
|
|
let addresses;
|
|
let balances = [];
|
|
|
|
function draw () {
|
|
hue = (hue + 1) % 360;
|
|
document.body.style.background = `hsl(${hue}, 45%, 85%)`;
|
|
style.innerHTML = `a { color: hsl(${hue}, 45%, 45%) !important } .buttons a { border-color: hsl(${hue}, 45%, 45%) !important } .buttons .invert { background: hsl(${hue}, 45%, 45%) !important }`;
|
|
|
|
setTimeout(() => window.requestAnimationFrame(draw), 100);
|
|
}
|
|
|
|
function appendRow (date, url = '', status) {
|
|
const row = document.createElement('tr');
|
|
const a = document.createElement('td');
|
|
const b = document.createElement('td');
|
|
const c = document.createElement('td');
|
|
|
|
a.appendChild(document.createTextNode(url));
|
|
|
|
if (typeof date === 'string') {
|
|
b.appendChild(document.createTextNode(date));
|
|
} else {
|
|
b.appendChild(date);
|
|
}
|
|
|
|
if (typeof status === 'string') {
|
|
const s = document.createElement('span');
|
|
|
|
s.classList.add(status);
|
|
s.appendChild(document.createTextNode(status));
|
|
c.appendChild(s);
|
|
}
|
|
|
|
row.appendChild(a);
|
|
row.appendChild(b);
|
|
row.appendChild(c);
|
|
|
|
table.appendChild(row);
|
|
}
|
|
|
|
function fillAddresses () {
|
|
addresses.forEach((address, index) => {
|
|
const balance = balances[index] || '';
|
|
|
|
appendRow(balance === '0' ? '' : balance, address);
|
|
});
|
|
}
|
|
|
|
function fillSites () {
|
|
let prevMonth = '';
|
|
|
|
metaJson.forEach(({ date, url }, index) => {
|
|
const thisMonth = date.split('-').slice(0, 2).join('-');
|
|
|
|
if (thisMonth !== prevMonth) {
|
|
const c = document.createElement('h3');
|
|
|
|
c.appendChild(document.createTextNode(thisMonth));
|
|
appendRow(c);
|
|
prevMonth = thisMonth;
|
|
}
|
|
|
|
appendRow(date, url, urlStatus[index] ? 'active' : 'inactive');
|
|
});
|
|
}
|
|
|
|
function fillTable (newNav) {
|
|
if (newNav !== navTo) {
|
|
if (navTo) {
|
|
document.getElementById(`btn-${navTo}`).classList = '';
|
|
}
|
|
|
|
document.getElementById(`btn-${newNav}`).classList = 'invert';
|
|
|
|
navTo = newNav;
|
|
table.innerHTML = '';
|
|
|
|
if (navTo === 'sites') {
|
|
fillSites();
|
|
} else {
|
|
fillAddresses();
|
|
}
|
|
}
|
|
}
|
|
|
|
async function isUp (url) {
|
|
try {
|
|
const controller = new AbortController();
|
|
const id = setTimeout(() => controller.abort(), 2000);
|
|
|
|
await fetch(url, { signal: controller.signal });
|
|
|
|
clearTimeout(id);
|
|
|
|
return true;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
async function main () {
|
|
draw();
|
|
|
|
const [addrBody, metaBody] = await Promise.all([
|
|
fetch('address.json'),
|
|
fetch('urlmeta.json')
|
|
]);
|
|
|
|
[addrJson, metaJson] = await Promise.all([
|
|
addrBody.json(),
|
|
metaBody.json()
|
|
]);
|
|
addresses = Object
|
|
.values(addrJson)
|
|
.reduce((all, addrs) => all.concat(...addrs), [])
|
|
.sort((a, b) => a.localeCompare(b));
|
|
urlStatus = await Promise.all(metaJson.map(({ url }) => `https://${url}`).map(isUp))
|
|
|
|
// Promise.all(
|
|
// addresses.map((key) => fetch('https://polkadot.subscan.io/api/scan/search', {
|
|
// method: 'POST',
|
|
// headers: {
|
|
// 'Content-Type': 'application/json'
|
|
// },
|
|
// body: JSON.stringify({
|
|
// key,
|
|
// page: 0,
|
|
// row: 1
|
|
// })
|
|
// }).then((body) => body.json()).then(({ data }) => (data && data.balance) || '0'))
|
|
// ).then((b) => balances = b).catch(console.error);
|
|
|
|
fillTable('sites');
|
|
}
|
|
|
|
main();
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|