Dec 152025
 
Google FLoC logo

Now, before you start reading this, I’ll just tell you up front: This is all old news and likely no longer relevant to you. Or at least not for long anymore. However, I still think it is worth mentioning as a similar technology might show up in the future, and if it does, it will likely not be less dangerous than [FLoC] or its successor, the [Topics API], which I learned about from [this blog post at saptalks.blog]. So what is this stuff? Well, since third-party cookies have basically been thrown out the window when it comes to tracking users on the web, Google came up with a new technology woven directly into their Chrome browser to replace those cookies. The idea is that websites run sandboxed within your Chrome browser, but the browser itself would do the tracking and data collection on the client side, then communicate the collected data to companies to do targeted advertising based on your personal browsing profile. Somehow the browser is supposed to exclude “sensitive” information, but I doubt that this would’ve worked all that well.

This is bad for obvious reasons, potentially even more so than third-party cookies ever were. Now that the functionality is woven into the web browser itself, there’s no easy escape left (other than using Mozilla Firefox or Apple Safari instead). But let us face it: Google Chrome has a market share of around 70% by now! Safari comes in as a distant second with around 15% market share, which makes it pretty clear how insignificant the rest is – sadly including Firefox.

In any case, FLoC has been phased out and its successor, the Topics API is [scheduled to be removed] from future versions of Google Chrome as well. I guess the backlash was pretty intense.

But the technology is still there for now, so I’ve modified my web servers’ configuration to transmit a HTTP header that switches FLoC off in your Chrome browser (should you be using it), at least for most web services on this server, including this blog.

The blog post I linked above shows you how to do this for an nginx web server, but this is possible with the good old Apache server as well. Make sure you have the module mod_headers.so loaded, and add this to your httpd.conf:

<IfModule mod_headers.c>
  Header always set Permissions-Policy "interest-cohort=(), browsing-topics=()"
</IfModule>

Restart your Apache server and you’re done. The header submission can be tested with a wide variety of tools, one being [curl], in my case by running $ curl -I http://www.xin.at:

HTTP/1.1 200 OK
Date: Mon, 15 Dec 2025 06:14:00 GMT
Server: Apache
Permissions-Policy: interest-cohort=(), browsing-topics=()
Last-Modified: Sat, 27 Aug 2022 10:53:28 GMT
ETag: "22000000001684-1464-5e736d73d881c"
Accept-Ranges: bytes
Content-Length: 5220
Content-Type: text/html; charset=UTF-8

With this, your Chrome browser would not leak data about your interactions with or comments on wp.xin.at to any advertising company. I guess I’ll have to stay vigilant about stuff like this in the future as well! Also, if you have to use or want to keep using Google Chrome, it might be a good idea to keep it up to date, not just for security reasons, but also because that way you’ll get rid of the Topics API as soon as possible.

At the time of writing the current major version of Chrome is 143. Deprecation of the Topics API should start with version 144 with removal being scheduled for version 150.

Jun 132022
 
Let's encrypt logo 136

In May 2021, I had [mentioned] that XIN.at had been starting to use Let’s Encrypt certificates with it’s root and intermediate certificates cross-signed by the expired IdenTrust DST Root CA X3 certificate authority. This was done mostly for compatibility reasons, as despite its expiry, some platforms could still trust DST Root CA X3, but not the newer ISRG Root X1. Let’s Encrypt themselves mention Windows XP and Android 7 as such platforms on their [Chain of Trust page]. Recently, some programs, e.g. FileZilla on RedHat Enterprise Linux and probably other systems or R2Mail2 on Android have stopped trusting this cross-signing construct and require constant user intervention to remain operable, which is quite cumbersome for those end users with modern platforms and software.

Let's Encrypt chain of trust since August 2021

Let’s Encrypt chain of trust since August 2021; The DST Root CA X3 is optional (click to enlarge)

On top of that I believe that most Windows XP clients still accessing any services on this server will quite likely be using software integrating their own, much newer cryptographic libraries such as OpenSSL, and their own certificate stores. Examples would include Java, all forks of Mozilla web browsers with XP compatibility and current security fixes, the Thunderbird eMail client, Python and many others.

Hence, I have decided to slowly phase out the DST Root CA X3 cross-signed ISRG Root X1 as well as the equally cross-signed R3 intermediate certificates. From now on, services will be adapted to using this chain:

ISRG Root X1 signs→ R3 Intermediate signs→ XIN.at subscriber/server certificate

…as opposed to this one:

DST Root CA X3 (expired)―signs―┐
            │                  ↓
          signs         R3 Intermediate ―signs→ XIN.at subscriber/server certificate
            ↓                  ↑
       ISRG Root X1――signs―――┘

For now, only the FTP+TLS service has been altered as such. The next ones will be the eMail server, the XIN.at webchat frontend, and the main web server, in no particular order.

By now there should be virtually zero clients running into problems as a result of this cleanup!

Also: Please note that while TLS v1.2 and modern cipher suites have been backported for most services on my ancient server, this was so far not possible for the main web server, which will remain using TLS v1.0 and older ciphers. If you cannot access this weblog because of that limitation (e.g. you’re using a modern Google Chrome instead of a reconfigured FireFox), you’ll have to revert to plain, unencrypted HTTP. For most of what few readers stumble over this page that should be fine anyway, given the nature of this site.

Edit 2022-06-22: The certificate chain of the secure IRC server listening at [ircs://xin.at:6697] has now been updated. This does not yet affect the webchat interface at [https://xin.at:8080], which will come next. For very old clients that do not know the ISRG Root X1 CA, you may still be able to connect if your client allows you to enable untrusted certificates, e.g. as X-Chat / HexChat do. Legacy cryptographic protocols implemented for backwards compatibility (e.g. with Windows 9x, 2000, XP, or old Linux 2.x-based systems) will remain in place, namely SSLv3 and TLS v1.0. Aside from having to allow untrusted certificates on very old machines, this should not have any negative effect for users, at least not a prohibitive one.

Edit 2022-06-23: Today, the following services have been updated in the same way: Web mail, web mail administration, SMTPS, IMAPS, POP3S and the [web chat interface]. While doing so, an issue was discovered for the web chat interface while testing it with [testssl]; The server had only provided the subscriber certificate, but no full chain including intermediate and root CA certificates. This was simply a configuration error that has now been corrected!

Mar 152018
 
Windows 2000 + Let's Encrypt logo

[1] 1.) Introduction

There has been an issue with my [stoneage server]German flag (which is also hosting this weblog) that has been bugging me for quite a while now: I’ve been scared of the time when other server operators and software developers would start to seriously disable ancient SSL/TLS ciphers such as SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA and SSL_RSA_WITH_3DES_EDE_CBC_SHA, or in other words: SHA1, RC4 and 3DES. The XIN.at services are actually made of both non-free as well as free services that are using several different cryptographic libraries such as different OpenSSL versions but also WinSSL CryptAPI / schannel. Naturally it’s the latter which is presenting the biggest issue: The CryptAPI of Windows 2000 Server is ancient. And while it can do at least TLS v1.0, the ciphers have been becoming the true burden. Unfortunately (?!), some services on XIN.at do require some form of widely accepted encryption.

Some of the servers do have interchangeable OpenSSL libraries – so you can just swap those .dll files for an upgrade – while others do not. Some from the latter category can be backported to / recompiled for Windows 2000 to upgrade OpenSSL, like I’ve been [able to do] for the UnrealIRCd IRC server. Some however can not.

And then there are services which are using Windows SSL or in other words the CryptAPI / schannel. Those are the most inflexible of the pack.

Another problem is that self-signed certificates such as the ones I’ve been using have also become increasingly problematic. Most client software like web browsers in particular, but also email clients, IRC clients and others keep pestering their users quite a bit when being presented with such an “untrustworthy” SSL certificate. They really want one signed by a fully trusted certificate authority (CA) or an intermediate CA. The best solution for that problem right now is to get a Let’s Encrypt[2] certificate, as it’s free and well-trusted. Only reason I haven’t done that so far is that it needs automatisms (=ACME client software) in place to remain manageable.

I wanted to solve both issues in one fell swoop.

2.) The trigger

