http://habrahabr.ru/blogs/infosecurity/70615/#habracut

statistical method for detection of statistical malicious javascript, perl implementation.