4
I am facing a serious problem with hackers and/ or crackers on the site developed for a city hall. I did tests with SQL MAP
on every page of the website. I tested the ftp lock, searched for injected files inside the site, searched for viruses, Malwares and backdoors and so far nothing...
Then I came up with this question, how to test the application effectively and locate the security flaws related exclusively to the application?
I think that in order to not get so wide the question could be focused only in relation to the WEB environment... if the person who answers the question thinks it can cover all the content it will be very welcome too :D
I would also like it to be possible for the answer to be very generic and to apply to any form of development (within the limitations of languages)
Information on the application:
Language: PHP
Database: Mysql Database: Mysql
Connections: mysql_connect (not my fault)Focus of Attack: Database
Common problems
Script injection for page redirection
Image injection into news and highlights
File injection for backdoorItems that do not cause problems(no attempts)
Attacks of Dos
Attacks by Brute-ForceCorrections in first instance
Exchange of database credentials
Administrator password exchange (current hash -> df8bce1285196dddc104c22f15665dac)
I had already asked What the code below (written by a Cracker) does? and had posted the code of one of the files that were already injected into the site...
I scanned the ftp and made sure that there is no malicious file inside it...
All gets and posts are validated as follows
if(isset($_GET['t'])){
$ids = (int)mysql_real_escape_string($_GET['t']);
if(!is_numeric($ids)){
$ids = '1';
}
} else {
$ids = '1';
}
So give more information about your problem, your structure, etc.
– Maniero
@bigown in this case, I’m not sure what information is needed to evaluate(I’d like it to be as generic as possible) if you can help me by telling me what information is most vital to be able to answer
– RodrigoBorth
What exactly happened? The application is written in what programming language? You quoted SQL, the attack was in the database?
– user7261
@Andrey added the question
– RodrigoBorth
You’re looking in the wrong place. Read more about safety in application in the project OWASP
– Felipe Fonseca
What exactly are the problems you’re having? The types of vulnerability an application may be exposed to are many and quite diverse, a generic response would be either too superficial or too extensive. If you can’t describe the problem in more detail, at least tell us what problems you have is not facing (e.g.: Dos, session hijacking, identity theft, JS injection, shell injection...). Of course, one cannot be sure that a vulnerability does not exist, but by "symptoms" one can restrict the focus of analysis to its probable causes.
– mgibsonbr
Well, if the vulnerability affects the database, you can start by changing the DB credentials and migrating the application layer to PDO/mysqli and start using Prepared statments
– gmsantos
@gmsantos would be a dream can do this, but for contractual issues and disagreement between the company and the city can not spend the day replacing all connections to
prepared statments
:'(– RodrigoBorth
Rodrigo, this disagreement is like Client: "You who did it or you who took over for free" ?
– gmsantos
@gmsantos is like "you did it, it’s not our fault if our employees sabotage the system itself"... Obs: the biggest suspicion so far is that it is a fight between the public servers, has happened to another city site
– RodrigoBorth
We are working to fix the flaws however the site is relatively old, an update of this size requires a lot of time (we do not have staff left for this) and for free will surely not be done...
– RodrigoBorth