internet

For a while now, I’ve been getting comments on my LiveJournal which apparently aren’t spam, but rather are questions which are totally out of context. For instance, I got one the other day which said “Hi. I find forum about work and travel. Where can I to see it?”

I recently got some more comment spam advertising something called XRumer, a clever and nasty program for spamming bulletin boards and other forums (like LJ), which is brought to us by some evil Russians (“No Meester Bond, I expect you to die”). One of the things the authors claim it can do is a crude form of astroturfing. They say you can configure it to post a comment asking about something, and response apparently from another user mentioning the site you actually want to advertise. It looks like this feature doesn’t quite work, and that the questions I’ve been seeing are examples of it misfiring. Mystery solved.

The spammers seem to favour certain entries of mine, so I’m screening anonymous comments on those entries (and on this one too, since I imagine it might attract undesirables). I don’t want to do that for my entire journal, as I get comments from people who aren’t on LJ but who say worthwhile things. In an ideal world, the way round this would be OpenID, but that’s not in widespread use yet, possibly because people who have an OpenID often don’t know they do. [Attention LJ users: you have an OpenID. Congrats. You’ve got a Jabber instant messaging account, too. See how good bradfitz is to you?]

A system which allows easy communication between two people who have no previous connection to each other is susceptible to spam. The trick is to keep this desirable feature while not being buried in junk (you could go the other way and remove this feature, of course, as many some IM users have, or make a virtue of it with social networking sites, but that’s not really an option for public blogs). Anything an ordinary user might to do create an identity, a spammer can do too, so cryptographic certificates aren’t a magical solution. Legislation doesn’t help, because the police don’t care and anyhow, spammers are in Wild West states like China or Russia, or at least run front operations there.

Most spam is still sent via email. Email spammers have been subject to an evolutionary arms race. The remaining effective spammers are bright and totally amoral. They’ll hijack millions of other people’s computers to send their spam or even to host the website they’re advertising, making it hard for blacklists to keep up (and they’ll use these computers to flood centralised blacklist sites with traffic in an attempt to knock them off the net). They’ll vary the text they use, to defeat schemes which detect the same posting lots of times. They’ll use images rather than text, or simply links to those images, to defeat textual analysis. You can bet that blog spammers will learn from this (some of them are probably email spammers too).

What’s working for email spam, and will similar ideas work for blog spam?

  • Banning mail sent directly from consumer ISP connections is the single most effective thing I do (you can do this with the Spamhaus PBL and with a few checks for generic rDNS to catch what the PBL misses). You can’t do that with blog comments, as spam or not, they almost all come from consumer ISP connections.

  • Banning mail sent from IPs which are known sources of spam is also effective. You can do that with blog comments, but you either need to be big enough to generate your own list (as LJ might be) or have the resources to run a centralised list like Spamhaus (which will be attacked by spammers). There are currently no IP blacklists devoted to blog spamming, as far as I know, although some spam comments I’ve seen came from IPs which were in the Spamhaus XBL.

  • Filtering on ways in which spamming programs differ from legitimate SMTP clients (greylisting, greet pause) is currently effective, but only as long as these methods don’t become so widespread that it’s worth the spammers’ while to look more like a legitimate sender. Still, this doesn’t seem that likely. Incompetent admins aren’t in short supply, and I don’t have to outrun the bear, only outrun them. This sounds promising against blog spammers. Apparently simple minded schemes are pretty effective.


What else can we do with a website that we can’t do on email?

  • CAPTCHAs are popular, but a bit of a bugger if you’re blind. The evil Russians claim to have defeated most of the deployed ones which use obscured letters, though that still leaves the “click on the picture of a cat” variant.

  • Proof-of-work or hashcash schemes are currently very effective, suggesting that blog spammers don’t yet have the huge amounts of stolen computing resources available to email spammers, or that they don’t have the knowledge to implement the hashcash algorithm in their spamming software. By using proof-of-work, we can at least drive the weak blog spammers to the wall.

    You can think of proof-of-work as a variant on the tactic of differentiating spam programs from real humans. Spammers can defeat simple-minded checks on how long a user has been reading a page before commenting without slowing their spamming rate up by much (how to do this is left as an exercise to the prospective spammer), but if a web browser has to do a computation which takes a fixed time and send the result along with the comment, the spammers have to slow down or do the work in parallel on many computers. If you can work out a way of doing the calculation in the background as the user looks at your page and writes their comment, so much the better. If you can dynamically generate the code you send to the browser to make it prove it’s done some work, you stop the spammers writing something equivalent in a real programming language and force them to run it in Java or Javascript. That’d really show them who’s boss.

    This hurts people who’ve turned off Javascript or Java, but it’s time for those dinosaurs to join the web 2.0 world, right?