eMail logoThen again, you know how people are – they tend to act only when something bad has already happened. In the tradition of that (bad) behavior I’ve chosen to act only where the problem at hand was truly easy to solve. After I’ve managed to compile a modern enough OpenSSL library, I’ve just swapped it on the spot where possible, but I haven’t touched the more problematic services, where such a thing is not doable.

However, there has been a serious issue recently when mail server operators started to beef up their cryptography across the board. It seems there are some updates being rolled out about now which block the ancient ciphers and/or protocols I mentioned in the introduction.

The truly serious part is that seemingly, all mail servers who encounter another that does feature STARTTLS on SMTP port 25, but has no secure ciphers to offer just drop the connection on the spot without generating any error. The mail will not be delivered, but no delivery error will be returned to the sender either! It’s truly a case where the eMails just “disappear” without anyone ever noticing a problem at first. To make matters worse, there was no way to disable just STARTTLS for SMTP with my server software. It’s either no SSL/TLS at all or fully enabled STARTTLS on all plain eMail ports.

See this log to get an idea (remote host names have been replaced with “remote.mailtransfer.com” and IP addresses as well as security-relevant data have been masked here):

expand/collapse log file

The most interesting part is clearly at the bottom, where it says “SSL negotiation successful (TLS 1.0, 2048 bit key exchange, 168 bit 3DES encryption)”. 3DES is the best Windows 2000 can do by itself, and it looks as if the remote server would accept the implementation just fine. But what happens next is that the remote machine just drops the connection, and that’s it!

The remote side who sent the eMail (that was myself from my account at work actually) never got any delivery failure notification, and after asking other people about it, it was just the same. As said, the mails just vanish!

I also talked to the operator of the mail gateway at work, and he said he didn’t see anything in the logs either, other than that the connection was just being dropped. Pretty stupid to not generate a proper error here, if you ask me.

Well, that was enough of a reason to act! eMails just disappearing is completely unacceptable after all!

3.) What can you do?

I thought about this issue in the past already, and one of my ideas was to use something like [BlackWingCats’] kernel API extensions for Windows 2000 (“KernelEx”). The issue with that is though, that it’s modifying large parts of the operating system, and it’s very incompatible to my German version, wrecking half of the system upon installation during my tests in a VM. So that idea went down the drain pretty fast.

Very recently however, I got the idea that maybe I could use [stunnel] to solve the cipher problem. It’s basically a port mapper wrapping plain text protocols up in SSL/TLS. It’s a program coming from the Linux/UNIX world, but it also works on Windows. On top of that, it miraculously runs on Windows 2000 as well, even in its newest version bundling modern OpenSSL 1.0.2.

Additionally, I thought I’d once again try to get some Let’s Encrypt ACME client to work on Windows 2000 for certificate issuing and renewal, even though I failed to get any of them working before.

3a.) Let’s Encrypt configuration via ZeroSSL

ZeroSSL bannerSince we need an SSL certificate for stunnel anyway, let’s cover this part first. For ease of use, I chose ZeroSSLs’ [Crypt::LE] Perl tool. I didn’t like their [web-based configuration] too much, as they’ll be issuing your private key for you on their servers.

Generally, when dealing with cryptography and trust concepts, I wouldn’t recommend anyone other than yourself generate and use your private key, so that’s one reason why I chose their Perl tool instead. Plus, you can’t automate the certificate renewal process with some web tool, but you can with Perl.

If you don’t have Strawberry Perl installed on your machine, you can still rely on their [Windows binaries] as well. Those are basically just le.pl and the necessary Perl parts wrapped in an le32.exe file. Crypt::LE also supports ActiveState Perl, but the free Strawberry Perl should be preferable, if you’re choosing that path.

Unfortunately, if you choose to use the .exe version, it won’t run on Windows 2000 out of the box, as it calls the WinSock 2.0 function freeaddrinfo(), which is only available on Windows XP and newer. For an easy fix, you can use a modified WS2_32.dll WinSock library found in the dllfiles\ subfolder of this [winsock2_getaddrinfo.rar] archive by [Martin Brenner]German flag, if you choose to trust the DLL.

If you do, just put it next to le32.exe, and make sure you launch the program only while sitting within the installation folder of le32.exe itself. Do not overwrite your system-wide %WINDIR%\system32\WS2_32.dll, you don’t need to do that, and you shouldn’t either!

As said, if you don’t trust the hack for the binary, you need to install Strawberry Perl and follow the instructions for the compilation & installation of Crypt::LE from their website.

3a1.) Ok, I have the tools, now what?

I won’t cover the process of using Crypt::LE, as there is an excellent manual [right here at ZeroSSL]! There is one thing that needs to be said though: You need an openssl.exe for the initial certificate request and key generation part. There is one bundled with stunnel in the subdirectory bin\ of its installation folder, you can just use that.

But before you start with it on a cmd terminal, you’ll need to tell OpenSSL where to look for its configuration file. Say you’ve installed stunnel in %PROGRAMFILES%\stunnel\, then run the following command before starting to work with OpenSSL:

SET "OPENSSL_CONF=%PROGRAMFILES%\stunnel\config\openssl.cnf"

This sets %OPENSSL_CONF% to the file name of the OpenSSL configuration, and OpenSSL will automatically parse that environment variable. Adjust paths as necessary, then follow ZeroSSLs’ manual to get your first Let’s Encrypt certificate(s)!

3b.) stunnel

stunnel on Windows 2000

stunnel on Windows 2000

If you’ve been following this article, you’ll already have stunnel installed by now. On Linux & UNIX, stunnel is just a command line tool and/or xinetd service, but on Windows, you also get a bit of a GUI and a tray icon with it. You’ll still have to configure it by editing its config\stunnel.conf configuration file with your favorite text editor however.

Say you wanted to protect a web server on port 80 by adding HTTPS on port 443 for it. The corresponding configuration entry in that configuration file would look like that (here: with separate key file not stored directly within the certificate):

[https]
accept  = 443
connect = 80
cert    = mydomain.pem
key     = mydomain.key

stunnel will listen on port 443 with implicit TLS for you, and then redirect the traffic to port 80 on the same machine. To a web browser connecting to https://yourdomain.com:443/, it’ll look like just another TLS-enabled web server.

The same goes for other implicit SSL/TLS services such as SMTPS, IMAPS, POP3S, etc.

The exception of course are explicit SSL/TLS implementations using the STARTTLS command. One classic example for that would be SMTP on port 587, which is typically STARTTLS-enabled. To make that work, stunnel has to emulate parts of the specific protocol to secure, so support for this is rather limited. Currently, stunnel supports the following network protocols for explicit STARTTLS:

  • CIFS (SMB, Samba, older implementation)
  • CONNECT (Client only)
  • IMAP (as per RFC 2595)
  • NNTP (as per RFC 4642)
  • PGSQL
  • POP3 (as per RFC 2449)
  • PROXY
  • SMTP (as per RFC 2487)
  • SOCKS (versions 4, 4a and 5)

To use it, you’d need to configure the service as follows, this example is for SMTP with STARTTLS on port 587, mapping it to your local, unencrypted SMTP server:

[smtp-es]
accept   = 587
connect  = 25
cert     = mydomain.pem
key      = mydomain.key
protocol = smtp

Now if present, switch off your existing SSL/TLS services first (like make your web server stop listening to port 443), and then fire up the stunnel program and everything should work. You can also install it as a system service on Windows by the way, it’s very easy: stunnel -install.

Together with a properly requested and signed Let’s Encrypt certificate this will give any ancient server things like TLS v1.2 with AES256-GCM-SHA384 and any modern client will trust your certificate implicitly, as most vendors have by now added the ISRG CA certificates to their CACert bundles. Even Microsoft trusts them by now.

4.) Really putting it all together

Let's Encrypt logoEven if you’ve managed to do all of this manually, it won’t solve the problem forever. Let’s Encrypt certificates have a lifetime of just 90 days, so you will have to renew them pretty often. That can be done with just a batch script launching Crypt::LE as well as doing the rollout of the certificates and relaunch of the servers, so that they can re-read the certificates and key files.

Here’s an example script for stunnel and some other hypothetical servers that accept certificate files in different configurations. It assumes that you’re using Crypt::LE together with Strawberry Perl. As you can see, aside from Perl and Crypt::LE you won’t need anything else, as the rest can be done with regular Windows cmd builtins and the NetShell:

expand/collapse certificate-renewal.bat
  1. :: Renew our certificate if it expires within the next 30 days, put HTTP
  2. :: challenge files in C:\MyHTTProot\.well-known\acme-challenge\ and return
  3. :: code 42 if there was a renewal
  4. --------------------------------------------------------------------------
  5. SET "PERLBIN=C:\StrawberryPerl\perl\bin\perl.exe"
  6. SET "LE=C:\StrawberryPerl\perl\bin\le.pl"
  7. "%PERLBIN%" "%LE%" -renew 30 -generate-missing -unlink -live -legacy ^
  8.  -key "C:\MyCerts\my-account-key.key" -csr "C:\MyCerts\my-cert-request.csr" ^
  9.  -csr-key "C:\MyCerts\mydomain-key.key" -crt "C:\MyCerts\mydomain-cert.cert" ^
  10.  -domains "www.mydomain.com,mydomain.com" -issue-code 42 ^
  11.  -path "C:\MyHTTProot\.well-known\acme-challenge\"
  12.  
  13. :: Check whether there was a renewal, and roll out certs + restart servers
  14. :: if so, otherwise just terminate
  15. :: -----------------------------------------------------------------------
  16. IF %ERRORLEVEL% EQU 42 (
  17.   :: stunnel for servers with old cryptographic implementations, this requires
  18.   :: a domain+intermediate certificate bundle with a separate private key file
  19.   TYPE "C:\MyCerts\mydomain.cert" > "%PROGRAMFILES%\stunnel\config\mydomain.pem"
  20.   ECHO. >> "%PROGRAMFILES%\stunnel\config\mydomain.pem"
  21.   TYPE "C:\MyCerts\mydomain.ca" >> "%PROGRAMFILES%\stunnel\config\mydomain.pem"
  22.   :: They key needs copying only once
  23.   :: COPY /V /Y "C:\MyCerts\mydomain.key" "C:\Server\stunnel\mydomain.key"
  24.  
  25.   :: A server that needs domain certificate, intermediate CA cert and key all
  26.   :: separately
  27.   COPY /V /Y "C:\MyCerts\mydomain.cert" "C:\Server1\sslconf\"
  28.   :: They key and intermediate certificate need copying only once
  29.   :: COPY /V /Y "C:\MyCerts\mydomain.ca" "C:\Server1\sslconf\"
  30.   :: COPY /V /Y "C:\MyCerts\mydomain.key" "C:\Server1\sslconf\"
  31.  
  32.   :: A server that needs domain and intermediate certificates in one bundle, but
  33.   :: the private key as a separate file, like stunnel
  34.   TYPE "C:\MyCerts\mydomain.cert" > "C:\Server2\sslconf\mydomain.pem"
  35.   ECHO. >> "C:\Server2\sslconf\mydomain.pem"
  36.   TYPE "C:\MyCerts\mydomain.ca" >> "C:\Server2\sslconf\mydomain.pem"
  37.   :: They key needs copying only once
  38.   :: COPY /V /Y "C:\MyCerts\mydomain.key" "C:\Server2\sslconf\"
  39.  
  40.   :: Yet another server, that needs both certificates and your private key all
  41.   :: in one bundled file
  42.   TYPE "C:\MyCerts\mydomain.key" > "C:\Server3\sslconf\mydomain.pem"
  43.   ECHO. >> "C:\Server3\sslconf\mydomain.pem"
  44.   TYPE "C:\MyCerts\mydomain.cert" >> "C:\Server3\sslconf\mydomain.pem"
  45.   ECHO. >> "C:\Server3\sslconf\mydomain.pem"
  46.   TYPE "C:\MyCerts\mydomain.ca" >> "C:\Server3\sslconf\mydomain.pem"
  47.  
  48.   :: Restart all services to reload the certificate and key
  49.   :: ------------------------------------------------------
  50.   :: Restart stunnel
  51.   net stop "stunnel"
  52.   net start "stunnel"
  53.  
  54.   :: Restart Server 1
  55.   net stop "Server 1 system service name"
  56.   net start "Server 1 system service name"
  57.  
  58.   :: Restart Server 2
  59.   net stop "Server 2 system service name"
  60.   net start "Server 2 system service name"
  61.  
  62.   :: Restart Server 3
  63.   net stop "Server 3 system service name"
  64.   net start "Server 3 system service name"
  65. )
  66.  
  67. :: All done!

Now you can automate the process by creating a job in Windows task scheduler to launch that certificate-renewal.bat like every 20 days or so. The script will of course vary quite a bit depending on your environment and your services, so take it only as a rough guide.

And that’s how you get Let’s Encrypt certificates and modern cryptography up and running on an 18 years old Windows operating system, for what it’s worth. :roll:

5.) Bonus information

You can actually use stunnel in client mode as well. Say you’re using Windows 2000 Pro as your client operating system (*cough*) and your software is so old and insecure, that some remote server at say https://www.verysecureserver.com:443 won’t talk to you anymore. Just run stunnel on your client on demand, with a per-host configuration such as this:

[thatverysecureserver]
client = yes
accept = localhost:9999
connect = www.verysecureserver.com:443
CAfile = ca-certs.pem

Open up your web browser, surf to https://localhost:9999, and stunnel’ll redirect you to that server, which will now see a secure clientside SSL implementation. Only thing is that you might need to create an exception in your browser, because the host names don’t match between what you entered in the address field and what’s in the remote servers’ certificate, but no way around that.

And now, time for some cold beer! Beer Smilie

[1] The “Let’s Encrypt Radiant Lock” design mark is a trademark of the Internet Security Research group and is licensed under the CC-BY-NC 4.0. All rights reserved.

[2] The “Let’s Encrypt®” word mark is a trademark of the Internet Security Research group. All rights reserved.

Jul 282017
 
Mail.ru logo

1.) Introduction

Of course you could say: “If you’re going to use Russian software, that’s what you’d have to expect!”. But yeah. I’ve actually used tools written by Russian developers before, and they used to be very slim and fast, so I thought, why not give it a shot. Background is that I’ve finally ditched my ancient Nokia E72 “smart phone” based on Symbian 9.2 / S60 3rd, which has become almost unusable because of its lack of modern SSL ciphers (most websites won’t let you connect anymore) and because of its Skype and ICQ clients being banned from their respective servers.

So I finally went ahead and got myself an Android 7.1.1 device, the Blackberry KEYone, my second attempt at using the OS (first was a Motorola Milestone 2 with Android 2.1, a failure because of many reasons).

Anyway, I had to find an eMail app that would let me do two things:

  1. Display and send everything as plain text (I hate HTML mails and find them pretty insulting to be honest)
  2. Allow me to connect to mail servers which support only older SSL/TLS protocols and ciphers (I’ve got no choice here)

2.) The Mail.ru email client on Android

2a.) The app itself

So, I tested a lot of clients, one of which was [Mail.ru], a pretty high-ranked email app (4.6/5) with more than 10 million installs out there. Superficially, it looks just like pretty much any other email client, because there are likely readily available Android libraries for implementing email clients:

Mail.ru client ad

An image directly from the Google play store, showing the apps’ GUI (click to enlarge)

So they advertise it with slogans like “ideal application for any mail” and “add all your email boxes in one application”. Actually, it’s ideal for just one thing: To hand over all your email accounts and emails to a Russian company and with it the Russian government – because in Russia, companies have to yield to the government and grant it full access to user accounts and data by default.

I guess free Russian developers and actual Russian software companies have to be treated very differently!

What I did was to enter my own email account credentials in the Mail.ru app to be able to fetch my emails via IMAP. I found that the client does not meet my personal requirements (no way to force plain text email), so after my quick test, I just uninstalled the app.

2b.) What the app does without you noticing

However, by that time, the Mail.ru app had already leaked my account credentials to certain mail.ru and my.com servers (my.com is a part of the bigger Mail.ru group), which had now started to log into my account from Russia – periodically checking all my email boxes and downloading every single message stored on my own server. Let’s have a look at the logs!

Here is their first connection attempt, coming from 5.61.237.44 (sapif30.m.smailru.net) as well as the second one from 94.100.185.215 (rimap21.i.mail.ru):

