# Investigating a tricky network problem with Python, Scapy and other network tools

We’ve had a fairly long-term issue at work with connectivity to one of our application servers. Every now and then you can’t login or connect and it has seemed fairly random. This finally annoyed myself and a customer enough that I had to look into it.

The connection is made to the server on port 1494 – Citrix ICA. Initially we suspected that the .ica file downloaded and opened by the Citrix Receiver software was incorrect or corrupt, but inspection and testing of this showed that it was OK. It really did look like the connection was just being randomly rejected.

It seemed that myself and a single customer were having far more frequent issues that other users. Of course it could just be my tolerance for whinging is lower than my colleagues.

Note that nearly all of the below was done on OS X – syntax of some of these commands differs under Linux and Windows. I have changed the host IP for security reasons.

## telnet

Most applications that listen on a TCP port will respond to telnet, even if they don’t send anything back. Telnet is almost raw TCP – it has some control and escape sequences layered on top, but it is very simple at a protocol level.

ICA responds when connecting by sending back “ICA” every 5s:

But every now and then I was getting nothing back:

Oddly, whenever the Citrix Receiver failed to launch, I wasn’t always having problems with telnet, and vice versa. This is good – we’ve replicated the issue with a very simple utility using raw TCP rather than having to look into the intricate details of Citrix and whatever protocol it uses.

## tcpdump

So let’s fire up tcpdump to see what happens when the connection is working. tcpdump is a command line packet analyser. It’s not as versatile or as easy to use as Wireshark, but it is quick and easy. You can use tcpdump to generate a .pcap file which can then be opened in Wireshark at a later date – this is good for when you are working on systems with no UI.

I filtered the tcpdump output to only show traffic where one of the two IPs was the server.

This all looks fairly normal – my laptop is sending a SYN to the server, which responds with SYN-ACK, and then I respond with an ACK. You can see this in the “Flags” part of the capture. S, S., . (. means ACK in tcpdump). Everything then progresses normally until I close the connection.

However, when the connection fails:

I get nothing back at all – it’s just telnet trying the connection again and again by sending SYNs. I was expecting part of the connection to succeed, but this looked like the host just wasn’t responding at all. This might indicate a firewall or network issue rather than a problem with Citrix.

I used Wireshark on the server side to confirm that no traffic was getting through. I could see the successful connections progressing fine, but I could see nothing of the failing connections. I wanted to check both sides because there were a number of potential scenarios where a client could send a SYN and not get a SYN-ACK back:

1. Client sends SYN, server never sees SYN.
2. Client sends SYN, server sees SYN, server sends SYN-ACK back which is lost.
3. Client send SYN, server sees SYN, choses not to respond.

It seemed that 1 was happening here.

So what was causing this? Sometimes it worked, sometimes it didn’t. Did it depend on what time I did it? Was there another variable involved?

## mtr

Let’s check for outright packet loss. ping and traceroute are useful for diagnosing packet loss on a link, but it can be hard work working out which step is causing problems. Step in mtr, or my trace route. This provides a tabular, updating output which combines ping and traceroute with a lot of useful information.

I let this run for a while and observed virtually no packet loss. It’s important to note that it is using ICMP pings – not TCP as Citrix uses. ICMP messages can be dealt with differently to TCP. mtr does support TCP pings but I can’t get it to work under OS X.

## Python and telnetlib

So wrote a small Python program using the telnetlib module to periodically connect to the port using telnet and indicate when there were problems. The output was simple graphical representation so that I could spot any timing patterns.

So this prints a . for a successful connection and * for unsuccessful. After every 16 packets, the number of failures/total is printed.

What can we note?

• There is some vague pattern there, often repeating every 8 packets.
• The rate of failed to successful connections is nearly always 25%.
• Varying the WAITTIME (the time between connections) had some interesting effects. With short times, the patterns were regular. With longer times they seemed less regular.
• Using the laptop for other things would disrupt the pattern but packet loss stayed at 25%. Even with very little other traffic the loss was 25%.

What varies over time, following a pattern, but would show behaviour like this?

The source port.

Every TCP connection not only has a destination port, but a source port – typically in the range of 1025 to 65535. The source port is incremented for each connection made. So the first time I telnet it would be 43523, the next time 45324, then 45325 and so on. Other applications share the same series of source ports and increment it as they make connections.

When I run the test program with a short wait time, there is very little chance for other applications to increment the source port. When I run it with a longer wait time (30s or so), many other applications will increment the source port, causing the pattern to be inconsistent.

It really looked like certain source ports were failing to get through to the server.

## netcat

I had to test this theory. You can’t control the source port with telnet, but you can with the excellent netcat (or nc, as the command is named). “-p” controls the source port:

As you can see – connections from 1025 and 1027 always succeed and 1026 always fail. I tested many other ports as well. We have our culprit!

## Python and Scapy

