Tom Carpenter’s WiFiStat Tool

UPDATE: WIFISTAT has been modified so that you can run:

wifistat 0

For unlimited iterations. The three options now are:

  • wifistat
    • this will run 1 iteration
  • wifistat 0
    • this will run until you press CTRL+C
  • wifistat #
    • this will run for the number of iterations specified as #

Additionally, a timestamp is provided.

Here is a tool by request. WIFISTAT.EXE will show the Tx/Rx rate and signal strength for the current connection (WLAN) in dBm. By default, it lists the information and exits, like so:

WiFiStat.exe with No Parameters
WiFiStat.exe with No Parameters

Here is the tool with the parameter 5 (of course, if you move while running, the signal will change:

WifiStat.exe with a Parameter of 5
WifiStat.exe with a Parameter of 5

Here is the download, have fun. Like all my tools, it comes with no support and no error processing as they are created as learning experiments or for my own use [smile].

WiFiStat.zip Download

 

Tom Carpenter’s WiFiScan Tool

NOTE: Tool has been updated to resolve problems on some systems. (Feb. 13, 2017)

OK. I have a problem with NETSH. It shows signal levels in percentages based on a known algorithm, but gives no option to show dBm levels. Hence, WiFiScan.exe. This little tool will pull the NETSH information in, convert signal strength to show dBm as well (for strengths weaker than -50 and stronger than -100) and show them parenthetically after the percentage info. The command is the same as:

NETSH WLAN SHOW NETWORKS MODE=BSSID

It goes against the default WLAN interface and has no parameters. I may modify it to allow for interface specification, but it serves my purpose for now. By the way, the conversion to dBm follows this logic:

if(quality <= 0)
    dBm = -100
else if(quality >= 100)
    dBm = -50 or better
else
    dBm = (quality / 2) - 100

The wifiscan.exe tool should be run while not connected to a WLAN. It will sort of work if you’re connected, but give you an error related to an array. I may fix that when energy returns. Here’s the tool, feel free to download and use at your own risk [smile]:

Download the Feb. 13, 2017 WiFiScan tool.

 

My Right-Click PowerShell WLAN Scanner Script

Download wifi.ps1 Here

I mentioned this script an a class recently. I threw it together sometime back. It’s not elegant, but it does what I wanted. It’s actually pretty beautiful when you consider that it was written late one night 🙂

It would need some tweaking to work as a command line script.

Just place it where you want it and then right-click and choose Run with PowerShell to get a listing of discovered networks sorted by channel.

By the way, I was studying two PowerShell concepts at the time: file access and pulling in NETSH information. I had used a method without files, but this was the last one I played with. If you want one without temp files, let me know. I can throw that together and post it too. This is mostly a learning tool for you.

Have fun and let me know if you make some great changes.

Download wifi.ps1 Here

Simple Wi-Fi NETSH Batch File for Information Gathering

Here is a simple batch file that will get information from NETSH without the lengthy commands. No error checking. A little help. But it’s the one I use. I added a menu for those who want interactive use. Copy and past it into a file with a .bat extension and you’re good to go. I name mine wifi.bat.  Someone asked for it so I thought I’d share it with the world.

Just run wifi.bat with no params to get help. Run “wifi.bat menu” to see the interactive menu I built just for you!

Have fun, tweak and change all you like.

@ECHO OFF
if [%1]==[] GOTO HELP

if /I %1==interfaces GOTO SHOWALL

if /I %1==networks GOTO NETWORKS

if /I %1==drivers GOTO DRIVERS

if /I %1==settings GOTO SETTINGS

if /I %1==menu GOTO MENU

netsh wlan show interfaces %1
GOTO END

:NETWORKS
netsh wlan show networks interface=%2
GOTO END

:DRIVERS
netsh wlan show drivers interface=%2
GOTO END

:SETTINGS
netsh wlan show settings
GOTO END

:SHOWALL
netsh wlan show interfaces
GOTO END

:MENU
CLS
ECHO.
ECHO Choose from the following options:
ECHO.
ECHO  I = Show all wireless interfaces
ECHO  S = Show general wireless settings
ECHO  N = Show wireless networks on default interface
ECHO  D = Show drivers on default interface
ECHO.
choice /C ISND /M "Make your selection: "
ECHO %errorlevel%
if %errorlevel%==1 NETSH WLAN SHOW INTERFACES
if %errorlevel%==2 NETSH WLAN SHOW SETTINGS
if %errorlevel%==3 NETSH WLAN SHOW NETWORKS
if %errorlevel%==4 NETSH WLAN SHOW DRIVERS

GOTO END

:HELP
ECHO.
ECHO NETSH Speedy Interface Script
ECHO This command provides information about Wi-Fi
ECHO interfaces. The proper use is:
ECHO.
ECHO wifi interface_name
ECHO.
ECHO interface_name should be in quotation marks if
ECHO the name has one or more spaces. For example:
ECHO.
ECHO wifi "Wi-Fi 1"
ECHO.
ECHO When interface names are not known, use the
ECHO modifier interfaces without an interface name.
ECHO.
ECHO Other modifier commands may be used to show other
ECHO information. Such commands should precede the
ECHO interface_name parameter. Only one modifier'
ECHO command may be used at a time.
ECHO.
ECHO Possible modifier commands include:
ECHO.
ECHO networks - show networks
ECHO drivers - show drivers
ECHO settings - show general settings
ECHO menu - use an interactive menu
ECHO.
ECHO For example:
ECHO.
ECHO  wifi networks "Wi-Fi 1"
ECHO.
ECHO would show the wireless networks seen by that
ECHO interface.
ECHO.
ECHO Created by Tom Carpenter, 2016
ECHO.
:END

Old Skills – Still Valuable

I have been working with various Linux distributions much more these days than in the past. Spending all that time in the shell has flooded the mind with memories of days gone by. When we used to have to know our systems well to properly configure the simple task of booting (config.sys and autoexec.bat), we had to master many technical skills. I am amazed, nearly every day, at how often those old skill still prove valuable to me.

Remember screens like this?

Config.sys in Edit
The mem Command

If not, you didn’t work with DOS. If so, you did. If not, don’t distress, you can learn the skills you need to get by in the Windows Command Prompt, PowerShell or the shell in a Linux distribution.

In this post, I’m going to focus on three skills we had to master in the DOS days that are still valuable today. They were:

  1. Getting Help
  2. System Diagnostics with Commands
  3. Automating Work

Getting Help

At the DOS prompt (and still in the Command Prompt or PowerShell in Windows and the shell in Linux) help was always just a simple switch away. For nearly every command or program, you could simply add a /? to the command to find out exactly what the command could do. Those who learned (and still learn) commands this way are always more powerful users or administrators than those who simply learn specific command parameters for specific tasks from books, blogs and articles.

The reason for this reality is simple: when you use the help to see all the command can do, you often learn of uses that others have not demonstrated or used themselves.

Consider the mem command shown earlier from DOS. If you simply typed mem and pressed ENTER, you saw a screen like the following.

Simple mem Command Output
Simple mem Command Output

Now look at all you learned about the mem command if you used the /? parameter.

Getting Help for the mem Command
Getting Help for the mem Command

I can already hear someone saying, “Wait, Tom. The mem command is not in the Windows Command Prompt anymore. How does this help?” That’s a great question. The answer is that you can find other commands, related to memory, that you can use and use with power when you learn to get help. Consider the tasklist command in Windows.

The following screen shows the output of a basic tasklist command with no parameters:

Raw tasklist Command Output
Raw tasklist Command Output

It is showing every process, regardless of the memory consumed by it. Now, look at the help for the tasklist command using the /? parameter.

tasklist Help
tasklist Help

Notice that you can do several things to refine the list, particularly in relation to memory usage.

Armed with this information, I can now use the /FI filter parameter to see only tasks consuming more than 15,000 kilobytes of memory with the tasklist /FI “MEMUSAGE gt 15000” command.

Filtering for High Memory Usage Tasks with tasklist
Filtering for High Memory Usage Tasks with tasklist

As you can see, getting help is key to learning Command Prompt or shell commands. In Linux, you typically use the —help parameter for this. In PowerShell, use the Get-Help cmdlet to accomplish this.

System Diagnostics with Commands

The old DOS prompt gave us several tools for performing system diagnostics. In addition to the mem command, you had commands like checkdsk, ver (both still in the Command Prompt), and  undelete (sadly, no longer with us). The Command Prompt is actually far more powerful today in Windows than it ever was in DOS. Dozens of additional commands are available for diagnostics. In addition to tasklist, important commands include:

  • sc – service management
  • ipconfig – IP configuration viewing and management
  • netsh – a plethora of networking functions
  • systeminfo – viewing information about hardware and software
  • ftype – working with file associations

This is a very brief starter list. Type help at the Command Prompt (just like in DOS by the way) to see a list of common commands as shown in the following image. Remember to use the /? parameter with them to learn all the details of how they work.

Partial Output from the Command Prompt help Command
Partial Output from the Command Prompt help Command

Automating Work

Finally, you can automate the Command Prompt using batch files and PowerShell or the Linux shell using scripts (PowerShell scripts and bash scripts respectively). The batch files work almost entirely the same in the Windows Command Prompt today as they did in DOS 25+ years ago when I used them. Of course, some of the old commands are gone, but the logic and concepts are still the same.

The point of this post is simple. Never discount old knowledge. It continues to benefit you today. In fact, I can say plainly that I passed a certification exam a couple of years ago almost entirely because I knew DOS all those years ago. And, yes, I still have my old DOS books including great books on batch files. Here’s a picture of just one.

Inside MS-DOS 6.22
Inside MS-DOS 6.22

And, yes as well, the Disk is still included after all these years 🙂

Happy shelling!

The 802.11ac 1 Gbps Uplink Myth

The following info-graphic illustrates as succinctly as possible why it is a myth that 802.11ac APs require more than a 1 Gbps uplink to the switch. I will be presenting a CWNP webinar on this on January 19th, but was thinking through some things this weekend and decided to share a graphic with the world.

NOTE: You are free to use this info-graphic in any way you desire. In print, online, in free distribution or paid distribution. It is yours to use. Please just give credit to the source or leave the Copyright reference in the image if used.

This information reveals why it is a myth that 802.11ac APs require more than a 1 Gbps uplink to the switch.

Of Inches and Feet – Or the Origin of a Poor Measuring System

Have you ever wondered why we use inches and feet in the United States or where it came from when the metric system seems to make so much more sense. I mean, really, 12 inches in a foot, 3 feet in a yard. How is this easier than 100 centimeters in a meter? Additionally, the centimeter being smaller than the inch, the metric system, without even addressing millimeters, allows for greater precision. More precision, simpler extrapolation from one unit to the other, where in the world did inches and feet come from?

Well, the inch, according to some, was originally the width of a man’s thumb. Therefore, as he was working he could simply measure out three thumb widths, or four, or five, or whatever length he desired, and he would have consistency in his measurements – within some measure of variance. The important thing to remember is that HE would have consistency in HIS measurements. If another man measured out the same three thumb widths, the actual length, width or height would vary. But, since every item created in the days of yore was a one-off item, this was not a real problem for many craftsmen.

Eventually, around the 14th century, the inch was defined as three corns of barley placed end-to-end. Of course, whether you use the human body or a plant member to define measurement, you are going to end up with inconsistency.

The yard was originally the length of a man’s belt or his girth, according to some sources. Again, depending on your dietary practices, your measurement would be different from another man’s. And your measurement would differ throughout life – at least mine would.

Interestingly, over the years, consistency was developed not for a pure desire for standardization, but out of governmental desire for more taxes. According to The Weights and Measures of England, by R. D. Connor, standardizing on yards and inches (instead of yards and handfuls) was implemented to prevent cloth merchants from avoiding taxes. We can always count on the greed of rulers to provide a standard if nothing else will do.

Thankfully, the modern world is moving more and more to the metric system (in fact, most of the world outside the U.S. these days) and we can get away from what is now a consistent but confusing system and use a consistent and simple system. No longer will I have to teach my small children or grandchildren creative techniques for remembering 12 inches make a foot and 3 feet make a yard.

Now we just have to get rid of miles so we don’t have to talk about 5280 feet in a mile anymore. 1000 meters in a kilometer is so much easier, don’t you think?

What If? Have you ever wondered what the world would be like if we always listened to the experts?

You walk down the front walk of your summer home and approach the moving truck parked in the driveway. It is a normal thing in today’s advanced society to work for the same company, but roam from place to place. You think to yourself, “How did they ever live without these portable computers all those years ago?” The ability to take a computer on the road with you wasn’t even a dream in the beginning, but now it’s a reality.

You open the rear door of the moving truck and step up through the narrow opening. The area is very crowded, but there is just enough room for your office chair and a few spare square feet of desk space. “Ahhh… advancements in technology,” you say to the bare walls of the truck. “Now then, let’s kick start this baby.”

After a long day of work in these tight quarters, you step out of the twenty-six foot moving truck and walk back into the house.

You are probably thinking, “C’mon, Tom. What are you talking about? There are no portable computers that require a moving truck to haul them.” Right you are, but this is – WHAT IF?

Here is what was reported in 1949:

Where a calculator on the ENIAC is equipped with 18,000 vacuum tubes and weighs 30 tons, computers in the future may have only 1,000 vacuum tubes and perhaps only weigh 1 1/2 tons.
-Popular Mechanics, March 1949

Didn’t know someone said that? Just hold on because there is much more to follow.

The truth of it all is that we’ve all been deceived. They have tried to convince us that these computers are worth something. The things we’re doing with them aren’t really productive, they are worthless. You don’t agree? Why not? A couple of really important people did:

Worthless.
-Sir George Bidell Airy (Astronomer Royal of Great Britain), in reference to the potential value of Charles Babbage’s analytical engine. Charles is considered to the the inventor of the computer today.

“What the ____ is it good for?”
-Robert Lloyd (an engineer at IBM) in response to colleagues who insisted that the microprocessor was the future of the computer industry in 1968.

Do you agree? Neither do I, but what if we had listened to them?

How many new computers are shipped every year? Not too many, as a matter of fact it has averaged .09 computers every year for the last forty-five years. Wow! How did we ever do it? Since 1943 we have developed and marketed five whole computers.

I realize that this sounds a little far-fetched, but I can prove it:

“I think there is a world market for about five computers.”
-Thomas Watson, Chairman of the Board of IBM, 1943

In reality, however, we have produced and marketed, not only millions of systems, but literally hundreds of different kinds of computer systems as well. He said five computers, but look at this list of computer types over the last thirty to forty years:

  • ATARI 800
  • IBM
  • Apple II
  • Apple IIe
  • Apple IIgs
  • Apple Macintosh
  • Commodore VIC-20 (I loved this one.)
  • Commodore 64 (Another personal favorite.)
  • Commodore 128
  • Commodore Amiga
  • TRS-80
  • Tandy 1000
  • Adam

I could go on, but I believe that my point is made – but what if?

We don’t need you. You haven’t got through college yet.
-HP Executive, 1976

Get your feet off my desk, get out of here, you stink, and we’re not going to buy your product.
-Joe Keenan, President of Atari, 1976

There is no reason for any individual to have a computer in their home.
-Ken Olson, President of DEC, 1977

It is a really good thing that we didn’t listen to these wise people. If we had, we would have undoubtedly been greatly delayed in the development of the personal computer system. The first one, the HP executive, was responding to Steve Jobs when he offered HP his Apple II computer design. The second quote was Atari’s response to Steve, and the third quote is just a bit of wisdom from the era.

Steve ignored these people, and financed the development of the Apple II himself. This act launched the personal computer revolution as we know it today – for the most part anyway. But – what if?

Well, we could go on talking about people like Bill Gates and others. But I’ll be nice and simply end by saying I am really glad I have over 8 GB of RAM in all of my computers. Aren’t you, Bill? Or maybe he still has 640k.

Aren’t you glad that you have never said anything that turned out to be wrong in your life? I know I am!

Oh yeah… now for my prediction of the future. I predict that we will all evolve into computers and then the computers will rule the world. It will be like a matrix kind of thing. I wonder if anyone else has ever thought of anything like that?

The reality is that experts can often get caught up in their knowledge of the present and lose sight of the possible.

The point of it all is this: as we enter the new year of 2017, dream. Dream and don’t let those around you say your dreams are impossible. Just dream, plan and act and see what your future may hold.

Happy holidays!

Security Myths?

I find it very interesting when an article debunks itself while talking about debunking myths. If you have not read the recent Network World article titled “13 Security Myths You’ll Hear – But Should You Believe?” you can read it here:

http://www.networkworld.com/news/2012/021412-security-myths-256109.html?page=1

While most of the “myths” are very obvious to anyone who has worked in computer support for very long, one of them I found quite interesting. The third “myth” referenced in the article is, “Regular expiration (typically every 90 days) strengthens password systems.” First, while I completely disagree that this is a myth taken within the context of a complete security system including proper user training, it appears that the article itself debunks the debunking of this “myth”. Note the following from myth number 6, “He adds that while 30-day expiration might be good advice for some high-risk environments, it often is not the best policy because such a short period of time tends to induce users to develop predictable patterns or otherwise decrease the effectiveness of their passwords. A length of between 90 to 120 days is more realistic, he says.”

Now here’s the reality of it from my perspective. If you never change passwords, an internal employee can brute passwords for months and even years until he gains access to sensitive accounts. If you change passwords every 90+ days while having strong passwords that are easy to remember, you accomplish the best security. Strong passwords that are easy to remember can take weeks or months to back with brute force. For example, the password S0L34r43ms3r is VERY easy to remember, well it’s easy for me to remember, but you have no idea why. Brute forcing this password would take months with most systems. Therefore, I have a strong password. If I change it every 90-120 days, I will have a good balance of security and usability.

Does every employee need to change his or her password every 90-120 days? No, certainly not. Some employees have access to absolutely no sensitive information. We can allow them to change their passwords either every 6-12 months or never, depending on our security policies. The point is that different levels of access demand different levels of security.

While I felt the article was very good and it did reference some research to defend the “myth” suggested in relation ot password resets, the reality is that the article and the research (which I’ve read) does not properly consider a full security system based on effective policies and training. Granted, few organizations implement such a system, but, hey, we’re only talking theory in this context anyway, right? It sure would be nice if security could move from theory to practical implementation in every organization, but it hasn’t. The reason? By and large, because most organizations (most are small companies) never experience a security incident beyond viruses, worms and DoS attacks. That’s just life.

Thoughts on IT for those who think about IT