I guess most people on LiveJournal saw their proposal to turn LJ into MySpace (lj_dirtycache is particularly good fun for anyone who’s ever looked at bands’ sites on MySpace). What’s funny about LJ’s effort is that LJ clearly understand what is going to provoke their users to apoplectic rage until they realise they’ve been had. By comparison, Facebook was a bit lame, merely offering to send someone round to physically poke the people you “poked” on Facebook. They should have announced some variant on the Facebook feed to get all the “OMG UR HELPING STALKERS” people up in arms again.

Google announced TISP, their IP-round-the-U-bend service, as well as Gmail Paper, for those who prefer their email on paper. Slashdot had a collection of unconvincing stories. Poor show.

Disappointingly, the IETF don’t seem to have done anything very exciting lately, at least nothing to match the seminal Standard for the transmission of IP datagrams on Avian Carriers.

Finally, robhu announced he’d reconverted to Christianity. It initially seemed he’d converted to a fluffy sort of Christianity in which God is a metaphor for the good which, in a very real sense, is in us all. However, in the discussion thread which followed, it soon became clear he’d reverted to his old evangelical habits, informing me that I was blinded by the devil and was “just as much of a fundamentalist as Richard Hawkings“. His later post contains the de-brief, in which it is revealed that I was in on it from shortly after he’d posted the entry. robhu used some excellent observational humour to convincingly impersonate evangelical responses to my ultra-atheist straight man.

In summary, burr86 and robhu jointly win the Internet. Tonight, we dine in Hell.

I am currently laid up. I’ve been trying out Firefox 2.0. It looks quite good. On the Mac, it’s faster then 1.5 and doesn’t get bogged down when you leave it running for a long time (I tend to put the Powerbook into sleep rather than shutting it down). I’ve not tried it on Windows yet, as I use Mozex for editing Wiki entries at work, and that’s not been updated for 2.0. The essential extensions have been updated, though: AdBlock and Greasemonkey being the two I use the most. It’s always a shock to use someone else’s machine and find their intarweb has adverts. I mean, how quaint. And you need Greasemonkey for LJ New Comments, which the people on lj_nifty seemed to like, bless ’em.

I like the spelling checker for form entries, and the way that you can now have it save and restore sessions, move tabs around, and put a close tab button in the corner of each tab. The smart completion thingy for Google searches is quite nice, as is the way that sites can offer their own search plugins which Firefox picks up on and can then install automatically (you can tell the site offers a plugin when the little arrow in the search box glows blue: thanks to marnanel for pointing that one out). I like the way that it can be configured to add RSS feeds to Bloglines, too.

While I was enjoying all this web 2.0 excitement, I thought I’d try out del.ico.us. It’s a site that lets you store your bookmarks externally, so you can find them on any computer, and also lets you tag them with keywords so you can find them again easily (which is my main reason for using it: my bookmarks were getting out of control). You can see my bookmarks here, and there’s also an RSS feed of them if you’d like to stalk me.

While casually browsing my website’s logs for hits from people looking for CICCU, rocking backwards and forwards and crooning “Soon, my precious! Soon!”, I noticed that some people from Facebook had been talking about the Losing my Religion page.

Coincidentally, Varsity recently interviewed one of the admins (PDF, look on page 7) of the Cambridge University mail server, hermes. The article mentioned Facebook, so I suppose it’s where the hip kids hang out these days. The article’s a bit odd. It’s one of those “the young people always think they invented it” things: apparently, email began in 2003. That’s more than just too late, for me, but I’m pretty sure that back in 1994 there was the joy of Pine and the anxiety of using finger to see whether New Hall girls had read their email (oh good, I seem to have navigated that sentence without saying “fingering”). There was none of this webmail nonsense. Things were starkly terminal based on the frontier of the Information Prairie, the bleached bones of our text lying on the dark surface of my wildly mixed metaphor. There was a greater awareness of the fragile underpinnings of it all, a rough justice needed to preserve order in our fledgling society: I got a sternly worded email from the man who became the author of Exim, telling me to stop pissing about sending myself mail from god@heaven. And we liked it.