Now, can we spot a pastern with the ports that are failing and those that are succeeding? Maybe. I needed something to craft some TCP/IP packets to test this out. I could use netcat and a bash script, but I’ve recently learnt about Scapy, a packet manipulation module for Python. It’s incredibly flexible but also very quick and easy. I learnt about it after reading the book Violent Python, which I would recommend if you want to quickly get using Python for some real world security testing.

The script needs to connect to the same destination port from a range of source ports and record the results. With Scapy, half an hour later, I have this (note, I did have some issues with Scapy and OS X that I will need to go over in another post):

This produced really helpful output. The failed packets are highlighted in the excerpt below:

At this point in the port range it appears that packets ending in 001 or 110 are failing.

Move further down the port range and packets ending 000 and 111 are failing.

In fact, at any given point it seems that the packets failing are either 000/111, 001/110, 010/101, 011/100 – complements of one another. Higher order bits seem to determine which pair is going to fail.

Curious!

What makes this even stranger is that changing the destination port (say, from 1494 to 80) gives you a different series of working/non-working source ports. 1025 works for 1494, but not 80. 1026 works for both. 1027 works only for 80.

All of my tests above have been done on my laptop over an internet connection. I wanted to test a local machine as well to narrow down the area the problem could be in – is it the perimeter firewall or the switch the server is connected to?

## hping3

The local test machine is a Linux box which is missing Python but has hping3 on it. This is another useful tool that allows packets to be created with a great degree of flexibility. In many respects it feels like a combination of netcat and ping.

What does all this mean?

• First parameter is the IP to connect to.
• -s is the start of the source port range – hping3 will increment this by 1 each time unless -k is passed
• -S means set the SYN flag (similar to the Scapy test above)
• -i u100000 means wait 100000us between each ping
• -c 20 means send 20 pings
• -p 1494 is the offending port to connect to

And what do we get back?

The same sort of packet loss we were seeing before. Oddly, the source ports that work differ from this Linux box to my laptop.

Here’s where it gets even stranger. I then decided to try padding the SYN out with some data (which I think is valid for TCP, though I’ve never seen a real app do it and mtr’s man page says it isn’t). You use -d 1024 to append 1024 bytes of data. I first tried 1024 bytes and had 20% packet loss as before. They I tried 2048 bytes:

Wait? All the packets are now getting through?

Through a process of trial and error I found that anything with more than 1460 bytes of data was getting through fine. 1460 bytes of data + 20 bytes TCP header + 20 bytes IP header = 1500 bytes – this is the Ethernet MTU (Maximum Transmit Unit). Anything smaller than this can be sent in a single Ethernet frame, anthing bigger needs to be chopped up into multiple frames (although some Ethernet networks allow jumbo frames which are much bigger – this one doesn’t).

I then ran the hping3 test from my laptop and found that altering the data size had no impact on packet loss. I strongly suspect that this is because a router or firewall along the way is somehow modifying or reassembling the fragmented frames to inspect them, and then reassembling them in a different way.

At this point I installed the Broadcom Advanced Control Suite (BACS) on the server to see if I could see any further diagnostics or statistics to help. One thing quickly stood out – a counter labelled “Out of recv. buffer” was counting up almost in proportion to the number of SYN packets getting lost:

This doesn’t sound like a desirable thing. It turns out the driver is quite out of date – maybe I should have started here!

## Conclusion

I’m still not sure what is going on here. The packets being rejected do seem to follow some kind of pattern, but it’s certainly not regular enough to blame it on the intentional behaviour of a firewall.

At this point we are going to try upgrading the drivers for the network card on the sever and see if this fixes the issue.

The point of all of the above is to show how quick and easy it can be to use easily available tools to investigate network issues.

# Programming a Texecom Premier Elite 12-W using a FTDI cable

The Texecom Premier Elite series of alarms can be programmed using Windows software called Wintex. This makes setting up these alarms far easier than using the keypad menus – they have hundreds of options and settings.

Texecom sell two products to connect to these alarms using Wintex – PC-COM (a serial port adapter ~£20) and USB-COM (a USB to serial adapter ~£35) . I strongly suspected these were just serial TTL converters, but I was concerned that there might be some jiggery pokery stopping this from working. Some software requires very specific VID (vendor ID) and PID (product IDs) on the USB device. Some software uses custom drivers. Others use microcontrollers and obfuscation to make sure you buy the genuine product.

As an avid hardware hacker, I have a lot of USB to TTL serial converters. The most useful (and reliable, in terms of drivers) are FTDI cables based on the FT232R chips. Genuine cables are ~£14, breakout boards can be as low as £2 on eBay. So let’s try and get connected to the Premier Elite 12-W using this cable.

There are two ports on the Premier Elite board – Com Port 1 and Com Port 2. These are 5 pin Molex connectors with only 4 pins populated. There didn’t seem to be a direct pin-out in the manual, so from the manual and with a multimeter we have:

Pin 1 – 12V

Pin 2 – nothing

Pin 3 – GND

Pin 5 – Transmit

Com port 1 and 2

Signalling appears to be 5V. So, get out the 5V FTDI cable (they come in different voltages):

A 5V FTDI cable

Pin 1 – GND

Pin 2 – Don’t care

Pin 3 – Don’t care

Pin 4 – Transmit

Pin 6 – Don’t care

We then need to connect transmit to receive, receive to transmit, and common ground. This terminology might be at odds with alarm equipment – RS485 buses often label one wire “T” and it means transmit on the master, receive on the slave. I suspect this simplifies wiring as you just connect all “T” wires.

So, to connect the two:

Texecom – FTDI

Pin 3 GND – Pin 1 GND

Pin 4 Receive – Pin 4 Transmit

Pin 5 Transmit – Pin 5 Receive

Just be cautious of the 12V on pin 1 of the alarm board – sending this up the chuff of your PC will result in damage.

Using jumper cables, you could make up a proper cable

Find out which COM port the FTDI cable is using (generally go into Device Manager, and it will be listed there).

COM6 is my FTDI cable

Go into Wintex and change the PC-COM port to this COM port:

Change Wintex to use COM6

Connect, receive settings, change settings, and monitor Ricochet devices to your heart’s content!

And start setting things up

# First look at the TI MSP-SA430-SUB1GHZ spectrum analyser

TI are running a “Back to school” promotion, and as part for this they are selling a simple sub-1GHz spectrum analyser for $25 (with free shipping to the UK). It uses a CC430 chip, which is an MSP430 microcontroller plus an RF front-end. Seems like a deal, and could be used for something like RFCat. It turned up in a couple of days, marked as a “Sample” so no duty or VAT to pay. It’s in a nice plastic case, which I immediately ripped off. Construction is good quality – the SMA connector is bolted on, big ground planes. It connects to a PC using USB, with cable supplied. There is also a SMA antenna provided: You can download the spectrum analyser software from the TI site, although it does come with a CD as well. This is our baby monitor transmitting white noise: I’ve only had a quick play about with it… it works, sort of. It’s buggy though and certainly not as good as the software that comes with the RF Explorer. Key points: • Covers 300-348MHz, 389-464MHz and 779-928MHz – quite gappy but covers ISM. • Relatively quick to update on the screen. • Can configure frequency, span, RBW and FSW. Minimum span is 0.2MHz, minimum RBW is 58kHz, minimum FSW is 1kHz. It seems that a lot of values here cause no display – span of 0.5MHz stops the display working. • Does realtime, max, average display. • Numeric entry validation is really irritating – it limits you whilst entering the value rather than after. • A lot of the UI doesn’t seem to like Windows 8 with scaling set to <>100%. • Crashes relatively frequently. • Mentions firmware and calibration data in the app, so it might be relatively well calibrated. • Source code for the app is available. I’d be annoyed if I spent$250, but it’s great for £25. There is a lack of documentation on the hardware – there are a lot of passives between the SMA and CC430. It would be nice if this could be used for transmit as well as receive but I expect the passives will get in the way.

# Straight Pride UK having a shot at the Streisand effect

A blogger called Oliver Hotham emailed a set of questions to an organisation called “Straight Pride UK”. They responded, Oliver blogged about it, and then was served with a DMCA takedown notice. WordPress generally just give in to these.

Oliver decided he didn’t want trouble – WordPress said his whole blog would be suspended if he posted it again. Ian at Technovia made the content available again. I’m mirroring it here. It would be great if more people could do the same – the more people that share this, the less can be done.

## Oliver’s original post

There has never been a better time to be gay in this country. LGBTI people will soon enjoy full marriage equality, public acceptance of homosexuality is at an all time high, and generally a consensus has developed that it’s really not that big of a deal what consenting adults do in the privacy of their bedrooms. The debate on Gay Marriage in the House of Commons was marred by a few old reactionaries, true, but generally it’s become accepted that full rights for LGBTI people is inevitable and desirable. Thank God.

But some are deeply troubled by this unfaltering march toward common decency, and they call themselves the Straight Pride movement.

Determined to raise awareness of the “heterosexual part of our society”, Straight Pride believe that a militant gay lobby has hijacked the debate on sexuality in this country, and encourage their members, among other things, to “come out” as straight, posting on their Facebook page that:

“Coming out as Straight or heterosexual in todays politically correct world is an extremely challenging experience. It is often distressing and evokes emotions of fear, relief, pride and embarrassment.”

First of all, what prompted you to set up Straight Pride UK?

Straight Pride is a small group of heterosexual individuals who joined together after seeing the rights of people who have opposing views to homosexuality trampled over and, quite frankly, oppressed.

