Archive for the Security Category

Building boost on Mac OS X 10.6 with XCode 3.2

Posted in Mac, Programming with tags , , , on 6 September, 2009 by continuous

Getting boost to build in ‘fat binaries’ is a pain when you’ve just switched to XCode 3.2. Switching to XCode 3.2 is somewhat obligatory, because that also brings you the SDK for Mac OS X 10.6, aka Snow Leopard. And when you run the Snow Leopard, you want the SDK for it as well. It sounds so simple.

The Apple version of gcc, included in XCode, stops building boost in fat versions, it works for targeted versions (i.e. with only one architecture). But, if you want to build ‘universal’ binaries that work in 64bit and 32bit mode, you’re out of luck.

I got it to build this morning, thanks to some discussions on the boost mailing list. And it == boost 1_40_0, with XCode 3.2 on Snow Leopard.

This is the command-line I used:

bjam --build-dir=../boost_build --layout=versioned toolset=darwin architecture=combined address-model=32_64 link=shared,static install

And here is the patch I created to get it to work. It boils down to: remove all the ppc entries from the tools/build/v2/tools/darwin.jam, because the XCode compiler does not offer support for PPC anymore. And, you have to remove the “-m64” option in the gcc.jam, because the xcode compiler does not like to have -arch x86_64 -arch i386 -m64 all together on the command-line.

But, if you take the road of building your code on XCode 3.2, you specifically eliminate all those users still using a PPC based Mac. That might not be what you intended. In that case you probably need to add the -V 4.0.1. option to gcc/g++ in which case you use the older compiler (from XCode 3.1), which might or might not be what you need for your project.

(Sorry for the stupid looks on the patch, but wordpress mangles stuff with the <code> tag).


diff --recursive -u boost_1_40_0.orig/tools/build/v2/tools/darwin.jam boost_1_40_0/tools/build/v2/tools/darwin.jam
--- boost_1_40_0.orig/tools/build/v2/tools/darwin.jam 2009-04-14 09:59:30.000000000 +0200
+++ boost_1_40_0/tools/build/v2/tools/darwin.jam 2009-09-06 08:01:26.000000000 +0200
@@ -304,9 +304,9 @@
: $(values) ;
}

-arch-addr-flags darwin OPTIONS : combined : 32 : -arch i386 -arch ppc : default ;
-arch-addr-flags darwin OPTIONS : combined : 64 : -arch x86_64 -arch ppc64 ;
-arch-addr-flags darwin OPTIONS : combined : 32_64 : -arch i386 -arch ppc -arch x86_64 -arch ppc64 ;
+arch-addr-flags darwin OPTIONS : combined : 32 : -arch i386 : default ;
+arch-addr-flags darwin OPTIONS : combined : 64 : -arch x86_64 ;
+arch-addr-flags darwin OPTIONS : combined : 32_64 : -arch i386 -arch x86_64 ;

arch-addr-flags darwin OPTIONS : x86 : 32 : -arch i386 : default ;
arch-addr-flags darwin OPTIONS : x86 : 64 : -arch x86_64 ;
diff --recursive -u boost_1_40_0.orig/tools/build/v2/tools/gcc.jam boost_1_40_0/tools/build/v2/tools/gcc.jam
--- boost_1_40_0.orig/tools/build/v2/tools/gcc.jam 2009-07-11 13:04:31.000000000 +0200
+++ boost_1_40_0/tools/build/v2/tools/gcc.jam 2009-09-06 08:11:17.000000000 +0200
@@ -375,7 +375,8 @@
}
else
{
- option = -m64 ;
+ # option = -m64 ;
+ option = ;
}
}
OPTIONS on $(targets) += $(option) ;

SCADA Honeypot

Posted in Hacking, Security with tags , , on 31 August, 2009 by continuous

I really like the idea of a SCADA honeypot. John Strand live-demoes a SCADA Honeypot. It uses several services which can later on be used to demonstrate (and lure an attacker) the life inside a SCADA universe.

You can download the SCADA Honeypot from here.

From the scadahoneynet site:

[The] goal of this project is to provide tools and to simulate a variety of industrial networks and devices. We see several uses for this project:

  • Build a HoneyNet for attackers, to gather data on attacker trends and tools
  • Provide a scriptable industrial protocol simulators to test a real live protocol implementation
  • Research countermeasures, such as device hardening, stack obfuscation, reducing application information, and the effectiveness network access controls.

Hilarious…

Posted in Forensics on 28 August, 2009 by continuous
Technorati Tags: ,,

1627225-1[1]

These are not the bobbies you’re looking for…

Flexible keyboards