Tue 2017-07-25 14:59:27: Session 5554; child 3; thread 1232
Tue 2017-07-25 14:59:26: Accepting IMAP connection from [5.61.237.44:42273]
Tue 2017-07-25 14:59:27: SSL negotiation successful (♡)
Tue 2017-07-25 14:59:27: --> * OK ♡ IMAP4rev1 ♡ ready
Tue 2017-07-25 14:59:27:  1 OK LOGIN completed
Tue 2017-07-25 14:59:27:  1 OK LIST completed
Tue 2017-07-25 14:59:27:  * BYE IMAP engine signing off (no errors)
Tue 2017-07-25 14:59:27: --> . OK LOGOUT completed
Tue 2017-07-25 14:59:27: IMAP session complete, (2654 bytes)
Tue 2017-07-25 14:59:27: ----------
Tue 2017-07-25 15:00:04: ---------- Partial transcript, remainder will follow.
Tue 2017-07-25 15:00:04: Session 5556; child 4; thread 3588
Tue 2017-07-25 14:59:28: Accepting IMAP connection from [94.100.185.215:53424]
Tue 2017-07-25 14:59:28: SSL negotiation successful (♡)
Tue 2017-07-25 14:59:28: --> * OK ♡ IMAP4rev1 ♡ ready
Tue 2017-07-25 14:59:28:  1 OK LOGIN completed
Tue 2017-07-25 14:59:28:  * CAPABILITY ♡
Tue 2017-07-25 14:59:28: --> 2 OK CAPABILITY completed

You might have guessed it, the ♡ marks things I cut from the logs for privacy reasons. Guess I got a bit too creative. ;) Anyway, this was only the beginning. Later, some mail collector servers from the IP range 185.30.17*.** (collector*.my.com) started to log in and download all my emails from all my folders! Here’s just a small excerpt from the commands issued with one of my archive folders serving as an example – most of the stuff has been cut out to make it more concise:

Hint: Unfortunately, this code block has been lost due to an error in the blogging software, that killed this part due to a bug in the code parser. and that within "pre"-tags. Great... Thank you, Javascript parser...

All of those are just the remote commands issued to my server. Note that in IMAP4, UID FETCH <UID> BODY.PEEK[] at the bottom is an actual message download. Needless to say, there were thousands of those going unchecked, because it took me 3 days to discover the leak. And I only discovered it coincidentally too. So by that time they had long downloaded all my emails from my own server to Russia. If you’re not running your own mail server, you wouldn’t even notice this.

So if you just happened to enter your AOL, Yahoo, gmail or Hotmail accounts, you’d never see those Russian servers accessing those accounts remotely!

3.) This can’t be ok, can it?

This behavior is completely unacceptable and has been reported to Google as it is borderline regarding Googles’ own privacy policy:

Privacy Policy & Secure Transmission

If your app handles personal or sensitive user data (including personally identifiable information, financial and payment information, authentication information, phonebook or contact data, microphone and camera sensor data, and sensitive device data) then your app must:

  • Post a privacy policy in both the designated field in the Play Console and from within the Play distributed app itself.
  • Handle the user data securely, including transmitting it using modern cryptography (for example, over HTTPS).

The privacy policy must, together with any in-app disclosures, comprehensively disclose how your app collects, uses and shares user data, including the types of parties with whom it’s shared.

Prominent Disclosure Requirement

If your app collects and transmits personal or sensitive user data unrelated to functionality described prominently in the app’s listing on Google Play or in the app interface, then prior to the collection and transmission, it must prominently highlight how the user data will be used and have the user provide affirmative consent for such use.

First of all, the mail collectors drop down to cryptographic ciphers even I wouldn’t use anymore when asked to do so. I mean, it sounds hypocritical coming from me (because I’m actually using very old ciphers too, as I’m out of options on my ancient server), but they do fall back to what’s by no means “modern cryptography”. Also, the leaking of account credentials and data to Russian servers and the continuous use of said data even after the user has stopped using Mail.ru services is not mentioned anywhere while installing or using the app, not that I could see at least.

I most definitely didn’t give my consent to having the app use my data like this – I wasn’t presented with an EULA during the installation or use of the software. Also, the (Russian…) email they had sent me after accounts were set up in the app didn’t show an EULA or privacy statement either. It’s even worse considering [Mail.ru’s history] in terms of handling that information.

None of this is new either, see e.g. [this Reddit] (MyMail is from my.com – as said, a part of the Mail.ru Group).

Well, I started to look around and found a Mail.ru [user agreement] online. The interesting part is point 4.1.3:

4.1.3 In addition to the registration procedure on the Internet Service specified in clause 4.1. the user may be granted the right to register through using its data (login and password) of the e-mail box registered at the third person’s resource.

Irrespective of using any method of registration on the Internet Service the User’s password used to visit the Internet Service shall be beyond the reach of Mail.Ru.

Now that part is a bit problematic. The “third person’s resource” is clearly your own mail account on some other server. So like my email account on my own server. The question is, what exactly does it mean when they say that the users’ password shall be “beyond the reach of Mail.Ru”? Guess they’d mean my actual plain text password, right?

Well, no matter if they use hashes with <-- 2 authenticate CRAM-MD5, or instead just plain text <-- 1 LOGIN ♡@♡.♡ ♡♡♡♡♡♡, they do have my password stored away on their servers as clear text (probably on some encrypted file system? But still.). I wouldn’t call that “beyond the reach of Mail.ru” anymore.

I guess I could have misread the user agreement (that I wasn’t even presented with!) somewhere, but it doesn’t seem to me as if they’d be following their own rules regarding privacy?!

If you’re using the Mail.ru app I can only advise you uninstall it if you haven’t done so already and to change all account passwords ever entered in the application to stop the Russian collector servers from logging into your accounts and “stealing” your email even after app deinstallation.

On a side note: Since K-9 Mail isn’t exactly right for me either, I settled with [R2Mail2], which is being developed in Austria by the company [RundQuadrat]. I’ve been talking with its developer over the last few days, and he seems a like a nice family guy. I do like the client, as it has an impressive feature list, let’s just name a few:

  • Manually configurable SSL/TLS cipher list, you can pick which ciphers you want or don’t want to use, including the option to support a few deprecated ciphers.
  • Data oriented encryption with either S/MIME, or even PGP and PGP/MIME for emails and also arbitrary files (a small tool for file encryption is embedded in the client).
  • Support for Microsoft Exchange servers
  • Option to stop syncing in the background, so a full shutdown of the app is possible with ease.
  • Full plain text support, so you can force all messages to be displayed and sent in plain text only.
  • The client itself can be password protected and can be instructed to store all local data in encrypted form.
  • Extremely configurable: Reply/Forward Prefixes, host name use in EHLO command, notification LED color ( :roll: ), IPv4/IPv6 preference, Certificate store access & configuration, peak day/time option to boost synchronization, sync grouping with other apps to save battery, local email pruning and many, many other things.

It does come at a price though, as it costs 4.80€. But if you want a seriously powerful and I’d say more trustworthy email application for Android, you might give this a shot. Otherwise, maybe just go with the free K-9 mail app if you want plain text and don’t need to rely on mail servers with antiquated SSL/TLS implementations.

But no matter what, stay away from Mail.ru and MyMail!

Update, 2017-12-30:

Thanks to a notification from [Bier.jpg]German flag I have now learned, that the testing password used to probe the Mail.ru and MyMail services (in context of writing this article) has been leaked to the Internet!

The corresponding data has been presented to the public on the Chaos Communication Congress (34C3) of the corresponding Chaos Computer Club (CCC), in the context of its [Can I Haz Passw0rds?] project. The leak website will be offline soon enough, but you can continue to access the password database on the [Tor network] after the Congress has ended (Open that link in the [Tor Browser]). Since my original, former true password has not been leaked, this must have happened some time after 2017-07-25.