So, Facebook. I joined. It seems to be a gentrified version of Myspace. There’s the bit where you can leave people messages and look at the pictures of them looking pale and interesting, but the residents’ committee has clamped down on the flashing purple text on a black background and the humourous cross-site scripting attacks. I didn’t have the de rigeur photo of myself exhibiting Internet disease (warning: Encyclopedia Dramatica is rarely safe for anything, although there’s nothing specifically worthy of summary dismissal on that page at the time of writing), so I just used the one off my website. I wandered around and laughed at the community called “FUCCU”. It’s all harmless fun I suppose. I’ve e-friended some of you on there, just cos: I’m not sure of the etiquette of friending on Facebook, so friend me back if you like, but don’t do it just because I know where most of you live.

I never did find out what people were saying about the religion page, the referrals were people following links from private messages. I expect it was the CICCU people wondering when I will actually overtake their official site in Google’s rankings. Soon, my precious, soon.

Anyone up for Isolatr? It’s where the cool people aren’t.

marnanel points out that Google Maps UK have updated their aerial shots to include a much higher resolution, down to a half a metre or so.

Apart from the inevitable “I can see my house from here”, you can also see a punt approaching Grantchester (the image doesn’t show whether the clock stands at ten to three, unfortunately), and a whole swarm of them having a look at King’s College chapel. You can also see Tony’s house, which I was a bit surprised by, because of the terrsts: Google, why do you hate AmericaEngerland?

On an unrelated note, someone pointed out a Wikipedia edit on Wicca, surely worthy of Encyclopedia Dramatica.

The recent change to LJ’s URL formats seems to be part of an attempt to defend against one or more attacks which allow the attacker to steal another LJ user’s credentials, gaining the ability to impersonate that user. The theft occurs when the victim visits a page on LiveJournal which contains some malicious Javascript inserted by the attacker (more technical details below for those that care).

What’s been happening?

Slashdot linked to an article with some more details on the attacks. This article includes details supplied by the Bantown group (who live at bantown.com, a site you probably want to visit using lynx). Bantown have use these attacks to pwn LiveJournal quite comprehensively: the comments on the news entry contained comments from tens of different users with the same demand from Bantown. It’s likely that these users all had their credentials stolen by Bantown.

I found a comment quoting an explanation of the vulnerability in an entry on lj_dev, but that entry has now been deleted. The quoted explanation is about a vulnerability which only applies to browsers based on Mozilla (so, Mozilla, Firefox and Netscape). The Bantowners claim that this is not the vulnerability they were using, as they have a vulnerability which affects all browsers. LJ recently patched a vulnerability which would do the job for all browsers, but it’s possible there are other, similar, vulnerabilities in LJ’s code. Or it’s possible that the Bantown people are lying.

Is it fixed?

LJ went down for a while on Friday afternoon, and seems to have invalidated all existing cookies. However, bradfitz is keeping quieter than I’d like about whether the risks still exist and about what workarounds users can use while LJ’s crack programmers are working on a fix. bradfitz‘s use of “soon” suggests that the URL change was part of further changes. These further changes aren’t in place as I write this, which I think means that it’s still possible to use whatever attack the Bantowners have been using to steal credentials, although it’s not possible for an attacker to use an old set of credentials from logins before this afternoon.

Edited: LJ has now fixed this, so it’s safe to turn Javascript on again.

What can we do about it?

For now, I’m running with No Script turned on, and using that to disable Javascript for all but trusted sites, of which LJ obviously isn’t one. LJ’s lack of communication about the risks to user data, and about possible workarounds, displays a worrying incompetence, as I’ve said elsewhere.

The Science Part

LJ uses cookies, small pieces of data stored by your web browser, as your credentials. When you log in to LJ, you get a cookie. From then on, your browser presents the cookie whenever it requests a page from LJ. LJ trusts you because you have the cookie, and lets you do things that only you should be able to do. The cookie can persist just until you close your browser, or longer if you’ve ticked the “remember me” option when you log in.

The attacks on LJ are cross-site scripting or XSS attacks. A Javascript running on a particular page can access the cookies for that page. Currently, any Javascript running on an LJ page can see your cookie, because the same cookie applies to the entire site. If an attacker can cause their own Javascript to run on a page supplied by LJ, they can steal that cookie and send it to a remote server that they own.

How might the attacker get their script onto LJ’s pages? Well, LJ lets you submit HTML as entries, comments, and as your own styles, and then displays it on its pages. LJ attempts to sanitise the HTML you supply it, but if it doesn’t do this correctly, the attacker has a way in. They can put their Javascript on the page, and visiting that page would then send your cookie to their server. Also, browsers based on Mozilla (such as Netscape and Firefox) allow stylesheet authors to embed Javascript in a CSS stylesheet, so the way LJ lets users reference their own external stylesheet is another security hole (although as I said above, it’s possibly not the one that the Bantown people are using).

