# My use cases for CyberChef ### Formatting MAC addresses Cisco seems to require a different format for every solution they have. I use this almost daily, so change the format of one or multiple MAC addresses. Input: `aa-aa-aa-bb-bb-bb` Output: ``` aaaaaabbbbbb AAAAAABBBBBB aa-aa-aa-bb-bb-bb AA-AA-AA-BB-BB-BB aa:aa:aa:bb:bb:bb AA:AA:AA:BB:BB:BB aaaa.aabb.bbbb AAAA.AABB.BBBB ``` [Try it yourself](https://baked.brrl.net/#recipe=Format_MAC_addresses('Both',true,true,true,true,false)&input=YWEtYWEtYWEtYmItYmItYmI) **Tipp**: the easiest way to change the format of multiple formats, is to choose the desired format, input 1 MAC address per line, and remove the empty lines with a `Find/ Replace` operation with the following regex search `^(?:[\t ]*(?:\r?\n|\r))+`. For more information, visit [this post](https://ittavern.com/cyberchef-how-to-remove-empty-lines/). ### Looking up Linux permissions Simple way to switch between various representations and shows the permissions. Input: `-rw-r--r--` Output: ``` Textual representation: -rw-r--r-- Octal representation: 0644 File type: Regular file +---------+-------+-------+-------+ | | User | Group | Other | +---------+-------+-------+-------+ | Read | X | X | X | +---------+-------+-------+-------+ | Write | X | | | +---------+-------+-------+-------+ | Execute | | | | +---------+-------+-------+-------+ ``` [Try it yourself](https://baked.brrl.net/#recipe=Parse_UNIX_file_permissions\(\)&input=LXJ3LXItLXItLQo) ### Working with IT subnets This function makes my life easier. It shows me the general network information and the range of a IP addresses for a subnet. Input: `10.121.10.8/28` Output: ``` Network: 10.121.10.8 CIDR: 28 Mask: 255.255.255.240 Range: 10.121.10.0 - 10.121.10.15 Total addresses in range: 16 10.121.10.0 10.121.10.1 10.121.10.2 10.121.10.3 10.121.10.4 [...] ``` [Try it yourself](https://baked.brrl.net/#recipe=Parse_IP_range\(true,true,false\)&input=MTAuMTIxLjEwLjgvMjg) ### Converting blog titles to an URL-friendly format I've created a small 'Recipe' to format my titles to URL/ text file friendly formats. Input: `My use cases for CyberChef` Output: `my-use-cases-for-cyberchef` [Try it yourself](https://baked.brrl.net/#recipe=Find_/_Replace\(%7B'option':'Regex','string':'-'%7D,'',true,false,true,false\)Find_/_Replace\(%7B'option':'Regex','string':'%20%20'%7D,'%20',true,false,true,false\)Find_/_Replace\(%7B'option':'Regex','string':'%5C%5C.'%7D,'',true,false,true,false\)Find_/_Replace\(%7B'option':'Regex','string':'%20'%7D,'-',true,false,true,false\)To_Lower_case\(\)&input=TXkgdXNlIGNhc2VzIGZvciBDeWJlckNoZWY) ### Finding the difference in text I only use this function for small configuration files or texts. For larger ones, I prefer vimdiff or Notepad++. [Try it yourself](https://baked.brrl.net/#recipe=Diff\('%5C%5Cn%5C%5Cn','Character',true,true,false,true\)&input=SSBzd2VhciwgdGhlcmUgaXMgbm90aGluZyBtaXNzaW5nLgoKSSBzd2VhciwgdGhlcmUgaXMgbWlzc2luZy4) ### Changing chars to upper/lower case I rarely use this function, but it has its use cases. Some passwords contain many characters, that can be difficult to differentiate, like `l`, `I`, `1`, `O`,`0`, and so on. I tend to use this feature if I only have 1 more try left, just to make sure. And I know that copy+paste exists, but that isn't always an option. [Try it yourself](https://baked.brrl.net/#recipe=To_Upper_case\('All'\)&input=VEhsU18xU19hX1A0UzV3b3JE) ### Adding or remove line numbers This is self-explanatory. I do not need this feature that often, but comes in handy from time to time. ### Hashing things If you need a hash of a string or file, CyberChef offers many algorithms. SHA, MD, bcrypt, and so on. [Try it yourself](https://baked.brrl.net/#recipe=SHA2\('512',64,160\)&input=VEhsU18xU19hX1A0UzV3b3JE) ### Generating QR codes I use it monthly to generate the QR code for our guest WLAN. Add `WIFI:S:MySSID;T:WPA;P:TH1S_P455W0RD;;` into the input field and it generates the QR code for you. I regularly use it for URLs too. [Try it yourself](https://baked.brrl.net/#recipe=Generate_QR_Code\('PNG',8,2,'Medium'\)&input=V0lGSTpTOk15U1NJRDtUOldQQTtQOlRIMVNfUDQ1NVcwUkQ7Ow) ### Generating dummy texts / Lorem Ipsum Really helpful to generate dummy text for all kinds of mock-ups. [Try it yourself](https://baked.brrl.net/#recipe=Generate_Lorem_Ipsum\(3,'Paragraphs'\)) ### Various utilities I won't go into too much detail since it is fairly self-explanatory. Sorting lines, convert masses or distances, remove white spaces, Find/Replace, find unique strings, converting hexdumps, converting date/time formats, and so many more. ## Conclusion CyberChef has become a great tool with many use cases. It is more the quick and dirty solution, but this is often all I need. The source code can be found [here](https://github.com/gchq/CyberChef). ---