Additionally to the two leaks that I attribute to Mail.ru and MyMail, there was also a third one with the same, temporary password. I’ve used it to continue my tests of all kinds of Android eMail applications, but unfortunately, I can’t be sure who the third culprit might have been. :( The only two Apps I’m sure couldn’t have been responsible are [K-9 Mail] and the Austrian program [R2Mail2], as those have only been fed real passwords, and they’re not supposed to leak them off-device anyway.

So much for that! :roll:

PS.: I cannot exactly prove, that two of the three leaks are from Mail.ru and MyMail, but given their handling of passwords and their history of repeated, massive password database leaks, I’m pretty sure that they were involved in this as well.

Jun 292017
 
Microsoft Security Essentials logo

Recently, I ran into another issue on my old Windows XP x64 machines, and on regular XP and Windows Vista boxes as well. Microsofts’ Security Essentials software – let’s just call it MSSE – stopped updating itself. Even more problematic was the fact that manual updates wouldn’t work anymore either. It would download the new definitions, but not install them. With no error messages to be found anywhere, I had no idea what to do. Ok, on XP x64, MSSE was never supported to begin with (the last 64-bit version 4.4.304.0 for Vista works though), but the problem also showed up on supported systems, maybe because of their EoL status.

Strangely though, sometimes it would work out of the blue, but mostly, it seems to be broken. This is specifically bad right now, because very recently, the Microsoft Malware Protection Engine that MSSE and many other Microsoft security products are based on has had some critical bugs resulting in potential remote code execution exploits (at the highest privilege levels). By just scanning a file – e.g. an attachment of an email – the code inside would be run and evaluated by the MMPE, and during that phase, the code could “break out” into the system, infecting it with god knows what.

So, updates are really important right now, or the security tool you may rely upon to protect you at least a little bit may become the most dangerous thing on your old XP x64, PosReady2009 XP or Vista box, and not just there but on more modern systems as well (The Windows Defender on Windows 7+ uses the same MMPE).

What I did was to download the full update pack mpam-fe.exe from Microsoft [here], and install it manually. Interestingly, this worked just fine. Based on that, I wrote a very simple little batch script, that automates the process. Only drawback: It relies on one external tool, namely wget.exe, needed to download the package from Microsoft. Sadly, Windows doesn’t seem to have a command line tool to do that on its own. You can get wget by installing [GNU on Windows], a collection of free UNIX command line tools built for Windows.

Once wget.exe is in your users’ search path, you can use the task scheduler to automate the launch of the following updater script (just save it as a .bat file somewhere):

  1. @ECHO OFF
  2. :: Fetch the most current AV definitions (%TEMP% doesn't need 
  3. :: to be quoted, because it returns a short path anyway):
  4. wget.exe --no-check-certificate -O %TEMP%\mpam-fe.exe "https://go.microsoft.com/fwlink/?LinkID=121721&arch=x64"
  5. :: Install them, wait for 120 seconds, then delete the installer:
  6. %TEMP%\mpam-fe.exe
  7. CHOICE /C:AB /D:A /T:120 >NUL 2>&1
  8. DEL /F %TEMP%\mpam-fe.exe
  9. :: And we're done.
  10. EXIT

I have no idea why the regular way of updating MSSE breaks on some systems, but now that I’ve been running the above script on my machines every night, MSSE is staying up to date pretty nicely. Ah yes, one thing: In case your system is 32-bit and not 64-bit, you need to change the URL being called by wget. Just replace the HTTP variable arch=x64 with arch=x86 in that script, and it’ll download the 32-bit version of mpam-fe.exe!

Also note that you can actually abort the 120 second wait by maybe accidentally pressing either A or B in the above example, because the delay is implemented in a weird way using CHOICE, since Windows XP doesn’t have a native sleep or wait command. If you want to prevent such accidents, you can make CHOICE use stranger characters that you would never be able to enter accidentally, like this for example:

CHOICE /C:©® /D:® /T:120 >NUL 2>&1

And with that you can keep older machines using MSSE a tiny little bit more secure in case the auto-update breaks for you as well.

Update 2018-04-27: It appears that the method as shown above no longer works due to the current mpengine.dll (The AV engine) not being accepted by MSSE 4.4.304.0. One of my assumptions (although I cannot prove it as of yet) is, that MPSigStub.exe fails to verify the .dll, which may be a reason for this to fail. This makes the entire update process unusable since 2018-04-20.

As a partial remedy, I’ve developed a solution to update only the AV definitions, but not the AV engine. For that, we do not execute mpam-fe.exe after downloading it from Microsoft, but instead we unpack it with a bundled 7zip program and install the definitions stored in *.vdm files in a special folder monitored by MSSE for offline updates. On XP x64, that folder can be found here:

%ALLUSERSPROFILE%\Application Data\Microsoft\Microsoft Antimalware\Definition Updates\Updates\

This time, I’ll ship the whole thing, the updater script and also the necessary binary programs and libraries. The corresponding licenses are referenced within the script source code itself.

The source code of that new version 2 script:

expand/collapse source code of msse-updater-v2.bat
  1. @ECHO OFF
  2.  
  3. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. ::                                                                       ::
  5. :: This is a script doing automatic AV definition (but not AV engine)    ::
  6. :: Updates for Microsoft Security Essentials v4.4.304.0 for Vista x64    ::
  7. :: when installed on Windows XP Professional x64 Edition. This is the    ::
  8. :: version for after 2018-04-20, when regular mpam-fe.exe updating would ::
  9. :: break due to the mpengine.dll becoming incompatible with the given    ::
  10. :: version of MSSE. Please note that this might pose a security risk, as ::
  11. :: only AV definition but not the engine are being updated. Check the    ::
  12. :: CVE-2017-0290 as a reference!                                         ::
  13. ::                                                                       ::
  14. :: Note: This is meant to be automated via the Windows task scheduler,   ::
  15. :: e.g. for a daily update.                                              ::
  16. ::                                                                       ::
  17. :: This script is © 2018 Michael Lackner aka GrandAdmiralThrawn,         ::
  18. :: https://wp.xin.at and is licensed under the GNU General Public        ::
  19. :: License v3.0.                                                         ::
  20. :: License: https://www.gnu.org/licenses/gpl-3.0.en.html                 ::
  21. ::                                                                       ::
  22. :: The companion program 7za.exe is cross-licensed under the Lesser GNU  ::
  23. :: General Public License, the 3-Clause BSD License and the unRAR        ::
  24. :: license.                                                              ::
  25. :: Licenses: https://www.gnu.org/licenses/lgpl-3.0.en.html               ::
  26. ::           https://opensource.org/licenses/BSD-3-Clause                ::
  27. ::           https://fedoraproject.org/wiki/Licensing:Unrar              ::
  28. ::                                                                       ::
  29. :: The companion program wget.exe and its linked library libiconv2.dll   ::
  30. :: are licensed under the GNU General Public License v3.0. The linked    ::
  31. :: library libintl3.dll is licensed under the Lesser GNU General Public  ::
  32. :: License v2.1. The libraries libeay32.dll and libssl32.dll are         ::
  33. :: licensed under the OpenSSL license.                                   ::
  34. :: Licenses: https://www.gnu.org/licenses/gpl-3.0.en.html                ::
  35. ::           https://www.gnu.org/licenses/lgpl-2.1.en.html               ::
  36. ::           https://www.openssl.org/source/license.html                 ::
  37. ::                                                                       ::
  38. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  39.  
  40. SETLOCAL EnableDelayedExpansion EnableExtensions
  41.  
  42. :: Paths and programs
  43. SET "myPath=%~dp0"
  44. SET "myPath=%myPath:~0,-1%
  45. SET "compPrg=%myPath%\7za.exe"
  46. SET "wgetPrg=%myPath%\wget.exe"
  47. SET "mssePrg=%TEMP%\mpam-fe.exe"
  48. SET "defsSourceFolder=%TEMP%\msse-definitionupdate"
  49. SET "defsTargetFolder=%ALLUSERSPROFILE%\Application Data\Microsoft\Microsoft Antimalware\Definition Updates\Updates"
  50.  
  51. ECHO. & ECHO Checking for administrative privileges and detecting operating system bitness...
  52.  
  53. :: Check for administrative privileges:
  54. net FILE 1>NUL 2>&1
  55. IF %ERRORLEVEL% NEQ 0 (
  56.   ECHO. & ECHO Error: No administrative privileges^^! & ECHO.
  57.   ECHO This script needs to be run as an administrator^^! & ECHO.
  58.   PAUSE
  59.   EXIT /B 1
  60. )
  61.  
  62. :: Detecting operating system version:
  63. FOR /F "tokens=1,2 skip=1 delims=." %%I IN ('wmic OS get Version') DO SET "OSVer=%%I%%J" & SET "OSVerMajor=%%I" & SET "OSVerMinor=%%J" & GOTO :OSVerEnd
  64. :OSVerEnd
  65.  
  66. IF %OSVer% NEQ 52 (
  67.   ECHO. & ECHO Error: Wrong operating system detected^^! & ECHO.
  68.   ECHO This script is for Windows XP Pro x64 Edition running MSSE 4.4.304.0 for
  69.   ECHO Vista x64 only^^! & ECHO.
  70.   ECHO Kernel version detected: %OSVerMajor%.%OSVerMinor%
  71.   ECHO Kernel version required: 5.2 & ECHO.
  72.   PAUSE
  73.   EXIT /B 1
  74. )
  75.  
  76. :: Make sure this is not Server 2003 32-bit:
  77. FOR /F "tokens=1" %%K IN ('ECHO %PROCESSOR_ARCHITECTURE%') DO SET "Arch=%%K"
  78. IF NOT %Arch%==AMD64 (
  79.   ECHO. & ECHO Error: 32-bit architecture detected, but this is for XP x64^^! & ECHO.
  80.   ECHO Are you trying to run this on Server 2003 32-bit?^^! & ECHO.
  81.   PAUSE
  82.   EXIT /B 1
  83. )
  84.  
  85. :: Fetch the most current AV definitions and create a temporary folder to
  86. :: unpack them to:
  87. ECHO. & ECHO Fetching latest AV definition update... & ECHO. & ECHO.
  88. "%wgetPrg%" --no-check-certificate -O "%mssePrg%" "https://go.microsoft.com/fwlink/?LinkID=121721&arch=x64"
  89. IF %ERRORLEVEL% NEQ 0 (
  90.   ECHO. & ECHO Error during download process detected^^! & ECHO.
  91.   ECHO Aborting... & ECHO.
  92.   PAUSE
  93.   EXIT /B 1
  94. )
  95. MD "%defsSourceFolder%"
  96.  
  97. :: Unpack and install them:
  98. ECHO. & ECHO Unpacking the AV definitions... & ECHO.
  99. "%compPrg%" e -y -o"%defsSourceFolder%" "%mssePrg%"
  100. IF %ERRORLEVEL% NEQ 0 (
  101.   ECHO. & ECHO Error during mpam-fe.exe unpacking detected^^! & ECHO.
  102.   ECHO Aborting... & ECHO.
  103.   PAUSE
  104.   EXIT /B 1
  105. )
  106. ECHO. & ECHO. & ECHO Copying/installing the AV definitions... & ECHO. & ECHO.
  107. COPY /B /D /V /Y "%defsSourceFolder%\*.vdm" "%defsTargetFolder%\"
  108. IF %ERRORLEVEL% NEQ 0 (
  109.   ECHO. & ECHO Error when trying to copy/install AV definitions^^! & ECHO.
  110.   ECHO *.vdm from: "%defsSourceFolder%\"
  111.   ECHO to: "%defsTargetFolder%\" & ECHO.
  112.   ECHO Aborting... & ECHO.
  113.   PAUSE
  114.   EXIT /B 1
  115. )
  116.  
  117. :: Restart the MSSE service, just to make sure it shows the updated status,
  118. :: otherwise it may report the current AV definitions as "old".
  119. ECHO. & ECHO. & ECHO Restarting MSSE service... & ECHO.
  120. net stop "Microsoft Antimalware Service"
  121. net start "Microsoft Antimalware Service"
  122.  
  123. :: Remove temporary files & folders:
  124. DEL /F "%mssePrg%"
  125. DEL /F /Q "%defsSourceFolder%\*"
  126. RD "%defsSourceFolder%"
  127.  
  128. :: All done, yay Jack, fuck the pack!
  129. ECHO. & ECHO All done^^! & ECHO.
  130.  
  131. ENDLOCAL
  132.  
  133. EXIT /B 0

And here is the complete package for XP x64: [MSSE updater v2]

Unpack that, and run it like this: msse-updater-v2.bat.

One word of warning though: No longer updating the AV engine poses its own security risk, just remember [CVE-2017-0290]! While you’ll get the latest AV definitions this way, you should still keep an eye on any critical security holes reported for the Microsoft Malware Protection Engine itself!

Anyway, like before I recommend running msse-updater-v2.bat on a daily basis via task scheduler.

Nov 222016
 
FreeBSD IBM ServeRAID Manager logo

And yet another FreeBSD-related post: After [updating] the IBM ServeRAID manager on my old Windows 2000 server I wanted to run the management software on any possible client. Given it’s Java stuff, that shouldn’t be too hard, right? Turned out not to be too easy either. Just copying the .jar file over to Linux and UNIX and running it like $ java -jar RaidMan.jar wouldn’t do the trick. Got nothing but some exception I didn’t understand. I wanted to have it work on XP x64 (easy, just use the installer) and Linux (also easy) as well as FreeBSD. But there is no version for FreeBSD?!

The ServeRAID v9.30.21 manager only supports the following operating systems:

  • SCO OpenServer 5 & 6
  • SCO Unixware 7.1.3 & 7.1.4
  • Oracle Solaris 10
  • Novell NetWare 6.5
  • Linux (only certain older distributions)
  • Windows (2000 or newer)

I started by installing the Linux version on my CentOS 6.8 machine. It does come with some platform-specific libraries as well, but those are for running the actual RAID controller management agent for interfacing with the driver on the machine running the ServeRAID controller. But I only needed the user space client program, which is 100% Java stuff. All I needed was the proper invocation to run it! By studying IBMs RaidMan.sh, I came up with a very simple way of launching the manager on FreeBSD by using this script I called serveraid.sh (Java is required naturally):

  1. #!/bin/sh
  2.  
  3. # ServeRAID Manager launcher script for FreeBSD UNIX
  4. # written by GAT. http://www.xin.at/archives/3967
  5. # Requirements: An X11 environment and java/openjdk8-jre
  6.  
  7. curDir="$(pwd)"
  8. baseDir="$(dirname $0)/"
  9.  
  10. mkdir ~/.serveraid 2>/dev/null
  11. cd ~/.serveraid/
  12.  
  13. java -Xms64m -Xmx128m -cp "$baseDir"RaidMan.jar com.ibm.sysmgt.raidmgr.mgtGUI.Launch \
  14. -jar "$baseDir"RaidMan.jar $* < /dev/null >> RaidMan_StartUp.log 2>&1
  15.  
  16. mv ~/RaidAgnt.pps ~/RaidGUI.pps ~/.serveraid/
  17. cd "$curDir"

Now with that you probably still can’t run everything locally (=in a FreeBSD machine with ServeRAID SCSI controller) because of the Linux libraries. I haven’t tried running those components on linuxulator, nor do I care for that. But what I can do is to launch the ServeRAID manager and connect to a remote agent running on Linux or Windows or whatever is supported.

Now since this server/client stuff probably isn’t secure at all (no SSL/TLS I think), I’m running this through an SSH tunnel. However, the Manager refuses to connect to a local port because “localhost” and “127.0.0.1” make it think you want to connect to an actual local RAID controller. It would refuse to add such a host, because an undeleteable “local machine” is always already set up to begin with, and that one won’t work with an SSH tunnel as it’s probably not running over TCP/IP. This can be circumvented easily though!

Open /etc/hosts as root and enter an additional fantasy host name for 127.0.0.1. I did it like that with “xin”:

::1			localhost localhost.my.domain xin
127.0.0.1		localhost localhost.my.domain xin

Now I had a new host “xin” that the ServeRAID manager wouldn’t complain about. Now set up the SSH tunnel to the target machine, I put that part into a script /usr/local/sbin/serveraidtunnel.sh. Here’s an example, 34571 is the ServeRAID agents’ default TCP listen port, 10.20.15.1 shall be the LAN IP of our remote machine hosting the ServeRAID array:

#!/bin/bash
ssh -fN -p22 -L34571:10.20.15.1:34571 mysshuser@www.myserver.com

You’d also need to replace “mysshuser” with your user name on the remote machine, and “www.myserver.com” with the Internet host name of the server via which you can access the ServeRAID machine. Might be the same machine or a port forward to some box within the remote LAN.

Now you can open the ServeRAID manager and connect to the made-up host “xin” (or whichever name you chose), piping traffic to and from the ServeRAID manager through a strongly encrypted SSH tunnel:

IBM ServeRAID Manager on FreeBSD

It even detects the local systems’ operating system “FreeBSD” correctly!

And:

IBM ServeRAID Manager on FreeBSD

Accessing a remote Windows 2000 server with a ServeRAID II controller through an SSH tunnel, coming from FreeBSD 11.0 UNIX

IBM should’ve just given people the RaidMan.jar file with a few launcher scripts to be able to run it on any operating system with a Java runtime environment, whether Windows, or some obscure UNIX flavor or something else entirely, just for the client side. Well, as it stands, it ain’t as straight-forward as it may be on Linux or Windows, but this FreeBSD solution should work similarly on other systems as well, like e.g. Apple MacOS X or HP-UX and others. I tested this with the Sun JRE 1.6.0_32, Oracle JRE 1.8.0_112 and OpenJDK 1.8.0_102 for now, and even though it was originally built for Java 1.4.2, it still works just fine.

Actually, it works even better than with the original JRE bundled with RaidMan.jar, at least on MS Windows (no more GUI glitches).

And for the easy way, here’s the [package]! Unpack it wherever you like, maybe in /usr/local/. On FreeBSD, you need [archivers/p7zip] to unpack it and a preferably modern Java version, like [java/openjdk8-jre], as well as X11 to run the GUI. For easy binary installation: # pkg install p7zip openjdk8-jre. To run the manager, you don’t need any root privileges, you can execute it as a normal user, maybe like this:

$ /usr/local/RaidMan/serveraid.sh

Please note that my script will create your ServeRAID configuration in ~/.serveraid/, so if you want to run it as a different user or on a different machine later on, you should recursively copy that directory to the new user/machine. That’ll retain the local client configuration.

That should do it! :)

