Scary tools
I recently attended a session held by Marcus Murray. It seems it was kind of a compressed version of the session he held at TechEd earlier this year. Murray is witty, charismatic and has a broad and deep understanding of IT-security issues. He cracks jokes and practices a little social engineering to keep the audience attentive. If you and your IT-staff wants to be briefed (and scared) with the latest in IT-security I could easily recommend Murray.
He demonstrated a couple of tools that both impressed and scared me. First he demonstrated how to set up a mail based attack using the commercial Core IMPACT. It's a very impressive tool and mail based attacks are only one out of many attacks this software has the ability to execute. Before seeing this I could never have guessed there are tools this advanced and this easy to use. The lists of exploits it can test, in an all automated fashion, were long and seemed to be up to date.
Murray also demonstrated ARP poisoning and hijacking of a RDP session by using the free Cain & Abel tool. You could feel the discomfort in the air as it dawned on the audience how easy this is to set up.
Man in the browser 1
There's some buzz about a new trojan technique called "Man in the browser". The trojan plugs itself into the users browser and then it intercepts the HTML. This have all sorts of implications, for instance the SSL certificate will seem to be valid.
Even if your virus protection does not detect the "Man in the browser" there are still ways to be quite safe. If your bank uses a security token which you not only logs in with but also use to sign your transactions, the attack will most likely fail. One problem is that it is up to you, the user, to actually verify that you are signing the expected amount to the expected accounts. To get protection against someone who has complete control over your computer the security protocol must "communicate" with the security token both ways.
It is not enough to only let the user enter the total value of the transactions because the tokens answer to such a simple value could be reused (during a short period of time) also the attack could be crafted to create the correct amount but to other accounts. By asking the user to also sign every new account the attacker will not be able to hide a transaction to his account.
The challenge is to make the security protocol clear and simple enough so that the user can understand what he would expect the bank to respond and expect from him.
It's the usual three: have a firewall, an updated virus protection and a secure bank with a digital security token were you sign your transactions and maybe you can sleep a little better.
Blowfish in the URL
Sometimes you do not want to show the database id for a row in the URL. The reason could be that you do not want someone to be able to scan through all the data.
One solution is to use GUID's but they have drawbacks and one of them is that they add a considerable length to the URL. The shortest URL-safe representation of a GUID I've seen is 22 characters but usually they are 36 characters.
Depending on how your id's are implemented a much shorter way could be to simply to encrypt them.
Here's a Ruby-example that Blowfish encrypts, Base64 encodes and URL-encodes an integer value. You can get crypt as a gem:
gem install crypt
1 2 3 4 5 6 7 8 9 10 11 |
require 'rubygems' require 'crypt/blowfish' require 'Base64' blowfish = Crypt::Blowfish.new("A key up to 56 bytes long") plainId=123456 encrypted = blowfish.encrypt_block(plainId.to_s.ljust(8)) idForURL = URI.escape((Base64.encode64(encrypted).strip)) decryptedId = blowfish.decrypt_block( Base64.decode64( URI.unescape(idForURL))). strip.to_i |
The .ljust(8) is because Blowfish is a 64-bit block cipher and the Ruby-implementation does not pad the data itself.
The id in the URL in this case would be c2PSXWgky40=
. Its 12 characters long (11 if you skip the equal sign) and that's 10 or 24 characters shorter than a GUID. Also there is zero percent chance of collusion and if you want to you can even decrypt it.
This is not a super safe implementation but if you start your id's at a random and not too low number you are making it a bit harder for someone to crack the 56-bit key. Actually a truly random and at least 64-bit big number would be a better choice as it would have no connection to the true id at all. You would have to check for uniqueness before storing those in the database though.
Sierpinski's shoes 1
There were no cross-platform windowing toolkits for Ruby so _why made one and he calls it Shoes. Not even close to 1.0, it's already yummy in a chunky kind of way and since it came from _why I simply had to try it out. Something simple.
Shoes.app :width => 1024, :height => 768 do
corners = [ {:x => 256, :y => 10}, {:x => 12, :y => 378}, {:x => 506, :y => 378} ]
xpos,ypos,c = 256,10,0
srand
2111.times do
c=rand(3)
xpos += (corners[c][:x]-xpos)>>1
ypos += (corners[c][:y]-ypos)>>1
star xpos, ypos, 5, 10
end
end
The result.