php etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
php etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

php de şifreli sayfa [Sanal Klavyesi de mevcuttur]

29 Kasım 2008

< ?
$sql
= "select username,password from $tablo_adi where id=1";
$sql_query = mysql_query($sql);
$sql_data = mysql_fetch_object($sql_query);

$username=$sql_data->username; $password=$sql_data->password;

$LOGIN_INFORMATION=array($username => $password);
define('USE_USERNAME', false);
if(isset(
$_GET['logout'])) { setcookie("verify", ''); header("Location: index.php"); }
if(!
function_exists('showLoginPasswordProtect')) {
function
showLoginPasswordProtect($error_msg) {
echo
'


'.$error_msg.'

';
if (
USE_USERNAME)
?>






Kullanıcı Adı :
Şifre :



Şifrenizi Sanal Klavye ile Yazınız










die();
}
}
if (isset(
$_POST['access_password'])) {
$login=isset($_POST['access_login']) ? $_POST['access_login'] : '';
$pass=$_POST['access_password'];
if (!
USE_USERNAME && !in_array($pass, $LOGIN_INFORMATION) || (USE_USERNAME && ( !array_key_exists($login, $LOGIN_INFORMATION) ||
$LOGIN_INFORMATION[$login] != $pass ))){
showLoginPasswordProtect("Kullanıcı adı veya parola yanlış. Lütfen yeniden deneyiniz.");
} else {
setcookie("verify", md5($pass));
}
} else {
if (!isset(
$_COOKIE['verify'])) { showLoginPasswordProtect(""); }
$found=false;
foreach(
$LOGIN_INFORMATION as $kay=>$val) {
if (
$_COOKIE['verify'] == md5($val)) {
$found=true;
break;
}
}
if (!
$found) {showLoginPasswordProtect("");}
}
?>
// Hatasız çalışması için tagının üzerinden include ediniz...

// Kod alıntıdır ve üzerine ekleme yapılmıştır...

Alıntı : http://www.pehepe.org

tr0yan0.blogspot.com

http://www.pehepe.org/kaynak-101.html

Creditcard Number Generator

1.
2.
/***************************************************************************
3.
* Copyleft (C) 2007 by evilsocket *
4.
* *
5.
* *
6.
* http://www.evilsocket.net/ *
7.
* *
8.
* This program is free software; you can redistribute it and/or modify *
9.
* it under the terms of the GNU General Public License as published by *
10.
* the Free Software Foundation; either version 2 of the License, or *
11.
* (at your option) any later version. *
12.
* *
13.
* This program is distributed in the hope that it will be useful, *
14.
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
15.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16.
* GNU General Public License for more details. *
17.
* *
18.
* You should have received a copy of the GNU General Public License *
19.
* along with this program; if not, write to the *
20.
* Free Software Foundation, Inc., *
21.
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22.
***************************************************************************/
23.

24.
$VISA = array( "Visa", 16, array( "4539", "4556", "4916", "4532", "4929", "40240071", "4485", "4716", "4" ) );
25.
$MASTERCARD = array( "Mastercard", 16, array( "51", "52", "53", "54", "55" ) );
26.
$AM_EXPRESS = array( "American Express", 15, array( "34", "37" ) );
27.
$DISCOVER = array( "Discover", 16, array( "6011" ) );
28.
$DINERS = array( "Diners Club", 14, array( "300", "301", "302", "303", "36", "38" ) );
29.
$ENROUTE = array( "EnRoute", 15, array( "2014", "2149" ) );
30.
$JCB = array( "JCB", 16, array( "3088", "3096", "3112", "3158", "3337", "3528" ) );
31.
$VOYAGER = array( "Voyager", 15, array( "8699" ) );
32.

33.
$CARDS = array( $VISA, $MASTERCARD, $AM_EXPRESS, $DISCOVER, $DINERS, $ENROUTE, $JCB, $VOYAGER );
34.

35.
function cc_generate( $type, $number ){
36.
global $CARDS;
37.

38.
$card = $CARDS[ $type ];
39.
$name = $card[0];
40.
$length = $card[1];
41.

42.
print "$name:\n";
43.

44.
for( $i = 0; $i < $number; $i++ ){
45.
$prefix = $card[2][ array_rand($card[2]) ];
46.

47.
while ( strlen($prefix) < ($length - 1) ) {
48.
$prefix .= rand(0,9);
49.
}
50.

51.
$sum = $j = 0;
52.
$rev = strrev($prefix);
53.

54.
while ( $j < $length - 1 ){
55.
$odd = $rev[$j] * 2;
56.
$odd = ($odd > 9 ? $odd - 9 : $odd );
57.
$sum += $odd;
58.

59.
if( $j != ($length - 2) ){
60.
$sum += $rev[ $j + 1 ];
61.
}
62.
$j += 2;
63.
}
64.

65.
$prefix .= (( floor($sum/10) + 1) * 10 - $sum) % 10;
66.

67.
echo "\t$prefix\n";
68.
}
69.
}
70.

