WorkHabit Blogs

WORKHABIT LABS

New Script: Are you dealing with a hacked drupal core?

by Aaron Stewart Published: July 21st, 2009
Tagged: bash, core, drupal, drupal planet, hacked, php, shell script

Whenever a group of us WorkHabit folks are sitting around the virtual watercooler reviewing upcoming projects, one of the first questions we need to answer is about the quality of the code we're starting with.

The big question we always want to know is this: Is core hacked? And how badly?

After doing this manually several times, I decided to cut to the chase and write a script for it.

The bash script to do this is at the bottom of this post. Just save it as iscorehacked.sh, mark it executable, and have at it.

To invoke:

  ./iscorehacked.sh /path/to/questionable/site/docroot

The output:

$ ./iscorehacked.sh ~/develop/mysite
Checking core against version: 6.12
Fetching core...
Checking core against site at /Users/foo/develop/mysite
Files /tmp/DRUPAL-VERSIONS/drupal-6.12/includes/bootstrap.inc and /Users/foo/develop/mysite/includes/bootstrap.inc differ
CORE IS LIKELY HACKED!
AttachmentSize
iscorehacked.sh1.54 KB

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h3>
  • You can use Markdown syntax to format and style the text.

More information about formatting options

Papernote
Papernote

WorkHabit Labs Archives