Narthex

Modular dictionary generator
git clone git@git.mcdim.xyz:/var/www/git/Narthex.git
Log | Files | Refs | README | LICENSE

commit aa28e4daebcd7dbcb371a9936e64ed8e4c4a6677
parent 2305d4f98b2a384524e460beb12b5c1a04805199
Author: Michael Constantine Dimopoulos <mk@mcdim.xyz>
Date:   Sat, 24 Jul 2021 17:27:40 +0000

Updated pretty much everything. Added makefile

Diffstat:
AMakefile | 34++++++++++++++++++++++++++++++++++
MREADME.md | 21++++++++++++++++++++-
Rnhance/nhan.c -> enhance/nhan.c | 0
Aenhance/nhance.1 | 25+++++++++++++++++++++++++
Ainc/nin.c | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ainc/ninc.1 | 27+++++++++++++++++++++++++++
Aleet/nleet.1 | 23+++++++++++++++++++++++
Rnleet/nleet.c -> leet/nleet.c | 0
Dnhance/nhance.1 | 25-------------------------
Dninc/nin.c | 93-------------------------------------------------------------------------------
Dninc/ninc.1 | 27---------------------------
Dnleet/nleet.1 | 23-----------------------
Dnrev/nrev.1 | 23-----------------------
Dnwiz/elder.txt | 19-------------------
Dnwiz/nwiz.sh | 36------------------------------------
Arev/nrev.1 | 23+++++++++++++++++++++++
Rnrev/nrev.sh -> rev/nrev.sh | 0
Awiz/elder.txt | 25+++++++++++++++++++++++++
Awiz/nwiz.sh | 27+++++++++++++++++++++++++++
19 files changed, 297 insertions(+), 247 deletions(-)