71.
function banner(){
72.
print "***********************************************\n" .
73.
"* Credit Card Generator *\n" .
74.
"* by evilsocket [http://www.evilsocket.net] *\n" .
75.
"***********************************************\n\n";
76.
}
77.

78.
function usage(){
79.
global $CARDS;
80.
print "Usage : php ccgen.php \n";
81.
print "\t\tAllowed types are :\n\n";
82.
for( $i = 0; $i < count($CARDS); $i++ ){
83.
print "\t\t\t[$i] " . $CARDS[$i][0] . "\n";
84.
}
85.
print "\n";
86.
}
87.

88.
banner();
89.

90.
$type = $argv[1];
91.
$num = $argv[2];
92.

93.
if( $argc < 2 || $type < 0 || $type > count($CARDS) - 1 ){
94.
usage();
95.
}
96.
else{
97.
cc_generate( $type, $num );
98.
}
99.

100.
?>


http://www.evilsocket.net/?action=nopaste&do=view&key=6280584

Javascript Evil Encoder

< ?php
#
/*
#
Javascript Evil Encoder
#
by evilsocket
#

#
http://www.evilsocket.net
#
evilsocket@gmail.com
#
*/
#

#
function banner(){
#
print "*-------------------------------------------------------*\n";
#
print "* Javascript Evil Encoder *\n";
#
print "* by evilsocket *\n";
#
print "* http://www.evilsocket.net *\n";
#
print "* evilsocket@gmail.com *\n";
#
print "*-------------------------------------------------------*\n\n";
#
}
#

#
function help(){
#
print "Usage :\n";
#
print "\tphp jsencode.php \n";
#
print "Example :\n";
#
print "\tphp jsencode.php page.html encoded_page.html\n\n";
#
}
#

#
function rand_char(){
#
$pattern = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
#
return $pattern[rand(0,strlen($pattern) - 1)];
#
}
#

#
// file_put_contents for PHP <= 4
#
if( function_exists('file_put_contents') == false ){
#
function file_put_contents($n, $d, $flag = false) {
#
$f = @fopen($n, 'w');
#
if ($f === false) {
#
return 0;
#
} else {
#
if (is_array($d)) $d = implode($d);
#
$bytes_written = fwrite($f, $d);
#
fclose($f);
#
return $bytes_written;
#
}
#
}
#
}
#

#
function get_jscript( $html ){
#
preg_match_all( "/\(.*)\<\/script\>/i", $html, $matches );
#

#
return $matches[1][0];
#
}
#

#
function encode_jscript( $js ){
#
$len = strlen($js);
#
$buffer = "";
#
$vars = array();
#

#
for( $i = 0; $i < $len; $i++ ){
#
$var = rand_char()."$i";
#
$vars[] = $var;
#

#
$buffer .= "var $var=\"" . ($js[$i] == "\"" ? "\\\"" : $js[$i]) . "\";";
#
}
#

#
$buffer .= "eval(";
#
for( $i = 0; $i < $len; $i++ ){
#
$buffer .= $vars[$i] . ($i < ($len - 1) ? "+" : "");
#
}
#
$buffer .= ");";
#

#
return $buffer;
#
}
#

#
function encode_file( $src, $dst ){
#
$html = file_get_contents($src);
#
$html = str_replace( "\n", "", $html );
#
$html = str_replace( "\r", "", $html );
#

#
$js = get_jscript( $html );
#
$ejs = encode_jscript( $js );
#

#
file_put_contents( $dst, str_replace( $js, $ejs, $html ) );
#
}
#

#
banner();
#

#
if( $argc < 3 ){
#
help();
#
}
#
else{
#
encode_file( $argv[1], $argv[2] );
#
}
#

#

?>




http://www.evilsocket.net/?action=nopaste&do=view&key=1157198

RFİ Scanner

< ?php
/***************************************************************************
* PHP Evil RFI Scanner v1.2 *
* *
* Copyright (C) 2007 by evilsocket *
* *
* http://www.evilsocket.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************/

/* regex per individuare le inclusioni */
$escan_inc_regex = array( '/include(_once)?.\$/ix', '/require(_once)?.\$/ix' )
;
/* regex per estrarre il nome delle variabili */
$escan_var_regex = array( '/\Ainclude(_once)?./is', '/\Arequire(_once)?./is' )
;
/* array di estensioni dei file da scansionare */
$escan_valid_ext = array( 'php' );
/* massima grandezza di un file da scansionare, se 0 scansiona tutti */
$escan_max_size = 0;
/* contatore delle directory scansionate */
$escan_dir_count = 0;
/* contatore dei file scansionati */
$escan_file_count = 0;
/* contatore dei potenziali rfi trovati */
$escan_match_count = 0;
/* contatore dei bytes totali scansionati */
$escan_byte_count = 0;

escan_banner();


if( $argc < 2 ){
escan_usage($argv[0]);
}
else{

$stime = escan_get_mtime();

escan_recurse_dir( realpath($argv[1]).DIRECTORY_SEPARATOR );

$etime = escan_get_mtime();

print "\n@ Scan report : \n\n" .
"\t$escan_dir_count directory .\n".
"\t$escan_file_count file .\n".
"\t" . escan_format_size($escan_byte_count) . " .\n".
"\t$escan_match_count potenziali RFI .\n".
"\t".($etime-$stime) . " secondi di elaborazione .\n\n";
}

/* formatta in una stringa una grandezza espressa in bytes */
function escan_format_size($bytes)
{
if( $bytes < 1024 ) return "$bytes bytes";
if( $bytes < 1048576 ) return ($bytes / 1024) . " Kb";
if( $bytes < 1073741824 ) return ($bytes / 1048576) . " Mb";

return ($bytes / 1073741824) . " Gb";
}

/* restituisce il timestamp espresso in secondi */
function escan_get_mtime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}

/* estrae la linea di codice dell inclusione */
function escan_scan_line($content,$offset)
{
list( $line, $dummy ) = explode( ";" , substr($content,$offset,strlen($c
ontent)) );

return $line.";";
}

/* estrae il nome della variabile dalla riga di codice dell inclusione */
function escan_parse_var( $line, $regex_id )
{
global $escan_var_regex;

$vars = preg_split($escan_var_regex[$regex_id],$line);
$varname = $vars[1];
$delimiters = " .);";

for( $i = 0; $i < strlen($varname); $i++ ){
for( $j = 0; $j < strlen($delimiters); $j++ ){
if($varname[$i] == $delimiters[$j]){
return substr( $varname, 0, $i );
}
}
}

return $varname;
}

/* controlla se la variabile $var viene definita in $content prima della posizio
ne $offset */
function escan_check_definitions($content,$offset,$var)
{
if( strpos( $var, "->" ) ){
return 1;
}

$chunk = substr($content,0,$offset);
$regex = "/".preg_quote($var,"/")."\s*=/ix";
preg_match( $regex, $chunk,$matches );

return count($matches);
}

/* parserizza il file $file per controllare la presenza di potenziali rfi */
function escan_parse_file($file)
{
global $escan_inc_regex;
global $escan_max_size;
global $escan_file_count;
global $escan_match_count;
global $escan_byte_count;

$fsize = filesize($file);

if( $escan_max_size && $fsize > $escan_max_size ) return;

$escan_file_count++;
$escan_byte_count += $fsize;

$content = @file_get_contents($file);

for( $i = 0; $i < count($escan_inc_regex); $i++ ){
if( preg_match_all( $escan_inc_regex[$i], $content, $matches, PR
EG_OFFSET_CAPTURE ) ){

$nmatch = count($matches[0]);

for( $j = 0; $j < $nmatch; $j++ ){
$offset = $matches[0][$j][1];
$line = escan_scan_line($content,$offset);
$var = escan_parse_var($line,$i);

if( escan_check_definitions($content,$offset,$var) == 0 )
{
$escan_match_count++;
print "@ $file - \n\t- '$var' alla posizione $offset .\n"{ ;
}
}
}
}
}
}

/* restituisce l'estensione del file $fname */
function escan_get_file_ext($fname)
{
if( strchr($fname,'.') ){
return substr($fname,strrpos($fname,'.')+1);
}
else{
return "";
}
}

/* controlla se il file $fname è di un estensione valida */
function escan_isvalid_ext($fname)
{
global $escan_valid_ext;

for( $i = 0; $i < count($escan_valid_ext); $i++ ){
if(strstr(escan_get_file_ext($fname),$escan_valid_ext[$i])){
return true;
}
}

return false;
}

