Browsing: Linux

WPA Password Verification Tool

I was going through my computer projects and realised that I never shared this one on my website. It’s a tool, coded in C++ that checks a text file for WPA/WPA2 password compatibility. It is most helpful in network security applications / pentesting when you have a password list and aren’t sure just how much of the list is actually a legitimate password.

For example, we have a text file with these contents:

Good Password
good password

Good Password 1234567890
good password 1234567890

GoodPassword
goodpassword

BadPass
badpass
badpa55

badpas™
BadPas™
B3dPas™

This is a bad password because the character length is way above the maximum limit of 63 characters, and WPA won’t allow such horrible things to exist in the first place anyways.

If we run the tool on it, we get these results:

A picture of the tool in action

 

Finally, here is the source code of the project. It should be able to be compiled with just about any compiler on any operating system.

#include <iostream>
#include <fstream>
#include <string>

int help(char *argv[]) {
std::cout << “Usage: ” << argv[0] << ” <PasswordFile> [Options]” << std::endl;
std::cout << ”  Options:” << std::endl;
std::cout << ”    -wpa  Verify password list using WPA Rules (WPA uses same rules as WPA2)” << std::endl;
//std::cout << ”    -clean    Automatically delete invalid passwords from file” << std::endl;
std::cout << ”    -goodlist Print all valid passwords” << std::endl;
std::cout << ”    -badlist  Print all invalid passwords” << std::endl;
std::cout << ”  Example:” << std::endl;
std::cout << ”    ” << argv[0] << ” passwordlist.txt -wpa -badlist” << std::endl;

return(1);
}

int does_exist(char *filetouse) {
//first check to see if the cfg file exists
FILE * pFile;
if(pFile = fopen (filetouse,”r”)) {
//the file exists
return(1);
} else {
//the file doesnt exist
return(0);
}
}

