0% found this document useful (0 votes)
58 views

Word Generator

This Perl script generates wordlists based on user-specified parameters. It asks the user to input a character set, number of words, and word length. Based on the character set selected, it randomly generates words of the given length using characters from that set and saves it to a file specified by the user. The script supports different character sets including alphanumeric, lowercase alphanumeric, numeric, and more.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Word Generator

This Perl script generates wordlists based on user-specified parameters. It asks the user to input a character set, number of words, and word length. Based on the character set selected, it randomly generates words of the given length using characters from that set and saves it to a file specified by the user. The script supports different character sets including alphanumeric, lowercase alphanumeric, numeric, and more.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

#!

/usr/bin/perl
# Wordlist Generator #
# By Warpboy #
## Read: README.txt ##
print "Wordlist Generator\n";
print "By Warpboy\n";
print "Read: README.txt\n\n";
print "Where to save generated file: ";
$path = <STDIN>;
chomp $path;
#Open file
open (pa, '>', $path) or die "Could not create file!\n";

#Usr Input
print "Character Set: ";
$charset = <STDIN>;
chomp $charset;
print "How many words to generate: ";
$inputted = <STDIN>;
chomp $inputted;
print "Word Length(s): ";
$a = <STDIN>;
chomp $a;
####
#Character Set#
if($charset eq 'alphanumeric') {
my $p;
my @char = (('A'..'Z'), (0..9));
my $ran = $#char + 1;
foreach (1..$inputted) {
for (1..int($a)) {
$p = $char[int(rand($ran))];
print pa $p ;
}
print pa "\n";
}
}
if($charset eq 'mixalpha') {
my $p;
my @char = (('A'..'Z'), ('a'..'z'));
my $ran = $#char + 1;
foreach (1..$inputted) {
for (1..int($a)) {
$p = $char[int(rand($ran))];
print pa $p ;
}
print pa "\n";
}
}
if($charset eq 'alpha') {
my $p;
my @char = (('A'..'Z'));
my $ran = $#char + 1;
foreach (1..$inputted) {
for (1..int($a)) {
$p = $char[int(rand($ran))];
print pa $p ;
}
print pa "\n";
}
}
if($charset eq 'lcalpha') {
my $p;
my @char = (('a'..'z'));
my $ran = $#char + 1;
foreach (1..$inputted) {
for (1..int($a)) {
$p = $char[int(rand($ran))];
print pa $p ;
}
print pa "\n";
}
}
if($charset eq 'lcalphanumeric') {
my $p;
my @char = (('a'..'z'), (0..9));
my $ran = $#char + 1;
foreach (1..$inputted) {
for (1..int($a)) {
$p = $char[int(rand($ran))];
print pa $p ;
}
print pa "\n";
}
}
if($charset eq 'lcalphanumeric-symbol14') {
my $p;
my @char = (('a'..'z') ,(0..9),'!','@','#','$','%','^','&','*','(',')','-','_','
+','=');
my $ran = $#char + 1;
foreach (1..$inputted) {
for (1..int($a)) {
$p = $char[int(rand($ran))];
print pa $p ;

}
print pa "\n";
}
}
if($charset eq 'numeric') {
my $p;
my @char = ((0..9));
my $ran = $#char + 1;
foreach (1..$inputted) {
for (1..int($a)) {
$p = $char[int(rand($ran))];
print pa $p ;
}
print pa "\n";
}
}
if($charset eq 'alphanumeric-symbol14') {
my $p;
my @char = (('A'..'Z'), ('a'..'z'), (0..9),'!','@','#','$','%','^','&','*','(','
)','-','_','+','=');
my $ran = $#char + 1;
foreach (1..$inputted) {
for (1..int($a)) {
$p = $char[int(rand($ran))];
print pa $p ;
}
print pa "\n";
}
}
if($charset eq 'all') {
my $p;
my @char = (('A'..'Z'), (0..9),'!','@','#','$','%','^','&','*','(',')','-','_','
+','=','~','`','[',']','{','}','|', "/", ":" ,";",'"',"'",'<','>',",",".","?","/
");
my $ran = $#char + 1;
foreach (1..$inputted) {
for (1..int($a)) {
$p = $char[int(rand($ran))];
print pa $p ;
}
print pa "\n";
}
}
###############
#End Code
#Warpboy

You might also like