AdminAddict

Join Us Members List Today's Posts
Go Back   AdminAddict > Forum and Community Development > Community/Forum Software > vBulletin

Discuss [HOW-TO] "UnHack" yourself and hacker prevention in vBulletin at AdminAddict
Recently, one of my vBulletin powered sites was under a hacking spout, I'd fix it, and it got hacked the ...

Welcome to the AdminAddict.

Hello and welcome to AdminAddict! The one-stop resource for forum and community administrators.

We offer a variety of content and resources, but in order to have access to all of our free tips and tools, you need to register a FREE account.

Registration is free, quick and easy.



(Register to remove this advertisement)
Reply
 
Share Thread Tools Search this Thread
Old November 7th, 2009, 03:39 PM   #1
Adept
Mikey's Avatar
Posts: 248
Join Date: Sep 2009
Location: United Kingdom

Experience: Master
Forums Admin/Mod: 10+
Software: vBulletin 3.8.x
Forum: Parlancia

Mikey has a spectacular aura aboutMikey has a spectacular aura aboutMikey has a spectacular aura about
Default [HOW-TO] "UnHack" yourself and hacker prevention

Recently, one of my vBulletin powered sites was under a hacking spout, I'd fix it, and it got hacked the next day, fixed it, hacked again, fixed, hacked again.

Fortunately, he was doing the same thing each time. Up until the last time, I was just restoring a DB backup, which he hacked several times. I found this is the lazy way out

I was scratching my head over and over, "how is he getting in". I'd followed the standard safety measures and such, renamed admincp/modcp, 128bit passwords, etc.

Here's what I did, and it seems to have worked (in b4 i get hacked for posting this )

Firstly I did a recursive CHMOD of 0644 on every single file and folder, this will make your vBulletin bring up a "Forbidden" Message, while you work on it. Then I CHMOD the AdminCP Dir (renamed) to 0755, which gives you access to your acp. So you have access to the site, the hacker doesnt.

I then fixed the bugs, using the vBulletin AdminCP, and PHPMYADMIN, I find it's more effective to remove these things at a database level (this time it was sql insertion and malicious javascript) I then went ahead and changed all my staffs passwords, sure, they'll moan, but if it protects the site, then they have to live with it.

I then went and created 128bit passwords and put .htaccess and .htpasswd's in the following directories:

admincp/ (renamed)
modcp/ (renamed)
includes/
install/

If you have SSH access to your server, ask your host to remove it also (even if just for like, a week or two), as this is another way the hacker can get in.

I then changed my Database NAME, and Database user name and password, and changed those in the config.php, I then renamed the admincp/modcp/ dirs, again, they now aren't even under /forum/, you can do that by adding your full path to any instance of "global.php".

Then I went and did a recursive CHMOD on all the DIRECTORIES to 0755, so all files are now sitting at 0644 and directories (folders) are at 0755. So this should be secure, remember to chmod your config_vbseo.php back to 777, and if you have any mods like vbimghost, chmod 777 the image upload directory..

Finally, I reviewed my raw access logs and control panel logs, and error logs, determined the IP of the hacker, and IPtabled them, they now can't access any part of the server. This is a b*tch to do, and gives you a headache and takes a long time.

Alot of what I've said is in all the official stuff, but eh, Hope this helps anyone.
Chatter? Spammer? Tecchie? Loony? Parlancia is the place for you
YouTube User? Check out my new Music Discussions & Downloads forum?
Mikey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

3 out of 3 members found this post helpful.
Old November 7th, 2009, 03:54 PM   #2
Nick's Avatar
Posts: 7,156


Default Re: [HOW-TO] "UnHack" yourself and hacker prevention

Great thread; "Stickied"!
Best Regards,
Nick


Support AdminAddict // Purchase from the following reputable vendors:
HostGator / Liquid Web / DriveThruOnline - Professional vBulletin Products / NameCheap Domains

Compare Hosting Plans
VPSDedicated Servers


Nick is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

1 out of 1 members found this post helpful.
Old November 7th, 2009, 04:15 PM   #3
Zealot
Posts: 1,668
Join Date: May 2009

Experience: Advanced
Forums Admin/Mod: 2
Software: vBulletin
Forum: Puberty

Michael is just really niceMichael is just really niceMichael is just really niceMichael is just really niceMichael is just really nice
Default Re: [HOW-TO] "UnHack" yourself and hacker prevention

Great article We were hacked once due to poor server security within a shared environment and I did the same as you, just put a backup back up and the hacker hacked us within just minutes. He was able to upload scripts to perform CHMOD, uploads etc whenever he wanted, I still have the same file somewhere which he was using to perform his hacking.

When checking our logs I noticed he was running the dokill forum script to delete each forum from the admincp, it has always made me wonder if he actually had one of our passwords but our PC's scanned clean of keyloggers etc I wonder if someone knows if it is possible to run such a script without needing admincp/passworded access.
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