Dec 252015
 

NFC logoAnd here we have another NFC-enabled banking card for contactless payment, this time it’s a VISA credit card issued by [Card Complete Austria]. Might I add, this is one of the few companies which also still leisurely prints the full credit cards’ numbers on their invoices, which are then being sent out via regular postal mail, clearly showing off what those letters are on the envelope. Good Job, Card Complete, especially your reply regarding the matter, telling me that “it’s okay, no need to change that”! bash

In any case, I’ve written about this whole NFC thing before in much greater detail, [see here]! That article will show you the risks involved when working with potentially exploitable NFC cards, which mostly pose a data leaking problem. But you may wish to read the comments there as well, especially [this one here]. This shows that VISA cards tend(ed?) to be extremely vulnerable up to the point where a person walking by close enough to your wallet could actually draw money from your credit card without you noticing.

I have no idea whether this security hole still exists in todays’ NFC-enabled VISA cards, but I’m no longer gonna take that risk. Especially not since I don’t even need the NFC tech in that (or any other) banking card. Once again, we’re just gonna physically destroy the induction coil that powers the NFC chip in the card and which also operates as its antenna. Since I’m lazy, I didn’t do the “poor mans’ x-ray” photos this time (you can see how to do that in the first NFC post), just before and after pictures:

So, before:

As you can see, there are already signs of use on this card. Yeah, I’ve been lazy, running around with an NFC enabled VISA for too long already. Time to deal with it then:

Finding a good spot for my slightly oversized drilling head wasn’t so easy on this card, because the card numbers, signature field, magnetic strip and other parts like the hologram where in the way. But in the end I managed to drill a hole in about the right spot. Because of the heavy image editing you can’t see it, but I did damage the first of my credit cards’ numbers, but only slightly, so it should still be o.k., just a bit of paint that came off.

So, once again: You’re not welcome in my wallet, so bye bye, NFC!

Jun 302015
 

NFC logoNFC – or “near-field communication” technology is a now-booming system for sending and receiving small chunks of data over very short distances. You may have heard about modern cellphones supporting the system to read information from small tags – in essence chips you stick onto something to provide local, small pieces of information. This can serve augmented reality purposes for instance, in a sense at least, providing metadata about objects anywhere in the world.

It’s nowadays also being used for payment though, both in conjunction with smartphones and their active NFC chips as well as debit/credit banking cards and their integrated, passive NFC circuitry.

Index:

  1. NFC basics
  2. NFC-capable banking cards
  3. Using a modern Android phone to fetch data from a banking card
  4. The theft issue
  5. Modern cards may be more close-lipped
  6. Killing NFC for good

1.) NFC basics

So there are connections between active chips (say: phone to phone) as well as active-passive ones, in which case the active side (a phone, an electronic cashier) will talk to the passive one. In the latter case, the active chip will generate an electromagnetic field which reaches a copper coil embedded in the passive device or tag, creating enough inductive voltage to power that passive NFC chip.

According to information that can be found on the web and in some specifications, the range should be about 20cm with data transfer rates of 106kbit/s, 212kbit/s or 424kbit/s, and in some non-standard cases 848kbit/s. That’d be 13.25kiB/s, 26.5kiB/s, 53kiB/s or 106kiB/s respectively. The time to build up a connection is around one tenth of a second. There are NFC range extenders [like this one] for active chips however, which can boost the range up to almost 1 meter! And that’s were the alarms start ringing in my head.

Now, why is any of that dangerous to begin with? Because it’s being used for payments and because there may be a significant information leaking issue with some of those banking cards.

2.) NFC-capable banking cards

First of all, I’d like to thank two of my colleagues, which shall remain anonymous, for providing a.) a fully affected debit card and b.) a NFC-capable Android smartphone.

Let’s take a look at our affected card (click to enlarge images, as usual):

A PayPass-based NFC-capable debit card

A PayPass-based NFC-capable debit card, see that PayPass logo?

Now this is not my own card, so I didn’t have unlimited access to it. Since my own cards – both debit and credit – were not NFC-capable yet, I simply ordered a new one from my bank. There are other people on the web who used CT/X-Ray like [here] or [here] to visualize the internals of such cards, but I wanted a cheap solution that every layman can copy easily. As a matter of fact, any bright light (even a cellphones LED flash, when used as a torch) is sufficient, see here:

NFC coil visualized by normal light

The NFC coil on my new card, visualized by normal light, in this case a Sigma EVO X halogen lamp used for riding mountain bikes at night. This is a stitched image assembled from 11 individual photographs. And yes, I left my given name in the clear there. wink

For more clarity, see the next image:

Here I emphasized the coil a bit, so you'd know what to look for

Here I emphasized the coil a bit, so you would know what to look for

Now this coil has two functions: First – as mentioned above – it provides inductive voltage and with it up to 15mA of power to run the NFC chip and potentially some flash memory. Second, it also is the NFC chips’ antenna to properly receive the signal on NFCs 13.56MHz radio frequency spectrum. So, how about we talk to that chip a little ourselves, now shall we?

3.) Using a modern Android phone to fetch data from a Banking card

A Frenchman named [Julien Millau] luckily has developed an Android app called “Banking card reader NFC (EMV)”, which you can find on [Google Play] for free, including the source code as it’s licensed under the [Apache License, v2.0]. There are other apps too, tailored towards cards with local features (I’ll get to those later), but this is a good, generic one.

So what you’ll need is an NFC-capable Android smartphone, that app, and some banking card with NFC enabled. If you’ve got a chatty one on top of things, you can do this:

The basic card info might not look like much, as it’s supposed to show only the cards serial number. Some cards – like this one here – however give you the bank account number instead! Nice one. So this is our information leak #1.

As you can see on the other two images, the card also features some flash memory, holding a very interesting transaction log. By sending hexadecimal commands of the form 00 B2 NN 5C 00 to the card, where NN equals the log entry number, we can get a nice transaction log including amounts paid. So 00 B2 01 5C 00 would get log entry #1, 00 B2 08 5C 00 gets #8, 00 B2 0E 5C 00 gets #14 and so on. After decoding, you get the date and amount of money spent for each transaction, and that includes both NFC transactions and normal full-contact transactions, where you put your card into a real chip reader and enter your pin.

