mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 14:11:02 +01:00
Tidied up 'Defang IP Addresses' operation
This commit is contained in:
parent
a4e9025b8e
commit
43472394c7
@ -180,7 +180,7 @@
|
||||
"Encode NetBIOS Name",
|
||||
"Decode NetBIOS Name",
|
||||
"Defang URL",
|
||||
"Defang IP"
|
||||
"Defang IP Addresses"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -8,19 +8,19 @@ import Operation from "../Operation";
|
||||
|
||||
|
||||
/**
|
||||
* Defang IP operation
|
||||
* Defang IP Addresses operation
|
||||
*/
|
||||
class DefangIP extends Operation {
|
||||
class DefangIPAddresses extends Operation {
|
||||
|
||||
/**
|
||||
* DefangIP constructor
|
||||
* DefangIPAddresses constructor
|
||||
*/
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.name = "Defang IP";
|
||||
this.name = "Defang IP Addresses";
|
||||
this.module = "Default";
|
||||
this.description = "Takes a IPV4 or IPV6 address and 'Defangs' it; meaning the IP becomes invalid, removing the risk of accidentally utilising it as an IP address.";
|
||||
this.description = "Takes a IPv4 or IPv6 address and 'Defangs' it, meaning the IP becomes invalid, removing the risk of accidentally utilising it as an IP address.";
|
||||
this.infoURL = "https://isc.sans.edu/forums/diary/Defang+all+the+things/22744/";
|
||||
this.inputType = "string";
|
||||
this.outputType = "string";
|
||||
@ -34,13 +34,10 @@ class DefangIP extends Operation {
|
||||
* @returns {string}
|
||||
*/
|
||||
run(input, args) {
|
||||
|
||||
|
||||
input = input.replace(IPV4_REGEX, x => {
|
||||
return x.replace(/\./g, "[.]");
|
||||
});
|
||||
|
||||
|
||||
input = input.replace(IPV6_REGEX, x => {
|
||||
return x.replace(/:/g, "[:]");
|
||||
});
|
||||
@ -49,7 +46,7 @@ class DefangIP extends Operation {
|
||||
}
|
||||
}
|
||||
|
||||
export default DefangIP;
|
||||
export default DefangIPAddresses;
|
||||
|
||||
|
||||
/**
|
Loading…
Reference in New Issue
Block a user