You are not logged in.

#1 2013-04-30 02:46:39

DeadDingo
Member
Registered: 2012-09-29
Posts: 46

Simple yet effective program for generating passwords

Got tired of the program I was using to pipe into aircrack-ng so I made another one.  Really simple concept, just thought I would share smile

import java.util.ArrayList;
import java.util.Scanner;
import java.util.Random;
//import java.io.*;
public class hailMary {
	
	public static void main(String[] args) {
		
		ArrayList<String> aList = new ArrayList<String>();
		
		int length = 10;
		Scanner kb = new Scanner(System.in);
		Random rand = new Random();
		length = grabInput(kb);
		
		buildList(aList);
		String[] ara = new String[length];
		
		
		do {
		for(int i = 0;i<length;i++) {
			int index = rand.nextInt(aList.size());
			ara[i] = aList.get(index);
		}
		//System.out.println(Arrays.toString(ara)); //prints in array format
		for(int i = 0;i<length;i++) {
			System.out.print(ara[i]);
		}
		System.out.println();
		}while(true);
		
	}
	public static int grabInput(Scanner kb) {
		System.out.print("Enter Password Length: ");
		return kb.nextInt();
		
	}
	public static ArrayList<String> buildList(ArrayList<String> aList) {
		
		aList.add("A");
		aList.add("B");
		aList.add("C");
		aList.add("D");
		aList.add("E");
		aList.add("F");
		aList.add("G");
		aList.add("H");
		aList.add("I");
		aList.add("J");
		aList.add("K");
		aList.add("L");
		aList.add("M");
		aList.add("N");
		aList.add("O");
		aList.add("P");
		aList.add("Q");
		aList.add("R");
		aList.add("S");
		aList.add("T");
		aList.add("U");
		aList.add("V");
		aList.add("W");
		aList.add("X");
		aList.add("Y");
		aList.add("Z");
		aList.add("0");
		aList.add("1");
		aList.add("2");
		aList.add("3");
		aList.add("4");
		aList.add("5");
		aList.add("6");
		aList.add("7");
		aList.add("8");
		aList.add("9");
		return aList;
		
	}

}

In order to understand recursion, one must first understand recursion.

Offline

#2 2013-04-30 02:54:21

DeadDingo
Member
Registered: 2012-09-29
Posts: 46

Re: Simple yet effective program for generating passwords

Before piping it into aircrack-ng you must comment out the line
length = grabInput(kb);

This will keep the default password length at 10.  Which is the default generated by linksys routers.

So the aircrack command will go something like this:
java hailMary | aircrack-ng -w - -b bssid psk*.cap


In order to understand recursion, one must first understand recursion.

Offline

#3 2013-04-30 06:26:24

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Simple yet effective program for generating passwords

Nice.


Moving to Community Contributions...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2013-04-30 21:05:28

Svenstaro
Administrator
From: Germany
Registered: 2008-11-19
Posts: 388

Re: Simple yet effective program for generating passwords

Why not just use pwgen? Also, your method of generating a character set is incredibly inefficient. Why not just use a certain ASCII character range as input?

Offline

#5 2013-04-30 21:13:11

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: Simple yet effective program for generating passwords

Out of curiosity, what program were you using before?

If you're looking for a random password generator, I use apg.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2013-05-01 02:10:09

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: Simple yet effective program for generating passwords

WorMzy wrote:

Out of curiosity, what program were you using before?

If you're looking for a random password generator, I use apg.

He isn't using this to generate passwords for himself, just a list of possible passwords for cracking wireless networks.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#7 2013-05-01 03:59:28

DeadDingo
Member
Registered: 2012-09-29
Posts: 46

Re: Simple yet effective program for generating passwords

Svenstaro wrote:

Why not just use pwgen? Also, your method of generating a character set is incredibly inefficient. Why not just use a certain ASCII character range as input?

I didn't really think of that at the time.  I didn't really put much thought into this as its only purpose is generating randoms for aircrack.  Maybe I will rewrite it in my spare time or whenever I am bored at work tongue


In order to understand recursion, one must first understand recursion.

Offline

Board footer

Powered by FluxBB