So no matter how you pay, it will be logged on such cards. And that log can be read. Given that NFC is completely pinless, we can just fetch such data without any authentication or encryption holding us back! That’s leak #2. Again, keep in mind that there are those range boosters for active NFC chips! If I put a powered NFC patch kit on my Android phone, in a worst-case scenario I could just walk by you and potentially fetch your transaction logs and bank account number!

Now that did raise a few eyebrows, which is why some banks have reacted to the issue, like my own bank too. But first, to another problem:

4.) The theft issue

Besides leaking information, there is another problem: As said, NFC access is pinless. It’s used for 25€ micropayments mostly, limiting the damage somewhat. Typically, you’ll get 3-5 payments before you have to plug the card back into an ATM or electronic cashier and re-authenticate it using the pin, after which you’ll get another 3-5 contactless payments activated. So with 5 usable payments, you can lose 125€, should your card be stolen. But it doesn’t end there.

In my own country, Austria, we also have an offline cash replacement technology called [Quick]Austrian Flag. With that, you can basically charge your banking card and carry the charge around like real cash. It’s being used for machines where online connections are economically unfeasible, like cigarette vending machines or pay and display machines, where you buy tickets for car parking. The maximum charge for Quick amounts to 400€ total.

Thing is, should you ever choose to charge the full amount, this triggers an activation of Quick-over-NFC! This is actually intentional, so that’s what you have to do to get to that feature, contactless offline payments. The real problem is, that with Quick-over-NFC, all limits are gone, which is confirmed [here]Austrian Flag. So a thief could just waste the entire charge of the card at his hearts’ content, upping the potential worst case loss to a full 525€! Holy hell, that does actually hurt already! Even if you call your bank and get the card locked due to theft, that money is still gone due to the offline nature of Quick. Just like real cash. So better hold on to your card, if you’ve already got that feature activated and money charged onto it!

But let’s get back to the data leak issue again:

5.) Modern cards may be more close-lipped

Banks aren’t entirely ignorant to the problem and related critizisms received, so some of them actually did try to improve the situation. When trying to read my brand-new card from Bank Austria for instance, what we get is this:

First of all, this newer card doesn’t give away my bank account number, but really just the serial number. That takes care of leak #1 to at least some degree. Secondly, the card doesn’t seem to have a transaction log anymore. At least it doesn’t hand one out using known commands. It can of course still be used for NFC payments using [PayWave] or, as it is in my case, [PayPass] and Quick, if activated. But yes, this is more secure, at least when considering the info leak.

But what if I just want to lock it down for good, once and for all?

We can never be sure that there really is no transaction log after all. Maybe we just don’t know the necessary commands. Plus, there still is the micropayment issue.

Now, some banks give you the option to deactivate the feature at your local branch bank, sometimes for free. Volksbank here does this for instance. Not sure how this works and whether it’s really final though. Others may give you the option to send you a NFC-free card, as my bank does. That is if you do know about it and proactively order one for 14€… By default they’d just send you a fully NFC-capable one before the old one expires.

Some banks do neither of the two. Which is why you may want to handle things yourself.

6. Killing NFC for good

Remember that poor mans’ X-Ray from above? All we need to do is to cut the copper coil to fully disable all NFC functionality. I used a microdrill for this, which may be slightly dangerous for the chip due to fast static charge buildup, but it worked fine in my case. You can also use a manual drill or even melt your way through with a soldering iron. Just make sure to not pick a spot that sits within the cards magnetic strip! In any case, we mark the spot first:

A red X above the NFC "wave" logo marks the spot

A red X above the NFC “wave” logo marks the spot. Notice that this card shows both the PayPass and that NFC wave logo.

A few seconds later, my cards’ NFC feature has effectively been dealt with. Tests with both Android phones and actual electronic cashiers have shown that yes, it’s truly gone. All the other full-contact functions like cash withdrawal and payments have also been tested and still work absolutely fine!

Universal Solution™: If it bugs you, just drill a hole in it!

Universal Solution™: If it bugs you, just drill holes in it ’till it’s dead!

So that’s it, no more contactless payments, no more reading information out of the card wirelessly, no more Quick-over-NFC (which only concerns Austrian people anyway, but yeah). Just make sure that the edge of the hole is properly deflashed, so your card won’t get stuck in any ATMs or whatever.

So, all of the good things are still there, and all of what I consider to be the bad things are now gone! Finally, I can put my tin foil hat off again.

Ah yes, tin foil! Before I forget it, another colleague of mine also tried to shield his card using tin foil instead. And indeed, that seems to be sufficient too, in case you don’t wanna physically modify your card. You can even buy readily-made shielded card sleeves to protect you from unauthorized NFC accesses, like [this one here].

I do prefer the final solution instead, but it’s up to you, the option to do it temporarily instead is there also.

So, stay safe! :)

Jul 172014
 

XViewerThe first release of XViewer is now available, providing TK-IP101 users with a way to still manage their installations using modern Java versions and operating systems without any blocker bugs and crashes. I have created a static page about it [here] including downloads and the statements required by TRENDnet. You can also see it on the top right of this weblog. This is the first fruition of TRENDnet allowing me to release my modified version of their original KViewer under the GPLv3 license.

As requested, all traces of TRENDnet and their TK-IP101 box have been removed from the code (not that there were many anyway, as the code was reverse-engineered from the byte code) on top of the rename to XViewer. In time, I will also provide my own documentation for the tool.

Since I am no Java developer, you shouldn’t expect any miracles though. Also, if anyone would be willing to fork it into yet another, even better version of the program, you’re of course welcome to do so!

Happy remote monitoring & managing to you all! :)

Edit: Proper documentation for SSL certificate creation using a modern version of [XCA] (The X certificate and key management tool) and about setting up and using XViewer & XImpcert has now also been made [available]!

Jul 162014
 

XViewer logoIn my [last post] I have talked about the older TRENDnet TK-IP101 KVM-over-IP box I got to manage my server over the network even in conditions where the server itself is no longer reachable (kernel crash, BIOS, etc.).

I also stated that the client software to access the box is in a rather desolate state, which led me to the extreme step of decompiling the Java-based Viewer developed by TRENDnet called KViewer.jar and its companion tool for SSL certificate imports, Impcert.jar.

Usually, software decompilation is a rather shady business, but I did this as a TRENDnet support representative could not help me out any further. After reverse-engineering the software, making it compatible with modern Java Runtime environments and fixing a blocker bug in the crypto code, I sent my code and the binary back to TRENDnet for evaluation, asking them to publish the fixed versions. They refused, stating that the product was end-of-life.

In a second attempt, I asked the guy for permission to release my version of KViewer including the source code and also asked which license I could use (GPL? BSD? MIT?). To my enormous surprise, the support representative conferred with the persons in charge, and told me that it had been decided to grant me permission to release KViewer under the GNU General Public License (GPL), as long as all mention of TRENDnet and related products are removed from the source code and program.

To further distinct the new program from its original, I renamed it to “XViewer”, and its companion tool to “XImpcert”, as a hommage to my server, XIN.at.

KVM host:port

The former KViewer by TRENDnet, that works up to Java 1.6u27

XViewer

XViewer, usable on JRE 1.7 and 1.8

Now, I am no Java developer, I don’t know ANYthing about Java, but what I did manage to do is to fix all errors and warnings currently reported by the Eclipse Luna development environment and the Java Development Kit 1.7u60 on the source code. While my version no longer supports Java 1.6, it does run fine on Java 1.7u60 and 1.8u5, tested on Windows XP Professional x64 Edition and CentOS 6.5 Linux x86_64. A Window closing bug has been fixed by my friend Cosmonate, and I myself got rid of a few more. In addition to that, new buttons have been added for an embedded “About” window and an embedded GPLv3 license as suggested by TRENDnet.

On top of that, I hereby state that I am not affiliated with TRENDnet and that TRENDnet of course cannot be held liable for any damage or any problems resulting from the use of the modified Java viewer now known as XViewer or its companion tool XImpcert. That shall be said even before the release, as suggested to TRENDnet by myself and subsequently confirmed to be a statement required by the company.

In the very near future, I will create a dedicated site about XViewer on this weblog, maybe tomorrow or the day after tomorrow.

Oh and of course: Thanks fly out to Albert from TRENDnet and the people there who decided to grant me permission to re-release their viewer under the GPL! This is not something that we can usually take for granted, so kudos to TRENDnet for that one!