diff --git a/Makefile b/Makefile @@ -0,0 +1,34 @@ +# Narthex Makefile +# GNU GPL v3.0 + +CC=gcc + +#all: inc/nin.c enhance/nhan.c leet/nleet.c rev/nrev.sh +# $(CC) enhance/nhan.c -o nhance +# $(CC) inc/nin.c -o ninc +# $(CC) leet/nleet.c -o nleet + +install: inc/nin.c enhance/nhan.c leet/nleet.c rev/nrev.sh wiz/nwiz.sh inc/ninc.1 enhance/nhance.1 rev/nrev.1 leet/nleet.1 + $(CC) enhance/nhan.c -o nhance + $(CC) inc/nin.c -o ninc + $(CC) leet/nleet.c -o nleet + sudo mv nhance /bin + sudo mv ninc /bin + sudo mv nleet /bin + sudo mv rev/nrev.sh /bin/nrev + sudo mv wiz/nwiz.sh /bin/nwiz + mkdir -p /var/lib/narthex/ + cp wiz/elder.txt /var/lib/narthex/ + sudo cp enhance/nhance.1 /usr/share/man/man1 + sudo cp inc/ninc.1 /usr/share/man/man1 + sudo cp leet/nleet.1 /usr/share/man/man1 + sudo cp rev/nrev.1 /usr/share/man/man1 + sudo mandb + +uninstall: /bin/ninc /bin/nhance /bin/nrev /bin/nleet /bin/nwiz /usr/share/man/man1/ninc.1 /usr/share/man/man1/nhance.1 /usr/share/man/man1/nrev.1 /usr/share/man/man1/nleet.1 + rm /bin/ninc /usr/share/man/man1/ninc.1 + rm /bin/nhance /usr/share/man/man1/nhance.1 + rm /bin/nleet /usr/share/man/man1/nleet.1 + rm /bin/nrev /usr/share/man/man1/nrev.1 + rm /bin/nwiz + rm -r $${HOME}/.config/narthex/ diff --git a/README.md b/README.md @@ -1,7 +1,7 @@ # Narthex Narthex (Greek: Νάρθηξ, νάρθηκας) is a modular & minimal dictionary generator for Unix and Unix-like operating system written in C and Shell. It contains autonomous Unix-style programs for the creation of a personalised dictionaries that can be used for password recovery & security assessment. The programs make use of Unix text streams for the collaboration with each other, according to the Unix philosophy. It is licensed under the GPL v3.0. Currently under development! -# The tools +## The tools + Nenchanc - A capitalization tool that appends the results to the bottom of the dictionary (stdout). + Ninc - A incrementation tool that multiplies alphabetical lines and appends an n++ at the end of each line. + Ncom - A combination tool that creates different combinations between the existing lines of the dictionary. @@ -9,3 +9,22 @@ Narthex (Greek: Νάρθηξ, νάρθηκας) is a modular & minimal dictionar + Nleet - A leetifier. Replaces characters with Leet equivalents, such as @ instead of a, or 3 instead of e. Also appends + Nwiz - A wizard that asks for the infromation and combines the tools together to create a final dictionary. +## Install +In order to install, execute the following commands: +``` +$ git clone git@git.mcdim.xyz:/var/www/git/Narthex.git && cd Narthex +$ sudo make install +``` + +## Usage +For easy use, there is a wizard program, nwiz, that you can use. Just run +``` +nwiz +``` +And it will ask you for the target's information & generate the dictionary for you. + +For advanced usage, you can read the manpages of each tool. What they all do, really, is enhance small dictionaries. For example you can run +``` +cat words.txt | nhance | nrev | nleet | ninc > words2.txt +``` +on a small wordlist and you can see the result for yourself. diff --git a/nhance/nhan.c b/enhance/nhan.c diff --git a/enhance/nhance.1 b/enhance/nhance.1 @@ -0,0 +1,25 @@ +.\" Manpage for Nhance + +.TH man 8 "15 Jul 2021" "1.2" "Nhance manual page" +.SH NAME +Ninc \- Narthex enhancer +.SH SYNOPSIS +cat dictionary.txt | nhance [OPTIONS] > output.txt +nhance [OPTIONS] dictionary.txt +.SH DESCRIPTION +Nhance reads from standard input or a file and appends to it the lines capitalized. It prints to standard output. + +.SH OPTIONS +-f Append full capitalizations as well + +-v print version and exit + +-h print help panel and exit + +.SH AUTHOR +Michael Constantine Dimopoulos <mk@mcdim.xyz> + +https://mcdim.xyz + +.SH LICENSE +GNU Public License 3.0 (GPL-3.0) diff --git a/inc/nin.c b/inc/nin.c @@ -0,0 +1,93 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <ctype.h> + +/* + * Ninc - Narthex incrementor + * + * By Michael Constantine Dimopoulos + * https://mcdim.xyz <mk@mcdim.xyz> + * License: GNU GPL v3 + * + */ + +#define VERSION "v1.0" +#define BUFFER_SIZE 256 + +static int +isnumber(char * str) +{ + for (int i = 0; str[i] != '\0'; i++) { + if (isdigit(str[i]) != 0) + return 1; + } + return 0; +} + +static void +ninc(FILE *f, int min, int max, int numerical) +{ + char buffer[BUFFER_SIZE]; + while (fgets(buffer, sizeof(buffer), f) != NULL) { + strtok(buffer, "\n"); + puts(buffer); + for (int i = min; i <= max; i++) { + if ((numerical == 0 && isnumber(buffer) == 0) || numerical == 1) { + printf("%s%d\n", buffer, i); + } + } + } +} + +static void +help(char * exename) +{ + printf( "Ninc - Narthex incrementor %s\n" + "By Michael C. Dim. <mk@mcdim.xyz>\n\n" + + "-n Increment numerical lines as well\n" + "-h Print this panel & exit\n" + "-v Print current version & exit\n\n" + + "Usage: cat [FILENAME] | %s [MIN] [MAX] [OPTIONS]\n", + VERSION, exename); + exit(0); +} + +void +die(char * str) +{ + printf("%d\n", str); +} + +void +main(int argc, char * argv[]) +{ + int min = 1; + int max = 10; + int numerical = 0; + + if (argc == 2) { + if (strcmp(argv[1], "-h") == 0) + help(argv[0]); + else if (strcmp(argv[1], "-v") ==0) + printf("%s\n", VERSION); + } else if (argc == 3) { + min = atoi(argv[1]); + max = atoi(argv[2]); + } else if (argc == 4) { + min = atoi(argv[1]); + max = atoi(argv[2]); + if (strcmp(argv[3], "-n") == 0) + numerical = 1; + } else { + fprintf(stderr, "%s: wrong number of arguments\n", argv[0]); + exit(0); + } + + if (min <= max) { + ninc(stdin, min, max, numerical); + } + exit(0); +} diff --git a/inc/ninc.1 b/inc/ninc.1 @@ -0,0 +1,27 @@ +.\" Manpage for Ninc + +.TH man 8 "15 Jul 2021" "1.0" "Ninc manual page" +.SH NAME +Ninc \- Narthex incrementor +.SH SYNOPSIS +cat dictionary.txt | ninc [MIN] [MAX] [OPTIONS] > output.txt +.SH DESCRIPTION +Ninc reads from standard input and multiplies each line with the difference of max-min, and appends n to each line, where n is increased after every line from min to max inclusive. It prints to standard output. + +.SH OPTIONS +-n increment numerical lines + +-v print version and exit + +-h print help panel and exit + +.PP +Notice, numerical lines (in this case 1234) are excluded. In order to include them you can use the -n option. + +.SH AUTHOR +Michael Constantine Dimopoulos <mk@mcdim.xyz> + +https://mcdim.xyz + +.SH LICENSE +GNU Public License 3.0 (GPL-3.0) diff --git a/leet/nleet.1 b/leet/nleet.1 @@ -0,0 +1,23 @@ +.\" Manpage for Nleet + +.TH man 8 "15 Jul 2021" "1.2" "Nleet manual page" +.SH NAME +Ninc \- Narthex leetifier +.SH SYNOPSIS +cat dictionary.txt | nhance [OPTIONS] > output.txt +nhance [OPTIONS] dictionary.txt +.SH DESCRIPTION +Nleet reads from standard input or a file and appends to it the lines leetified (hello -> h3ll0). It prints to standard output. + +.SH OPTIONS +-v print version and exit + +-h print help panel and exit + +.SH AUTHOR +Michael Constantine Dimopoulos <mk@mcdim.xyz> + +https://mcdim.xyz + +.SH LICENSE +GNU Public License 3.0 (GPL-3.0) diff --git a/nleet/nleet.c b/leet/nleet.c diff --git a/nhance/nhance.1 b/nhance/nhance.1 @@ -1,25 +0,0 @@ -.\# Manpage for Nhance - -.TH man 8 "15 Jul 2021" "1.1" "Nhance manual page" -.SH NAME -Ninc \- Narthex enhancer -.SH SYNOPSIS -cat dictionary.txt | nhance [OPTIONS] > output.txt -nhance [OPTIONS] dictionary.txt -.SH DESCRIPTION -Nhance reads from standard input or a file and appends to it the lines capitalized. It prints to standard output. - -.SH OPTIONS --f Append full capitalizations as well - --v print version and exit - --h print help panel and exit - -.SH AUTHOR -Michael Constantine Dimopoulos <mk@mcdim.xyz> - -https://mcdim.xyz - -.SH LICENSE -GNU Public License 3.0 (GPL-3.0) diff --git a/ninc/nin.c b/ninc/nin.c @@ -1,93 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <ctype.h> - -/* - * Ninc - Narthex incrementor - * - * By Michael Constantine Dimopoulos - * https://mcdim.xyz <mk@mcdim.xyz> - * License: GNU GPL v3 - * - */ - -#define VERSION "v0.1" -#define BUFFER_SIZE 256 - -static int -isnumber(char * str) -{ - for (int i = 0; str[i] != '\0'; i++) { - if (isdigit(str[i]) != 0) - return 1; - } - return 0; -} - -static void -ninc(FILE *f, int min, int max, int numerical) -{ - char buffer[BUFFER_SIZE]; - while (fgets(buffer, sizeof(buffer), f) != NULL) { - strtok(buffer, "\n"); - puts(buffer); - for (int i = min; i <= max; i++) { - if ((numerical == 0 && isnumber(buffer) == 0) || numerical == 1) { - printf("%s%d\n", buffer, i); - } - } - } -} - -static void -help(char * exename) -{ - printf( "Ninc - Narthex incrementor %s\n" - "By Michael C. Dim. <mk@mcdim.xyz>\n\n" - - "-n Increment numerical lines as well\n" - "-h Print this panel & exit\n" - "-v Print current version & exit\n\n" - - "Usage: cat [FILENAME] | %s [MIN] [MAX] [OPTIONS]\n", - VERSION, exename); - exit(0); -} - -void -die(char * str) -{ - printf("%d\n", str); -} - -void -main(int argc, char * argv[]) -{ - int min = 1; - int max = 10; - int numerical = 0; - - if (argc == 2) { - if (strcmp(argv[1], "-h") == 0) - help(argv[0]); - else if (strcmp(argv[1], "-v") ==0) - printf("%s\n", VERSION); - } else if (argc == 3) { - min = atoi(argv[1]); - max = atoi(argv[2]); - } else if (argc == 4) { - min = atoi(argv[1]); - max = atoi(argv[2]); - if (strcmp(argv[3], "-n") == 0) - numerical = 1; - } else { - fprintf(stderr, "%s: wrong number of arguments\n", argv[0]); - exit(0); - } - - if (min <= max) { - ninc(stdin, min, max, numerical); - } - exit(0); -} diff --git a/ninc/ninc.1 b/ninc/ninc.1 @@ -1,27 +0,0 @@ -.\# Manpage for Ninc - -.TH man 8 "15 Jul 2021" "1.0" "Ninc manual page" -.SH NAME -Ninc \- Narthex incrementor -.SH SYNOPSIS -cat dictionary.txt | ninc [MIN] [MAX] [OPTIONS] > output.txt -.SH DESCRIPTION -Ninc reads from standard input and multiplies each line with the difference of max-min, and appends n to each line, where n is increased after every line from min to max inclusive. It prints to standard output. - -.SH OPTIONS --n increment numerical lines - --v print version and exit - --h print help panel and exit - -.PP -Notice, numerical lines (in this case 1234) are excluded. In order to include them you can use the -n option. - -.SH AUTHOR -Michael Constantine Dimopoulos <mk@mcdim.xyz> - -https://mcdim.xyz - -.SH LICENSE -GNU Public License 3.0 (GPL-3.0) diff --git a/nleet/nleet.1 b/nleet/nleet.1 @@ -1,23 +0,0 @@ -.\# Manpage for Nleet - -.TH man 8 "15 Jul 2021" "1.2" "Nleet manual page" -.SH NAME -Ninc \- Narthex leetifier -.SH SYNOPSIS -cat dictionary.txt | nhance [OPTIONS] > output.txt -nhance [OPTIONS] dictionary.txt -.SH DESCRIPTION -Nleet reads from standard input or a file and appends to it the lines leetified (hello -> h3ll0). It prints to standard output. - -.SH OPTIONS --v print version and exit - --h print help panel and exit - -.SH AUTHOR -Michael Constantine Dimopoulos <mk@mcdim.xyz> - -https://mcdim.xyz - -.SH LICENSE -GNU Public License 3.0 (GPL-3.0) diff --git a/nrev/nrev.1 b/nrev/nrev.1 @@ -1,23 +0,0 @@ -.\# Manpage for Nrev - -.TH man 8 "15 Jul 2021" "1.1" "Nrev manual page" -.SH NAME -Ninc \- Narthex reverser -.SH SYNOPSIS -cat dictionary.txt | nhance [OPTIONS] > output.txt -nhance [OPTIONS] dictionary.txt -.SH DESCRIPTION -Nrev reads from standard input or a file and appends to it the lines reversed. It prints to standard output. - -.SH OPTIONS --v print version and exit - --h print help panel and exit - -.SH AUTHOR -Michael Constantine Dimopoulos <mk@mcdim.xyz> - -https://mcdim.xyz - -.SH LICENSE -GNU Public License 3.0 (GPL-3.0) diff --git a/nwiz/elder.txt b/nwiz/elder.txt @@ -1,19 +0,0 @@ - -\033[0;32m . - - .\033[0m -\033[1;33m /^\ \033[0m \033[0;32m.\033[0m -\033[0;31m /\ \033[0m \033[1;33m"V"\033[0m -\033[0;31m /__\ \033[0m I \033[0;32m O o \033[0m -\033[0;31m //\033[0m..\033[0;31m\\\ \033[0mI\033[0;32m . -\033[0;31m \]\033[0m.`\033[0;31m[/\033[0m I \033[0;32m -\033[0;31m /l\/j\ \033[0m (] \033[0;32m . O \033[0m -\033[0;31m /. ~~ ,\\/\033[0mI \033[0;32m . \033[0m -\033[0;31m \\\\\\L__j\/\033[0mI \033[0;32m o \033[0m -\033[0;31m \/-- } \033[0mI \033[0;32m o . \033[0m -\033[0;31m |I N| \033[0mI\033[0;37m _________ \033[0m -\033[0;31m |C I| \033[0mI\033[0;37m c( )o \033[0m -\033[0;31m |X Kl \033[0mI\033[0;37m \. ,/ \033[0m -\033[0;31m_/ C A \_\033[0m!\033[0;37m _//^---^\\\\_\033[0m -Row \n - - diff --git a/nwiz/nwiz.sh b/nwiz/nwiz.sh @@ -1,36 +0,0 @@ -#!/bin/sh - -version="1.0" - -printf "$(curl -s file:///home/michael/Documents/projects/c/narthex/nwiz/elder.txt)\n" - -printf "NARTHEX ELDER $version\n"; sleep 0.1; -printf "Wizard program for Narthex\n"; sleep 0.1; -printf "By Michael Constantine Dimopoulos\n"; sleep 0.1; -printf "https://mcdim.xyz <mk@mcdim.xyz>\n\n"; sleep 0.5; - -printf "Leave as many empty as you like\n\n" - -printf "=Questions=\n" -echo -n "Name: " -read name; echo "$name" >> /tmp/narthextemp.txt; -echo -n "Last name: " -read lname; echo "$lname" >> /tmp/narthextemp.txt; -echo -n "Nickname: " -read nname; echo "$nname" >> /tmp/narthextemp.txt; -echo -n "Birthday: " -read bday; echo "$bday" >> /tmp/narthextemp.txt; -echo -n "Birthyear: " -read byear; echo "$byear" >> /tmp/narthextemp.txt; -echo -n "Phone number: " -read phn; echo "$phn" >> /tmp/narthextemp.txt; -echo -n "Pet name: " -read pname; echo "$pname" >> /tmp/narthextemp.txt; -echo -n "Spouce name: " -read sname; echo "$sname" >> /tmp/narthextemp.txt; -#echo "Other keywords (separated by space): " -#read other - -cat /tmp/narthextemp.txt | sed '/^$/d' | tr -d ' ' | nhance | ninc 1 30 | nleet > "${name}".txt -rm /tmp/narthextemp.txt -echo "[!] Exported at $name.txt" diff --git a/rev/nrev.1 b/rev/nrev.1 @@ -0,0 +1,23 @@ +.\" Manpage for Nrev + +.TH man 8 "15 Jul 2021" "1.0" "Nrev manual page" +.SH NAME +Ninc \- Narthex reverser +.SH SYNOPSIS +cat dictionary.txt | nhance [OPTIONS] > output.txt +nhance [OPTIONS] dictionary.txt +.SH DESCRIPTION +Nrev reads from standard input or a file and appends to it the lines reversed. It prints to standard output. + +.SH OPTIONS +-v print version and exit + +-h print help panel and exit + +.SH AUTHOR +Michael Constantine Dimopoulos <mk@mcdim.xyz> + +https://mcdim.xyz + +.SH LICENSE +GNU Public License 3.0 (GPL-3.0) diff --git a/nrev/nrev.sh b/rev/nrev.sh diff --git a/wiz/elder.txt b/wiz/elder.txt @@ -0,0 +1,25 @@ + +\033[0;32m . + + .\033[0m +\033[1;33m /^\ \033[0m \033[0;32m.\033[0m +\033[0;31m /\ \033[0m \033[1;33m"V"\033[0m +\033[0;31m /__\ \033[0m I \033[0;32m O o \033[0m +\033[0;31m //\033[0m..\033[0;31m\\\ \033[0mI\033[0;32m . +\033[0;31m \]\033[0m.`\033[0;31m[/\033[0m I \033[0;32m +\033[0;31m /l\/j\ \033[0m (] \033[0;32m . O \033[0m +\033[0;31m /. ~~ ,\\/\033[0mI \033[0;32m . \033[0m +\033[0;31m \\\\\\L__j\/\033[0mI \033[0;32m o \033[0m +\033[0;31m \/-- } \033[0mI \033[0;32m o . \033[0m +\033[0;31m |I N| \033[0mI\033[0;37m _________ \033[0m +\033[0;31m |C I| \033[0mI\033[0;37m c( )o \033[0m +\033[0;31m |X Kl \033[0mI\033[0;37m \. ,/ \033[0m +\033[0;31m_/ C A \_\033[0m!\033[0;37m _//^---^\\\\_\033[0m -Row \n + +NARTHEX ELDER $version +Wizard program for Narthex +By Michael Constantine Dimopoulos +https://mcdim.xyz <mk@mcdim.xyz> + +Leave as many empty as you like + diff --git a/wiz/nwiz.sh b/wiz/nwiz.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +printf "$(curl -s file:///var/lib/narthex/elder.txt)\n" + +echo "=Questions=" +echo -n "Name: " +read n; echo "$n" >> /tmp/nrthxtmp; +echo -n "Last name: " +read lname; echo "$ln" >> /tmp/nrthxtmp; +echo -n "Nickname: " +read nn;echo "$nn" >> /tmp/nrthxtmp; +echo -n "Birthday: " +read bd; echo "$bd" >> /tmp/nrthxtmp; +echo -n "Birthyear: " +read by;echo "$by" >> /tmp/nrthxtmp; +echo -n "Phone number: " +read phn; echo "$phn" >> /tmp/nrthxtmp; +echo -n "Pet name: " +read pn; echo "$pn" >> /tmp/nrthxtmp; +echo -n "Spouce name: " +read sn; echo "$sn" >> /tmp/nrthxtmp; +echo "Other keywords (separated by space): " +read o; echo "$o"| tr " " "\n" >> /tmp/nrthxtmp; + +cat /tmp/nrthxtmp | sed '/^$/d' | tr -d ' ' | nhance | ninc 1 30 | nleet > "${n}".txt +rm /tmp/nrthxtmp +echo "[!] Exported at $n.txt"