Posted in Programming with tags , , , on 24 August, 2009 by continuous

IMG_4194 IMG_4196

I’m a very happy user of the ‘old’ Sun Type 7 keyboard. Actually, I’m hoarding them, since, Oracle is going to kill the Sun hardware business and the Type 7 is one of those keyboards with all the keys in the right place. Control is left to ‘a’ and backspace is not in the top row, but one below, just above the ‘return’. In order words, I’m a sucker for keyboards and I’m really sensitive to their touch and feel and click and whatever there is to them.

Today I saw someone mysteriously put a silicone keyboard (it flappy and flexible, but no brand label to be seen) in my room and I had to try it. Actually, I’m trying to type on it for this blogentry. And, I’m not really a happy customer. Let me count the ways in which this board does not suck:

  • It’s very cool to fold away your keyboard when you’re not using it.
  • It has an uncounted number of shift keys. Well, there are four.
  • It’s featuring (sort of) in Die Hard IV.
  • It feels nostalgic.
  • You can spill stuff on it.
  • It fits in you backpack, or even the side pocket of your cargo pants.

Ok, that was the good stuff. Now for the less convenient stuff.

  • It stinks, as in, it has an awful plastic smell about it.
  • It stinks, because I’m actually trying to type less, because I’m prone to mistype on this thing a lot.
  • It gives me carpal tunnel syndrome with just using it for the past half hour.
  • It is very wobbly, even when I put it on a sturdy surface area.
  • Did I mention it has four shift keys? And two space keys, but you can still touch them without any reaction? It even has keys on them without any label at all.
  • It has windows keys on it, but more keyboards do, so I will not hold it against it.
  • It doesn’t have a brand label on it, so it must be crap. Otherwise, someone would put a label on it to say that they’re responsible for it. Probably they’re quite scared of someone suing them into oblivion.
  • The control key is broken.

So that’s it. Unless you want to look really cool and like you’re in Die Hard 4, get it. Otherwise, give your wrists and hands and the rest of your body some rest and stay away from it.

Coolness: 7/10 (hey, it’s in Die Hard Four) (but it does not glow in the dark)
Function: 3/10 (with working control: 4/10)
Weight: 8/10 (it’s very light)
Space: 10/10 (it takes up almost no space in your backpack. That’s good).
Total: 5/10. If function is not good, forget it.

Summer Cleaning

Posted in Hacking, Observations, Security with tags , , on 27 July, 2009 by continuous

Today I finally got around to cleaning my desk at home. It had become cluttered with all sorts of stuff. You probably know, old bills, new bills, a used password list (only one of them has been sort of correct), leaflets received during a trade show, etc. I was wondering myself how much information about me, good and bad, could be derived from the assorted clutter.

It’s quite scary and a reminder for myself that I should be more careful when leaving stuff on my desk. I know all the risks of garbage dumpers and people coming in and slicing and dicing your personal life (been there, done that) but it takes some mental effort to be aware of your own clutter.

So, back to cleaning the desk and keeping it clean.

Gems documentation

Posted in Linux, Programming with tags , on 7 June, 2009 by continuous

When trying metric_fu, gem told me quite gently, though persistently, that it did not know about metric_fu. Blimey. You’ve got to look around the Intarnetz, but then you can find the stuff you need to get more than one repository.

So, what’s the trick?

gem sources

lists the sources that are already available.

gem sources -a http://gems.github.com

adds that source to the other sources. Jay! That’s what we needed,

RSpec and Forensics

Posted in Forensics, Programming with tags , , , on 7 June, 2009 by continuous

I’m currently reading the beta edition of the RSpec book by David Chelimsky et.al. Because a book like this can only be comprehended when actually using the content, I’ve decided to start documenting a new project I’m doing with it.

So far, it has been about Behavior Driven Design (BDD), which is an acronym I’ve head before, but I didn’t have the time to read more about it.

It feels a bit weird specifying stuff using mostly natural language, but on the other hand it’s naturally very cosy to do so. What’s really neat is that you start using the api you want to specify right up, instead of first formalizing a design for it. That way you known that all the methods in your api really belong there and actually work.

While I was busy to code up some small project I received the new linux journal, which had an article on metric_fu. It contains a lot of code that can measure the quality of your code. That is always good to do, because the more checks you perform on your code, the bigger the chance that you run into a bug waiting to happen. Of course, you also run into false positives faster, and most people stop using checks like these because they run into false positives too often.

