-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiocRF.html
148 lines (138 loc) · 6.67 KB
/
iocRF.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
142
143
144
145
146
147
148
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Reformatter</title>
<style>
body {
font-family: Arial, sans-serif;
}
#asciiart {
font-family: Courier, serif;
}
#inputText {
width: 90%;
height: 200px;
margin-bottom: 15px;
}
#outputText {
width: 90%;
height: 200px;
margin-bottom: 30px;
}
@media screen {
span.cc {
font-family: 'CC-ICONS';
color: #ABB3AC;
}
}
.footer {
background-color: #f0f0f0;
padding: 30px;
}
</style>
</head>
<body>
<p id="asciiart">
####_############____###______<br>
###(_)___##_____/ __ \// ____/<br>
##/ / __ \/ ___/ /_/ // /_####<br>
#/ / /_/ / /__/ _, _// __/####<br>
/_/\____/\___/_/#|_//_/#######</p>
<h1>Indicator of Compromise Re-Formatter</h1>
<p>Most IOCs are released in a format that prevents inadvertent navigation to the domain or IP address intel. It is often necessary to remove characters used to neutralize those strings, such as [braces].<br>This tool will remove the open and close brace characters.</p>
<p><b>Examples</b><br>
<i>192.168.254[.]2<br>www.google[.]com</i></p>
<p>Step 1: Paste <u>line-delimited</u> data into the text area below.<br>Step 2: Choose a delimiter option to segment the output strings.<br>Step 3: Click Reformat button to remove any braces.</p>
<!--
<p><b>Input Datatype</b><br>
<input type="radio" name="datatype" value="ipv4"> IPv4
<input type="radio" name="datatype" value="domain"> Domain
<input type="radio" name="datatype" value="email"> Email
<input type="radio" name="datatype" value="hash"> Hash<br></p>
-->
<p><b>Output Delimiters</b><br>
<input type="radio" name="delimiter" value="space" checked> Space
<input type="radio" name="delimiter" value="comma"> Comma
<input type="radio" name="delimiter" value="newline"> Newline<br></p>
<p><b>Output Wildcards</b><br>
<input type="radio" name="wildcard" value="none" checked> None
<input type="radio" name="wildcard" value="prepend"> Prepend
<input type="radio" name="wildcard" value="append"> Append
<input type="radio" name="wildcard" value="both"> Both</p>
<textarea id="inputText" placeholder="Enter data strings here..."></textarea><br>
<button onclick="reformatData()">Reformat</button>
<button onclick="refreshPage()">Refresh Page(F5)</button><br><br>
<textarea id="outputText" readonly></textarea>
<div class="footer">
<p>This page is licensed under <span class="cc">Creative Commons 1.0, CC BY 1.0 Deed</span> © Garrett Spear</p>
</div>
<script>
function reformatData() {
var inputData = document.getElementById("inputText").value.trim(); // Remove trailing spaces
var delimiter = getSelectedDelimiter();
var wildcard = getSelectedWildcard();
var reformattedData;
if (delimiter === "space" && wildcard === "none") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, ' ');
} else if (delimiter === "space" && wildcard === "prepend") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, ' *');
} else if (delimiter === "space" && wildcard === "append") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, '* ');
} else if (delimiter === "space" && wildcard === "both") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, '* *');
} else if (delimiter === "comma" && wildcard === "none") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, ',');
} else if (delimiter === "comma" && wildcard === "prepend") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, ',*');
} else if (delimiter === "comma" && wildcard === "append") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, '*,');
} else if (delimiter === "comma" && wildcard === "both") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, '*,*');
} else if (delimiter === "newline" && wildcard === "none") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, '\n');
} else if (delimiter === "newline" && wildcard === "prepend") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, '\n*');
} else if (delimiter === "newline" && wildcard === "append") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, '*\n');
} else if (delimiter === "newline" && wildcard === "both") {
reformattedData = inputData.replace(/\[\.\]/g, ".").replace(/[\s,]+/g, '*\n*');
}
if (wildcard === "prepend") {
// Prepend asterisk to first line
reformattedData = reformattedData.split('\n').map(line => '*' + line).join('\n');
} else if (wildcard === "append") {
// Append asterisk to last line
reformattedData = reformattedData.split('\n').map(line => line + '*').join('\n');
} else if (wildcard === "both") {
// Enclose output with asterisks
reformattedData = reformattedData.split('\n').map(line => '*' + line + '*').join('\n');
} else if (wildcard === "none") {
// Prepend asterisk to each line
reformattedData = reformattedData.split('\n').map(line => line).join('\n');
}
document.getElementById("outputText").value = reformattedData;
}
function refreshPage() {
location.reload();
}
function getSelectedDelimiter() {
var delimiters = document.getElementsByName("delimiter");
for (var i = 0; i < delimiters.length; i++) {
if (delimiters[i].checked) {
return delimiters[i].value;
}
}
}
function getSelectedWildcard() {
var wildcards = document.getElementsByName("wildcard");
for (var i = 0; i < wildcards.length; i++) {
if (wildcards[i].checked) {
return wildcards[i].value;
}
}
}
</script>
</body>
</html>