The following port scanner C code checks approximately 65535 ports in about 15 seconds on-network. #include <stdio.h> #include <stdlib.h> #include <netinet/in.h> #include <string.h> #include <sys/socket.h> #include <arpa/inet.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <netdb.h> #include <sys/types.h> #include <sys/time.h> #include <sys/ioctl.h> #include <sys/wait.h> #define MAX_PORTS 65535 #define MAX_SOCKETS 1023 // gcc -o portscanner portscanner.c int…

Read More A Port Scanner in C

// gcc bofh.c -o bofh #include <stdio.h> #include <stdlib.h> #include <time.h> #define NUM_QUOTES 10 const char* bofh_quotes[NUM_QUOTES] = { “No, my powers can only be used for good.”, “It must be a hardware problem.”, “I’m sorry, we don’t support that feature.”, “That’s a PEBCAK error (Problem Exists Between Chair And Keyboard).”, “Have you tried turning…

Read More A BOFH Generator in C

Grant-SmbShareAccess -Name ShareName -AccountName Administrators -AccessRight Full -ForceGrant-SmbShareAccess -Name “Brother DW2710 series” -AccountName Everyone -AccessRight Change -Force It appears that there is no pre-existing command line tool for managing permissions on existing shares beyond the initial setup. However, you can accomplish multiple grants if temporarily taking the shares offline is not a concern. In such…

Read More Change Windows network share permissions from command line

This seems to do the trick for listing processes by memory usage. I’m most interested in the top 9 processes (I have to figure out why the regexp isn’t working in findstr for anything over 10 in a range like [1-15]. tasklist /NH | sort /R /+65 | findstr /N . | findstr “^[1-9]:” Here’s…

Read More List top processes using memory from Windows commandline

After implementing a Group Policy to prohibit saving of passwords in Google Chrome and Microsoft Edge, the previously saved passwords are still on the system. To remove these from multiple systems, a simple script can be deployed via GPO at User Logon to do the work. Otherwise, on a case-by-case basis, the passwords can be…

Read More Delete saved passwords for Chrome and Edge from the command line

If you get the following error on a Windows Server (possibly desktop client), you can use the local group policy editor to resolve this. It commonly impacts Server 2019 systems promoted to a domain controller wherein the UAC admin approval mode is reset and does not contain a value (Enabled or Disabled). Windows cannot access…

Read More mmc – Windows cannot access the specified device, path, or file.

Looking to capture some performance metrics for website from the Linux command line and eventually get it into Cacti (RRD). Here are my scattered notes on this process. I’m not very familiar with NodeJS stuff, so I’m documenting from installation of NodeJS on Debian 11 to creating the project. Install NodeJS, Puppeteer and Chromium headless…

Read More Website Performance Analysis and Graphing – Debian NodeJS + Puppeteer + Cacti

Working with an older Cisco ASA, I was not able to directly SSH to the host using SSH on Windows unless I specified the diffie-hellman-group1-sha1 algorithm. PuTTY gives the following warning: For Windows, I can use the following command to SSH (as well as SCP). ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 user@host

Read More Unable to negotiate with port 22: no matching key exchange method found.

This is the procedure that has worked for me. There are various methods dating as far back as 2011 across the internet, but this step-by-step works in my environment for Windows and Linux virtual machines. Step 1 – Prepare the Guest Operating Systems Windows Linux Step 2 – Punch some Holes

Read More Reclaiming space from thin provisioned disks in VMware ESXi