/* funzione che scansiona ricorsivamente le directory */
function escan_recurse_dir($dir)
{
global $escan_dir_count;

$escan_dir_count++;

if( $cdir = @dir($dir) ){
while( $entry = $cdir->read() ){
if( $entry != '.' && $entry != '..' ){
if( is_dir($dir.$entry) ){
escan_recurse_dir($dir.$entry.DIRECTORY_SEPARATOR);
}
else{
if( escan_isvalid_ext($dir.$entry) ){
escan_parse_file($dir.$entry);
}
}
}
}

$cdir->close();
}
}

function escan_banner()
{
print "*-----------------------------------------------*\n" .
"* PHP Evil RFI Scanner v1.2 by evilsocket *\n" .
"* *\n" .
"* http://www.evilsocket.net *\n" .
"*-----------------------------------------------*\n\n";
}

function escan_usage($pname)
{
print "Uso : php $pname

\n";
}
?>

Çarpım Tablosu PHP

27 Kasım 2008

Yaz çiz karala...

Matematik dersi görmemiş veya çarpım tablosunu halen ezberleyemeyenlere bir kolaylık :D

Çarpım Tablosu...

php code ;

< ?
$i
=1;
for (
$i=1;$i<10;$i++){
$j=1;
for (
$j=1;$j<10;$j++){
$t=$k[$j]=$i * $j;
echo
"$i X $j=".$t;

if (!(
$j<9)){
echo
"-------";
print
"Toplam :". (array_sum($k))."";
echo
"-------";

}
}
}
?>



tr0yan0.blogspot.com

Sayısal Loto Tahmin Üreteci PHP :p

Yaz çiz karala..

Sayısal Loto Tiryakilerine ve Ya Tutarsa Düşünceli Vatandaşlarımıza Sayısal Loto Tahmin Üreticisi..

İş Şansa Kaldıysa İş Yaş Baş Baş Diyorum XD



< ?
function
isInside($r,$array,$k) {
for(
$j=0;$j<=$k;$j++) {
if(
$array[$j]==$r)
return
0;
}
return
1;
}

function
rastgele() {
$r= rand(1, 49);
return
$r;
}

$i=0;
$adet=array();
while (
$i <7 ) {
$kontrol=0;
if(
$i!=0) {
while(
$kontrol == 0) {
$rastgele=rastgele();
$kontrol=isInside($rastgele,$adet,$i);
}
}else{
$rastgele=rastgele();
}
$adet[$i]=$rastgele;
$i++;
}

sort($adet);
foreach(
$adet AS $sira => $sayi) {
echo
$sayi."-";
}
?>




tr0yan0.blogspot.com

php ile gün hesapları

< ?php
echo strtotime("now"), "\\n";
// bugün
echo strtotime("10 September 2000"), "\\n";
// 10 eylül 2000
echo strtotime("+1 day"), "\\n";
// bir gün sonrası
echo strtotime("+1 week"), "\\n";
// bir hafta sonrası
echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\\n";
// bir hafta 2 gün 4 saat 2 saniye sonrası
echo strtotime("next Thursday"), "\\n";
// en yakın perşembe
echo strtotime("last Monday"), "\\n";
// son pazartesi
?>

tr0yan0.blogspot.com

cURL ile Arkaplan Dosya İletişimi

< ? function QueryString($arr) {
$qs='';
foreach(
$arr as $d=>$v) {
$qs.=urlencode($d).'='.urlencode($v).'&';
}
$qs = trim($qs,'&');
return
$qs;
}

// verilen arrayı a=b&c=d olarak QueryStringe çevirir

function veriCek($url,$post_arr,$method='POST',$ssl=false) {
//QueryStringi sil
$url = explode('?',$url);
$url = $url[0];
//Host belirtilmediyse kendi hostuna ayarla, SSL varsa https yaz.
if(!preg_match('/http:\/\//',$url)||!preg_match('/https:\/\//',$url)) {
$url = (($ssl)?'https://':'http://').$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/".$url;
}
//Curl aç
if($method=='GET') {
$url.='?'.QueryString($post_arr);
}
$curl = curl_init($url);
//POST aç
curl_setopt ($curl, CURLOPT_POST, 1);
//Query Stringi diğer fonksiyondan oluşturup entegre et, get ve post olarak ayır
if($method=='POST') {
curl_setopt ($curl, CURLOPT_POSTFIELDS, QueryString($post_arr));
}
//Yolladığın sayfadan cevap iste
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
//Headeri kapat neden oldğunu bilmiorum ama gerekli
curl_setopt($curl, CURLOPT_HEADER, 0);
//Sonucu çalıştırıp değişkene ata
$sonuc = curl_exec ($curl);
//cURL kapat
curl_close ($curl);
//Sonucu döndür
return $sonuc;
}

