Security Hole

22 04 2008

From cracker who defaced depkominfo.go.id :

beberapa kelemahan pada situs depkominfo:
XSS
SQLi
LFI/RFI

beberapa settingan pada depkominfo.go.id yg membantu proses hacking:
allow_url_include = on
magic_quotes_gpc = off
user mysql memiliki file_priv on
beberapa folder pada root document yang memiliki write permission untuk user apache





PHP Redirect to SSL

2 04 2008
<?php
if ($_SERVER['SERVER_PORT'] != 443) {
	header(”HTTP/1.1 301 Moved Permanently”);
	header(”Location: https://”.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
	exit();
}
?>




Implementing SOAP Server on CakePHP

23 01 2008

My key concept is: create the SOAP server in the Controller and the methods in the Model. Why? Because controller is … (read this) and model is this.

As an example here we gonna make web service for Post of a Blog (see Blog Tutorial) using native SOAP in PHP version 5.

We’ll put the SOAP handler at URL: http://yourhost/posts/service and the WSDL (which is will be used by the SOAP consumer) at URL: http://yourhost/posts/wsdl.

  1. Create table Post (see the Blog Tutorial for details).
  2. Create Post model (models/post.php) as usual.
  3. Create Post controller (controllers/posts_controller.php), see bellow. You need RequestHandler component for create XML-type response on wsdl action.
  4. Create view for action “wsdl” (views/posts/wsdl.ctp) and define your service method in it. You can publish all of methods in Post model including from its parent (AppModel), eg. findById(), find(), findAll(), etc. Note: you should turning off “short_open_tag” in php.ini to avoid error on rendering the xml of wsdl view. And don’t forget to define your service address in the WSDL to http://yourhost/posts/service.
  5. Now your service consumer could consume your service by pointing to your WSDL URL (http://yourhost/posts/wsdl).

Here are the sample codes: Read the rest of this entry »





Disable AutoRun in Ms. Windows

23 01 2008

Via group policy:

  1. Go to Start > Run
  2. Type gpedit.msc & press Enter. You should see the Group Policy window.
  3. In the left-hand column, select Computer Configuration > Administrative Templates > System
  4. Next, look in the right-hand column for “Turn off Autoplay”, and double-click on that.
  5. Next, in the “Turn Off Autoplay Properties” window, select “Enabled”
  6. Then choose “All drives” from the dropdown menu in “Turn off Autoplay on:”
  7. Click OK.




Web Service Client using CakePHP & PHP SOAP

1 08 2007

I’m using PHP version 5.2.1 and CakePHP version 1.1.16-5421.

In this example we’ll create a basic web service client using native PHP SOAP function and CakePHP. The service we will consume is a “fortune”, you can find its info at xmethods.net.

Here is the complete code:

<?php
class WsController extends AppController {
	var $uses = array();
	var $layout = '';

	function fortune() {
		ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
		$client = new SoapClient("http://www.doughughes.net/WebServices/fortune/fortune.cfc?wsdl",
			array('proxy_host' => "10.1.89.231",'proxy_port' => 8080)
		); // I'm using proxy to connect Internet from my LAN
		try {
			echo $client->getFortune();
		} catch (SoapFault $exception) {
			echo $exception;
		}
	}
?>

Don’t forget to create empty file for the view (I’m wondering how to create an action without a view in CakePHP). Then access it at http://<url to your cake>/ws/fortune.

The key in that code is the WSDL, and function “getFortune()” which is defined in the WSDL.

Really simple isn’t it?





Javascript Variable on Internet Explorer

8 07 2007

Javascript variable name can not be same as DOM element id name on Microsoft Internet Explorer. If it same, it will caused error on IE.

Example:

This example will caused error on IE.

<div id="varFoo" >Foo Bar</div>
<script type="text/javascript">
varFoo = document.getElementById('varFoo');
alert(varFoo);
</script>




PHP’s Control Structures

6 07 2007

if

<?php
if (expr)
   statement;
?>
<?php
if (expr)
   statement;
else
   statement;
?>
<?php
if (expr)
   statement;
else if (expr)
   statement;
else if (expr)
   statement;
else
   statement;
?>

Read the rest of this entry »





Knowledge Management at a Glance

29 06 2007

http://en.wikipedia.org/wiki/Knowledge_management

http://en.wikipedia.org/wiki/Tacit_knowledge

http://www.systems-thinking.org/kmgmt/kmgmt.htm

KM Toolkit:

  1. The KM Fact Sheet,
  2. Knowledge Sharing,
  3. Knowledge Management Implementation Plan Template,
  4. The Knowledge Management Organization,
  5. Knowledge Management Assessment and ROI,
  6. Knowledge Management Tools,
  7. Knowledge Ecomomy and KM Future,
  8. Knowledge Management Systems and Workshop,

I need those toolkit..





How To Create Multiple Blog at WordPress.com

29 06 2007

Read this page, wrote by Matt (founder of wordpress.com):
http://wordpress.com/blog/2006/04/05/unlimited-blogs/





Hello world!

29 06 2007

I’m interested to Knowledge Management and learning about it now. I think blog could be a simply KM tool. I’ll try to manage my knowledge using this blog. Let see how far i could manage my knowledge… :)