Security aspects concerning code written in the programming language PHP which is often used for web applications.
0
votes
1answer
56 views
Security comparisons between two approaches: how to distinguish FUD from Substance? [closed]
Background:
WorkerB and Tymac were discussing the pros-and-cons of using two different alternatives for extending a web content management system that is used in their company.
Alternative one ...
-3
votes
0answers
48 views
Prevent Malware attack on my site [closed]
I built a wordpress site for a client. After some days, client reported that the site has been blocked by Google for Malware content. When I reviewed the site, I found some changes in the code like ...
5
votes
2answers
333 views
Is this Data Encryption/Storage Method Secure?
Let me first say that I know it is a bad idea to store sensitive information in a mysql database, so please don't respond by saying "DON'T DO IT" or something to that effect. I am building a website ...
13
votes
6answers
874 views
Is it possible for a hacker to download a php file without executing it first?
I have a php website where everything is in the public_html\ folder, including inclides folder with config and classes. I told my developer to move it away from public folder but he said there is no ...
0
votes
1answer
113 views
Stopping js malware injection on our Wordpress site
This had been added to our wordpress site, specifically in the footer.php.
hxxp://pkktjuchlrv.peguards.cc/02b31ac5iq/get.js
It is malware as defined by google, i belive it is tracking code.
We have ...
2
votes
2answers
133 views
Are these two ways safe?
I have two scenarios and want to know if each is secure or which risk there are.
Number One:
If the User has the edit Link (edit/[md5hash]) he can edit a post. The editkey (the hash) is in an form ...
-3
votes
0answers
92 views
Decrypt my cookie [closed]
Would anybody -with the right experience- point me to the encryption, encoding, hash this number: ah0nr6721epbph2tts2i0bttd2 is stored as -if it is at all. It's a PHP session cookie.
3
votes
1answer
66 views
PHP - Serializing user inputs
My entropy gathering system works by serializing user inputs:
$entropy=sha1(microtime().$pepper.$_SERVER['REMOTE_ADDR'].$_SERVER['REMOTE_PORT'].
...
6
votes
1answer
212 views
Does HTTPS Encrypt PHP Arguments?
I am working on a web app that will need to have a secret key(s) passed from one server to another - I'll need to do this over PHP. Consider the following URL:
...
5
votes
4answers
260 views
A customers site had a big mysql injection attack on it, just want to learn from it
I created an online store for a friend of mine.
I created a system that shoots me an email any time there is a database error, that way if it is a bug in my code I can identify it and fix it. The ...
1
vote
2answers
58 views
Remote File Injection in ARGS blocking form updating database
I am getting a page forbidden because mod_security blocks it with Remote File Injection in ARGS rule.
How do I stop this apart from not including URLs in the form fields or removing the http:// ...
5
votes
3answers
351 views
How do I make SQL injection harder but not impossible?
I'm doing a CTF application for my final year project. I wanted to craft a SQL injection flag but I don't wish that they can simply found out the SQLi vulnerability by injecting ' . Hence, is there ...
6
votes
3answers
467 views
Is there any SQL injection for this PHP login example?
I want to write a login form, and I got one example from the web.
I want to know, if there is any SQL injection for this code? If there is, what could the exploit's web form entry look like?
This is ...
1
vote
0answers
73 views
Two-way authentication with google authentication app [migrated]
Can someone guide me on what I've done wrong with implementing Google authentication app?
Here is what I've tried without success:
1# Create secret key
$chars = ...
3
votes
1answer
188 views
Exploited by newbie3viLc063s
My debian server got exploited by some scriptiekiddie who used Newbie3viLc063
http://pastebin.com/jma8JRG1 .
Scriptkiddie uploaded logo_php.png to my server (My permissions sucked :s) and he did run ...
1
vote
2answers
95 views
secure certain data on my webserver
I've developed a website where people add their sensitive data. Not credit cards, but lets say they share things about themselves which are private and it wouldn't be good if other people see that ...
2
votes
3answers
146 views
Secure login system - using sessions?
I'm looking for a secure way to let users login on my website. Currently, I've always used a session system, like this:
<?php
session_start();
if (validPass() || isset($_SESSION['userId'])) {
...
3
votes
2answers
90 views
User privileges for unsanatized code
We all know there are still vulnerable code out there even though they may or may not get exploited and found for hacking attempts. I've seen people do it countless times and have a possibly plausible ...
2
votes
1answer
85 views
Securely store two values per user in SQL
I have come across the need in my web app to store two values for each user. These values would need to be retrievable from a value stored in a URL. I would prefer to store neither of the values in ...
2
votes
1answer
85 views
Mark parts of strings as unsafe?
Is there a smooth way to mark unsafe parts of a string? i.e. for use in SQL.
example in php:
someFunction("safe text" . $unsafeVariable . "safe text" . $anotherUnsafeVariable);
Is there a smooth way ...
14
votes
4answers
442 views
What are the security threats of zip file uploads and what preventive actions should be taken?
We have a Drupal application developed for sharing files.
We are allowing zip files to be uploaded by logged in departmental user.
We are using Drupal private file system (outside webroot).
We are ...
1
vote
1answer
82 views
XSS MySQL Database Accessible?
I'd like to know if there is any danger of someone being able to access the database via XSS vulnerabilities on this page.
I have the following link. When you go to this link, the text I've enclosed ...
1
vote
2answers
126 views
How to stop a (malicious) endless loop
Few days ago someone tried to crack my site using a Remote File Inclusion attack.
The attack was blocked by my Web Application Firewall, but I was curious about the file.
So I downloaded it started to ...
2
votes
3answers
125 views
MySQL database access prevention
I am doing a PHP website for a client who deals with third party financial information, and he is concerned about the developmers (me) having access to all the information, which is obviously a valid ...
2
votes
1answer
150 views
ALERT - ASCII-NUL chars not allowed within request variables
In a Drupal site, I get this error in my Debian's syslog.
suhosin[9413]: ALERT - ASCII-NUL chars not allowed within request
variables - dropped variable 'name' (attacker 'x.x.x.x', file
...
2
votes
1answer
123 views
When checking a session variable to see if a user is logged in, is it enough to check to see if the variable is set?
When displaying a page with content only logged in users should see, I simply check
if(isset($_SESSION['hasLoggedIn']))
{
//show content
}
else
{
echo 'you must log in';
}
In this article it ...
3
votes
3answers
608 views
Is it possible to execute a php script in an image file? [duplicate]
I have an image upload php website. Users can upload images to my website. A user claims he can hack my website using an uploaded image.
I opened all the images that he uploaded to my server with ...
3
votes
3answers
190 views
Stop code injections into page code
I started a topic HERE on the stackoverflow site, but was refered here.
I did get some info there, but think it need's more indepth input.
So hopefuly people here can help.
I have a few domains ...
12
votes
1answer
371 views
Risks of a php image upload form
So I have a client wants a photography site where users can upload their photos in response to photography competitions. Though technically this isn't a problem, I want to know the risks associated ...
0
votes
1answer
225 views
Proxy / VPN Quality Check / Detection
Is there any way to build a script which detects or rates proxies like Maxmind's proxy detection software?
I have already tried to use this code, but it doesn't detect all proxies, in fact it detect ...
1
vote
2answers
126 views
how to find injected code in SQL
Recently one of my sites is hacked. The hacker used SQL injection to compromise the security. After getting SQL access he injected code in many places in database. I cleaned up many of them. But I am ...
6
votes
3answers
219 views
Setting a limit on password recovery attempts
in a setting where one has forgotten their password, I'd like to be able to limit the attempts of entering in email addresses to something like 10. My first thought was to use a cookie.
$attempts = ...
0
votes
1answer
348 views
ASP.net vs PHP security? [closed]
I have been told that generally speaking, asp.net web apps tend to be more secure than php, since asp.net has some automatic security measures, for example, by default it doesn't allow remote file ...
1
vote
1answer
95 views
Is it secure to use a custom written Php extension for handling + hashing (db) keys?
I'm designing the security of a new application and try to figure out what the best way is to store the keys of the mysql AES encryption in the file system. I've seen several options like store it ...
-2
votes
1answer
374 views
Admin area in my php website is vulnerable to sql injection without login [closed]
my website admin area is vulnerable to sql injection . I tried using havji and it hacked successfully to database. But how is this possible. without login it breaked into admin panel.
...
7
votes
4answers
668 views
Is $_SERVER[ ] a safe source of data in PHP?
Can I 100% rely on $_SERVER[] to be a safe source of data that I do not need to sanitized like I do $_GET[] and $_POST[]?
Thanks.
OVERVIEW OF RESPONSES:
So it seems there is a consensus that some ...
2
votes
4answers
262 views
When logging out of a website is anything else required then destroying the session?
In PHP, I'm not sure if I should start the session before destroying it when a user wants to log out.
session_start();
session_destroy();
Is there anything else that needs to be done?
EDIT: I ...
2
votes
3answers
143 views
is it safe to allow external images to be attached to Blog or any Web content?
I am filtering all images that attached to any content of my blog:
Check for file extension.
Check content type using $finfo = finfo_open(FILEINFO_MIME_TYPE);
I also save the image temporary on my ...
4
votes
4answers
314 views
Site constantly getting infected
I am the webmaster of some websites running Typo3, 2 of which are getting infected constantly. These 2 sites are being owned by the same client.
Something happens on those 2 sites that causes ...
12
votes
2answers
486 views
PHP attack string in access logs
So one of the Invision Power Board installations on my server was recently compromised. I found what seemed to be the attack (using PHP in the query string and carefully crafted cookies), and I ...
4
votes
1answer
150 views
What are possible consequences for applications that depends on Safe Mode for security?
PHP finally removed safe_mode feature:
Safe Mode
Warning
This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP
5.4.0.
The PHP safe mode is an attempt to solve the ...
1
vote
2answers
173 views
how to bypass “header” in php
While reading an article I encounter an interesting thing I did not know about:
if(!isset($_SESSION['usr_id']) || !isset($_SESSION['usr_name']))
{
header('Location: index.php');
}
...Which ...
1
vote
2answers
112 views
How high is the entropy of this salt-generating code? (No code-reading actually necessary)
What is the best method?
Assumption: I have a function that generates a number of medium-high entropy bytes
Step1:
I generate 3 of these medium-high entropy bytes.
Step2:
I hash these bytes using a ...
4
votes
1answer
106 views
Need to ephemerally store third-party password
One particular web service that I am writing interfaces with an API. Each API call requires the user's username and password to be sent, no state is maintained.
Ideally, when using my web service the ...
2
votes
2answers
122 views
What are the security risks when users upload their html & javascript to AWS S3 and the content is used in a webapp
I'm building this webapp where users can login and build their own online presentation. To build the presentation they can use their own html, css and javascript. These user files are not uploaded to ...
1
vote
5answers
294 views
Site backdoor & eval()
I'm running a Joomla 1.7 site which was hacked today. Below script did the hack.
...
5
votes
1answer
280 views
My site just got hit with a SQL injection attack, how can I tell what they were doing?
So a page on my site (it's a PHP page that displays newsletter articles) was vulnerable to SQL injection and got hit. I discovered it because it was doing enough database queries to cause the CPU load ...
3
votes
1answer
171 views
CodeIgniter CSRF confusion
I have been working with CodeIgniter for about 3 weeks and am very well on the way to loving this framework. However I have been looking at the core code of the framework and I was reading over the ...
-1
votes
1answer
105 views
How Do Spammers Exploit Mailto Fields?
I was interested in finding out how spammers can target my Mailto link to send out spams.
mailto:foo@domain.com?subject=foo
Is it just a case of appending
?from=foo?to=victim1;victim2;victim3
to ...
0
votes
1answer
60 views
Getting hmac_sha to work between Erlang and PHP
I am trying to get an implementation based on the AWS signed http request API to work between Erlang and PHP. But I can't get it to work.
The core approach is that you constructed a canonical version ...





