this site keeps getting hacked
#1
Posted 17 January 2012 - 09:40 AM
link to my verifying txt file : http://www.apdec.org.za/phpfreaks.txt
link to the site : http://www.apdec.org.za/
specifically I have been hacked on the branch names and page content.
I have a full backup of code as well as the database.
I would really appreciate any help.
thanks
Craig
#2
Posted 17 January 2012 - 10:19 AM
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
#3
Posted 17 January 2012 - 11:58 AM
#4
Posted 17 January 2012 - 12:10 PM
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
#5
Posted 17 January 2012 - 03:29 PM
all that information is stored in the database, so it would appear to be an sql attack of some sort.
Thanks for the help so far, it is much appreciated
#6
Posted 17 January 2012 - 04:29 PM
If he's changing the home page, he has access to the code as well, unless the string he's inserting comes from a database table.
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
#7
Posted 18 January 2012 - 01:10 AM
You keep saying "branch names" like we know what that term means.
basically it is a non-profit organisation and they have different branches, these branches are stored in a database.
sorry my bad, everything being edited by the hacker is stored in the database.
code seems to stay in place.
Thanks again, I am not a hacker or a security specialist, and this was my first project (the code is not the best).
#8
Posted 18 January 2012 - 01:59 AM
Did you use mysql_real_escape_string() to escape all the strings you are accepting via inserts, updates and deletes? I'm guessing no. Start there.
#9
Posted 18 January 2012 - 02:19 AM
Did you use mysql_real_escape_string() to escape all the strings you are accepting via inserts, updates and deletes?
I think so, I am going to double check them all again to be sure.
#10
Posted 06 March 2012 - 04:40 PM
http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/
also if you have server access to your VPN or SVN might look into getting and installing some freesource anti DDOS software.
Basics: print_r()|what does a particular function do? |how does this work?|PHP returns no error|PHP Books?|Ajax Books?
#11
Posted 10 July 2012 - 08:36 PM
This script is possibly vulnerable to Cross Site Scripting (XSS) attacks.
Cross site scripting (also referred to as XSS) is a vulnerability that allows an attacker to send malicious code (usually in the form of Javascript) to another user. Because a browser cannot know if the script should be trusted or not, it will execute the script in the user context allowing the attacker to access any cookies or session tokens retained by the browser.
This vulnerability affects /events.php,searchresults.php
Discovered by: Scripting (XSS_in_URI.script).
The impact of this vulnerability
Malicious users may inject JavaScript, VBScript, ActiveX, HTML or Flash into a vulnerable application to fool a user in order to gather data from them. An attacker can steal the session cookie and take over the account, impersonating the user. It is also possible to modify the content of the page presented to the user.
Attack details
URI was set to 'onmouseover=prompt(914554)>
The input is reflected inside a tag element between single quotes.
URL encoded GET input Searchterms was set to 1<ScRiPt >prompt(957795)</ScRiPt>
The input is reflected inside <title> tag.
The input is reflected inside a text element.
The input is reflected inside a tag element between double quotes.
Basics: print_r()|what does a particular function do? |how does this work?|PHP returns no error|PHP Books?|Ajax Books?
#12
Posted 14 July 2012 - 11:47 PM
http://www.apdec.org...ch=2&article=58'
Could this be what is causing your problem?
when you query is expecting numbers, force the value to a number like this:
$branch_id = (int)$_GET['branch']; $query = "select * from branches where branch_id = $branch_id";
Twitter: http://twitter.com/phpsnips
http://dreamhost.com (promo code: 8RN4)
$30 off 1 year of hosting
$40 off 2 years of hosting
#13
Posted 15 July 2012 - 02:36 AM
#14
Posted 28 July 2012 - 05:59 PM
http://www.hackforums.net/search.php?action=results&sid=b6617ba1b2b97559ccb77d02b8969b98&sortby=lastpost&order=desc
You may need an account to view them.
Twitter: http://twitter.com/phpsnips
http://dreamhost.com (promo code: 8RN4)
$30 off 1 year of hosting
$40 off 2 years of hosting
#15
Posted 05 November 2012 - 11:47 PM
Use htmlspecialchars() and/or strip_tags() to clean user input.
And avoid using $_GET method
#16
Posted 15 November 2012 - 04:04 AM
$category = filter_input(INPUT_GET, 'category', FILTER_SANITIZE_NUMBER_INT);
Filter_input is an awesome function for security.
Edited by Stefany93, 15 November 2012 - 04:06 AM.
"Never take counsel of your fears!" - Stonewall Jackson
My site - http://dyulgerova.info
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users




This topic is locked







