Jump to content

Regex, Word Permutations and Visual Basic, i need help


mr_hasch
 Share

Recommended Posts

i have a program problem, i have a a wordlist text file, Short in size, less then a few hundred words if that. and i want to take a keyword and check it against the wordlist, saving all of the matches and displaying them in a Listbox. i am fairly new to programming, i have looking into regex to match partial patterns, and have begun looking into creating a function to generate a list of every permutation of the keyword and then run them against the wordlist. i hope someone can help.

Link to comment
Share on other sites

  • 2 months later...

Forgive me for sucking at Visual BASIC syntax. I've done some of this stuff in QB64 and Visual BASIC 2010 but it's more than a year ago. I switched over to Linux completely and learned C++ after my last experience with windows and loosing 500gb of downloads. But hopefully this give you some ideas so you can at least start looking things up on Google or YouTube.

Pretty much you want to use a fileReader.

fileReader.ReadLine() this is probably what you want to use but basically loop through the file where file != eof

Line by line then run the comparison operator. If textbox1.text ==myword then IDK make the label show the word that matches

Dim fileReader As System.IO.StreamReaderfileReader = _My.Computer.FileSystem.OpenTextFileReader("C:\\testfile.txt")Dim stringReader As StringstringReader = fileReader.ReadLine()MsgBox("The first line of the file is " & stringReader)

//http://msdn.microsoft.com/en-us/library/s2kc1xee%28v=vs.90%29.aspx

Optionally since the wordlist is so small you can store the words in a string rather than looping through the wordlist. But open file dialogues in VB aren't difficult.

If you want to make a whole bunch of words just use nested for loops to go through integer values in the range you want and output the ascii value using the a char variable.

Like this maybe

DIM a as integer

for a = 97 to 122

print char(a) or is it char$(a)

next a or is it just next

nested loops is the same

just

for a = 88 to 127

for b = 88 to 127

for c = 88 to 127

print char©;char( B);char(a)

Not sure on syntax it's been a long time

might be char©&&char( B)&&char(a) or something like that you'll have to mess around with it

Dump the variables into a single string

comparison operator

output something if string == keyword

or run something like write all of the outputs to a list

next

next

next

If you are going to run a hashing function against the output you'll have to do a variable dump first. Basically you need to concat all of the chars into a single string variable.

but you can print "keyword" &&char(a)&&whatever

Of course there's a lot of other cool string manipulations you can do in Visual BASIC I'm just not sure what they are.

Also check out some tools aleady available like john, hashcat, burpsuit, and crunch have some function similar to what you are talking about. But most of the good linux programs are written in C.

Edited by vailixi
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...