With the current political situation in the United Kingdom with Gay Marriage passing, everyone  is being forced to accept homosexuals, and other chosen lifestyles and behaviours, no matter their opposing views. Straight Pride has seen people sued, and businesses affected, all because the homosexual community do not like people having a view or opinion that differs from theirs.

Straight Pride aims are neutral and we do not follow religion, but we do support people who are oppressed for being religious. Only today, Straight Pride see that two homosexual parents are planning to sue the Church because they ‘cannot get what they want’. This is aggressive behaviour and this is the reason why people have strong objections to homosexuals.

You say that one of your goals is “to raise awareness of the heterosexual part of society”. Why do you feel this is necessary?

The Straight Pride mission is to make sure that the default setting for humanity is not forgotten and that heterosexuals are allowed to have a voice and speak out against being oppressed because of the politically correct Government.

Straight Pride feel need to raise awareness of heterosexuality, family values, morals, and traditional lifestyles and relationships.

Your website states that “Homosexuals have more rights than others”. What rights specifically do LGBTI people have that straight people are denied?

Homosexuals do currently have more rights than heterosexuals, their rights can trump those of others, religious or not. Heterosexuals cannot speak out against homosexuals, but homosexuals are free to call people bigots who don’t agree with homosexuality, heterosexuals, religious or not, cannot refuse to serve or accommodate homosexuals, if they do, they face being sued, this has already happened.

Straight Pride believe anyone should be able to refuse service and speak out against something they do not like or support.

There is a hotel in the south of England, called Hamilton Hall which only accepts homosexuals – if this is allowed, then hotels should have the choice and right to who they accommodate.

What has been the response to your campaign?

The response to Straight Pride’s formation has been as expected; hostile, threatening, and aggressive. Homosexuals do not like anyone challenging them or their behaviour.

We have had support from many people saying that if homosexuals can have a Pride March, and then equality should allow Heterosexuals to have one too. After all, the homosexual movement want everyone to have equality.

Why would you say that heterosexuality the “natural orientation”?

Heterosexuality is the default setting for the human race, this is what creates life, if everyone made the decision to be homosexual, life would stop. People are radicalised to become homosexual, it is promoted to be ‘okay’ and right by the many groups that have sprung up.

Marriage is a man and a woman, homosexuals had Civil Partnerships, which was identical to Marriage with all the same rights, they wanted to destroy Marriage and have successfully done so.

If you could pick one historical figure to be the symbol of straight pride (just as figures like Alan Turing, Judith Butler or Peter Tatchell would be for Gay Pride) which would you choose?

Straight Pride would praise Margaret Thatcher for her stance on Section 28, which meant that children were not  taught about homosexuality, as this should not on the curriculum.

More recently, Straight Pride admire President Vladimir Putin of Russia for his stance and support of his country’s traditional values.

How do you react to anti-gay attacks and movements in Russia and parts of Africa?

Straight Pride support what Russia and Africa is doing, these country have morals and are listening to their majorities. These countries are not ‘anti-gay’ – that is a term always used by the Homosexual Agenda to play the victim and suppress opinions and views of those against it.

These countries have passed laws, these laws are to be respected and no other country should interfere with another country’s laws or legislation.

We have country wide events which our members attend, and ask people their opinions and views, on such event at Glastonbury this year was very positive with the majority of people we asked, replied they were happily heterosexual.

For the record, Straight Pride did not respond to these questions:

“Pride” movements such as Gay Pride and Black Pride were making the argument that the stigma against them meant that proclaiming their “pride” was an act of liberation from oppression. Can being heterosexually really compare?

A problem that Gay rights activists cite is the issue of bullying, and the effect this can have on young LGBT people. Do you think a similar problem exists with straight children being bullied by gay children?

I will obviously add to this if they do respond.

# Reverse engineering Megamos Crypto?

Some of you might have read the stories going around a few weeks ago – “Scientist banned from revealing codes used to start luxury cars“. The short of it is that a security researcher has had a injunction imposed on him, preventing him from publishing a paper. The paper reveals security problems in the Megamos Crypto system used in the immobiliser system of many cars. Volkswagen are not happy – it really seems they want this shut down.

(As an aside, I hate the way that mainstream media refers to “codes” – it can mean source code, executables, an algorithm, or even a secret key. Often used interchangeably in the same article)

Details were a little scant, but last night the EFF passed comment, based on the court’s decision.

I am not a lawyer – I’m not going to pass judgement on the legal side. But what is interesting is how the researchers got hold of the Megamos Crypto algorithm. It wasn’t by decapping the chips in the transponders, it wasn’t from observing them black-box, it wasn’t from looking at an embedded software implementation – they took a Windows program used to clone car key transponders and reverse engineered that.

In terms of working out how Megamos was implemented, someone else had already done the hard work. This left the researchers to perform detailed cryptanalysis of the algorithm and – rumour has it – find some serious problems.

