PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri May 26, 2017 12:34 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon May 30, 2016 10:32 pm 
Offline
Forum Newbie

Joined: Mon May 30, 2016 10:24 pm
Posts: 1
I am beginner and I am struggling with kind of attack called (XSS). I tried this codes
Syntax: [ Download ] [ Hide ]
/"><script>alert('hacked')</script>
/>"
><script>alert("XSS")</script>&
on my [url]127.0.0.1/myweb/home.php?u=paul[/url] and then this is the result: [url]127.0.0.1/myweb/home.php/"><script>alert('hacked')</script>/>"><script>alert("XSS")</script>&?u=daniel[/url]. And now it appears that my web page is been hacked, I do not have any security or validation code to prevent this so I am looking for sample codes, or advices to apply on my application thank you.


Top
 Profile  
 
PostPosted: Tue May 31, 2016 6:19 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6243
Location: Montreal, Canada
Start with this: http://php.net/manual/en/function.htmlspecialchars.php

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Mon Dec 12, 2016 10:12 pm 
Offline
Forum Contributor

Joined: Fri Sep 05, 2008 3:34 pm
Posts: 462
Location: Victoria, BC
paul8088 wrote:
I am beginner and I am struggling with kind of attack called (XSS). I tried this codes
Syntax: [ Download ] [ Hide ]
/"><script>alert('hacked')</script>
/>"
><script>alert("XSS")</script>&
on my [url]127.0.0.1/myweb/home.php?u=paul[/url] and then this is the result: [url]127.0.0.1/myweb/home.php/"><script>alert('hacked')</script>/>"><script>alert("XSS")</script>&?u=daniel[/url]. And now it appears that my web page is been hacked, I do not have any security or validation code to prevent this so I am looking for sample codes, or advices to apply on my application thank you.


I recommend using a secure password for your site, ftp credentials or WP as the case may be. This will keep miscreants out.

_________________
Hardcore Games Legendary is the Only Way to Play!
Vegan Advocate 16 lbs grain to make only 1 lb meat, water for 6 months of showers and 34.1 lbs carbon dioxide
My sites are made with WordPress, which is a content management system, Joomla and Drupal are some alternatives


Top
 Profile  
 
PostPosted: Tue Dec 13, 2016 9:02 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6243
Location: Montreal, Canada
Vegan wrote:
paul8088 wrote:
I am beginner and I am struggling with kind of attack called (XSS). I tried this codes
Syntax: [ Download ] [ Hide ]
/"><script>alert('hacked')</script>
/>"
><script>alert("XSS")</script>&
on my [url]127.0.0.1/myweb/home.php?u=paul[/url] and then this is the result: [url]127.0.0.1/myweb/home.php/"><script>alert('hacked')</script>/>"><script>alert("XSS")</script>&?u=daniel[/url]. And now it appears that my web page is been hacked, I do not have any security or validation code to prevent this so I am looking for sample codes, or advices to apply on my application thank you.


I recommend using a secure password for your site, ftp credentials or WP as the case may be. This will keep miscreants out.

No, no it won't. If your site is vulnerable to cross site scripting, having a "secure password" won't do anything to prevent that. Ditto SQL injection and other common vulnerabilities. Secure passwords are great, but they're not a panacea.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Tue Dec 13, 2016 5:03 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13396
Location: New York, NY, US
Celauran wrote:
No, no it won't. If your site is vulnerable to cross site scripting, having a "secure password" won't do anything to prevent that. Ditto SQL injection and other common vulnerabilities. Secure passwords are great, but they're not a panacea.

Yes, this is exactly right. CSS and SQL injection can happen on public search forms, login pages, etc. that are irrelevant to password security. And yes, strong password are still a good thing.

_________________
(#10850)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group