1 out of 1 members found this post helpful.
Old November 7th, 2009, 05:37 PM   #4
Adept
Mikey's Avatar
Posts: 248
Join Date: Sep 2009
Location: United Kingdom

Experience: Master
Forums Admin/Mod: 10+
Software: vBulletin 3.8.x
Forum: Parlancia

Mikey has a spectacular aura aboutMikey has a spectacular aura aboutMikey has a spectacular aura about
Default Re: [HOW-TO] "UnHack" yourself and hacker prevention

Well, this has been happening to me all week, so I documented what I did and threw it up here, cheers for the sticky Nick! Fingers and toes and everything else crossed, it doesn't happen again!
Chatter? Spammer? Tecchie? Loony? Parlancia is the place for you
YouTube User? Check out my new Music Discussions & Downloads forum?
Mikey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old November 7th, 2009, 06:50 PM   #5
Grand Master


Default Re: [HOW-TO] "UnHack" yourself and hacker prevention

You only need 2 files from the install folder present, and thats only if something mucks up and you have to run repairs.

I usually completely remove the install folder, and then if its needed, reupload the files.
Looking for web hosting? Look no further than Web Hosting Review Shop be sure to leave your hosting experience as well.
Personal Blog of BS
David McHenry is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old November 9th, 2009, 01:35 PM   #6
Adept
CrazyTech's Avatar
Posts: 107
Join Date: Nov 2009
Location: South Carolina

Experience: Advanced
Forums Admin/Mod: 4
Software: IP.Board

CrazyTech is just really niceCrazyTech is just really niceCrazyTech is just really niceCrazyTech is just really nice
Default Re: [HOW-TO] "UnHack" yourself and hacker prevention

You could actually simplify this a good bit.

Just use an .htaccess directive to restrict access to the site for everyone but you while you make the necessary changes. This would make all of the chmodding unnecessary while you investigated. If you run the server (or if your host does), a good firewall should be installed - CSF and APF are excellent where you don't have to use iptables, which can get confusing for those who don't use it often enough.

777 anything - files or directories - should be avoided at all costs, that's the single greatest cause of hacks outside of scripts that haven't been updated.

If anyone would like for me to explain the above or elaborate, let me know.
Idologic Networks Reseller & Managed Dedicated Hosting Since 2001
Administrator: Christianity Board Christian Forum
CrazyTech is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

1 out of 1 members found this post helpful.
Old November 9th, 2009, 01:50 PM   #7
Grand Master
MjrNuT's Avatar
Posts: 579
Join Date: Oct 2009
Location: Sacramento, CA

Software: vb3.8, Drupal

MjrNuT is a name known to allMjrNuT is a name known to allMjrNuT is a name known to allMjrNuT is a name known to allMjrNuT is a name known to allMjrNuT is a name known to all
Default Re: [HOW-TO] "UnHack" yourself and hacker prevention

Mikey,

Was this on a shared environment?
MjrNuT

"I disapprove of what you say, but I will defend to the death your right to say it."
MjrNuT is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old November 11th, 2009, 11:22 PM   #8
Adept
Mikey's Avatar
Posts: 248
Join Date: Sep 2009
Location: United Kingdom

Experience: Master
Forums Admin/Mod: 10+
Software: vBulletin 3.8.x
Forum: Parlancia

Mikey has a spectacular aura aboutMikey has a spectacular aura aboutMikey has a spectacular aura about
Default Re: [HOW-TO] "UnHack" yourself and hacker prevention

No, it was on a dedicated server, so some of these options I said wouldn't be avaliable to you, like dropping the ip of the hacker from the server etc.

Thanks CrazyTech
Chatter? Spammer? Tecchie? Loony? Parlancia is the place for you
YouTube User? Check out my new Music Discussions & Downloads forum?
Mikey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

Old November 12th, 2009, 08:16 AM   #9
Adept
CrazyTech's Avatar
Posts: 107
Join Date: Nov 2009
Location: South Carolina

Experience: Advanced
Forums Admin/Mod: 4
Software: IP.Board

CrazyTech is just really niceCrazyTech is just really niceCrazyTech is just really niceCrazyTech is just really nice
Default Re: [HOW-TO] "UnHack" yourself and hacker prevention

Quote:
No, it was on a dedicated server, so some of these options I said wouldn't be avaliable to you, like dropping the ip of the hacker from the server etc.
Actually it is -- in a way. Use .htaccess to block individual IPs. Google for some tutorials, but let me know in the future if you need help. Also, you should be able to place a ticket to your host to have the IPs blocked.
Idologic Networks Reseller & Managed Dedicated Hosting Since 2001
Administrator: Christianity Board Christian Forum
CrazyTech is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTwitterShare on Facebook
Reply With Quote

1 out of 1 members found this post helpful.
Reply

Tags
hacker, howto, prevention, unhack

AdminAddict > Forum and Community Development > Community/Forum Software > vBulletin > [HOW-TO] "UnHack" yourself and hacker prevention


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 03:13 PM.
Powered by vBulletin®, ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Copyright ©2008-2010 AdminAddict, All Rights Reserved


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51