Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 21:33

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Brauche dringend hilfe in PHP

Discussion on Brauche dringend hilfe in PHP within the Web Development forum part of the Coders Den category.

Reply
 
Old 10/01/2012, 23:17   #16
 
Hiris's Avatar
 
elite*gold: 99
Join Date: Apr 2011
Posts: 730
Received Thanks: 236
Warum schickstes nicht einfach an die php datei? also ***.php
Hiris is offline  
Old 10/01/2012, 23:26   #17
 
elite*gold: 0
Join Date: Feb 2012
Posts: 267
Received Thanks: 50
Quote:
Originally Posted by ..Zeus.. View Post
Stimmt. Das habe ich selber noch nicht gewusst, danke PHP_SELF bietet 'ne recht einfache Möglichkeit für XSS.

Hier mit SCRIPT_NAME anstatt von PHP_SELF:

Code:
<?php

function ms_escape($data) { //Zu jeder Benutzereingabe hinzufügen!
	if(!isset($data) or empty($data)) return '';
	if(is_numeric($data)) return $data;
	$non_displayables = array(
		'/%0[0-8bcef]/',			// url encoded 00-08, 11, 12, 14, 15
		'/%1[0-9a-f]/',				// url encoded 16-31
		'/[\x00-\x08]/',			// 00-08
		'/\x0b/',					// 11
		'/\x0c/',					// 12
		'/[\x0e-\x1f]/'				// 14-31
	);
	foreach($non_displayables as $regex)
		$data = preg_replace($regex,'',$data);
		$data = str_replace("'","''",$data);
	return $data;
}

$dbhost = '127.0.0.1';
$dbuser = 'Shaiya';
$dbpass = 'Shaiya123';

mssql_connect($dbhost, $dbuser, $dbpass);
session_start();

if (isset($_SESSION['UserUID']))
	echo '<iframe src="http://wallapi.com/api/ps/?key=372f7c56b14a8d1920f2e07adff9aa62&uid&uid='.$_SESSION['UserUID'].'&widget=p1_1" " name="frame1" scrolling="auto" frameborder="no" align="center" height = "1200px" width = "100%"></iframe>';
else if (isset($_POST['login'])) {
	$userid		= ms_escape($_POST['userid']);
	$password	= ms_escape($_POST['password']);
	
	$res = mssql_query("SELECT [UserUID], [UserID], [Point] FROM [PS_UserData].[dbo].[Users_Master] WHERE [UserID] = '".$userid."' AND [Pw] = '".$_POST['password']."'");
	if (mssql_num_rows($res) == 0){
		?>
		<h1>Login erforderlich!</h1>
		<br>
		<font color="red">Kein Benutzer gefunden.</font>
		<br>
		<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST">
			<table>
				<tr><td>Benutzername: </td><td><input type="text" name="userid" value="Benutzername"></td></tr>
				<tr><td>Passwort: </td><td><input type="password" name="password" value="Passwort"></td></tr>
				<tr><td></td><td><input type="submit" name="login" value="Einloggen"></td></tr>
			</table>
		</form>
		<?php
		exit();
	}
	
	$useruid = mssql_fetch_array($res);
	$_SESSION['UserUID'] = $useruid[0];
	Header("Location: ".$_SERVER['SCRIPT_NAME']);	
} else {
	?>
	<h1>Login erforderlich!</h1>
	<br>
	<form action="<?php echo $_SERVER['SCRIPT_NAME'];?>" method="POST">
		<table>
			<tr><td>Benutzername: </td><td><input type="text" name="userid" value="Benutzername"></td></tr>
			<tr><td>Passwort: </td><td><input type="password" name="password" value="Passwort"></td></tr>
			<tr><td></td><td><input type="submit" name="login" value="Einloggen"></td></tr>
		</table>
	</form>
	<?php
}

?>
Danke mein freund, das ist genial!
Ich bin dir was schuldig, nenne mir bitte deine Skype ID damit ich dich entblocken kann.

Ps: Ist dieses Script sql injection geschützt?
cypherxxl is offline  
Old 10/02/2012, 06:49   #18
 
elite*gold: 5
Join Date: Jun 2012
Posts: 176
Received Thanks: 214
Quote:
Originally Posted by cypherxxl View Post
Danke mein freund, das ist genial!
Ich bin dir was schuldig, nenne mir bitte deine Skype ID damit ich dich entblocken kann.

Ps: Ist dieses Script sql injection geschützt?
Ja ist es

PS: blackpanther992
..Zeus.. is offline  
Thanks
1 User
Old 10/02/2012, 09:32   #19
 
elite*gold: 0
Join Date: Feb 2012
Posts: 267
Received Thanks: 50
Der Thread kann geschlossen werden.

Ich bedanke mich recht herzlich bei allen die geholfen haben

Lieben Gruß.
cypherxxl is offline  
Old 10/03/2012, 23:41   #20
 
TechnoMan's Avatar
 
elite*gold: 206
Join Date: Mar 2010
Posts: 1,622
Received Thanks: 426
Quote:
Originally Posted by Hiris View Post
PhP-Self ist soweit ich weiß eine große Sicherheitslücke, hat mir mal jemand gesagt, kann aber sein das ich mich täusche^^
Finde ich super dass du dir gemerkt hast was ich gesagt habe.
TechnoMan is offline  
Old 10/04/2012, 15:49   #21
 
Hiris's Avatar
 
elite*gold: 99
Join Date: Apr 2011
Posts: 730
Received Thanks: 236
Quote:
Originally Posted by TechnoMan View Post
Finde ich super dass du dir gemerkt hast was ich gesagt habe.
Kenne ich sie?
Hiris is offline  
Reply


Similar Threads Similar Threads
[RL - HILFE] Leute ich brauche dringend eure hilfe :/
06/14/2012 - Main - 2 Replies
Hej liebe Community! Seit ein paar Tagen date ich 3 Mädels... (DAS IST MEIN VÖLLIGER ERNST!) Die 3 sehen schon heiß aus, aber das Problem liegt darin, dass alle 3 auf mich abfahren... Ich weiß nicht, was ich machen soll & ein Arschloch bin ich ja auch nicht! Ich lag mit allen 3 schon in der Kiste & fühle mich gerade wie der größte Stecher Berlin's... Ist eigentlich ganz cool, aber wie Carlos will ich nicht enden!!!! :rtfm:
Brauche dringend und zwar wirklich dringend eure Hilfe
09/18/2011 - Metin2 Private Server - 0 Replies
Bei mir auf dem Rootserver verlieren alle Teamler nach wenigen Minuten die GM Rechte, das war gestern noch nicht so... Woran könnte das liegen und wie beheben? Hoffe auf schnelle antwort Wäre mir sogar 10 e*Gold wert für eine Hilfestellung die funktioniert.
Brauche Dringend Hilfe! Bin Metin spieler aber Brauche Hilfe
12/30/2009 - Metin2 Private Server - 0 Replies
Es gehört hier zwar nicht rein , aber ich weiß keine andere Lösung Ich habe seit einigen Tagen ein Problem... Microsoft Windows Search Protocol Host funktioniert nicht mehr Die Anwendung wird Aufgrund eines Problems nicht mehr richtig Ausgeführt. Ich weiß nicht was das ist und wie ich es loswerde.



All times are GMT +1. The time now is 21:33.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.