Blog Feed

How To Renew a Microsoft Terminal Server SSL Certificate.

Recently, I had to renew one of the remote desktop server farm SSL certificate. There are many instructions and videos for renewal of self-sign SSL for RDS gateway but there are only few places I was able to find anything for trusted SSL renewal.

In this blog I’ve used images from windowsserveressentials.com ( https://windowsserveressentials.com/2012/06/20/renew-your-ssl-certificate-sbs-2011-essentials/), because I really didn’t have chance to take snapshot of every step I did and cannot risk leaking any info on servers I worked on( if I forget to black out some parts 🙂 ). But basically cert renewal is the same and no difference initially with few important changes. Server I worked was 2016 Server.

****First, open IIS Manger and click on Server name.

Renew your SSL Certificate : SBS 2011 Essentials | Title (Required)
https://windowsserveressentials.com/2012/06/20/renew-your-ssl-certificate-sbs-2011-essentials/

****Then click on server certificate about to expire and right hand top corner click on create certificate request and this will bring up certificate request wizard. In this fields make sure to fill the name as exactly as current rds gateway name and choose bit length as 2048.

4
https://windowsserveressentials.com/2012/06/20/renew-your-ssl-certificate-sbs-2011-essentials/

https://windowsserveressentials.com/2012/06/20/renew-your-ssl-certificate-sbs-2011-essentials/

****Then save the cert request where ever you want. But I usually save to the root C:\Cert\2020. So I can keep track on old certs too. Just in case if I need old one I’ve it close by. This a text file with all the crypto info.

6
https://windowsserveressentials.com/2012/06/20/renew-your-ssl-certificate-sbs-2011-essentials/

Then head to your favourite SSL provider and complete the cert renewal. My cert provider was Go daddy and usually godaddy auto renew SSL but cannot use this SSL due to the fact that it is missing private key info from the server. So basically click on cert and copy and past entire certreq.txt file info and request the SSL from Go daddy.

****Then Go daddy will do it things and send out email to whoever mange domain to confirm cert renew. In this case I had access to the email account who mange the domain. Once you go daddy issue cert go ahead and choose IIS as a cert and download to the server cer location. I choose C:\certs\2020.

****Then we gonna go to next step and open IIS Manger again and same place click on complete cert renewal. Then select the CA issues cer and name the cert complete the request which will install new SSL on IIS.

2b
https://windowsserveressentials.com/2012/06/20/renew-your-ssl-certificate-sbs-2011-essentials/

****After cert install SSL need to bind into port 443 in order to be active.

****So we are done with SSL for IIS, then need to assign cert for RD Gateway. Open TS Gateway Manager and right-click the local TS Gateway server, and then click Properties.

****On the SSL Certificate tab, click Select an import and it will show certificate just install in IIS and you can simply install it. After that Click OK to close the Properties dialog box for the TS Gateway server.

How to renew RDP service self signed certificate in Windows 2012 ...
https://www.youtube.com/watch?v=yRjoGb6DmcA

*****After this step you are done and RDS gateway will show with proper cert.

How to Disable Server Manger at Startup

I’m sure anyone of you log onto server notice that server manger start automatically. This is particularly issue for remote desktop environment when regular user log in, they will be presented with server manger. I’ve no idea why Microsoft allow this in RDS environment in first place. Anyways, here how you can disable it for all users.

There is two way you can do this first via GP, which is my preferred method.

First bring up group policy editor and create a GP and navigate to Computer configuration, Administrative Templates, System, Server Manger and then open ” Do Not Display Server Manger Automatically at logon” and click enable.

Otherwise, ( But this will need to be run on each servers) run power shell in admin mode,

Get-ScheduledTask -TaskName Server Manger | Disable-ScheduledTask -verbose

Done!!

Run Command Without Entering Sudo Password in remote kali system.

This is very useful if you have system that you need to run commend without keep typing su in the beginning of the command line and then enter the sudo password.

Bring up terminal and ssh into the system ssh your host ip -l username and then enter the psw

You will be in the ssh line on the remote system.

Type sudo visudo and then the psw

add this line to the end of the file and save and done.

username ALL=(ALL) NOPSSWD:ALL

How to RDP into Kali Linux

I love to experiment with various software and one of those essential system that I play around is kali. I’ve setup mine in ESXI server that I cannot directly connect. This is one of the way you can RDP into your kali and experience full GUI access.

Here is the codes that you need to run in sudo mode.

Apt-get update && apt-get upgrade
Apt-get dist-upgrade
Apt-get install xrdp
Service xrdp-sesman start
update-rc.d xrdp enable
Apt-get remove gnome-core
apt-get install lxde-core lxde kali-defaults kali-root-login desktop-base
update-alternatives –config x-session-manager

Now you can access your kali instance from your Windows PC.

Set IP Address / DNS / Route in CMD

I know once in a while we all have to use our CMD skill to set some stuff up in machines. So here is some command to get windows machine online via CMD.

****First you need to locate the name of the network interface

netsh interface ipv4 show interfaces

***Assume that you want to setup a static IP such as below

  • IP:172.28.5.10
  • sub:255.255.255.0
  • GW: 172.28.5.1

netsh interface ip set address name=”Local Area Connection” static 172.28.5.10 255.255.255.0 172.28.5.1 1

Note that ” local area connection” is the one I found when I ran very first command and “1” in the end is the metric for route.

If you want to forget about the static rout and want to get DHCP,

netsh interface ip set address name=”Local Area Connection” dhcp

****Now if you want to set a static DNS,

netsh interface ip set dns name=”Local Area Connection” static 8.8.8.8

Second DNS

netsh interface ip add dns name=”Local Area Connection” 8.8.4.4 index=2

Again if you want to get DNS via DHCP

netsh interface ip set dnsservers name=”Local Area Connection” source=dhcp

DONE,your PC will be one line!!. Yes of course you need to plug the network cable 🙂

Reset TCP/IP Stack

Computer communication via internet only can work if TCP/IP working properly. I’m sure you have seen after many ipconfig/renew/release and flushdns and REBOOT still PC cannot get IP. In my experience this is related to corruption in TCP/IP and of course you need to check the cable or WIFI is connected before all of this 🙂

Anyway here is how to reset those corrupted TCP/IP stack and make sure to reboot the PC after reset and RUN the command prompt in ADMIN mode.Also if you have static IP, remember to note them down, because this will wipe those out!

Before all of this in my experience resetting socket also can fix many ip stack related issues and here is the command.

netsh winsock reset

Reset the ipv4

netsh int ip reset

if you want to reset ipv6

netsh int ipv6 reset

If you want to re-install the stcack,

  • SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
  • SYSTEM\CurrentControlSet\Services\DHCP\Parameters

END of the RESET.

Install ZENMAP in Debain( Kali Linux) base system.

If you are familiar with PENTEST and Kali linux platform, you should know nmap which is great vulnerability scanning tool. But recent version of kali has dropped ZENMAP which is GUI base for nmap which great tool to run nmap in GUI and also to generate command line to run on nmap.

Few of my blog readers mentioned to me that after Kali 2020.4 my previous method of installing Zenmap no longer works. So after breaking few VM images and few swear moment I was able to figure out a way to install Zenmap GUI in new Kali. 🙂

Go to https://nmap.org/download.html and scroll down to Source Code Distribution and download tar package https://nmap.org/dist/nmap-7.91.tar.bz2 and save to wherever you are happy :). Usually it is Download folder.

Here is link to all the packages need to install this https://github.com/ayeshsherman/ZENMAP.git

Then bring up terminal from the place downloaded the tar package and run sudo su and get the root access. After that run below command in sequence. Very good guide here https://nmap.org/book/inst-source.html

apt-get update
bzip2 -cd nmap-7.91.tar.bz2 | tar xvf -
cd nmap-7.91
./configure
make
su root
make install

After that you need to download python packages.

wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pygtk/python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
wget http://azure.archive.ubuntu.com/ubuntu/pool/universe/p/pygobject-2/python-gobject-2_2.28.6-14ubuntu1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/p/pycairo/python-cairo_1.16.2-2ubuntu2_amd64.deb

then install each package with dpkg -i <each package name from above>

As a example dpkg -i ./python-cairo_1.16.2-2ubuntu2_amd64.deb

Once you down you will be able to see zenmap from search window in kali. But if you want to run Zenmap as root you need to brows into place where tar package got unzip. In my case download folder nmap 7.91 and bring terminal and run sudo su and then ./zenmap.

You can get more info here https://nmap.org

Here is the way to install Zenmap on previous ver of Kali.

Go to https://nmap.org/download.html and download Optional Zenmap GUI (all platforms): zenmap-7.80-1.noarch.rpm usually it will go to download on your kali

Then run these commands:

sudo su it will ask to enter password for root

apt-get update
apt-get install alien

cd to the download folder where you download zenmap
sudo alien “zenmap-7.80-1.noarch.rpm”
sudo dpkg -i “zenmap-7.80-1.noarch.deb”

Then you will be able to launch zenmap.

All credit goes to https://forums.kali.org/showthread.php?45988-Zenmap-missing-Kali-Linux-2019-4

https://stackoverflow.com/questions/64359059/whet-i-try-to-run-zenmap-the-terminal-show-me-this

Installation Failed in Safe_OS Phase with Windows 10 Upgrade

So if you are one of the user has mcafee antivirus, specially the drive encryption enabled, you will run into issue upgrading Win 10 patches or upgrade. Usually the error pretty similar to below,

Image result for windows 10 date  safe_os error

So solution would be upgrading OS via mcafee switch enabled via CMD. Here is what I did,

*****Copy Windows update to C: folder called updates( This was 1903 update and I downloaded it as ISO from Microsoft site and then mount and copied to the folder)

******Then bring up CMD as administrator and type cd c:\update, which change the directory.

******Then run this

Setup.exe /ReflectDrivers “%programfiles%\McAfee\Endpoint Encryption\OSUpgrade

OR

Setup.exe /ReflectDrivers “C:\Program Files\McAfee\Endpoint Encryption\OSUpgrade”

Upgrade should run without and error.

Here is the full KB article link,

Change iTunes Backup Location

These days more and more PC/laptops comes with SSD drive and most of them are either 128 or 256 and some are even smaller drives. If you are one of the user don’t want top pay for more storage with iphone and backing up your phone to PC, you will face some challenge with drive space. Specially with ever expanding iphone storage size.

Issue is itunes saves this backups under userprofile, usually in C drive. Solution would be change this location and point to a external drive or different drive. All the credit should goes to https://support.imazing.com/hc/en-us

I’m gonna list the Windows way first.

Usual backup location for iphone located under C:\Users\*current user name*\AppData\Roaming\Apple Computer\MobileSync\Backup

Navigate to folder and rename or delete folder called “backup”

Then Shift+Right click and select open powershell windows OR you can bring command prompt (go to run type CMD) and the type

cd C:\Users\*current user name*\AppData\Roaming\Apple Computer\MobileSync

then type

mklink /J “%APPDATA%\Apple Computer\MobileSync\Backup” “D:\iTunes Backup”

****Note that above I send my backups to D:\ drive.

and you done!!

So now in Mac OSx

Bacup folder located under ~/Library/Application Support

Go to search and type ~/Library/Application Support/MobileSync/ and this will point to backup location and as previous Windows remove the folder called backup.

Then bring up terminal and type

ln -s /Volumes/location where the backup should go/MobileSync/Backup ~/Library/Application\ Support/MobileSync/Backup

Done!!

Disable Windows UAC Completely

I know once in a while windows UAC tend to interfere with application. I seen many issues with some ERP programs. You can simply disable UAC via control panel in Windows 7 but Windows 10 will not completely disable UAC via control panel. Because if it completely disable metro app will not work on Win10.

This is reg edit to disable UAC completely, if you ever have to fight with it to get application working.

Click run and type regedit.exe and go to the path

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

In the right side select EnableLUA and set the value to 0 and restart the PC.

Done!