Mimikatz can be a tool not only for hackers. During migrations to Cloud from IaaS many times I need to export the certificate to reuse on the cloud – most of them -p private kay is protected against the export. But it is easy to do with Mimikatz. Moreover, it is easier than using certificates MMC. Here is a step by step process: Disable Antivirus including Windows Defender using gpedit.msc. Execute gpupdate /force. Download Mimikatz https://blog.gentilkiwi.com/mimikatz – binaries. Execute: crypto::capi privilege::debug crypto::cng crypto::certificates /systemstore:local_machine /store:my /export If you cannot find your certificate here: Get-ChildItem Cert:LocalMachineMy Just instead of looking where it is go to IIS Management or simply open webpage, export certificate without the private key, import it to the LocalMachine using mmc.exe/certificate. At this point, the certificate has not private key associated, but you can download DigiCert utility run this utility as an administrator, choose the certificate to right-click, and repair the certificate. In that way, private kay that exists on the machine will be found and you can export the certificate with a private key once again using: crypto::certificates /systemstore:local_machine /store:my /export The certificate will have the password: mimikatz.
Conference – Community – Networking – Ignite – Great Materials
Właśnie mija 2 lata od ostatniej największej i najbardziej wartościowej konferencji IT, która odbyła się fizycznie – a nie wirtualnie. Myślę tutaj o Microsoft Ignite. Chyba każdy z nas tęskni za takimi konferencjami, wymianą doświadczeń z innymi uczestnikami wspaniałym kontaktem z prelegentami. Konferencja nie była darmowa, była płatna i to nie mało – ale to gwarantowało, że materiały były naprawdę wartościowe. Całe szczęście do dzisiaj z nich możemy korzystać. Poniżej link, gdzie znajduje się ich cały zestaw: Liste et liens de téléchargement des sessions Ignite 2019 Gdyby zniknęły poniżej skopiowane zestawienie i jak patrzę na SAS to oglądać możemy do listopada 2024 roku. Two years have passed since the last largest and most valuable IT conference, which was held physically – not virtually. I am thinking of Microsoft Ignite here. Probably each of us misses such conferences, exchange of experiences with other participants, great contact with the speakers. The conference was not free, it was paid and it was not enough – but it guaranteed that the materials were really valuable. Fortunately, we can still use them today. Below is the link where you can find their entire set: Liste et liens de téléchargement des sessions Ignite 2019 If the … Conference – Community – Networking – Ignite – Great MaterialsRead more
Azure Security Center Recommendations for Linux
Nowadays Hardening Operating system is a must! There are a lot of tools that can help to do this. One of my favorites is CIS Hardened Images that do more than others. Other solutions and companies can help on this also like Qualys and finally Azure Security Center. But the recommendation is one part, but the next part is implementation. So I launched Azure Security Center Recommendations for Linux Github repo that is based on the recommendation from Azure Security Center and I hope some of you can contribute to them. From another way you can visit some Security Technical Implementation Guides (STIG) scripts – especially I recommended these forked ones, but you can always jump to the source: https://github.com/MariuszFerdyn/Ubuntu_18.04_STIG https://github.com/MariuszFerdyn/Standalone-Windows-STIG-Script https://github.com/MariuszFerdyn/STIG-SCRIPTS So once again – please visit: https://github.com/MariuszFerdyn/AzureSecurityCenterOSRemediations/tree/main/Linux and contribute, now I cover only Redhat/Fedora and these, but updates will be only in Github: NAME Zeroconf networking should be disabled. CCEID CCE-14054-1 RULE SEVERITY Critical FULL DESCRIPTION Zeroconf networking should be disabled. (disabled) POTENTIAL IMPACT An attacker could use abuse this to gain information on network systems, or spoof DNS requests due to flaws in its trust model ACTUAL VALUE File /etc/sysconfig/network should contain one or more lines … Azure Security Center Recommendations for LinuxRead more
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 – The semaphore timeout period has expired.)
SQL – last time this error occurred in my Azure Environment when I am using SoftEther VPN installed on the SQL server. When I moved it to the Linux Server it disappears. So this is confirmation that it is strictly connected with network connectivity, but I was not indicated what exactly the problem was. So fast and working solution. Linux install step by step: sudo su –wget https://www.softether-download.com/files/softether/v4.38-9760-rtm-2021.08.17-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gztar xvfz softether-vpnserver-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gzcd vpnserver/apt-get update && apt-get upgradeapt-get install build-essential -ymakecd ..mv vpnserver /usr/localcd /usr/local/vpnserver/chmod 600 *chmod 700 vpnserverchmod 700 vpncmdvi /etc/init.d/vpnserver #!/bin/sh# chkconfig: 2345 99 01# description: SoftEther VPN Server### BEGIN INIT INFO# Provides: vpnserver# Required-Start: $remote_fs $syslog# Required-Stop: $remote_fs $syslog# Default-Start: 2 3 4 5# Default-Stop:# Short-Description: SoftEther VPN Server### END INIT INFO DAEMON=/usr/local/vpnserver/vpnserverLOCK=/var/lock/subsys/vpnservertest -x $DAEMON || exit 0case “$1” instart)$DAEMON starttouch $LOCK;;stop)$DAEMON stoprm $LOCK;;restart)$DAEMON stopsleep 3$DAEMON start;;*)echo “Usage: $0 {start|stop|restart}”exit 1esacexit 0 exit vi: ESC/w/q mkdir /var/lock/subsyschmod 755 /etc/init.d/vpnserver && /etc/init.d/vpnserver startupdate-rc.d vpnserver defaultscd /usr/local/vpnserver./vpncmd1enterenterServerPasswordSetexit reboot sudo su –/etc/init.d/vpnserver stop/etc/init.d/vpnserver startsystemctl enable vpnserversystemctl status vpnserver PORTS: 443,500,4500,1701 SSTP: 1. Using https://www.digicert.com/support/tools/certificate-utility-for-windows export certificate in Apache compatible format2. Copy files to Linux (you can do it via text editor)3. Connect via SoftEther VPN Server Manager to … A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 – The semaphore timeout period has expired.)Read more
AWS EC2 Metadata is not shown on your Windows Machine?
If you are running your EC2 machine in AWS a lot of Cloud functionality is dependent on the AWS EC2 stack named metadata. You can open the browser and check to open the page http://169.254.169.254/latest/dynamic/instance-identity/. If you see your data it means that the machine is properly configured as an EC2 instance, if not it can work but for example, Cloud Watch will not be working. You can try this using this Power Shell script: C:ProgramDataAmazonEC2-WindowsLaunchScriptsInitializeInstance.ps1.
How to optimize your VPN connection to Azure, GCP and AWS.
Nowadays day by day more people have inbound/outbound connections of about 1 GB and can reach this speed during connection to Cloud – 2,5 Gigabits per second. But if you build your VPN to Cloud you can reach this speed: So it is ten times slow… Just why, as far I remember from school IPSEC was designed to use special cards and protocol changes bit 1 to 0 many times for low-level electronics processors it is not a problem, but for programmatic it is. How to reach better results, can we reach better results – it depends, but starting reading a quite old article you can figure out that at least 50% reduction is a must. See here more. So 50% less is ok, but not 90% – so how to do it in Windows – just change parameters like this: Set-VpnConnectionIPsecConfiguration -ConnectionName “VPN” -AuthenticationTransformConstants GCMAES128 -CipherTransformConstants GCMAES128 -EncryptionMethod AES128 -IntegrityCheckMethod SHA1 -PfsGroup None -DHGroup Group2 -PassThru -Force So it is for Appliance VPN and Point-To-Site VPN- but the same is for Site-To-Site VPN. Simply you must use GCMAES128. After that you can reach this result: Why wrong results, just testing machine used nested virtualization and was overloaded, so in … How to optimize your VPN connection to Azure, GCP and AWS.Read more
Easy tool for checking bandwidth not only to Cloud like Azure, AWS, and or GCP.
Sometimes we need to check how fast our network connection is – with VPN without VPN. The most advanced tool is iperf – You can refer to it here (I used this tool to crash hyper-v cluster but usage is the same). Here is the official document from Microsoft on how to do it. But sometimes we need simple graphic Windows tools. The one is coming with a very good 10 minutes config free VPN appliance like Softether. There is also a supported version from Marketplace. But you can use traffic_test without installing Client or Server just download zip, unzip and press start.bat. You must Run Server on one and the client on the other end. The default connection metering protocol is TCP 9821 port. You can also test against the server provided by Softether. Download – here. BTW see this scripts to create VPN in any cloud.
Windows Virtual Desktop – The Group Policy Client Service failed the sign-in. Access is denied.
If you see this error when user log-in to Windows Virtual Desktop: The Group Policy Client Service failed the sign-in. Access is denied. Probably cached profile is broken on session host. Go to the session host go to the c:Users – and rename username and local_username directory. After that user should be able to log in. After that you can restore data from profile.
Implement AWS CloudWatch to the AWS WorkSpaces using System Manager
Install System Manager on WorkSpaces – you must follow installing AWS System Manager on-premise. Create Hybrid Activations for your AWS WorkSpaces Copy code and id to the script that installs it to all AWS instances using PS remoting from your Active Directory Administration Account. Invoke the following code to install a System manager Agent on Workspaces: Set-ExecutionPolicy Unrestricted Invoke-Command -ComputerName WSAMZN-AJHQL2HU,WSAMZN-4C2SBR05 -FilePath .InstallSME.ps1 InstallSME.ps1: $code = “xxx” $id = “yyy” $region = “us-east-1” $dir = $env:TEMP + “ssm” New-Item -ItemType directory -Path $dir -Force cd $dir (New-Object System.Net.WebClient).DownloadFile(“https://amazon-ssm-$region.s3.amazonaws.com/latest/windows_amd64/AmazonSSMAgentSetup.exe”, $dir + “AmazonSSMAgentSetup.exe”) Start-Process .AmazonSSMAgentSetup.exe -ArgumentList @(“/q”, “/log”, “install.log”, “CODE=$code”, “ID=$id”, “REGION=$region”) -Wait Get-Content ($env:ProgramData + “AmazonSSMInstanceDataregistration”) Get-Service -Name “AmazonSSMAgent” Install Cloud Watch Agent on Work Spaces – that now you are see them as Managed Instances. Install Cloud Watch binaries using Run Command From System Manager, search for AWS-ConfigureAWSPackage package. Put AmazonCloudWatchAgent in Name and confirm that Action is Install and specify targets. You can use: aws workspaces describe-workspaces –output json > workspaceinstances.txt notepad .workspaceinstances.txt aws ssm describe-instance-information –output json > managedinstances.txt notepad .managedinstances.txt to fetch instance details and match instanceid against computername. Disable the S3 bucket and RUN. Run script that pass config files to the insances: Run command and … Implement AWS CloudWatch to the AWS WorkSpaces using System ManagerRead more
5 błędów, które mogą doprowadzić do kompromitacji środowiska chmury Azure
Zapraszam do udziału w The Hack Summit 2020, gdzie będę miał przyjemność prezentować następującą sesje: 5 błędów, które mogą doprowadzić do kompromitacji środowiska chmury Azure i Nie Tylko. Przy okazji, jeżeli chcą Państwo otrzymać, oczywiście bezpłatnie dokument jak bezpiecznie skonfigurować usługę WebApp / App Service w Microsoft Azure wraz z filmem dot. konfiguracji Managed Identity – proszę wypełnić poniższe zgłoszenie.
Adaptive application controls – feature you must use to be secure
This feature like the old Windows AppLocker or Software restriction Policy. Simply you can block to run off any unknown software on your VM. First, it runs on Audit mode and then Enforces mode. By the way – some time ago I was in a team that delivered computers to schools – 40k+ and there was no antimalware/antivirus software and after three years if the teacher did not disable Software Restriction on these computers they working like a brand new without any unwanted software. Compare it to your laptop with a bunk of software that nobody knows what is for. Great Video: https://www.youtube.com/watch?v=wWWekI1Y9ck It runs under the licensed feature of the Security Center / Azure Defender. Recommended tab included automatically created groups of VM have similar applications detected by Machine Learning. You can use them just by clicking Audit mode and after auditing switch to Enforced mode. Machine Learning is great, but the human brain is better, so from here you can create your group with servers that play the same or similar role in your organization and runs the same or similar applications, especially for cross regions VMs. After that you should be patient and get data for at … Adaptive application controls – feature you must use to be secureRead more
Intune – Disable PIN for Windows 10
Normal behavior is when you add a computer to Azure Active Directory & Intune PIN is required. You can disable it on the Tenant level here:
Update ADFS 3.0 Communication Certificate
The best way is to use this scrip: https://gallery.technet.microsoft.com/scriptcenter/Update-the-Service-9e080ef8 If fail – Run the script as a local admin account – not a domain. You can finish manually it by local admin account: Set-AdfsSslCertificate -Thumbprint 2b02128a3fc867c65200e27bb1c25023d339f372 And as a domain account: Set-AdfsCertificate -CertificateType Service-Communications –Thumbprint 2b02128a3fc867c65200e27bb1c25023d339f372
Intune – Remove User – Remove-LocalUser : The term ‘Remove-LocalUser’ is not recognized as the name of a cmdlet, function, script file
I tried to use PowerShell script via Intune that remove my user from Windows Endpoint using powershell command Remove-LocalUser -Name “myuser”. It was not working, just because: , error = Remove-LocalUser : The term ‘Remove-LocalUser’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:Program Files (x86)Microsoft Intune Management ExtensionPoliciesScripts5b2518c-c36d-4a05-84f7-6fac956d4cc6_c293361b-b3d3-48d9-8aca-f8ccf0a11330.ps1:1 char:1 + Remove-LocalUser -Name “myuser” + ~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Remove-LocalUser:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException So the workaround is using this: “net user myuser /DELETE”|cmd All script: $op = Get-LocalUSer | where-Object Name -eq “myuser” | Measure if ($op.Count -eq 0) { Write-Host “No User to Remove” } else { “net user myuser /DELETE”|cmd Write-Host “User myuser has been Removed” }
Recovery Services vault – How to Disable Backup, Move to a new Recovery Services vault
1. Stop Backup – without Erasing Data2. Disable Soft Deletion in Recovery Service VaultId 3. Execute Script: $RG=backup-mig$Vault=backup-mig$VMName=medicareiisql$vault = Get-AzRecoveryServicesVault -ResourceGroupName $RG -Name $Vault$Container = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVM -Status Registered -VaultId $vault.ID -FriendlyName $VMName$BackupItem = Get-AzRecoveryServicesBackupItem -Container $Container -WorkloadType AzureVM -VaultId $vault.IDDisable-AzRecoveryServicesBackupProtection -Item $BackupItem -VaultId $vault.ID -RemoveRecoveryPoints -Force
MS SQL also Express on Azure VM – TempDB on ephemeral local disk
Fast SQL on Azure – nutshell: TempDB on fast local disk At least 3 disks for data and logs Read-only caching for data disks One of the most important things for SQL Server is to store TempDB on a fast ephemeral local – temporary disk. How to do it: Install SQL and configure it to use D:TempDB for TempDB. Create two files on c: dirive: StartSQL.bat: PowerShell -Command “Set-ExecutionPolicy Unrestricted” >> “%TEMP%StartupLog.txt” 2>&1 PowerShell C:StartSQL.ps1 >> “%TEMP%StartupLog.txt” 2>&1 StartSQL.ps1: PowerShell -Command “Set-ExecutionPolicy Unrestricted” >> “%TEMP%StartupLog.txt” 2>&1 PowerShell C:StartSQL.ps1 >> “%TEMP%StartupLog.txt” 2>&1 StartSQL.ps1: $SQLService=”SQL Server (MSSQLSERVER)” $SQLAgentService=”SQL Server Agent (MSSQLSERVER)” $tempfolder=”D:SQLTEMP” if (!(test-path -path $tempfolder)) { New-Item -ItemType directory -Path $tempfolder } Start-Service $SQLService #Start-Service $SQLAgentService #remove # for non Express version Set Startup Type – Manual for the following Services: SQL Server (MSSQLSERVER) SQL Server Agent (MSSQLSERVER) Configure Task Scheduler (Run as SYSTEM with highest privileges): Additional tip is to use at least 3 disks for Data and Logs. Just create 3 data disk and run this PowerShell that configure it for you: $disks = Get-PhysicalDisk -CanPool $true New-StoragePool –FriendlyName StoragePool1 –StorageSubsystemFriendlyName “*” –PhysicalDisks (Get-PhysicalDisk –CanPool $True) New-VirtualDisk -FriendlyName “sql-stripe” -StoragePoolFriendlyName “StoragePool1” -Interleave 65536 -AutoNumberOfColumns -ProvisioningType Fixed -ResiliencySettingName “Simple” … MS SQL also Express on Azure VM – TempDB on ephemeral local diskRead more