The piece of software is called “Tango Programmer“, a third party tool (software and hardware) used to make transponders. This has been available since at least 2009.

Tango Programmer is readily available, but it appears that it needs to be bought alongside a physical programmer. I strongly suspect that the software would be available on file sharing sites illegally, or possibly even legitimately on another site if you look hard enough.

Another company, Bicotech, produce a similar tool called RwProg. The software is downloadable from their website. The executable is packed, but I am sure it would be perfectly possible to reverse engineer the algorithm from the binary.

The court decision itself contains valuable information on Megamos as well, notably from paragraphs 4 and 5:

In detail the way this works is as follows: both the car computer and the transponder know a secret number. The number is unique to that car. It is called the “secret key”. Both the car computer and the transponder also know a secret algorithm. That is a complex mathematical formula. Given two numbers it will produce a third number. The algorithm is the same for all cars which use the Megamos Crypto chip. Carrying out that calculation is what the Megamos Crypto chip does.

When the process starts the car generates a random number. It is sent to the transponder. Now both computers perform the complex mathematical operation using two numbers they both should know, the random number and the secret key. They each produce a third number. The number is split into two parts called F and G. Both computers now know F and G. The car sends its F to the transponder. The transponder can check that the car has correctly calculated F. That proves to the transponder that the car knows both the secret key and the Megamos Crypto algorithm. The transponder can now be satisfied that the car is genuinely the car it is supposed to be. If the transponder is happy, the transponder sends G to the car. The car checks that G is correct. If it is correct then the car is happy that the transponder also knows the secret key and the Megamos Crypto algorithm. Thus the car can be satisfied that the transponder is genuine. So both devices have confirmed the identity of the other without actually revealing the secret key or the secret algorithm. The car can safely start. The verification of identity in this process depends on the shared secret knowledge. For the process to be secure, both pieces of information need to remain secret – the key and the algorithm.

In standard cryptography terminology:

A car $\text{C}$ and a transponder $\text{T}$ share a secret key $K$. A pseudo-random function family $\textsf{PRF}$ is keyed using key $K$ i.e. $\textsf{PRF}_K$. The output from this PRF is split into two parts $F$ and $G$.

1. $\text{C}$ generates a random number $r$.
2. $\text{C}$ calculates $(F,G) = \textsf{PRF}_K(r)$
3. $\text{C} \to \text{T}: r, F$
4. $\text{T}$ calculates $(F',G') = \textsf{PRF}_K(r)$
5. $\text{T}$ checks that $F = F'$
6. $\text{T} \to \text{C}: r, G$
7. $\text{C}$ checks that $G = G'$

This process means that the transponder believes the car knows the key and PRF, and the car believes the transponder knows the key and PRF. They should have authenticated themselves with each other.

What is a PRF? A pseudo-random function is similar in many respects to a psuedo-random number generator (PRNG), except instead of sequentially generating output, you can randomly access any of the outputs using an index (r in the example above). The key is analogous to the seed of the PRNG. Using a certain key, a given input will map to a determined output.

Importantly, the output of a PRF should be indistinguisable to an observer from a random function, and by extension you should not be able to derive the key even if inputs, outputs, or free access to the function is given. You should also not be able to tell which PRF is in use even if you can control the inputs and read the outputs.

So – if this is a secure, solid, verified PRF, the protocol should be secure, even if we know what the PRF is. The only thing that needs to be kept secret is the key.

But the court decision says:

The verification of identity in this process depends on the shared secret knowledge. For the process to be secure, both pieces of information need to remain secret – the key and the algorithm.

This suggests a few things:

1. The PRF used is not secure
2. They don’t know what they are talking about

Both are entirely possible, but I would strongly suspect that the PRF has issues and they want to keep it secret. This would be a clear example of “security through obscurity”.

How could a PRF be insecure?

• Using one or more input/output pairs, it might be possible to derive the key.
• You might not need a key to derive the output given the input.
• The key length might not be long enough to prevent bruteforcing.
• F and G might not depend on the whole key i.e. you might be able to calculate G given part of the key.

The protocol itself might suffer from further issues:

• There does not appear to be any protection from replay attacks (prevented from being used as a direct vulnerability because the authentication is bidirectional).
• Is the random nummber actually random? Does it matter if it isn’t? If they are re-used (i.e. it’s not a nonce), it probably does matter.
• The transponder can bypass the check for F = F’ – it can be a “yes” key. If we don’t need the entire key to compute G, this matters.
• The key might be constant across an entire line or make of cars. Recover the key from one transponder and there would be no secrets left.
• The key might be derived from an open piece of information like the car VIN number
• The key might be derived from something like the manufacture date/time of the car, massively reducing keyspace
• Probably a million more things

Let’s look at the attacks described in the court decision.

Firstly, note:

The attacks are not, themselves, trivial things to do. However, they allow someone, especially a sophisticated criminal gang with the right tools, to break the security and steal a car.

This makes it sound like some of these attacks are practical i.e. it won’t take 2 weeks of effort after decapping and reading the key from EEPROM.

Attack 1:

One attack relies on weaknesses in the secret keys that are used in certain cars. That “weak key” weakness arises because certain car makers have used weak secret keys which are easier to guess than they need to be. In effect, it is a bit like using the word “password” for a password.

As I mentioned above, there are a number of situations where the keys chosen might be poor. It might be the case that the researchers need 2 weeks to work out the key given a car and transponder, but then if the same key is used across all cars, it doesn’t really matter.

Attack 2:

Another is concerned with key updates. The details do not matter.

Attack 3:

The third attack relates to weaknesses in the Megamos Crypto algorithm itself. The academics explain this attack in the paper, and, as I say, the paper also sets out the whole of the algorithm. It is these two elements that the claimants seek to prevent publication of. The claimants wish to remove the Megamos Crypto algorithm and information about the attack based on the weakness in it from the paper.

This is where we get to the point that it sounds like the PRF is not secure. It sounds like this attack may take days of work with access to both the car and transponder.

This could be like the insecurities found in Keeloq. The first step was determining the details of the algorithm. The first few papers detailed weaknesses that meant the protocol was insecure, but the weakness could not practically be exploited. After this, papers were released that detailed faster, more effective attacks, until finally we are at the stage where Keeloq can be called “broken”.

A quick look at some of the software

I haven’t got hold of Tango Programmer, but I do have RwProg up and running. Here is a screenshot:

What can we tell from this? Well, the crypto key looks to be 96bits long – too long to bruteforce.

There are a few videos as well:

Nothing really groundbreaking. I can’t see how the software reads and then writes the crypto key.

## Conclusion

Regardless of the court decision, it looks like there is enough information out there for other people to start work on this. Download the software, maybe buy Tango Programmer, reverse the algorithm and then let the world loose on it!

# A remedy to the anti-NHS bile…

Last year, I was suffering from serious anxiety around my infant son getting ill. It was stopping me sleeping and eating. I had a couple of panic attacks. I ended up speaking to a psychotherapist to help me control these feelings. In retrospect, it feels like a part of this anxiety centred around a lack of confidence in the medical help available to us. My confidence had been eroded by the media picture of the NHS.

Day after day I see the NHS being attacked at every level. The people running it are useless. The nurses lack compassion. The doctors can’t speak English. It goes on and on.

A big thing that helped my anxiety was following doctors, nurses, paramedics and other healthcare professionals on twitter. That might sound trite, but I really think it helped. I could see that there are a huge number of people in the NHS who are really passionate and involved in their jobs.

This post is probably just going to become a hugely involved version of a “follow Friday”, but I thought I would highlight some of the best NHS twitter accounts out there. If I have missed you, I am sorry. If I have got your title a bit wrong, also sorry!

• @DrRanj - a paeds doctor who does a lot of really good TV and media work. Comes across as personable and honest.
• @Dr_Ayan - a GP who is also the BBC World News medical expert. Heavily into evidence based medicine, never afraid to say what he means.
• @kiershiels - peads doctor who you might remember from the first series of “Junior Doctors” on the BBC. Clearly passionate about his work. The most middle class man in the UK.
• @SepsisUK – The UK Sepsis Trust – the account is run by Dr Ron Daniels, an ITU doc. Always willing to engage. Sepsis kills more than 37k people each year in the UK, and for each person it kills it can destroy another person’s life. I urge everyone to take a look at what sepsis is and how to recognise it. Don’t rely on doctors and nurses to pick it up! My partner was admitted to hospital with suspected sepsis and because she was treated promptly and correctly, it was nipped in the bud.
• @DoctorChristian - I might not always agree with him or his shirts, but he does an awful lot to make the public aware of problems and how to solve them.
• @DrCJohn - anaesthetist who seems to need to learn something new each day. Less celeb that the ones above, but just as involved.
• The paramedics – @meditude@HewettChris, and @StretcherMONKEY. These three accounts couldn’t be any more different to each other, but there is no doubt they all have the same goals.
• And finally, the ambulance control room, @AmbControl999. Honest and informative.

Give these guys a go. Or any of the other NHS staff on twitter. I’m almost certain it will leave you impressed rather than saddened.

Don’t blame what is happening to the NHS on these guys – blame it on our ridiculous government.

Thanks also has to go to the West Middlesex UCC which has seen me and my son several times, and seen us quickly and given us the best possible standards of care.

# Another muddled, seriously misguided petition

Petitions seem to have become the de facto form of protest, somewhere between tutting and writing a strongly worded letter.

So often they are badly written, require previous knowledge of the situation, and don’t have a clear goal.