There’s some more discussion of how this works (in amongst a lot of sarcasm) in this thread on jameth‘s journal.

This post doesn’t contain spoilers, and I’ll warn if I link to one which does.

scribb1e bought the new Harry Potter book, and I read it after she’d finished with it. I didn’t particularly enjoy the last one, which I thought was very long and which we both thought was confusing in places (I couldn’t honestly say I felt I could imagine what the interior of the Ministry of Magic was like, for example). I did like this one. I’m still not quite sure what the fuss is about, but it was enjoyable, well written and more coherent than the last book.

I’d already been spoiled for the book’s biggest surprise by the countless trolls on LJ with their marvelous flashing icons. It’s my own fault for reading Encyclopedia Dramatica (WARNING: Not Safe For Anything), I suppose: I’m a sucker for sarcastic toilet humour. I liked the mock spoilers broin posted in andrewducker‘s journal.

Apparently, some of the people who’ve been writing fanfiction about which characters will get it on have been disappointed. kenboy gives the fanficcers some helpful suggestions (contains spoilers). The people over at Fandom Wank have helpfully collated the very best of Half Blood Prince drama (even more spoilers). It’s all good.

Update: mistful posts some thoughtful comments (spoilerific) on the book.

Usenet news is the Internet’s original discussion forum (in fact, technically it predates the Internet, but that’s not important right now): groups organised into a hierarchies, with messages (articles) in them which have a similar format to email, but which are distributed using a different mechanism. You can read news using a news-reader, a piece of software which connects to a news server to retrieve articles. There are thousands of newsgroups out there, covering every topic you can imagine and some you’d probably rather not. A whole lot of the Internet’s subculture originated on Usenet.

A while ago, Google acquired a Usenet archive dating back for a couple of decades, and did their usual search magic with it. Unfortunately, they’ve since lost the plot. The latest revamp of Google Groups, which went live yesterday, has sacrificed the usability of the news archive to promote Google’s own discussion groups. These internal Google groups are presented on the same site, in a move which seems to be designed to compete with the Yahoo! Groups! service!. What’s wrong with the new site?<lj-cut text=”Bad Google, no biscuit.”>

In decreasing order of badness:

  • They’ve broken old links. There are countless web pages which cite Usenet threads by linking to Google’s archive. These are now all dead links. Old links to individual articles (which refer to the Message ID of the article) are redirected (hurrah!), but into the top of the thread which contains the article (doh!): good luck finding the article you thought you’d linked to in a thread containing hundreds of responses. Oh, and the new way of forming links to individual articles doesn’t use the unique Message ID which is already in the original article, but a unique ID of Google’s own devising. That ID is presumably subject to change the next time Google’s developers are bored.

  • Google are tracking clicks on URLs in messages (the URLs are re-written to go via Google). I regard that as somewhat sinister: why do they need to know which links you’ve clicked? They’re not doing that on their web search, presumably because they know what would happen if they tried it.

  • They’ve tried to obscure email addresses throughout the articles, replacing some of the local part (that’s the bit before the @ sign, RFC 2821 fans) with an ellipsis. They’ve ended up obscuring similar looking things, like mention of Message-IDs in the original messages. Obscuring email addresses in Usenet articles is pointless: spammers already suck up email addresses directly from Usenet servers.

  • In all these changes, they’ve still not fixed the problem of Google users replying to messages from years ago. Or, as far as I know, the other problems (like not honouring the Followup-to header) which mean Google’s posting interface isn’t a good Usenet citizen.

  • They’ve tried to be clever with fonts. The text of articles is shown in a proportional font (one where all the letters are not the same width). Some levels of quotation seem to be in monospace fonts (where they are). Mock HTML tags (like, say, <sarcasm>) seem to confuse it, for some reason, as do other variations in spacing. If you have a post which discusses HTML itself, Google gets confused and may render the whole thing as a huge link, or with random spacing and fonts.


On the plus side:

  • The new interface is pretty.

Google provides a valuable service by making the Usenet archive searchable for free. But it is also using this to drive traffic to their own discussion groups, and doubtless hopes to make money from ads, in a similar way to the Google web search and Gmail products. Unlike the web search or Gmail, though, Google has made a product by reproducing people’s copyrighted work in its entirely (except for those ellipses, naturally). In the past Google has got away with it because their product enhanced the experience of Usenet, which is, after all, full of people who want to be heard. Every change will produce some resistance from people who liked things how they were before, but in this case something has been lost, and pretty fluff does not make up for it.