But reading the article I was thinking to myself: why don’t we use BDD combined with something like metric_fu on hour one-off tools we create to solve a case? Most forensic practitioners I know are bound to run into the situation where all the available tooling is not adequate to perform a certain job. Things that come to mind are refiling images based on camera, but oh wait, based on resolution first, or extracting all email addresses from an image and compare them to some filter, These things should be rigorously tested before put in use, because a simple code snafu can dump all your stuff in the bin and will cost you valuable time to clean up again. There is in this case an obvious tradeoff between codingtime, solvingtime, clean-the-errors-time and the time you need in court to explain that you did everything in your power to not botch up the code. For that last part you would ideally show testing output that shows that your testcases have a 100% coverage and pass every test you thought was possible.

Serious flaw in CA certs.

Posted in Hacking, Security with tags , on 31 December, 2008 by continuous

Oh boy. People are still dumb enough to use MD5 for anything important? Well, it’s all over the net of course, so this is the reference to the original research. Wow.

Leadership, done properly

Posted in Forensics with tags on 31 December, 2008 by continuous

I think the CEO of Japan Airline (JAL) really gets it. He doesn’t save himself from the hardships he’s laying down on all the other personnel. And I always thought that Japan was the pinnacle of hard work but if all the managers were doing this as well I can imagine why you’d work hard, and still feel good about it.

Getting things done with software

Posted in Forensics with tags , , , on 30 December, 2008 by continuous

I’ve been steadily improving my efficiency by using the Getting Things Done method, way of Life, something like that. One of the first recommendations is to have a single inbox. One way to have a single inbox is by using some piece of software to do that for you.

So far I’ve used TaskPaper, OmniFocus, Things and the recent newcomer (only in Beta) The Hit List.

Taskpaper is quite simple, it has the minimal set of features to manage your inbox. You can do most things, like selecting everything with a certain tag. However, it’s not too easy to organize everything by deadline. My final conclusion is that TaskPaper is too basic to fill my needs.

Things is much more advanced. What I like are the ‘Focus’ boxes in the sidebar. They make it very easy to change your focus to what should be done today, which tasks are available to do next etc. What I absolutely don’t like is that you can’t (or, at least I can’t) create sub-projects. As I found out, it’s a number one requirement for me. Further the number of tags grows quite rapidly for me and that makes it inconvenient to use. But, in retrospect, I may have been misusing the tags functionality a bit. If I’d have used it more as the list of contexts it might have been more workable. Things did not quite cut the cake, right now. Today I’ve also looked at the 1.0rc and it has 100% eye-candy, but I have not seen subprojects yet.

OmniFocus is the software I put my money in. It had all the features I needed, like subprojects. What it hasn’t got is eye-candy. It’s not quite as ugly as a baboon’s backside, but nearly there. I’ve been using it for the last month as I should. The things I use most are:

  • Recurring tasks (both recurring after completion as on a fixed deadline).
  • Subprojects. In this respect I almost use Omnifocus to do the outline of the project, now if only the output could be shown as a Gantt chart… One thing you cannot do is put a subproject on hold.
  • Emailing new ideas to my inbox via the Apple Mail integration. Nice.
  • It’s easy to spot which tasks are available next, and what tasks are due any time soon. It’s only configurable for all taks, whereas Things allows you to enter this information separately.

The Hit List is in semi-private beta since December 23rd and I’ve been using it on-and-off (not fulltime since it’s a beta and I have serious doubts if I like to reenter all the items from omnifocus again in THL, since there is currently no import/export functionality, also, THL does not have recurring tasks, which is necessary for me for THL to be a OmniFocus replacement. But do I like what I see so far?

  • It looks good, very good.
  • It’s stable.
  • You can organize your projects (why does the menuitem say ‘List’ btw?) in any way you want. Tagging can be done in any way you want, for contexts as well as ‘ordinary tags’.
  • There are shortcuts for just about anything to speed you up.
  • You can approach the tasks in the list as the project-breakdown, but also as a ‘card’ (with shuffle-eye-candy when going from one task to the next). This invites you to create more extensive notes. Since I use the note to describe the result of the task, I think this way of viewing a task is a plus.
  • You can time the duration of a task.

But there are some things I think should be added:

  • I couldn’t find how you can create a list of ‘next’ tasks. But, for this to be useful, you have to be able to specify that a (sub-)project is parallel or serial.
  • Make it scriptable, so you can hook it to mail via mail rules.
  • Make a task that is due more obvious than making it bold.
  • If you have subsubtasks it’s not obvious from the card-view for the task. Ideally the top project card would show a gantt chart of the subtasks. Featuritis, I know.
  • Create an import-feature for plaintext or any of the competitor’s file formats.
  • Due times could be displayed as ‘in 3 days’ like Things has. That’s quite nice.

The Conclusion for me is that it’s going to be either THL or OmniFocus.