BASHACKS(1)

๐Ÿ“ฆ
version 1.5+git20260330.988ab7e ยท 2 versions
, in ubuntu stonking

๐Ÿ’– BASHACKS(1) ๐Ÿ’–

User Commands โ€” like, the whole bashacks manual, bestie, and it's giving absolute legend energy โœจ


โœจ NAME โœจ

bashacks โ€” a collection of useful bash functions for programmers ๐Ÿซถ


๐ŸŒธ DESCRIPTION ๐ŸŒธ

So basically: Bashacks Is a collection of Bash functions for UNIX systems, designed to simplify low-level operations. Ideal for programmers, security analysts, and users seeking concise commands, enhancing script readability and productivity. ๐Ÿ’…

Likeโ€ฆ it's the bestie that makes your low-level life cute and short instead of a 400-character one-liner you'll forget by Friday. No cap. ๐Ÿ‘‘


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

bashacks [OPTIONS] ARGUMENTS

๐Ÿ’… OPTIONS ๐Ÿ’…

  • -h, --help โ€” Display help message and exit. (Your "hey queen, what do you do" button ๐ŸŽ€)
  • -v, --version โ€” Display version information and exit. (For when you need to know which era of slay you're running โญ)

๐ŸŒˆ USAGE ๐ŸŒˆ

The following Bashacks functions are available. Type the function name and press TAB to auto-complete:

Examples of Options : bh_"TAB"

bh_asciitable     bh_cmd_sha256     bh_hex2dec        bh_rot13          bh_str2hexr
bh_asmgrep        bh_cmd_sha512     bh_hex2str        bh_rotall         bh_strxor
bh_asminfo        bh_cmd_wget       bh_hexcalc        bh_secretfile     bh_unshort
bh_bin2dec        bh_dec2asc        bh_hostcalc       bh_sharefile      bh_urldecode
bh_bin2ip         bh_dec2bin        bh_ip2bin         bh_skel_c         bh_urlencode
bh_bkp            bh_dec2hex        bh_ipinfo         bh_skel_go        bh_utf8table
bh_charcalc       bh_epoch          bh_ipisblocked    bh_skel_latex     bh_wgetr
bh_cmd_disasm     bh_findmime       bh_md5rename      bh_skel_python    bh_zerostring
bh_cmd_md5        bh_hashes         bh_myip           bh_skel_yara      bh_zipmal
bh_cmd_sed_ext    bh_hex2bin        bh_replacestring  bh_str2dec
bh_cmd_sha1       bh_rot            bh_str2hex

lowkey the tab-completion alone is worth it, iykyk โœจ


๐Ÿ‘‘ CONTENTS ๐Ÿ‘‘

The Bashacks pack is organized into several subcategories for easy location of specific functions. Each subcategory addresses a set specific functionalities. Below the main subcategories are available.

These subcategories help organize the package's functionalities, making it easier for users to find and use tools wanted. ๐Ÿงš


๐Ÿ” Crypto

Functions related to cryptography and hash manipulation. (the secret-keeping girlies)

  • bh_rot โ€” Encrypts/Decrypts a string with the Caesar Cipher using n shifts to the right.
  • bh_strxor โ€” Calculates the exclusive OR of each character in a string with a key.

For more details, see: file:///usr/share/doc/bashacks-doc/html/crypto.html


๐Ÿ“ Filesystem

This section generally contains functions for file manipulation. (files, but make it organized ๐Ÿ’–)

  • bh_bkp โ€” Performs a quick backup of the file using the current date.
  • bh_findmime โ€” Finds files by MIME type.
  • bh_hashes โ€” Generates the md5, sha1, and sha256 message digest of the file or list of files.
  • bh_md5rename โ€” Converts the filename to the equivalent md5 hash.
  • bh_secretfile โ€” Use it to compress and send files, automatically generating a password.
  • bh_sharefile โ€” Loads a file and provides a unique URL to access it without a password.
  • bh_zipmal โ€” Compresses the file in zip format with password protection. The password is "infected".

For more details, see: file:///usr/share/doc/bashacks-doc/html/filesystem.html


๐Ÿงฎ Math

Mathematical operations functions. (numbers girlies, rise ๐Ÿซถ)

  • bh_bin2dec โ€” Converts binary to decimal.
  • bh_charcalc โ€” Performs operations with characters (char).
  • bh_dec2bin โ€” Converts decimal to binary.
  • bh_dec2hex โ€” Converts decimal to hexadecimal.
  • bh_hex2bin โ€” Converts hexadecimal to binary.
  • bh_hex2dec โ€” Converts hexadecimal to decimal.
  • bh_hexcalc โ€” In the same way as bh_charcalc, however, works here with hexdigits.

For more details, see: file:///usr/share/doc/bashacks-doc/html/math.html


๐ŸŒ Net

Network operations and related tools. (the internet is literally right there โœจ)

  • bh_bin2ip โ€” Convert a binary string into a network IP address.
  • bh_hostcalc โ€” Enter a network CIDR mask and determine the number of hosts.
  • bh_ip2bin โ€” Convert a network IP address into a binary string.
  • bh_ipisblocked โ€” Checks if an IP address is blocked by several security vendors, returning [T] if positive and [F] if opposite.
  • bh_ipinfo โ€” Queries ipinfo.io and returns basic information about an address.
  • bh_myip โ€” Returns the external IP address of your network connection.
  • bh_unshort โ€” Reveals the real URL behind shortened links.
  • bh_wgetr โ€” Operates recursively, building on a previous instance of wget.

For more details, see: file:///usr/share/doc/bashacks-doc/html/net.html


๐Ÿง‘โ€๐Ÿ’ป Programming

Session for the creation of facilitators for development in cli (skeletons, but the cute kind ๐Ÿ’€)

  • bh_skel_c โ€” Generates on the standard output a "C" skeleton.
  • bh_skel_go โ€” Generates on the standard output a "go" skeleton.
  • bh_skel_latex โ€” Generates on the standard output a "LaTeX" skeleton.
  • bh_skel_python โ€” Generates on the standard output a "python" skeleton.
  • bh_skel_yara โ€” Generates on the standard output a "yara" skeleton.

For more details, see: file:///usr/share/doc/bashacks-doc/html/programming.html


๐Ÿ”Ž Reversing

Reverse engineering utilities (main character energy for binaries ๐Ÿ‘‘)

  • bh_asmgrep โ€” With the binary, attempts to find assembly instructions and prints 4 lines around.
  • bh_asminfo โ€” Displays information about assembly instructions. Internet connection is required for help.
  • bh_replacestring โ€” Finds and replaces occurrences of a string in the file.
  • bh_zerostring โ€” Replaces occurrences with zero bytes in a block or a common file.

For more details, see: file:///usr/share/doc/bashacks-doc/html/reversing.html


๐ŸŽ€ String

Functions for string manipulation. (the OG girlypop category fr fr)

  • bh_asciitable โ€” Displays the ASCII table in the terminal.
  • bh_dec2asc โ€” Equivalent in ASCII for decimal numbers.
  • bh_epoch โ€” Converts a Unix epoch timestamp to a human-readable date and time.
  • bh_hex2str โ€” Converts one or more bytes into a hex string.
  • bh_str2dec โ€” Converts one or more bytes to their decimal equivalent.
  • bh_str2hex โ€” Converts a string to its hex byte equivalent for each character (hex string).
  • bh_str2hexr โ€” Converts a string to its reversed hexadecimal equivalent.
  • bh_urldecode โ€” Decodes strings to web standard human-readable format.
  • bh_urlencode โ€” Encodes strings to web standard format.
  • bh_utf8table โ€” Displays the UTF-8 table.

For more details, see: file:///usr/share/doc/bashacks-doc/html/string.html

โœจ EXAMPLES โœจ

ok bestie this is the good part, the demo reel, the show-and-tell ๐Ÿ’– every single one of these is copy-pasteable and every output shown is exactly what you'd see. no cap.


๐ŸŒ€ bh_rot [int] [string]

usage:

$ bh_rot 3 terra
whuud

๐ŸŒˆ bh_strxor [key] [string]

usage:

$ bh_strxor 15 'hack'
gnld

๐ŸŽ€ bh_bkp [filename]

usage:

$ bh_bkp bashacks.sh
$ ls -1
bashacks.sh
bashacks.sh.20160122

๐Ÿฆ‹ bh_findmime -[type] [directory]

usage:

$ bh_findmime -elf /usr/bin
/usr/bin/[
/usr/bin/411toppm

๐Ÿ”ฅ bh_hashes [filename or list of files]

usage:

$ bh_hashes bashacks.sh
5dab37cac730088fd959f8292636fc9b bashacks.sh
38be74a4e710a3eeb24b4fa2015cea990d4eda67 bashacks.sh
587b713bb31e3bf32de0b734805c3dd247f49a14cd9e9a5f35008e4f620d3f82 bashacks.sh

three hashes, three algorithms, one file, zero effort ๐Ÿ’…

๐Ÿ‘‘ bh_md5rename [filename or list of files]

usage:

$ touch ment.bin
$ bh_md5rename ment.bin
$ ls
d41d8cd98f00b204e9800998ecf8427e

not me renaming your file to its own md5 sum, iconic behaviour fr fr ๐Ÿซถ

๐Ÿ’€ bh_zipmal [filename]

usage:

$ bh_zipmal file.txt
  adding: file.txt (deflated 69%)
-rw-rw-r-- 1 user user 577 mar 29 10:43 file.zip
password: infected

the password is literally infected, that's the whole bit, slay.

โญ bh_bin2dec [binary]

usage:

$ bh_bin2dec 1111111

๐ŸŒธ bh_charcalc [char/string] [operator] [number]

usage:

$ bh_charcalc A + 2
C
$ bh_charcalc A \* 255
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

ok the second one is so extra and i'm obsessed, look at all those A's ๐Ÿ˜ญ

๐Ÿงš bh_dec2bin [decimal]

usage:

$ bh_dec2bin 255
11111111

๐Ÿ’œ bh_dec2hex [decimal]

$ bh_dec2hex 10
a

๐Ÿฆ‹ bh_hex2dec [one or more hex digit]

usage:

$ bh_hex2dec A
10

โœจ bh_hexcalc [hex digit] [operator] [hex digit]

usage:

$ bh_hexcalc A \* 2
0xa0

๐ŸŽ€ bh_bin2ip [binary string]

usage:

$ bh_bin2ip 00001010.00001010.00000000.00000001
10.10.0.1

๐ŸŒˆ bh_hostcalc [network/prefix]

usage:

$ bh_hostcalc 192.168.1.0/24
254

๐Ÿ”ฅ bh_ipisblocked [ipaddress]

usage:

$ bh_ipisblocked 77.xxx.xx.xx
== 77.xxx.xx.xx ==
[F]    TALOS
[F]    Malc0de
[F]    Projecthoneypot.org
[F]    blocklist.de
[T]    Alienvault
[F]    SANS-TOPSOURCE

[T] = true, [F] = false, and the vibe check on that Alienvault line is giving caught in 4k ๐Ÿ’€

๐Ÿซถ bh_unshort [url]

usage:

$ bh_unshort https://bit.ly/3example
http://websitedoctors.blogspot.com/2010/11/best-search-engine-optimization-seo.html

revealing the real url under the cute little shortener, main character energy.

๐ŸŒธ bh_wgetr [url]

usage:

$ bh_wgetr http://www.mentebinaria.com.br/artigos/0x1e/0x1e-maqengrevwin.html
www.mentebinaria.com.br/art 100%[==========================================>]   8.73K  --.-KB/s   in 0s
www.mentebinaria.com.br/rob 100%[==========================================>]     361  --.-KB/s   in 0s
www.mentebinaria.com.br/art 100%[==========================================>]  66.18K   132KB/s   in 0.5s
$ ls -1
www.mentebinaria.com.br
$ ls -1 www.mentebinaria.com.br/artigos/0x1e/
0x1e-maqengrevwin.html
desktop.png

it recursed, it pulled the html and desktop.png, it ate and left no crumbs ๐Ÿ‘‘

๐Ÿ’œ bh_ipinfo [ipaddress]

usage:

$ bh_ipinfo 8.8.8.8
{
 "ip": "8.8.8.8",
 "hostname": "dns.google",
 "anycast": true,
 "city": "Mountain View",
 "region": "California",
 "country": "US",
 "loc": "37.4056,-122.0775",
 "org": "AS15169 Google LLC",
 "postal": "94043",
 "timezone": "America/Los_Angeles",
 "readme": "https://ipinfo.io/missingauth"
}

๐ŸŒˆ bh_skel_c

usage:

$ bh_skel_c
#include <stdio.h>

int main(int argc, char *argv[]) {

    return 0;
}

๐Ÿฆ‹ bh_skel_go

usage:

$ bh_skel_go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}

โญ bh_skel_latex

usage:

$ bh_skel_latex
\documentclass{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}

\author{}
\title{}

๐Ÿงš bh_skel_python

usage:

$ bh_skel_python
#!/usr/bin/env python
# *-* coding: utf-8 *-*

if __name__ == '__main__':

๐ŸŽ€ bh_skel_yara

usage:

$ bh_skel_yara
rule test {
    meta:
        author = "username"
        description = ""
        date = "2026-03-29"
        ref = ""
        hash = ""
    strings:
        $a = "test" ascii wide
    condition:
        all of them
}

five whole skeletons, zero typing, we love a head start ๐Ÿ’–

๐Ÿ”ฅ bh_asmgrep [asm instruction] [binary path]

usage:

$ bh_asmgrep mov /bin/ls

409f2e:66 90                : xchg   %ax,%ax
409f30:80 7c 13 ff 2f       : cmpb   $0x2f,-0x1(%rbx,%rdx,1)
409f35:48 8d 42 ff          : lea    -0x1(%rdx),%rax
409f39:75 08                : jne    409f43 <__sprintf_chk@plt+0x7783>
409f3b:48 89 c2             : mov    %rax,%rdx
409f3e:48 39 d5             : cmp    %rdx,%rbp
409f41:75 ed                : jne    409f30 <__sprintf_chk@plt+0x7770>
409f43:48 83 c4 08          : add    $0x8,%rsp
--

๐Ÿ’€ bh_asminfo [asm instruction]

usage:

$ bh_asminfo push
push
|Code   |Mnemonic        |Description                                         |
|FF /6  |PUSH r/m16      |Push r/m16                                          |
|FF /6  |PUSH r/m32      |Push r/m32                                          |
|50+rw  |PUSH r16        |Push r16                                            |
|50+rd  |PUSH r32        |Push r32                                            |
|6A     |PUSH imm8       |Push imm8                                           |

๐Ÿซถ bh_replacestring [file] [string to search] [string to replace]

usage:

$ hexdump -C MB_DEV

00000690  2e 00 54 00 58 00 54 00  2e 00 00 00 73 00 77 00  |..T.X.T.....s.w.|
000006a0  e5 45 53 54 45 54 7e 31  53 57 58 20 00 65 a1 9b  |.ESTET~1SWX .e..|
000006b0  8b 54 8b 54 00 00 a1 9b  8b 54 00 00 00 00 00 00  |.T.T.....T......|
000006c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00005e00  4d 65 6e 74 65 42 69 6e  61 72 69 61 0a 00 00 00  |MenteBinaria....|
00005e10  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

๐ŸŒธ bh_zerostring [file] [string to replace]

usage:

$ cp /usr/bin/true /tmp/true_test
$ bh_zerostring /tmp/true_test "error"
5+0 records in
5+0 records out
5 bytes copied

โญ bh_epoch [timestamp]

usage:

$ bh_epoch 1743249600
sรกb 29 mar 2026 09:00:00 -03

๐Ÿ’œ bh_dec2asc [decimal]

usage:

$ bh_dec2asc 65
A

๐Ÿฆ‹ bh_hex2str [hex string]

usage:

$ bh_hex2str '72 6f 63 6b'
rock

๐ŸŽ€ bh_str2hex [-x] [-0x] [-c] [string]

usage:

$ bh_str2hex 'Fernando'
46 65 72 6e 61 6e 64 6f
$ bh_str2hex -0x 'Fernando'
0x46 0x65 0x72 0x6e 0x61 0x6e 0x64 0x6f

๐ŸŒˆ bh_str2hexr [string]

usage:

$ bh_str2hexr "hello"
6f 6c 6c 65 68

๐Ÿ”ฅ bh_urldecode [encoded string]

usage:

$ bh_urldecode '%2fzzz%21%40%2e%23'
/zzz!@.#

๐Ÿงš bh_urlencode [string]

usage:

$ bh_urlencode '/zzz!@.#'
%2fzzz%21%40%2e%23

see how those two are literally each other's mirror? ๐Ÿ” the way that bh_urldecode and bh_urlencode are besties, iykyk ๐Ÿ’…


๐ŸŒŸ SEE ALSO ๐ŸŒŸ

want more lore about bashacks? go read:


๐Ÿ’– AUTHOR ๐Ÿ’–

developed by Fernando Merces <contato@mentebinaria.com.br>

this manual page was written by Josenilson Ferreira da Silva <nilsonfsilva@hotmail.com> for the Debian project (but may be used by others).


and that's the whole page, bestie ๐Ÿซถ this little bundle of joy is bashacks 1.5, dated November 2026, and it lives its life as BASHACKS(1) โ€” now go run something cute in your terminal, you've earned it โœจ๐Ÿ‘‘๐Ÿ’…

๐Ÿ“ฆ where this page comes from