Some while ago, Mark Pilgrim did a post on cool software tools he couldn’t do without. In the absence of any pending rants about religion, here’s mine. Probably only of interest to fellow geeks, so cut for length.
<lj-cut>
Mail:

I’m still using Pine, that staple from university days. As it’s terminal based, I can use it to read my mail by logging in to my machine from wherever I happen to be. It supports multiple incoming folders for mailing lists and the like, and multiple roles. It’ll invoke an external editor, so I can use Vim to write email. The address book is nice. It keeps mail in flat text files, which, despite being a somewhat broken format, is easily understood by grep and the like. What more do you want? I hear good things about Mutt and also Apple’s own Mail.app, but nothing which compels me to change.

I run Exim as a mail transport agent, and use its nice filtering lanuage to handle sorting stuff into folders, ditching HTML mail sent to my Usenet posting address, and that kind of thing. Fetchmail gets the mail to Exim. Exim calls dccproc, which checks for bulkiness, and rbfilter, which checks for blacklisted senders.

My pobox.com forwarding address has been around since 1998 and so gets a tonne of spam, but since I used their spam filtering options to block China, Korea, and Brazil; and also turned on their cunning “looks like a consumer broadband machine” test (which looks for bytes from the IP address in the machine’s hostname, as that’s a common naming convention for broadband addresses), spam is a solved problem for me.

News:

I was using trn, but gave that up after failing to compile it for OS X. slrn is a worthy replacement, with colour highlighting and a useful scoring language. As well as using that to killfile people, I can increase the score of posters or threads which interest me and sort by score in the thread view. slrn shares trn’s handy habit of doing the right thing when you just keep hitting space, which is handy for eating and reading news at the same time.

I use Leafnode to fetch news from a variety of servers (NTL groups from their server, news.individual.net for everything else). A tip for Mac users: Leafnode creates directories full of lots and lots of small files (one per article, in fact). HFS+, the native OS X filesystem, is dog slow at accessing these. Make a UFS disk image and put your news spool on there.

Editing:

I use Vim, which combines the usability of the old Unix vi with the startup time of Emacs. It does all the usual good stuff like syntax highlighting every language known to man (including quoted text in mail messages, which is nice), indenting automatically and all that jazz. A killer feature is the function which will complete words from occurrences in the same file, or from a tags file (a list of all the names defined in a program). Helpful for not getting variable names wrong and also in rants where you find yourself writing “evangelical” a lot. The interface to cscope is also very useful when writing C code (and more importantly, trying to understand other people’s C code).

Browsing:

Since I started using OS X, I’ve been happily using Safari as my web browser. When writing long comments here on LiveJournal, I occasionally miss the text entry box editing facility of Mozex, since I could then edit the comments with Vim, but since no-one’s ported Mozex to the Mac yet, I’ve not switched to Mozilla or Firefox. You Windows users should so switch, of course, because Firefox is nicer and a lot more secure than IE.

Uploading:

I maintain my websites with sitecopy, which replaces that Perl or Python script which everyone seems to have written at least once to FTP stuff to their provider’s web space. sitecopy is works with both NTL’s and Gradwell’s servers and can do useful stuff like uploading based on hash values rather than modification times.

I post to LiveJournal using Xjournal, a pretty and featureful client for OS X. If I want to post from the command line, I use Charm.

Scripting:

I prefer Python to Perl for scripting tasks. As Yoda says, you will know Python is better than perl when your code you try to read six months from now.

Mudding:

I use Mudwalker when I have the OS X GUI available, mainly because I’ve made it talk using the Mac’s speech synthesis stuff. I’d also recommend Crystal.

Coding:

From within Vim, I make heavy use of ctags and cscope for browsing around code and jumping to declarations and references to a symbol. You can do it with grep, but it’s not as nice (and a lot slower on big projects).

I’ve also used Smatch to write customised static checkers for C code. Smatch is a modified version of GCC which outputs an intermediate language which is readily processed by your scripting language of choice. If you’ve ever found yourself writing Perl or Python code to parse C directly, you probably should have used this instead. There are some scripts which come with it which can do useful things like attach state to particular code paths as your script parses the code, and allow you to describe what happens to that state when the paths merge (so you could check that all paths free anything they’ve allocated, say).