Uncover Starred-Out Passwords

Uncover Starred-Out Passwords

I was inside my unifi controller a while back and the new update had starred out the radius password. The documentation had yet to occur on the radius password. So, I used a simple HTML trick with my firefox to change the stars to clear text. This is how you can Uncover Starred-Out Passwords in firefox.

Developer Options

F12 will trigger the developer options. Inside Google Chrome, the developer window will appear on the right-hand side. In Firefox, the developer window will appear at the bottom of the window. These options allow you to change your current view of the site. If you want to change the background to hot pink, you can. if you want to change a password field to plain text, you can.

Developer Options in Firefox

What we are looking at

Stared-Out Passwords
The view area.

This is the page we are viewing. I want the starred-out shared secret that you see in the red box. Click the edit button to the right of the shared secret. Notice the password is still starred out. To get this information, we need to start the Developer options. Inside the developer options on the left-hand side, you will see a mouse cursor in a box, also known as an inspector. We still have Starred-Out Passwords

Once you click the inspector tool, you can move the mouse over the shared secret and click on it. Inside the developer options, you will see the HTML itself highlighted. Notice the highlighted HTML code is the input object. We are looking for the word “type”. All we have to do is replace type=”password” to type=”text”. Once you type in text, click enter. The password is now exposed.

That’s pretty much it. The key secret is to make sure you are editing the input and not just the div. I you see div code instead of input code, then you do not have it set in edit mode. This process can be used for just about any website out there. This is how we Uncover Starred-Out Passwords.

Continue Reading

Datamuse API and PowerShell

Datamuse API and PowerShell

There are 171,476 or so words in the English language. This doesn’t include names or other items. Datamuse is a very powerful database of English words. It contains rhyming, like, anonymous, Synonyms and much more. What I like about this site is it has a simple API that can be stacked. You can find the API here.

What do I mean by stacked. Some APIs use the URL and gathers all the information from that. While others uses the custom header and body of requests. Datamuse uses the URL. It returns a nice json to work with as well inside its content area. Basically, it’s my kind of API. The below API is an example of a url API. After words? each XX= has the word to query with. Each item means something different. The ML means, means like and the sp is spelled like. So we are looking for words that means like black and starts with the letter b.

https://api.datamuse.com/words?ml=Black&sp=b*

URL API’s are super easy to work within PowerShell. The key is to make a string of what you are looking for. If you have a flag of $meansLike = Black. Then it will add the &ml=black to the string. Same as $Spelling=”B*”. It will add the &ml=Black&sp=B*. Then we just remove the first character of the string and we have our string. We do that with substring. Let’s take a look at the full script.

The Script

function Get-SHDWords {
    [cmdletbinding()]
    param (
        [string]$MeansLike,
        [string]$SoundsLike,
        [string]$SpelledLike,
        [string]$LeftContext,
        [string]$RightContext,
        [string]$Topic,
        [string]$NounModifiedByAdjective,
        [string]$AdjectiveModifiedbyNoun,
        [string]$Synonym,
        [string]$Trigger,
        [string]$Antonym,
        [string]$KindOf,
        [string]$MoreGeneralThan,
        [string]$Comprises,
        [string]$Meronym,
        [string]$FrequentFollowers,
        [string]$FrequentPredecessors,
        [string]$Rhymes,
        [string]$NearRhymes,
        [string]$Homophones,
        [string]$Consonant,
        [switch]$Random
    )
    $actionstring = ""
    if ($PSBoundParameters.ContainsKey('MeansLike')) { $actionstring = "$($actionstring)&ml=$MeansLike" }
    if ($PSBoundParameters.ContainsKey('SoundsLike')) { $actionstring = "$($actionstring)&sl=$SoundsLike" }
    if ($PSBoundParameters.ContainsKey('SpelledLike')) { $actionstring = "$($actionstring)&sp=$SpelledLike" }
    if ($PSBoundParameters.ContainsKey('LeftContext')) { $actionstring = "$($actionstring)&lc=$LeftContext" }
    if ($PSBoundParameters.ContainsKey('RightContext')) { $actionstring = "$($actionstring)&rc=$RightContext" }
    if ($PSBoundParameters.ContainsKey('Topic')) { $actionstring = "$($actionstring)&topics=$Topic" }
    if ($PSBoundParameters.ContainsKey('NounModifiedByAdjective')) { $actionstring = "$($actionstring)&rel_jja=$NounModifiedByAdjective" }
    if ($PSBoundParameters.ContainsKey('AdjectiveModifiedbyNoun')) { $actionstring = "$($actionstring)&rel_jjb=$AdjectiveModifiedbyNoun" }
    if ($PSBoundParameters.ContainsKey('Synonym')) { $actionstring = "$($actionstring)&rel_syn=$Synonym" }
    if ($PSBoundParameters.ContainsKey('Trigger')) { $actionstring = "$($actionstring)&rel_trg=$Trigger" }
    if ($PSBoundParameters.ContainsKey('Antonym')) { $actionstring = "$($actionstring)&rel_ant=$Antonym" }
    if ($PSBoundParameters.ContainsKey('KindOf')) { $actionstring = "$($actionstring)&rel_spc=$KindOf" }
    if ($PSBoundParameters.ContainsKey('MoreGeneralThan')) { $actionstring = "$($actionstring)&rel_gen=$MoreGeneralThan" }
    if ($PSBoundParameters.ContainsKey('Comprises')) { $actionstring = "$($actionstring)&rel_com=$Comprises" }
    if ($PSBoundParameters.ContainsKey('Meronym')) { $actionstring = "$($actionstring)&rel_par=$Meronym" }
    if ($PSBoundParameters.ContainsKey('FrequentFollowers')) { $actionstring = "$($actionstring)&rel_bag=$FrequentFollowers" }
    if ($PSBoundParameters.ContainsKey('FrequentPredecessors')) { $actionstring = "$($actionstring)&rel_bgb=$FrequentPredecessors" }
    if ($PSBoundParameters.ContainsKey('Rhymes')) { $actionstring = "$($actionstring)&rel_rhy=$Rhymes" }
    if ($PSBoundParameters.ContainsKey('NearRhymes')) { $actionstring = "$($actionstring)&rel_nry=$NearRhymes" }
    if ($PSBoundParameters.ContainsKey('Homophones')) { $actionstring = "$($actionstring)&rel_hom=$Homophones" }
    if ($PSBoundParameters.ContainsKey('Consonant')) { $actionstring = "$($actionstring)&rel_cns=$Consonant" }
    if ($Random) {
        $Character = [char](Get-Random -Minimum 65 -Maximum 90)
        $actionstring = "$($actionstring)&sp=$Character*"
    }
    $actionstring = $actionstring.Substring(1)
        (Invoke-WebRequest -Uri "https://api.datamuse.com/words?$actionstring").content | convertfrom-json
}