This morning, a hot topic of conversation has been how Twitter deals with reports of abuse, in relation to alleged rape threats made to @CCriadoPerez. Of course – a petition has started.

EDIT – the petition has been edited to add something about changing T&Cs. This is a step in the right direction, I still feel the petition is very poor. I also really dislike the fact you can edit petitions on change.org – it seems dishonest to let 8k people sign something and then alter it. The screenshot still stands below.

I really don’t want to comment on the alleged threats themselves, but the response and what people expect of Twitter.

## Why direct this at Mark S Luckie?

The first thing I find really odd is how Mark S Luckie has become part of this issue. He is the Manager of Journalism and News at Twitter. He isn’t involved with how abuse is reported or dealt with on Twitter. I’m not sure what people expected from him. It seems unfair to direct this campaign towards him.

After many tweets were directed at Mark, he changed his account to be protected, preventing most people from seeing his tweets.  I think it would be massively unprofessional for him to personally comment on the situation. At most he could direct people towards the proper channels for reporting abuse.

Oddly, some have interpreted Mark’s actions as “twitter says it’s not their problem”

I really don’t see how one employee protecting their account says this. The big issue here is how Twitter deals with abuse in general, not how one employee has handled one particular instance of abuse. Conflating the two seems petty.

## Zero-tolerance? You are joking?

How can a multi-national micro-blogging platform with half a billion users and millions of tweets a day adopt a zero-tolerance policy on abuse?

Just think for a second about how this could possibly work.

Which country’s laws would Twitter uphold? What is perfectly fine in one country isn’t in another.

What happens if someone calls you a name you don’t like? Report it as abuse!

Someone was mean about a blog post you wrote? You can shut them down by reporting it as abuse.

Zero-tolerance means you would need to side with people who are easily offended and uphold laws in countries where free speech is oppressed. This isn’t what Twitter is about.

It’s just not possible or desirable to adopt a zero-tolerance stance on abuse. By aiming for a ridiculous goal you are never going to achieve it.

## Totally missing the point

Twitter has procedures for reporting abuse already. I’ve used them and they worked for me.

I get the impression they don’t always work. It seems like the abuse team is often overworked. This is the real issue –  how Twitter actually deals with reports of abuse.

@CCriadoPerez seems to have managed to find out how to report abuse and she has also contacted the police. I would hope that both Twitter and the police handle the reports appropriately.

If @CCriadoPerez doesn’t get an appropriate response, then there is a problem. I don’t think enough time has passed to pass judgement on this.

I am not sure how adding an abuse button to tweets is going to solve any problem. If the abuse in a tweet is serious enough to warrant getting a member of Twitter staff to investigate, surely it is worth your effort to go the page where you need to report abuse? Inundating the abuse team with single-click abuse reports is not going to help in any way.

# Why you should say no to the #SayNoToTheBountyMutiny campaign.

I’m not a mummy blogger clearly. I don’t frequent MumsNet or Bounty. So this post may not be too interesting to many regular readers.

There is currently a campaign to remove direct sales representives from maternity wards. The very short story is that a company called Bounty pays the NHS money to get access to maternity wards. Many people, including myself, don’t think this should be allowed. My motivation behind this is simple – Bounty have no motivation to improve health outcomes so they have no place in a healthcare setting.

This post isn’t about my motivations though, it is about the counter-campaign that has sprung up, #SayNotToTheBountyMutiny. I don’t know how it started or a timeline of events, but the central part of the campaign appears to be a petition on change.org.

Go ahead and read the petition. You’ll come away wondering what several parts of it could possibly mean, or why they are relevant. I’ll be blunt – it’s badly written. It’s not directed at any one person (just the “UK Government”) and there is no suggestion to how you could achieve their goal (“Ignore Mumsnet over their Bounty Mutiny”).

I asked for clarification on a number of parts of it. The person who started the petition, Claire Curran (@TheLazyGirlBlog), clarified some of the points on twitter, and I thought I would summarise what I took away from that discussion here.

I have a number of problems with her position and way she has represented her arguments.

## False dilemma

Claire has created a false dilemma. Apparently, the two choices are:

1. Campaign to stop Bounty reps on wards
2. Campaign to make the NHS better

It’s absolutely clear that this is not a binary choice. I can do both. Using a false dilemma is a common way of trying to strengthen your argument, especially when presenting it to those who aren’t fully informed of the background.

It also heavily relies on an appeal to worse problems. Why are you trying to fix this small issue when there are bigger issues? The same kind of thing you hear from chuggers every day (“Why did you buy that expensive sandwich from Pret when you could be giving an African child water for 6 months?”).

I don’t know if using these two fallacies are conscious decisions or just lack of logical reasoning.

## Some kind of issue with MumsNet

