@echo off setlocal enableextensions disabledelayedexpansion set "search1=[" set "replace1=(" set "search2=]" set "replace2=)" set "textFile=test.txt" (for /f "delims=" %%i in ('type "%textFile%"') do ( set "line=%%i" setlocal enabledelayedexpansion set "line=!line:%search1%=%replace1%!" set "line=!line:%search2%=%replace2%!" echo(!line! endlocal )) > "%textFile%.tmp" move /y "%textFile%.tmp" "%textFile%" >nul
Author: mario
Read all user from windows AD
Read all user from windows AD
$ExportPath = 'C:\Users\administrator\ad-export' $groupNames = (Get-ADGroup -Filter * -SearchBase "OU=Groups,OU=Users,DC=local,DC=exmaple") foreach ($group in $groupNames) { $fileName = (Get-ADGroup $group | Select-Object SamAccountName | Out-String -Stream) $fileName2 = ( $fileName. replace('@{Name=',''). replace('}',''). replace('\',''). Replace('SamAccountName',''). Replace('----------',''). replace('\\r\\n',''). replace('\r\n',''). replace('----',''). replace(' ','') ) $path = $ExportPath + "\" + $fileName2 + ".csv" Get-ADGroup $group | Get-ADGroupMember -Recursive | Get-ADUser -Properties * | Select SamAccountName, Surname, GivenName, Title, Mail | Export-Csv -NoType -Encoding UTF8 -Delimiter ";" $path }
Ip bringing Interfaces Up Down
using ip
# ip link set dev <interface> down
ip link set dev eth0 down
# ip link set dev <interface> up
ip link set dev eth0 up
using ipconfig
# /sbin/ifconfig <interface> up
# /sbin/ifconfig <interface> down
Git Tag Delete Local and Remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
Diskpart Windows restore partion
restore partion
diskpart
list disk
select disk #
clean
create partition primary
select partition 1
format quick
Reasons for TR-03116-4 for ciphers and curves from Bundesamts für Sicherheit in der Informationstechnik (BSI)
What is the reason that the BSI does not allow Chacha20 / Poly 1305?
The BSI does not allow ChaCha20/Poly1305 in its technical guidelines such as TR-03116-4 because it is primarily based on the NSA’s Suites-B specification and established European or German standards. There are several reasons the Focus is on AES-GCM and CNSA Suites.
1. The BSI relies on AES (Advanced Encryption Standard), especially in AES-GCM (Galois/Counter Mode), because this algorithm is recommended by both the NSA and European standardization bodies such as ENISA and ISO/IEC. AES is highly optimized for modern hardware (e.g. AES-NI in x86 processors), which makes it efficient and secure to implement.
2. FIPS and Common Criteria certification. The BSI prefers algorithms that are certified according to FIPS 140-2/3 or Common Criteria (CC). ChaCha20/Poly1305 is less widely used in these circles than AES, especially for government applications.
3. AES has dedicated hardware acceleration (e.g. AES-NI on Intel/AMD or ARMv8-A Cryptography Extensions), while ChaCha20 was primarily intended for software-side implementations on CPUs without AES hardware. In modern environments, AES-GCM with hardware acceleration is usually faster than ChaCha20.
4. Assessment of security properties. Although ChaCha20 is considered secure, there is less formal security analysis and certification than for AES.
Poly1305 is an efficient MAC (Message Authentication Code), but the BSI prefers GCM because it is already closely coupled with AES.
5. Interoperability and long-term strategy. Government IT infrastructures rely on long-term support. AES has a clearly defined future (e.g. through the CNSA Suite 2.0), while ChaCha20 is not treated equally in official European crypto standards. Future migrations to post-quantum cryptography (PQC) are likely to build on AES-based hybrid approaches.
But why is there an algorithm with CBC? As far as I know, CBC is vulnerable to attacks.
Yes, you are right: CBC (Cipher Block Chaining) has known weaknesses, especially padding oracle attacks, which is why many security guidelines (e.g. TLS 1.3) have abolished it. The BSI continues to list AES-CBC in TR-03116-4 for the following reasons:
Backward compatibility with existing systems. Many older or security-critical systems (e.g. in administration or industry) are based on AES-CBC because it was the standard for a long time. A complete switch to AES-GCM is difficult in some environments because not all systems support GCM (e.g. smart cards or older hardware). AES-CBC is still widely used in IPsec, S/MIME, OpenPGP and other protocols. In some scenarios, CBC can be used safely if additional protection mechanisms are in place (e.g. Encrypt-then-MAC (EtM) instead of MAC-then-Encrypt).
In TLS 1.3, CBC was removed because padding oracle attacks were particularly critical there.
In other applications, especially for offline encryption or fixed protocols, CBC can remain secure under certain conditions.
If the BSI allows AES-CBC, then only with HMAC protection (Encrypt-then-MAC) or in precisely defined areas of use. Usually there are strict guidelines for IV handling and padding checking to prevent attacks.
What is the reason for specifying the brainpoolP256r1 curve?
The BSI’s specification of the brainpoolP256r1 curve (also known as brainpoolP256r1, more precisely brainpoolP256t1 or brainpoolP256r1) has several security and strategic reasons. Here are the most important: Alternative to NIST curves (e.g. secp256r1 / P-256) The NIST curves (e.g. secp256r1, also known as P-256) are widely used, but there has been distrust of the origin of the parameters for years. It is speculated that the choice of parameters for the NIST curves was influenced by the NSA, so that backdoors could possibly exist. Brainpool curves, on the other hand, were developed independently (by the ECC Brainpool group led by German cryptographers). Brainpool curves were designed specifically for European security standards and are preferred by the BSI in German government projects. They are specified in various BSI guidelines, e.g. TR-03111 (Cryptographic specifications for eID applications).
For NIST curves, the parameters are published, but their derivation is unclear. The parameters of the Brainpool curves were generated using an open, traceable process.
Brainpool curves are specified in many European protocols, including eIDAS (electronic identities and signatures in the EU), German smart cards, TR-03110 (security of electronic identities). Brainpool curves were chosen to make certain timing and side-channel attacks more difficult, especially in hardware-based implementations. Their structure is intended to prevent implementation errors from leading to vulnerabilities.
Regex Robocopy Logfile Filter
Robocopy Log Dateien filter with Regex in Notepad++
REM Zeilen, die FEHLER enthalten
REM ^(.*)FEHLER
REM
REM Zeilen mit neuen Dateien
REM ^(.*)EXTRA Datei(.*)$
REM
REM Zeilen mit neuen Verzeichnissen
REM ^(.*)ZUS\. Verz(.*)$
REM
REM Doppelte Zeilen
REM ^(.*?)$\s+?^(?=.*^\1$)
REM
REM Leere Zeilen
REM ^\s*$
TR-03116-4 Apache config from Bundesamts für Sicherheit in der Informationstechnik (BSI)
I wonder why the Germany’s BSI, the Federal Office for Information Security requires The brainpool P256r1 curve. Also the must-have ECDHE-ECDSA-AES128-SHA256 aka TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 required by the BSI is a weak cipher. ALso They don’t allow Chacha 2.0 aka POLY 1305 ciphers
Here it comes.
SSLEngine On SSLUseStapling On SSLSessionCache shmcb:/opt/apache2/logs/ssl_gcache_data(512000) SSLStaplingCache shmcb:/opt/apache2/logs/ssl_stapling_data(512000) SSLOptions +StrictRequire +StdEnvVars -ExportCertData SSLProtocol -all +TLSv1.2 +TLSv1.3 SSLCompression Off SSLHonorCipherOrder On # The must have ECDHE-ECDSA-AES128-SHA256 aka TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 required by the BSI is a weak cipher SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256 SSLCipherSuite TLSv1.3 TLS_AES_256_GCM_SHA384 SSLCertificateFile /etc/letsencrypt/live/tr-03116-4.example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/tr-03116-4.example.com/privkey.pem SSLOpenSSLConfCmd ECDHParameters secp521r1 SSLOpenSSLConfCmd Curves X25519:secp521r1:secp384r1:brainpoolP256r1 SSLOpenSSLConfCmd SignatureAlgorithms "ECDSA+SHA512:ECDSA+SHA384:ECDSA+SHA256:RSA+SHA512:RSA+SHA384:RSA+SHA256:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:rsa_pss_rsae_sha256"
In order to test compliance, tls-check.de may be used. In the test results, look at “TLS Parameters and Algorithms (TLS 1.2)” in the “Supported Signature Algorithms” sections.
Windows remote rename (AD) computers
# oldname, newname $Computers = import-csv .\Rename.csv $adminUser = Get-Credential # "PREFIX- +" "+ $SerNum" $Computers = Import-Csv ServerNames.csv -Header OldName, NewName Foreach ( $Computer in $Computers ) { Rename-Computer -ComputerName $Computer.OldName -NewName $Computer.NewName -DomainCredential $adminUser -Force -PassThru }
Windows Update Error 0x80073712
Run the DISM tool
- tap Search.
- Enter command prompt in the search box.
- In the list of results, swipe down on or right-click Command Prompt, and then tap or click Run as administrator.
- In the Administrator: Command Prompt window, type the following commands. Press the Enter key after each command:
DISM.exe /Online /Cleanup-image /Scanhealth
DISM.exe /Online /Cleanup-image /Restorehealth
- To close the Administrator: Command prompt window, type Exit, and then press Enter.
- Run Windows Update again.
Author Archive
Archives by Month:
- March 2025
- February 2025
- January 2025
- December 2024
- November 2024
- October 2024
- August 2024
- April 2024
- January 2024
- December 2023
- November 2023
- July 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- October 2022
- September 2022
- August 2022
- July 2022
- May 2022
- March 2022
- February 2022
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- February 2021
- January 2021
- August 2020
- July 2020
- June 2020
- April 2020
- January 2020
- December 2019
- November 2019
- October 2019
- May 2019
- April 2019
- March 2019
- January 2019
- October 2018
- August 2018
- June 2018
- April 2018
- March 2018
- February 2018
- November 2017
- June 2017
- April 2017
- February 2017
- January 2017
- November 2016
- September 2016
- May 2016
- February 2016
- September 2015
- August 2015
- July 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- July 2014
- June 2014
- April 2014
- January 2014
- December 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- August 2012
- July 2012
- June 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009