// Kullanım:

$veriler = array("siteadi"=>"tr0yan0.blogspot.com","coder"=>"x");

echo
veriCek("sayfa.php",$veriler,'POST',true); // POST yollar ve SSL açık
echo veriCek("sayfa.php",$veriler,'GET'); // GET yollar ve SSL kapalı
?>

cURL genel olarak kullanıcının yapılan işlemi görmemesi için kullanılır.

Gizli yapılan işlemlerde yaygın olarak kullanılan cURL için çok gelişmiş ve güvenli bir fonksiyondur.
Sanal POS ve e-ticaret uygulamalarında kullanımı yaygındır.

tr0yan0.blogspot.com

Toplu mail göndermek 2 PHP

< ?
ob_start
();

$tablo_adi = "";
$tablo_sutun = "";

$mail_sayi_sorgu = mysql_query("SELECT COUNT(*) FROM $tablo_adi");
list(
$mail_sayi_sonuc) = mysql_fetch_row($mail_sayi_sorgu);
mysql_free_result($mail_sayi_sorgu);

$basla = $_GET["basla"] ? $_GET["basla"] : 0;
$limit = 1;
$bekle = 2;

$konu = "";
$mesaj = "";

$ustk = "From: xxx \n";
$ustk .= "X-Sender: \n";
$ustk .= "X-Mailer: PHP\n";
$ustk .= "X-Priority: 3\n";
$ustk .= "Return-Path: \n";
$ustk .= "Content-Type: text/html; charset=iso-8859-9\n";

$mail_sorgu = mysql_query("SELECT $tablo_sutun FROM $tablo_adi limit $basla,$mail_sayi_sonuc");
$mail_sonuc = mysql_fetch_object($mail_sorgu); mysql_free_result($mail_sorgu);
$mail_adres = $mail_sonuc->eposta;

mail($mail_adres, $konu, $mesaj, $ustk);

echo
" Alıcı : $mail_adres
"
;
echo
"Gönderilen : $basla
"
;
echo
"Kalan :"; echo $mail_sayi_sonuc-$basla; echo "
"
;

if(
$mail_sayi_sonuc > $basla+$limit){
header("refresh: $bekle; url=index.php?basla=".($basla+$limit));
}
?>

DB den gelen mail listesine aynı anda mail atmak için kullanılır.

Alıntı : Spam için kullanmayın please xD

tr0yan0.blogspot.com

Toplu mail göndermek PHP

Yaz çiz karala...

Toplu mail göndermenize yarayacak php bir döküman..

Lütfen spam için kullanmayın :D

< ?php

ob_start();

$basla = $_GET["basla"] ? $_GET["basla"] : 0; // Kactan baslayacak?
$limit = 5; // Kac tanesıne gonderecek?
$bekle = 2; // Kac sanıye bekleyecek?

$konu = "Test";
$mesaj = "...";

$ustk = "From: xxx \\n";
$ustk .= "X-Sender: \\n";
$ustk .= "X-Mailer: PHP\\n";
$ustk .= "X-Priority: 3\\n";
$ustk .= "Return-Path: \\n";
$ustk .= "Content-Type: text/html; charset=iso-8859-9\\n";

if(
$dosya = (fopen("mail.txt",'r'))){
while(!
feof($dosya)){
$satir = trim(fgets($dosya,50));
if(
$satir != "") $mail[] = $satir;
}
fclose($dosya);

for(
$i=$basla; $i<$basla+$limit; $i++){
if(
$mail[$i] != ""){
echo
$mail[$i]."
"
;
mail($mail[$i], $konu, $mesaj, $ustk);
}
}

echo
"
Gönderilen $basla, "
.($basla+$limit)." arası toplam ".($basla+$limit)." mail. ";
if(
count($mail) > ($basla+$limit)){
echo
"Kalan ".(count($mail) - ($basla+$limit))." mail.";
header("refresh: $bekle; url=mail.php?basla=".($basla+$limit)); // Sayfayı yenıle
}
}else {
echo
"Hata: Dosya açılamıyor.";
}
?>



Alıntı : Mail.php olarak kaydetmeniz yeterli..


tr0yan0.blogspot.com