-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
141 lines (133 loc) · 7.11 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Blue Army Knife</title>
<meta name="description" content="A tool for security analysts.">
<link rel="stylesheet" href="style.css" />
<script>
function toggleNav() {
var move = document.getElementById('nav');
if (move.style.display === "block") {
move.style.display = "none";
} else if (move.style.display === "none") {
move.style.display = "block";
} else {
move.style.setProperty('display', 'block');
}
}
var activeArticle = "article-home"; //
var activeNav = "nav-home";
function navUtil(id) {
// Hide the old article and disply the new
var articleId = 'article-' + id;
if (articleId !== activeArticle) {
var articleToDisplay = document.getElementById(articleId);
var currentarticle = document.getElementById(activeArticle);
currentarticle.style.display = "none";
articleToDisplay.style.display = "block";
activeArticle = articleId;
}
if (activeArticle === "article-epoch-time") {
document.getElementById("input-epoch-time").focus();
}
// Set the active class on the current nav item that is displayed
var navId = 'nav-' + id;
if (navId !== activeNav) {
var toActive = document.getElementById(navId);
var toDeActivate = document.getElementById(activeNav);
toDeActivate.classList.remove("active");
toActive.classList.add("active");
activeNav = navId;
}
}
</script>
</head>
<body>
<div class="header">
<div class="header-item">
<input class="nav-btn" type="checkbox" id="nav-btn" onclick="toggleNav()"/>
<label class="nav-icon" for="nav-btn"><span class="navicon"></span></label>
</div>
<div class="header-item">
<a href="#home">Blue Army Knife</a>
</div>
</div>
<div class="page">
<div class="nav" id="nav">
<ul>
<li><a href="#home" class="active" id="nav-home" onclick="navUtil('home')">Home</a></li>
<br>
<li><a href="#epoch-time" id="nav-epoch-time" onclick="navUtil('epoch-time')">Epoch time</a></li>
<li><a href="#ip-checker" id="nav-ip-checker" onclick="navUtil('ip-checker')">IP checker</a></li>
<br>
<li><a href="#playbooks" id="nav-playbooks" onclick="navUtil('playbooks')">Playbooks</a></li>
<div class="sub-nav" id="sub-nav">
<li><a href="#playbooks/ip-address" id="nav-playbooks-ip-address" onclick="navUtil('playbooks-ip-address')">IP address</a></li>
<li><a href="#playbooks/file" id="nav-playbooks-file" onclick="navUtil('playbooks-file')">File</a></li>
<li><a href="#playbooks/process" id="nav-playbooks-process" onclick="navUtil('playbooks-process')">Process</a></li>
<li><a href="#playbooks/mail" id="nav-playbooks-mail" onclick="navUtil('playbooks-mail')">Mail</a></li>
</div>
</ul>
</div>
<div class="article" id="article-home" style="display: block;">
<h1>Home page</h1>
</div>
<div class="article" id="article-epoch-time">
<h1>Epoch timestamp converter</h1>
<p>Convert epoch timestamps into human-readable formats</p>
<p>Current Epoch time: <span id="date-time"></span></p>
<input type="text" size="16" maxlength="20" id="input-epoch-time" placeholder="Epoch time..." value="" spellcheck="false" autocomplete="off" autofocus>
<p>
Readable: <a id="UTC-time"></a>
<button type="button" onclick="copyText('UTC-time', 'UTC-cpy-msg')">Copy</button>
<a id="UTC-cpy-msg"></a>
</p>
<p>
ISO 8601: <span id="ISO8601-time"></span>
<button type="button" onclick="copyText('ISO8601-time', 'ISO-cpy-msg')">Copy</button>
<span id="ISO-cpy-msg"></span>
</p>
<script>
const interval = setInterval(() => {
// Live epoch time
document.getElementById('date-time').innerHTML = Math.floor(Date.now()/1000);
// Convert epoch time
var unixEpochTimeMS = parseInt(document.getElementById("input-epoch-time").value) * 1000;
var date = new Date(unixEpochTimeMS);
document.getElementById('UTC-time').innerHTML =
date.getUTCFullYear() + "-" +
("0" + (date.getUTCMonth()+1)).slice(-2) + "-" +
("0" + date.getUTCDate()).slice(-2) + " " +
("0" + date.getUTCHours()).slice(-2) + ":" +
("0" + date.getUTCMinutes()).slice(-2) + ":" +
("0" + date.getUTCSeconds()).slice(-2) + " UTC";
document.getElementById('ISO8601-time').innerHTML =
date.getUTCFullYear() + "-" +
("0" + (date.getUTCMonth()+1)).slice(-2) + "-" +
("0" + date.getUTCDate()).slice(-2) + "T" +
("0" + date.getUTCHours()).slice(-2) + ":" +
("0" + date.getUTCMinutes()).slice(-2) + ":" +
("0" + date.getUTCSeconds()).slice(-2) + "Z";
}, 100);
// Copy text to clipboard
function copyText(timeElement, cpMsg) {
var valueToCopy = document.getElementById(timeElement).innerHTML;
navigator.clipboard.writeText(valueToCopy);
document.getElementById(cpMsg).innerHTML = "✅";
setTimeout(() => { document.getElementById(cpMsg).innerHTML = ""; }, 1000);
}
</script>
</div>
<div class="article" id="article-ip-checker"></div>
<div class="article" id="article-playbooks"></div>
<div class="article" id="article-playbooks-ip-address"></div>
<div class="article" id="article-playbooks-file"></div>
<div class="article" id="article-playbooks-process"></div>
<div class="article" id="article-playbooks-mail"></div>
</div>
<div class="footer">
<a> Footer </a>
</div>
</body>
</html>