I first heard about the campaign from Dr Alice Roberts, who had just had her baby and wrote an article about Bounty in the Guardian. I didn’t know of any particular MumsNet involvement until the #SayNoToTheBountyMutiny campaign started.

Many of Claire’s tweets, blog posts, and the petition discuss MumsNet and how they are in competition to Bounty. The final words of her petition are “Ignore Mumsnet over their Bounty Mutiny” – a tight focus on MumsNet again.

There have been insults directed at MumsNet:

From Claire’s comment on a Telegraph article about her petition:

Yes, I am very aware of Mumsnet and it’s forums as a former member who left down to a disgraceful level of bullying on the forums which the Moderators ignore. I am very surprised they are backing/highlighting a campaign (I say Mumsnet are the main campaigners purely because  the majority of tweets or blogs posted in support of the Mutiny come from Mumsnet’s feed, Justine Roberts (its founder) and Mumsnet members) where new Mothers are portrayed as vulnerable as most bullying I witnessed was of Mothers admitting to vulnerability in their parenting.  However, this is not the root cause of why I am against the mutiny.

It’s not the root cause, but it certainly sounds like it is part of the cause.

Then the petition itself:

However, we believe the bigger picture is that Bounty and it’s forums are in direct competition with Mumsnet. Bounty works with Bloggers and has done for many years- in competition with Mumnets own, very new by comparison Blogger Network

I think we are supposed to infer something from this. Are MumsNet out to destroy Bounty? Do they want their blogging traffic? Who knows, without it being said explicitly, we are left to guess.

I don’t know if this is because Claire isn’t very clear, or if she is relying on people making some kind of false assumption. It really weakens her arguments though as it really looks like there are other motives for starting a petition against MumsNet.

## Overstating the impact of £2.3m of funding

This sounds like a lot of cash, but in terms of the NHS budget, it is tiny. I don’t have much more to say about this.

## Conclusion

If you want to change the NHS, campaign for change in the NHS. Don’t campaign against people who want to change the NHS.

## Update

Claire has asked for her name to be removed. I don’t understand why.

## Update 2

This series of tweets happened this evening:

I hate to be like this, but Claire has strongly inferred in public that I have threatened her. This is totally baseless. I can’t see how these tweets have been misinterpreted by me.

## Update 3

These are strong accusations without any evidence. Simply for challenging a petition on threads and posts that are about the petition.

The terms “stalk” and “harass” have specific legal meaning in the UK. Being ignorant of this is no defence, and using those terms against someone with no evidence is defamatory.

## Update 4

There have been some almost comedic blog posts, condemning the continued discussion of this topic whilst continuing to discuss it.

How do we cope with adult tantrums? - by having a passive-aggressive outburst. If this isn’t an attempt at the last word, I don’t know what is.

The mutiny over the mutiny over the Bounty Mutiny - let’s all be nice to each other, whilst thanking those that hurl insults. Apparently by directing 3 tweets at the poster of this, I have been “bombarding” them.

# Bumbling burglars

Today, my wireless alarm hacking posts ended up on Hackaday, and I received this comment:

Your average suburban burglar is gonna be way to dumb to figure this stuff out. And if you’ve got millions of dollars worth of art or whatever that might attract a higher class of crook, you’re not gonna scrimp on security eh?

I’ve had more than a few people reply with the same sentiment over the last few months, so I thought I’d reply here rather than in a comment.

## Burglars are too dumb

The burglar doesn’t need to be clever. He just needs to buy a device from someone who is clever and immoral. It’s possible to use a CC1110 RF SoC to jam, disarm, and otherwise disable many of these alarms. It wouldn’t need any skill to operate and it wouldn’t cost much.

## Burglars won’t bother

This was exactly what people said about keyless ignition and entry on cars. That quickly changed once exploits were available.

## Anyone with sense would have a better alarm system

They might have an alarm system that looks better on paper. But they have absolutely no way of actually knowing if the alarm has any exploitable vulnerabilities or not. There is no requirement for alarms to be independently tested. I can confidently say that much more expensive alarms are no better than the Friedland alarm detailed in my posts.

As an aside from this – the higher grade alarms are really only there to satisfy insurance requirements. As long as it the system meets the requirements of the insurers, it shouldn’t matter if there are any vulnerabilities. Unless, of course, it looks like the alarm wasn’t set in the first place…

## Conclusion

This doesn’t mean that burglars are exploiting vulnerabilities in wireless alarms. It does mean two things:

• Consumers don’t have the means to tell if an alarm system is secure or not, due to poor standards and lack of third party testing.
• Alarm and signalling manufacturers are happy to sell insecure equipment because of this.

# Reverse engineering a wireless burglar alarm – summary

I started (but didn’t really finish…) a series of posts reverse engineering several parts of a Friedland wireless burglar alarm. I will come back to finish it off, but in order, here are the posts:

If anyone wants any further details about technologies used in alarm systems (though not this one), I have another series of posts: