Narthex

Modular dictionary generator
Log | Files | Refs | README

commit 769678f3ba5a1e59df50feb2b69650d143e14148
Author: Michael Constantine Dimopoulos <mk@mcdim.xyz>
Date:   Fri, 23 Jul 2021 14:59:49 +0000

Started

Diffstat:
AREADME.md | 13+++++++++++++
Anhance/nhan.c | 126+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Anhance/nhance.1 | 25+++++++++++++++++++++++++
Aninc/nin.c | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aninc/ninc.1 | 27+++++++++++++++++++++++++++
Anleet/nleet.1 | 23+++++++++++++++++++++++
Anleet/nleet.c | 132+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Anrev/nrev.1 | 23+++++++++++++++++++++++
Anrev/nrev.sh | 25+++++++++++++++++++++++++
Anwiz/nwiz.sh | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10 files changed, 549 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -0,0 +1,13 @@ +# Narthex +PAX 2.0: Narthex (Greek: Νάρθηξ, νάρθηκας) is a modular & minimal password recovery suit for Unix and Unix-like operating system written in C. It contains autonomous programs for the creation of a personalised dictionaries that can be used for password recovery & offensive 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. Under development! + +# 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. ++ Nrev - A reversing tool, that appends the reserved versions of the lines at the end of the dictionary. ++ Nleet - A leetifier. Replaces characters with Leet equivalents, such as @ instead of a, or 3 instead of e. Also appends ++ Nuniq - A uniq utility that uses minimal memory and works for unsorted files (as dictionaries are sorted by likelyhood, not alphabetically) ++ Nwiz - A wizard that asks for the infromation and combines the tools together to create a final dictionary. ++ N-Woran - A wordlist analyzer for leaks. It compares to known dictionaries, notes common words & character, char combinations & popularity. + diff --git a/nhance/nhan.c b/nhance/nhan.c @@ -0,0 +1,126 @@ +#include <stdlib.h> +#include <ctype.h> +#include <stdio.h> +#include <errno.h> +#include <string.h> + +/* + * Nhance - Narthex enhancer + * + * By Michael Constantine Dimopoulos + * https://mcdim.xyz <mk@mcdim.xyz> + * License: GNU GPL v3 + * + */ + + +#define VERSION "v1.1" +#define BUFFER_SIZE 256 + +FILE * +save_stdin(FILE *f) +{ + FILE *f2 = tmpfile(); + char buffer[BUFFER_SIZE]; + while(fgets(buffer, sizeof(buffer), f) != NULL) { + fprintf(f2, "%s", buffer); + } + fclose(f); + return f2; +} + +void cap(char string[]){ + int i; + int x = strlen(string); + for (i=0; i<x-1; i++){ + if (isalpha(string[i])){ + string[i]= toupper(string[i]); + } + } +} + +void +print_only(FILE *f) +{ + char buffer[BUFFER_SIZE]; + while(fgets(buffer, sizeof(buffer), f) != NULL) { + printf("%s",buffer); + } +} + +void +enhance(FILE *f, int full_upper) +{ + char buffer[BUFFER_SIZE]; + while(fgets(buffer, sizeof(buffer), f) != NULL) { + if (isalpha(buffer[0])) { + if (full_upper ==0) + buffer[0] = toupper(buffer[0]); + else + cap(buffer); + printf("%s",buffer); + } + + } +} + +void die(char * str) +{ + printf("%s\n", str); + exit(0); +} + +void help(char * exename) +{ + printf( "Nhance - Narthex enhancer %s\n" + "By Michael C. Dim. <mk@mcdim.xyz>\n\n" + + "-f Append full capitalization\n" + "-h Print this panel & exit\n" + "-v Print current version & exit\n\n" + "Usage: cat [FILENAME] | %s [OPTIONS]\n", + " %s [OPTIONS] [FILENAME]\n", + VERSION, exename); + exit(0); +} + +void +main(int argc, char* argv[]) +{ + int full_upper, file = 0, i; + for (i=0; i<argc; i++) { + if (strcmp(argv[i],"-f")==0) + full_upper = 1; + else if (strcmp(argv[i],"-v")==0) + die(VERSION); + else if (strcmp(argv[i],"-h")==0) + help(argv[0]); + else + file = i; + } + + FILE *f2; + if (file != 0) { + FILE *f = fopen(argv[file], "r"); + + if (f) { + f2 = save_stdin(f); + } else { + fprintf(stderr, "nenhan: %s\n", strerror(errno)); + } + } else { + f2 = save_stdin(stdin); + } + + rewind(f2); + print_only(f2); + rewind(f2); + enhance(f2,0); + if (full_upper == 1) { + rewind(f2); + enhance(f2,1); + } + fclose(f2); + + exit(0); +} diff --git a/nhance/nhance.1 b/nhance/nhance.1 @@ -0,0 +1,25 @@ +.\# 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 @@ -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 "0.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 @@ -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/nleet/nleet.1 b/nleet/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/nleet/nleet.c @@ -0,0 +1,132 @@ +#include <stdlib.h> +#include <ctype.h> +#include <stdio.h> +#include <errno.h> +#include <string.h> + +/* + * Nhance - Narthex leetifier + * + * By Michael Constantine Dimopoulos + * https://mcdim.xyz <mk@mcdim.xyz> + * License: GNU GPL v3 + * + */ + + +#define VERSION "v1.2" +#define BUFFER_SIZE 256 + +FILE * +save_stdin(FILE *f) +{ + FILE *f2 = tmpfile(); + char buffer[BUFFER_SIZE]; + while(fgets(buffer, sizeof(buffer), f) != NULL) { + fprintf(f2, "%s", buffer); + } + fclose(f); + return f2; +} + +void +print_only(FILE *f) +{ + char buffer[BUFFER_SIZE]; + while(fgets(buffer, sizeof(buffer), f) != NULL) { + printf("%s",buffer); + } +} + +void +enhance(FILE *f, int full_upper) +{ + char buffer[BUFFER_SIZE]; + while(fgets(buffer, sizeof(buffer), f) != NULL) { + int i; + + /* + * + * vv EDIT THIS PART vv + * + */ + + int npflag = 0; + for (i=0; i<=BUFFER_SIZE; i++) { + if (buffer[i] == 'a' || buffer[i] == 'A') { + buffer[i] = '@'; + npflag = 1; + } else if (buffer[i] == 'o' || buffer[i] == 'O') { + buffer[i] = '0'; + npflag = 1; + } else if (buffer[i] == 'i' || buffer[i] == 'I') { + buffer[i] = '1'; + npflag = 1; + } else if (buffer[i] == 'e' || buffer[i] == 'E') { + buffer[i] = '3'; + npflag = 1; + /* } else if (buffer[i] == 't' || buffer[i] == 'T') { + * buffer[i] = '7'; + * npflag = 1; */ + } + } + if (npflag == 1) printf("%s",buffer); + } +} + +void die(char * str) +{ + printf("%s\n", str); + exit(0); +} + +void help(char * exename) +{ + printf( "Nhance - Narthex leetfier%s\n" + "By Michael C. Dim. <mk@mcdim.xyz>\n\n" + + "-h Print this panel & exit\n" + "-v Print current version & exit\n\n" + "Usage: cat [FILENAME] | %s\n", + " %s [FILENAME]\n", + VERSION, exename); + exit(0); +} + +void +main(int argc, char* argv[]) +{ + int full_upper, file = 0, i; + for (i=0; i<argc; i++) { + if (strcmp(argv[i],"-v")==0) + die(VERSION); + else if (strcmp(argv[i],"-h")==0) + help(argv[0]); + else + file = i; + } + + FILE *f2; + if (file != 0) { + FILE *f = fopen(argv[file], "r"); + + if (f) + f2= save_stdin(f); + else + fprintf(stderr, "nenhan: %s\n", strerror(errno)); + } else { + f2 = save_stdin(stdin); + } + + rewind(f2); + print_only(f2); + rewind(f2); + enhance(f2,0); + if (full_upper == 1) { + rewind(f2); + enhance(f2,1); + } + fclose(f2); + + exit(0); +} diff --git a/nrev/nrev.1 b/nrev/nrev.1 @@ -0,0 +1,23 @@ +.\# 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/nrev/nrev.sh b/nrev/nrev.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +version="1.0" + +if [ "$1" = "-v" ]; then echo version; exit; +elif [ "$1" = "-h" ]; +then + printf "Nrev - Narthex reverser ${version} \n"; + printf "By Michael C. Dim. <mk@mcdim.xyz>\n\n"; + printf '%s\n' "-h Print this panel & exit"; + printf '%s\n\n' "-v Print current version & exit"; + printf "Usage: nrev [FILENAME]\n"; + printf " cat [FILENAME] | nrev\n"; + exit; +fi + +filename=$(mktemp); + +while read line +do + echo "$line" >> $filename; +done < "${1:-/dev/stdin}" + +cat $filename; +cat $filename | rev; diff --git a/nwiz/nwiz.sh b/nwiz/nwiz.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +version="1.0" +RED='\033[0;31m' +YELLOW='\033[1;33m' +GREEN='\033[0;32m' +GREY='\033[0;37m' +NC='\033[0m' + +printf "\n" +printf "${GREEN} . \n"; sleep 0.05; +printf " \n"; sleep 0.05; +printf " .${NC} \n"; sleep 0.05; +printf "${YELLOW} /^\ ${NC} ${GREEN}.${NC} \n"; sleep 0.05; +printf "${RED} /\ ${NC} ${YELLOW}\"V\"${NC} \n"; sleep 0.05; +printf "${RED} /__\ ${NC} I ${GREEN} O o ${NC} \n"; sleep 0.06; +printf "${RED} //${NC}..${RED}\\\\\\ ${NC}I${GREEN} . ${NC}\n"; sleep 0.06; +printf "${RED} \]${NC}.\`${RED}[/${NC} I ${GREEN} ${NC}\n"; sleep 0.06; +printf "${RED} /l\/j\ ${NC} (] ${GREEN} . O ${NC} \n"; sleep 0.06; +printf "${RED} /. ~~ ,\\/${NC}I ${GREEN} . ${NC} \n"; sleep 0.07; +printf "${RED} \\\\\\L__j^\/${NC}I ${GREEN} o ${NC} \n"; sleep 0.07; +printf "${RED} \/-- } ${NC}I ${GREEN} o . ${NC} \n"; sleep 0.08; +printf "${RED} |I N| ${NC}I${GREY} _________ ${NC} \n"; sleep 0.08; +printf "${RED} |C I| ${NC}I${GREY} c( )o ${NC} \n"; sleep 0.09; +printf "${RED} |X Kl ${NC}I${GREY} \. ,/ ${NC} \n"; sleep 0.1; +printf "${RED}_/ C A \_${NC}!${GREY} _//^---^\\\\_${NC} -Row\n"; sleep 0.1; +printf "\n"; sleep 1; +# The ASCII art was originally created by Row. It has been modified. + +printf "${GREEN}NARTHEX ELDER $version\n"; sleep 0.1; +printf "Wizard program for Narthex ${NC}\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 "${RED}You will be asked a couple of questions regarding the target.\n"; sleep 2; +printf "And Narthex will generate a personalized wordlist based on the information.\n"; sleep 2; +printf "You are encouraged to edit the nwiz.sh file yourself.${NC}\n\n"; sleep 2; +printf "Leave as many blank as you like\n\n" + +printf "${RED}-Questions-${NC}\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"