The Breakdown

Ok, first notice that we have each of the items from the datamuse site as string values that can take input. None of them are mandatory. The first thing after the parameters is our blank action string.

Next, we start questioning the input like a youtube conspiracy theorist. We do that by asking if the bound parameters contains a key. If it does we add to the action string.

    if ($PSBoundParameters.ContainsKey('MeansLike')) { $actionstring = "$($actionstring)&ml=$MeansLike" }

Here we are recreating the string by taking the value of the string and adding the &ml=$MeansLike. We do this for each parameter we use except for random. Random we just grab a random english word character and ask for a word that starts with that word. After we have created our action string we use our substring command to remove the first & from the string.

$actionstring = $actionstring.Substring(1)

Once we have the action string formatted right, we are ready to go. We use the invoke-webrequest command and we will grab the data. We will select only the content, which is in a nice json format. Then we will pipe that information into convertfrom-json to create a Powershell object.

(Invoke-WebRequest -Uri "https://api.datamuse.com/words?$actionstring").content | convertfrom-json

From here you can select the data you want. Lets look at some examples.

Example 1 – Link

Get-SHDWords -SpelledLike "L*" -Rhymes "Pink"

Here are the results:

word     score numSyllables
----     ----- ------------
link      2267            1
linc       144            1
lip sync   105            2
lynk        43            1
linke       31            1
linck        2            1

Here we are looking for all the words that start with the letter L and that Rhyme with Pink.

Example 2 – Lash

Get-SHDWords -MeansLike anger -SoundsLike love | Where-Object {$_.tags -contains "v"}

Here are the results:

word score tags
---- ----- ----
lash 14742 {v}

In this example, we are looking for words that mean anger but sound like love. Some of the results will have tags. Items like means like and sounds like have tags that you can filter through. With this example, we are looking for verbs. So we look with the where-object command.

Example 3 – Random Word

$Test = Get-SHDWords -Random
$test[(Get-Random -Minimum 0 -Maximum $test.count)].word
ominous

In this example, we get a random list of words that start with a random letter. Then we select from that list a random item. We do that with the get-random with a minimum of 0 and the maximum of the test count. Then we select the word. All that produced the word ominous.

Taking a step farther – Passwords

Let’s take this one step further and make a two-word password. The first thing we want is a word. So we use the command Get-SHDwords again. We are going to use the word trust.

$Charcter = [char](Get-Random -Minimum 33 -Maximum 64)
$CharcterEnd = [char](Get-Random -Minimum 33 -Maximum 64)
$CharcterMiddle = [char](Get-Random -Minimum 33 -Maximum 64)
$One = "Trust"
$Two = Get-SHDWords -Rhymes $One
$Two = $two[(Get-Random -Minimum 0 -Maximum $two.count)].word -replace ("[ aAeEiIoOuUyY](?!.*[aAeEiIoOuUyY])", "$Charcter")
"$one$($CharcterMiddle)$Two$($CharcterEnd)"

The password this produced was: Trust<comb?st’

Here we generate 3 random characters. We then select our word, trust by putting it into the $One. We can replace our word by replacing the $One input. Then we get the second word with two. Get-SHDWords -Rhymes $One Then we grab just one of those words like before. This time we replace all the vowels with the character we generated at the beginning. Then we combine it all together. The first word, $One, the middle character, $characterMiddle, the second word $two, and finally the ending Character $CharacterEnd. Now we have an easy-to-remember password.

Datamuse offers even more options than what this script offers. Check them out and see what amazing things you can create.

I’m going to leave off here with a challenge this week. Can you write a poem using datamuse based off the word:

$Test = Get-SHDWords -Random
$test[(Get-Random -Minimum 0 -Maximum $test.count)].word

Post your results in the comments.

Dino Passwords!

Dino Passwords!

Passwords can be hard to make for people, especially kids and older users. That’s where Dino Passwords come into play. You can make simple and yet complex passwords using this service. This service also has a simple API to work with. I personally like using the API with new user creation scripts. The API is a single line with the invoke-webrequest command let.

Strong Passwords

(Invoke-WebRequest -Uri http://www.dinopass.com/password/strong).content

Simple Passwords

(Invoke-WebRequest -Uri http://www.dinopass.com/password/simple).content

That’s it, it’s as simple as that. Great little passwords that even kids can figure out how to use.