int verify(int argc, char *argv[]) {
//variables for later usage
//booleans for user options
bool wpa = false;
//bool clean = false;
bool goodlist = false;
bool badlist = false;
//strings for file reading
std::string password;
std::ifstream infile;
//strings for password statistics
int numberoflines = 0;
int numberoftolong = 0;
int numberoftoshort = 0;
int numberofbadchar = 0;
int numberofgood = 0;
int numberofempty = 0;

const char *filetouse = argv[1];

//check all the options
for (int i = 0; i < argc; i++) {
//options are -wpa -clean -goodlist -badlist
std::string options[4] = {“-wpa”,”-clean”,”-goodlist”,”-badlist”};
if(argv[i] == options[0]) {
wpa = true;
}
/*if(argv[i] == options[1]) {
clean = true;
}*/
if(argv[i] == options[2]) {
goodlist = true;
}
if(argv[i] == options[3]) {
badlist = true;
}
}

//read the file line by line and check to see if the passwords are right
infile.open(filetouse); //open the user file
while(getline(infile, password)) { //while not the end of the file
//getline(infile,password); //read the current line to std::string password

//count the lines in the password field
numberoflines += 1;

//check password
if(wpa == true) { //if checking WPA Rules
if(password == “”) { //empty line
//skip empty lines
numberofempty += 1;
} else if(password.size() > 63) {
//password is to big to be used
if(badlist == true) {
std::cout << password << std::endl;
}
numberoftolong += 1;
} else if(password.size() < 8) {
//password is to small to be used
if(badlist == true) {
std::cout << password << std::endl;
}
numberoftoshort += 1;
} else if (password.find_first_not_of(“!\”#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ “) != std::string::npos) {
//password contains a bad character
if(badlist == true) {
std::cout << password << std::endl;
}
numberofbadchar += 1;
} else {
if(goodlist == true) {
std::cout << password << std::endl;
}
numberofgood += 1;
}
}
}
infile.close();

std::cout << “Checked ” << numberoflines << ” passwords.” << std::endl;
std::cout << ”  ” << numberofempty << ” lines contained no text” << std::endl;
std::cout << ”  ” << numberoftoshort << ” lines were to short” << std::endl;
std::cout << ”  ” << numberoftolong << ” lines were to long” << std::endl;
std::cout << ”  ” << numberofbadchar << ” lines contained illegal characters” << std::endl;
std::cout << ”  ” << numberofgood << ” lines contained good passwords” << std::endl;

return(0);
}

int main(int argc, char *argv[]) {
if(argc <= 1){ //not enough options so help is shown
if(help(argv)) {
std::cout << “Fatal error. Quitting program.” << std::endl;
return(1);
} //else program is working fine
} else { //plenty of options, better check to see if they are the right ones
if(argv[1] == std::string(“help”)) {//display help
if(!help(argv)) {
std::cout << “Fatal error. Quitting program.” << std::endl;
return(1);
} //else program is working fine
} else {
if(does_exist(argv[1])){
verify(argc, argv);
} else {
std::cout << “Invalid file” << std::endl;
}
}
}
}

 

{ Comments are closed }

Linux Autotyper 1.1 Released

Alrighty guys! I have finished the latest and greatest version of my Linux autotyper! Some of the main changes are to the menus, and to the OSD. The OSD now has more info for you, and i made the menus a little better. I also added a suffix / prefix form. All the info is in the readme.

I added a countdown for the OSD, and you can now stop / pause / play the text sending with it. (This removes the need for start/stop function keys.)

As for the suffix / prefix form, It lets you add some text to the end and beginning of the text you send. Some games require you to press enter to type the text, and then enter again to send it. This form (Window?) allows you to do that easily.

Anyway, here is the download link:

//sourceforge.net/projects/rsautosayer/files/Linux/1.1/

There is also a detailed install file with instructions for installing the Linux autotyper.

{ 1 Comment }

Installing / Running The Linux Autotyper

It was recently brought to my attention that I do not have clear instructions for installing the linux autotyper. Well, this post fixes that. So without further adieu, the instructions.

 

1: First, you need gambas2 installed. I may have a script fixing this later, but not right now. To install gambas2:

1a: Open the terminal by pressing “ctrl” and “Shift” and “t” on your keyboard at the same time.

2: Enter this code in the terminal (command prompt for you new-to-linux people)
sudo apt-get install gambas2

You may or may not have to press ‘y’ to confirm that you want to have gambas2 on your system.

3: Download the latest version of the linux autotyper by clicking this link:
Download here.

4: Extract the downloaded zip file to your desktop.
5: Browse to the extracted folder on your desktop, and open it.
6: Open the folder called “Executable”

7: there are two files, DaGeek247s_Autotyper,gambas, and readme.txt.
Make DaGeek247s_Autotyper.gambas executable.

{ Comments are closed }

WordPress Update

Today, I decided to update to the newest WordPress installation. Thank goodness for backups.

Basically, I clicked “Update Now”, and it didn’t work. I had to download the new installation of WordPress, and restore all my changed settings, and do the backup. That’s why my site was down for the most part of an afternoon.

I also was notified about my not having proper instructions on setting up my Linux autotyper. Oops! I will have that fixed fairly soon. Until then, go backup your site! 🙂

{ Comments are closed }

Windows and Linux Autotypers

I have good news, and bad news. I’ll start with the bad news. Quite frankly, development of the windows autotyper has stopped for one reason: windows is a pain in the butt. I recently got Windows 7, the latest and greatest. I tried installing VB6 (The language i use for the windows autotyper) and it failed miserably due to issues beyond my abilities to fix. I got the newest Visual Studio (2010) and it ran so slow it wasn’t worth it. It could not import my autotyper’s source, so it wasn’t worth the effort of remaking it.

For now, the windows autotyper development is stopped. I cannot develop it right now. If you want to help out,  and start development again, email me at imageek247@gmail.com, and we can work something out. For now, there is only the old version of the windows autotyper.

 

Alrighty guys! Here’s the good news. I finally got around to finishing the newest version of the Linux autotyper; 1.0. This one has some major updates;

New OSD  that shows a preview of the next text

You could already save/open a text file into the autotyper. Now you can choose the method with which it divides the text. Suppose you felt like ‘reading’ a book you got of the internet to RuneScape. You would import the text file, and choose a period “.” as the divider, instead of the default enter “\n” key.

Runescape Effects are now fully supported (that one took awhile)

Finally, You have three different ways of timing the sent text. You can use one speed for all the texts, just like always, or you can have it send the text randomly between two texts. And the newest one, you can have its sending speed go according to the number of characters in the text. For example, by building off of you reading a book to runescape, you could use this speed setting to make it look like you typed it yourself, at an average typing speed.

You can get the newest version of the autotyper,  at this link:

//sourceforge.net/projects/rsautosayer/files/Linux/1.0/?

and you can check out its new screenshot on my website at this link:

//dageek247.tk/wordpress/?page_id=32

enjoy!

{ Comments are closed }

Fedora 16 Rant

I love Linux, and I love fedora and Ubuntu. they are my favorite distros. Lately, however, they haven’t been doing as good as they can. In a previous post i talked about Ubuntu 11.10 and unity. Unity didn’t turn out as well as it could, but after some research, i found i was able to simply impermanently hide the side bar and use docky instead.

This time, my rant is not about fedora itself, but my computer and its limitations along with Fedora’s hardware needs. The default gnome3 fedora spin is not able to install on my computer, and its because i need 256MB more RAM. Normally, linux is supposed to be less resource intensive, but this is not the case with F16. It takes 756MB ram to install the fedora 16 gnome spin, and I only have 512MB. However, I was able to look at the desktop on the livecd, and see, how promising it looks, for computers that could handle it. Maybe when I get more RAM, it will get better.

In any case, I hope everyone who can run fedora 16 enjoys it.  Have fun with Linux!

{ Comments are closed }

Ubuntu Templates

Ubuntu templates, the one thing they always forget to add in the release. Sure you can add your own, but that’s always a pain to do yourself. But first, an explanation for the newer ubuntu users.

Whenever you right click on a folder or the desktop in ubuntu, you are given the option to to create a file. If its a new install, it will almost certainly tell you how it doesn’t have any templates installed. The simple fix is to go to the ~/randomuser335/Templates folder and make some files, and most of us do.

However, doing that with every new release is a pain, so i spent about thirty minutes setting up a whole bunch of files and adding them to a file to share with everyone else. Now, you just need to come here and get my file, and copy its contents to your own templates folder.

Last thing, and i’ll give you the templates link. Every folder in the templates folder is a new sub-menu in the ‘create file’ menu. every file you put in the templates folder is just copied when you use the create new file menu. So here is an exemple of the sub-menus;
Finally, here is the link to my templates. Just extract the files to the ~/username/Templates/ folder and you can use them instantly. //dageek247.com/wordpress/wp-content/uploads/2011/10/Templates.tar.gz

{ 1 Comment }

Ubuntu 11.10 IS OUT!!!

And I had, to my absolute delight, the chance to install it on an asus netbook, and try it out. I also had, to my tentative enjoyment, to test it out on my desktop.

Let me explain, the new ubuntu 11.10 now uses unity as its default interface. why is that bad and good? It was originally made for netbooks, and as such it looked great on the netbook. But, its new sidebar was terrible on the desktop. Worse, the sidebar can’t be moved according to this, and my messing around with it failed to change that. Other than that, the new default unity interface is great, and ubuntu 11.10 is great also.

When i installed it on the netbook and looked around, i was thrilled everywhere i went. The new interface, (i always used the main ubuntu for the netbook, even though there is a netbook version) has me feeling right at home. If you have a 16:3 desktop screen, 11.10 will only make you happy. If you have a 4:3 desktop screen (like me) Unity will annoy, but it won’t hurt you, and its always fun to mess with a new OS.

So, I recommend everyone to go check it out. (Try to use the torrent if you can to alleviate some of the load on the servers)

{ Comments are closed }

Restoring gnome panels to their defaults

Quite frankly, this happens to many times to ignore. You are messing around with ubuntu and oops! you deleted, or misplaced something on the panels. Maybe you booted up your computer and something on the panels somehow is ruined, through no fault of your own. this often happens to me, so it seemed necessary to put it here, even though there are plenty of other sites saying the same thing. Here is a probable messed up panel screenshot:

First, you need to open the terminal. The easiest way to do this, is to go to Applications>Accessories>Terminal, but not everyone has the luxury of working panels. You can also open the terminal by pressing ALT+F2 and then typing ‘gnome-terminal’  in the resulting dialog box. This is what it looks like:

next, you need to type a few commands into the terminal. First, copy/paste this in:

gconftool – -recursive-unset /apps/panel

the above command prepares the computer for the next commands and allows you to delete the settings files.. now type in the below command:

rm -rf ~/.gconf/apps/panel

The above command deletes all the settings for the gnome panels and allows them to be automatically reset by the system to their defaults.. finally, copy/paste this in:

pkill gnome-panel

The previous command stops the system app running the gnome panels, allows the system to restore the settings to their defaults, and starts the panel back up. if you did not delete the settings with the rm -rf command, this would have just restarted the gnome panels. And for those of us who don’t care and just want their panels reset quickly, you can copy/paste the below command into the terminal, and it will have the same effect.

gconftool – -recursive-unset /apps/panel; rm -rf ~/.gconf/apps/panel; pkill gnome-panel

That’s it! the gnome panels had all their settings reset to factory default, and you can now look at your proper panels and use them like they are supposed to be, here is even a screenshot of mine after they were fixed:

{ 3 Comments }

Grub Bootloader

Many of you should know about it, its the thing that lets you choose which operating system to run, and then starts it for you. Its also what can almost stop a computers usability with a few clicks of a button. You have probably also had problems with it in the past, maybe a dead os listing, maybe not all the oses are there, or something more serious.

I know people who think the solution to whatever bug or problem in grub is to reinstall the machine. If you are thinking of doing this, don’t. The easiest thing to do is get a live cd and fix the grub issues there. Here is even a good tutorial on how to do so:

If grub was overridden by a new install of windows or if grub has an incorrect/missing boot item:
//www.robertbeal.com/562/rebuilding-grub2-grub-cfg-from-ubuntu-live-cd

You can fix the random errors that you have no idea how they got there by reinstalling grub, and if that fails, you need a new pc, because reinstalling grub is the same as reinstalling everything on your pc to fix grub.

So please, for the love of grub users everywhere, don’t format everything to fix grub, use a liveCD to fix it instead.

{ Comments are closed }