Need Help Securing Website.

Discussion in 'PHP' started by astrazone, Feb 22, 2010.

  1. #1
    I created a website in couple of days (my second website ever) and I have 0 knowledge in security.

    I need some help tips for XSS and CSS.

    The website astrazone.com/website

    Admin User

    Username : Admin
    Password : pass

    Normal User

    Username : idan
    Password : edri

    try to add comments,new posts , edit stuff, and find security holes.

    Thanks.

    PS:

    I disabled some features, and some are still under construction.
     
    astrazone, Feb 22, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    I can see many flaws in your script.

    Without me even logging in,

    1. http://astrazone.com/website/page.php?p=3 (example page), I can post a comment without entering any data!, validate it! - use strip_tags! to strip code as it can also look untidy even its been printed and not executed ;)

    2. Consider adding a capatcha to the comment form -> http://astrazone.com/website/page.php?p=3 (example page)

    3. Always validate your $_GET values, if I input an invalid value; it should display some sort of error, not proceed, (since the $_GET is invalid).
     
    danx10, Feb 22, 2010 IP
  3. astrazone

    astrazone Member

    Messages:
    358
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #3
    I will patch to version 1.0.2 and renew this thread... Thanks for all the replies.
     
    astrazone, Feb 22, 2010 IP
  4. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #4
    strip_tags will not strip all HTML. You should simply use htmlspecialchars($bla, ENT_QUOTES, 'UTf-8');
     
    premiumscripts, Feb 23, 2010 IP
  5. K.Meier

    K.Meier Well-Known Member

    Messages:
    281
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Did you do all the coding? As well as the login system?
     
    K.Meier, Feb 23, 2010 IP
  6. extraspecial

    extraspecial Member

    Messages:
    788
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    45
    #6
    why are you trying to code yourself? Use a cms like wordpress :)
     
    extraspecial, Feb 23, 2010 IP
  7. n3r0x

    n3r0x Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #7

    Maybe because everyone else uses stuff like that... And if someone wants to learn coding he/she needs to test writing something of their own.. not modify wordpress features..

    @Astrazone:

    Great start.. You should check htmlentities unless you use utf-8 encoding then you should use htmlspecialchars as premiumscripts said.. or just make your own function.. i did a while back
     
    n3r0x, Feb 23, 2010 IP
  8. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #8
    I've always prefered to code my own, and havent yet had the need to use wordpress. Coding your own, can have benefits.

    But, I'm not knocking wordpress its great software, however such software should only be used for blogs, and not customized to be something its not ;)
     
    danx10, Feb 23, 2010 IP
  9. K.Meier

    K.Meier Well-Known Member

    Messages:
    281
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #9
    I think its great when people code their own website instead of using pre made CMS.
     
    K.Meier, Feb 23, 2010 IP
  10. DN48

    DN48 Peon

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    yes I agree, each website deserve its own code, moreover security holes are harder to find since its not open source ;)
     
    DN48, Feb 24, 2010 IP