Created
July 11, 2011 18:18
-
-
Save shamun/1076428 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hacker machine is running with ip: 1.0.0.1 | |
1) /etc/hosts | |
8.8.8.1 zend.com | |
2) open and visit zend.com | |
3) What will be the result for this? in main server? | |
$ip = $this->getRequest()->getServer('REMOTE_ADDR'); | |
8.8.8.1 or 1.0.0.1? | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Zend.com | |
// This server is running with ip: 8.8.8.1 | |
// | |
public function fireAction() | |
{ | |
$ip = $this->getRequest()->getServer('REMOTE_ADDR'); | |
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/conf.ini', 'production'); | |
if ($config->fire) | |
{ | |
$ips = explode(",", $config->fire); | |
if (is_array($ips)) | |
{ | |
foreach($ips as $k=>$v) | |
{ | |
$check = str_replace(" ", "", $v); | |
if ($check==$ip) { | |
$this->_redirect("/?failed"); | |
exit; | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment