Simple way to protect ur site fr4 session hack.

Started on the old forum in December 2009 · view the original in the archive · old links redirect here

27 replies · 4,006 views · started 16 years ago · 1 min read

TL;DR · summary of 27 replies
  • - The original question proposed hiding an admin panel by changing its URL path.
  • - Subzero suggested using mod_rewrite to hide the hidden folder with a random string each time the page is refreshed.
  • - Huwad recommended adding passwords, removing BBCodes for links, and preventing accidental script execution as ways to protect against session hacking.
  • - The discussion also touched on other security measures like disabling staff lists, changing admin panel directories, using cookies, and implementing mod_security.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

17 participants
GiLL Senior · 356 posts #21

kei_ki7 wrote: For what is this? 🙂 new in mod Rewrite

its also a security 8)

and if you have own server or can ask to server admin for install and configure mod_security

left wap stuff

ori Lead · 512 posts #22

im not an expert on mod_security but i have mod_security2 on localhost and session stealing is not fixed by this at all

djlee Developer · 224 posts #25

theres many ways to secure a site and ive listed a lot on various threads, if people cant secure there sites now.... they never will. Just to recap a few points:

  1. htmlspecialchar user supplied data
  2. sql escape text supplied by the user before insertion
  3. typecast ints and bools for insertion
  4. never echo back user input unless its neccassary (i.e. you dont need to tell them user "djlee" doesnt exist, they know what they typed in, user not found is more than enough and safer)
  5. use static or near to static headers for authentication
  6. use a private user salt rather than a global salt for passwords
  7. authenticate cookies via subdomain to stop xss cookie stealing attacks
  8. employ whitelisting where applicable, never blacklisting
  9. global fixes never work and never will, never rely on them.
  10. turn off magic quotes and do it properly
  11. turn off the request header or at least never use it
  12. turn reg globals OFF thats all i can recall off the top of my head, but theres plenty more
frostymarvelous Senior · 266 posts #27

Lol. Cookies are safer than sessions? That's the funniest thing I ever heard. Ok, so this is the thing, when cookies are stolen, they can be easily figured out especially when the hacker has harvested loads of them. The trend is visible. Believe me, I've tried. Even finding a unique way. Of using a persons UA. Like I have, difficult to figure out, but still possible.

Now comes in sessions. With sessions, saving some sort of ua string, say a substr() salted and hashed, then check against each use page load. Not just

 if (isset($_SESSION['username']) .......

Take the ua of the user, get your substr and hash with your salt, then compare to session save ua.

If hacker is unable to get ua, or does not know, he gets logged out immediately.

But still. Not proof. Just an extra measure. And as you know, every extra Measure counts.

Perfection comes at a cost

I accept liberty!

frostymarvelous Senior · 266 posts #28

Was just thinking and realized a way to make this better. Well since the session only lasts for as long as a session, you could take the IP as well, but leave out the last 3 numbers as they are likely to change depending on the ISP. Add it to The UA and hash it. Unless you share the same ISP or IP range, or the hacker manages to successfully spoof his IP to match hacked users IP, this would be great. But as it was said, if you want to be 100percent safe, take your server offline. Lmfao.

Perfection comes at a cost

I accept liberty!

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close