<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ra23.net</title>
	<atom:link href="http://ra23.net/wop/feed/" rel="self" type="application/rss+xml" />
	<link>http://ra23.net/wop</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 10 Mar 2011 23:45:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PHPIPS activated in this WordPress Installation</title>
		<link>http://ra23.net/wop/2011/03/phpips-some-more-coding-done/</link>
		<comments>http://ra23.net/wop/2011/03/phpips-some-more-coding-done/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 23:11:47 +0000</pubDate>
		<dc:creator>Andre Rein</dc:creator>
				<category><![CDATA[phpips]]></category>

		<guid isPermaLink="false">http://ra23.net/wop/?p=151</guid>
		<description><![CDATA[Hi, today I started coding again on PHPIDS. I implemented it in this wordpress installation. Each attack is logged into a mysql table and the system is in so called "kick ass mode". So if you inject some stuff you will soon or later mess up your session. If you reset your session you are [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>today I started coding again on PHPIDS.</p>
<p>I implemented it in this wordpress installation. Each attack is logged into a mysql table and the system is in so called "kick ass mode".<br />
So if you inject some stuff you will soon or later mess up your session.</p>
<p>If you reset your session you are back on 0 and can inject other attacks or just leave me a comment. :)</p>
<p>Feel free to play a little bit around with the search or the admin login and inject some attacks.</p>
<p>A low level attack e.g. </p>
<pre>
'>XXX
</pre>
<p>If you need some higher impact values try to search for </p>
<pre>
'>XXX javascript:alert(1) SELECT DISTINC ;
</pre>
<p>The coding itself was cleaning up codebase, so no new feature is in the code, just a few modified commands for mysql logging and sending mails.</p>
<p>I really need some attack requests and some more testing to further implement new functionality. So feel free to suggest wishes, what you would like to see or to have.<br />
Because most coding effort is currently framework stuff, it will take some time for a new version because till now everything works quite fine.</p>
<p>Oh, and please don't hurt this system, or at least try to :)</p>
]]></content:encoded>
			<wfw:commentRss>http://ra23.net/wop/2011/03/phpips-some-more-coding-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Websocket protocol changes</title>
		<link>http://ra23.net/wop/2011/01/websockets-changes/</link>
		<comments>http://ra23.net/wop/2011/01/websockets-changes/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 15:08:52 +0000</pubDate>
		<dc:creator>Andre Rein</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://ra23.net/wop/?p=143</guid>
		<description><![CDATA[On early December 2010 Christopher Blizzard announced the removement of the websocket implementation in FF 4.0 0xdeadbeef (Opera also removed it.) There was an attack scenario which poisons a proxy server such that the upgrade handshake of the websockets can be attacked. Look here if you are interested in the details. This means for my [...]]]></description>
			<content:encoded><![CDATA[<p>On early December 2010 Christopher Blizzard announced the removement of the websocket implementation in FF 4.0<br />
<a href="http://http://www.0xdeadbeef.com/weblog/">0xdeadbeef</a><br />
(Opera also removed it.)</p>
<p>There was an attack scenario which poisons a proxy server such that the upgrade handshake of the websockets can be attacked.<br />
Look <a href="http://http://www.ietf.org/mail-archive/web/hybi/current/msg04744.html">here</a> if you are interested in the details.</p>
<p>This means for my implementation it has to wait until the actual draft gets updated/modified.<br />
It makes no sense for further developing without knowing what actually will change in the specification.</p>
<p>I will continue coding on my implementation as soon as the draft is updated and browsers who removed it re-enable websockets again.</p>
]]></content:encoded>
			<wfw:commentRss>http://ra23.net/wop/2011/01/websockets-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mid February phpips coding will continue&#8230;</title>
		<link>http://ra23.net/wop/2011/01/mid-february-coding-will-continue/</link>
		<comments>http://ra23.net/wop/2011/01/mid-february-coding-will-continue/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 19:48:54 +0000</pubDate>
		<dc:creator>Andre Rein</dc:creator>
				<category><![CDATA[phpips]]></category>

		<guid isPermaLink="false">http://ra23.net/wop/?p=140</guid>
		<description><![CDATA[Hi there, the last 3 months, I had so much work to do, I wasn't able to write a single line of code for this project. I plan to continue coding mid February again, so stay tuned. If anyone wants to contribute, in whatever way, just let me know.]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>the last 3 months, I had so much work to do, I wasn't able to write a single line of code for this project.<br />
I plan to continue coding mid February again, so stay tuned.</p>
<p>If anyone wants to contribute, in whatever way, just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://ra23.net/wop/2011/01/mid-february-coding-will-continue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Websocket implementation in php</title>
		<link>http://ra23.net/wop/2010/11/websocket-implementation/</link>
		<comments>http://ra23.net/wop/2010/11/websocket-implementation/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 17:15:53 +0000</pubDate>
		<dc:creator>Andre Rein</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://ra23.net/wop/?p=127</guid>
		<description><![CDATA[Hi, yesterday I wanted to do some tests with Websockets which will be available when HTML5 is coming to the real world. I downloaded a phpwebsocket implementation, done early this year and tried to get it running with the examples. Soon I noticed, it cannot work, cause the browsers (I tested with Chrome and Firefox), [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>yesterday I wanted to do some tests with Websockets which will be available when HTML5 is coming to the real world.</p>
<p>I downloaded a phpwebsocket implementation, done early this year and tried to get it running with the examples.</p>
<p>Soon I noticed, it cannot work, cause the browsers (I tested with Chrome and Firefox), modified the way they handle the handshakes.<br />
Earlier this year, it was possible to just send a standard reply to the browser and the connection gets initiated.</p>
<p>Now you have to do some calculations from given keys from the browser at server side.<br />
So the browser initiates the connection to a socket and sends some data. </p>
<p>E.g.:</p>
<pre lang="bash">
GET / HTTP/1.1
Connection: Upgrade
Host: example.com
Upgrade: WebSocket
Sec-WebSocket-Key1: 3e6b263  4 17 80
Origin: http://example.com
Sec-WebSocket-Key2: 17  9 G`ZD9   2 2b 7X 3 /r90

WjN}|M(6
</pre>
<p>At server side, you have to do the following now:</p>
<pre>
Extract the keys
Count Spaces
calculate(key/spaces)
get random challenge
concatenate calculated keys+random challenge
build md5 hash of concatenation
and sent it back to the client.
</pre>
<p>If the generated hash value is the one the client expects, you get a connection, else this fails.</p>
<p>It took quite some time to get this running, maybe I will explain the implementation later.</p>
<p>I've uploaded my code to sourceforge, you can download it from there if you want to test it.</p>
<pre lang="bash">
svn co https://phpwebsocket.svn.sourceforge.net/svnroot/phpwebsocket phpwebsocket
</pre>
<p>It is not working for multiple clients from the same machine, but for a first test or impression its usable.<br />
I will do some work on the code to fix this, but for know you have to live with that :)</p>
<p>If you downloaded the code, just start the server with:</p>
<pre lang="bash">
php TestServer.php
</pre>
<p>Open your browser and point it to the client html file called test.html in the client directory.</p>
<p>If you have any question or problem, just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://ra23.net/wop/2010/11/websocket-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating custom modules for phpips</title>
		<link>http://ra23.net/wop/2010/10/creating-custom-modules-for-phpips/</link>
		<comments>http://ra23.net/wop/2010/10/creating-custom-modules-for-phpips/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 22:00:51 +0000</pubDate>
		<dc:creator>Andre Rein</dc:creator>
				<category><![CDATA[phpips]]></category>

		<guid isPermaLink="false">http://ra23.net/wop/?p=100</guid>
		<description><![CDATA[Hi, as promised I will explain how you can create custom modules for the ips system today. At first you should get the latest version from the svn reposatory from sourcforge. svn co https://php-ips.svn.sourceforge.net/svnroot/php-ips/trunk/ php-ips To add a new module, you just need to create a new directory under phpids/lib/Modules We will name it Example. [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>as promised I will explain how you can create custom modules for the ips system today.</p>
<p>At first you should get the latest version from the svn reposatory from sourcforge.</p>
<pre lang="bash">
svn co https://php-ips.svn.sourceforge.net/svnroot/php-ips/trunk/ php-ips
</pre>
<p>To add a new module, you just need to create a new directory under phpids/lib/Modules<br />
We will name it Example.</p>
<pre lang="bash">
mkdir phpids/lib/Modules/Example
</pre>
<p>This is you new Module Directory. Now we need a place where we can add Commands for our Module.<br />
The Directory name, the system searches Commands is named, well "Command" :)</p>
<pre lang="bash">
mkdir phpids/lib/Modules/Command
</pre>
<p>Our first command, we will implement is a modified version of the log command.<br />
The default command just opens a file and writes logging messages to it.<br />
This is fine, but we are logs going in a database, so wa can do some analysing logfiles more easily with a nice backend. To simplify this example much, I will use a SQLite Database. If you want another Database, like MySQL, PGSQL or even Microsoft SQL Server you can do this on your own.</p>
<p>Further I will use the PDO php package doing the Database stuff, so forgive me, its my second time working with it, so hopefully I don't mess up my code to much. (We will see if Zend Framework spoiled me too much :))</p>
<p>To create the Command, all we have to do is add a new file. With the name Log.php. Lets do it.</p>
<pre lang="bash">
touch phpids/lib/Modules/Command/Log.php
</pre>
<p>In the file itself you need to insert the following code, before we begin.</p>
<pre name="code" class="php">
class Module_Example_Command_Log extends Ips_Command_Abstract {
	private static $_instance=null;

	public static function getInstance() {
		if (self::$_instance==null)
		self::$_instance=new self();
		return self::$_instance;
	}

	protected function realExecute() {
	}

	protected function realSimulate($fileHandle) {
	}

}
</pre>
<p>From the frameworks point of view, thats all. Just implement the methods and you are done. (Well you need to configure the system, using the new Module Directory, furthermore it makes no sense to only implement one command in a module. So you have to implement all commands you need in this module.<br />
I will show the configuration Part at the end. )</p>
<p>Ok, forget the last note, we implement the code now here, cause I wann show some things you probably need while you are implementing your own commands.</p>
<p>As I said, we wanna log to a sqlite database. So first of all, we need to create it. (We will use sqlite3, so moke sure you got the sqlite3 package of your distribution. Further you need php5-sqlite php module)</p>
<p>First the table definition:</p>
<pre lang="sql">
CREATE TABLE [loggertable] (
[id] INTEGER  NOT NULL PRIMARY KEY AUTOINCREMENT,
[time] TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
[affected_tags] VARCHAR(256)  NULL,
[impact] INTEGER  NOT NULL,
[session_impact] INTEGER  NOT NULL,
[attacker_ip] VARCHAR(128)
);
</pre>
<p>Just open a new file, called create_loggerdb.sql and insert the sql code in it. Than use the following commands</p>
<pre lang="bash">
sqlite3 logger.db < create_loggerdb.sql
chown www-data logger.db
chmod u+rw logger.db
</pre>
<p>(www-data is the user running the httpd server at debian based systems. So you have to use your user who run the httpd server on your host)</p>
<p>Now we have our database finished. Just put the file to a place where you httpd server can reach it. I willt put it in the directory /var/www/path/to/webroot/phpips/examples/logger.db</p>
<p>If you downloaded a package greater alpha_01 you already have such a file in the examples directory. You can use it if you like.</p>
<p>Now lets go back to our logger command.</p>
<p>I will now add some methods to the class, you can just copy and paste the following code or do it on your own.</p>
<p>I created a method called dbInsert, here the code:</p>
<pre name="code" class="php">
private function dbInsert(){
	$this->_dbPath=$this->_dbPath=$this->_registry->getBasePath().
                               "phpips/examples/db/logger.db";
	$this->_dbTableName="loggertable";
	$db=new PDO('sqlite:'.$this->_dbPath);
	$idsReport=$this->_registry->getidsReport();
	$session_impact=$this->_registry->getHighestSessionImpact();
	$impact=$idsReport->getImpact();
	$attacker_ip=$_SERVER['REMOTE_ADDR'];
	$affected_tags=$idsReport->getTags();
	$affected_tags_text="";
	foreach ($affected_tags as $tag){
		$affected_tags_text.="[".$tag."]";
	}
	$values=array($impact,$affected_tags_text,
                             $session_impact,$attacker_ip);
	$insert=$db->prepare("INSERT INTO ".
             $this->_dbTableName." ( impact,
						affected_tags,
						session_impact,
						attacker_ip
						)
						values (?,?,?,?);"
						)->execute($values);
}
</pre>
<p>I modified the realExecute method like this:</p>
<pre name="code" class="php">
protected function realExecute() {
    $this->dbInsert();
}
</pre>
<p>The realSimulate method I just copied from an existing one.</p>
<pre name="code" class="php">
protected function realSimulate($fileHandle) {
	$logText = "\n-------\n";
	$logText.= "SIMULATING LOGGING COMMAND\n";
	$logText.= "Logging to Database\n";
	$logText.= "-------\n";
	$this->_registry->add("SimulationOutputBuffer", $this->_registry->
                 get("SimulationOutputBuffer").$logText);
	fwrite($fileHandle, $logText);
}
</pre>
<p>To get the full code I post it here again:</p>
<pre name="code" class="php">
class Module_Example_Command_Log extends Ips_Command_Abstract {
	/*
	 * This is the sample command descripted implementing in my blog.
	 * http://ra23.net/wop/category/phpips/
	 *
	 */
	private static $_instance=null;
	private $_dbPath=null;
	private $_dbTableName=null;
	public static function getInstance() {
		if (self::$_instance==null)
		self::$_instance=new self();
		return self::$_instance;
	}
	protected function realExecute() {
		$this->dbInsert();
	}

	protected function realSimulate($fileHandle) {
		$logText = "\n-------\n";
		$logText.= "SIMULATING LOGGING COMMAND\n";
		$logText.= "Logging to Database\n";
		$logText.= "-------\n";
		$this->_registry->add("SimulationOutputBuffer", $this->_registry->
                         get("SimulationOutputBuffer").$logText);
		fwrite($fileHandle, $logText);
	}
	private function dbInsert(){
		$this->_dbPath=$this->_dbPath=$this->_registry->getBasePath().
                                       "phpips/examples/db/logger.db";
		$this->_dbTableName="loggertable";
		$db=new PDO('sqlite:'.$this->_dbPath);
		$idsReport=$this->_registry->getidsReport();
		$session_impact=$this->_registry->getHighestSessionImpact();
		$impact=$idsReport->getImpact();
		$attacker_ip=$_SERVER['REMOTE_ADDR'];
		$affected_tags=$idsReport->getTags();
		$affected_tags_text="";
		foreach ($affected_tags as $tag){
			$affected_tags_text.="[".$tag."]";
		}
		$values=array($impact,$affected_tags_text,
                                     $session_impact,$attacker_ip);
		$insert=$db->prepare("INSERT INTO ".
                                   $this->_dbTableName." (   impact,
							                affected_tags,
									session_impact,
									attacker_ip
								)
								values (?,?,?,?);"
								)->execute($values);
}
</pre>
<p>The other needed commands like Mail, Warn, Kick, Ban I just copied out of the Test folder and renamed them to fit the module.</p>
<p>Thes example is included withing the alpha_2 release, so you get the code here:</p>
<p>http://sourceforge.net/projects/php-ips/files/</p>
<p>To get this module now running, just go to etc/System.ini and edit it. Below I show you what you need to change:</p>
<pre lang="ini">
UseCustomCommands="On"
CustomCommandModuleName="Example"
</pre>
<p>Now your new Module is activated and the system uses our created new log command.</p>
<p>I hope you enjoyed this post, if anything isn't clear or you just found an error in this post, use the comment system.</p>
<p>I'll upload the alpha_2 release asap, so you can implement your own command modules now.</p>
<p>regards</p>
]]></content:encoded>
			<wfw:commentRss>http://ra23.net/wop/2010/10/creating-custom-modules-for-phpips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing php based web applications with phpips</title>
		<link>http://ra23.net/wop/2010/10/securing-php-based-web-applications/</link>
		<comments>http://ra23.net/wop/2010/10/securing-php-based-web-applications/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 00:26:00 +0000</pubDate>
		<dc:creator>Andre Rein</dc:creator>
				<category><![CDATA[phpips]]></category>

		<guid isPermaLink="false">http://ra23.net/wop/?p=80</guid>
		<description><![CDATA[Currently I'm working on an Intrusion Prevention System, project name is phpips. The system itself is based on the Intrusion Detection System PHPIDS The main goal is to program a framework like ips system, which interacts with the ids. Currently interacting with the ids is working fine and I'm implementing the framework around the system. [...]]]></description>
			<content:encoded><![CDATA[<p>Currently I'm working on an Intrusion Prevention System, project name is phpips.</p>
<p>The system itself is based on the Intrusion Detection System <a href="http://phpids.net">PHPIDS </a></p>
<p>The main goal is to program a framework like ips system, which interacts with the ids.<br />
Currently interacting with the ids is working fine and I'm implementing the framework around the system.<br />
If you wanna check out the current version, its online under: <a href="http://ra23.net/phpips/online_version_ra23_alpha01/example.php">http://ra23.net/phpips/online_version_ra23_alpha01/example.php</a>. Take a look and play a bit around with it.<br />
But don't hurt my machine ;)</p>
<p>At a later stage a programmer would be able to implement modules for the ips, and configure the system with a few configuration files or even from a database.</p>
<p>There is no Documentation for the code yet and how you can implement modules (which is working already, but I'm not fully satisfied yet.)</p>
<p>To give you a short preview how you can install and setup the example in your enviroment, I'll show some Details now.</p>
<p>As I already said, the System is based on phpids. If you already have a running phpids, you can use it, if not there will be an actual version included in the first code release.</p>
<p>So you need to configure the ids first. Currently I'm not using special functions in my setup. I just editied the main configuration (phpids-0.6.4/lib/IDS/Config/Config.ini.php)</p>
<p>Just use the absolute path to the location where your phpids is located.</p>
<pre lang="php"> base_path       = /var/www/path/to/webroot/php-ips/phpids-0.6.4/lib/IDS/</pre>
<p>You can find the documantation for phpids <a href="http://php-ids.org/faq/">here</a>. Search for "How to install the PHPIDS"</p>
<p>The project is currently hosted on sourceforge.net</p>
<p>To Download the first alpha release follow <a href="https://sourceforge.net/projects/php-ips/files/">this link</a></p>
<p>Well, if you downloaded my code, you have to configure it too.<br />
There are three things which have to be done, pretending you wanna get the example.php up and running.</p>
<p>1. Configure phpips/etc/System.ini:<br />
You need to setup the Basepath:</p>
<pre lang="php">BasePath="/var/www/path/to/webroot/php-ips/"</pre>
<p>2. Edit example.php</p>
<p>You need to define a path here too, now third time. All good things are three you know ;)</p>
<pre lang="php">define("PATH_TO_ROOT", "/var/www/path/to/webroot/php-ips/" );</pre>
<p>I promise, it was the last time setting a path.</p>
<p>3. Edit System.ini to fit your needs.</p>
<p>You find the Documentation inline. For the first running test, you don't need to modify anything inside.</p>
<p>On my example page, the Debugger is enabled. So if you wanna see what the system actually does in the Background get the following Fiefox addons:</p>
<p><a href="http://www.getfirebug.com ">FireBug</a><br />
<a href="http://www.firephp.org ">FirePHP </a></p>
<p>I write another post in a couple of days, explaining how to create you own modules, configuring the system and so on....<br />
This need further testing right now and is not satisfying me right now.</p>
<p>If you found a bug or have trouble with setting the system up, just use the comment system.</p>
<p>I advice you, the system is under heavy development. Things can change rapidly, so try it, have fun with it, but things can change very fast. Never ever use the alpha version in a production enviroment.</p>
<p>Never. Ever. Please! </p>
<p>I did a further post, how to build your own modules. You find it <a href="http://ra23.net/wop/2010/10/creating-custom-modules-for-phpips/">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ra23.net/wop/2010/10/securing-php-based-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mumble Online User anzeigen</title>
		<link>http://ra23.net/wop/2010/03/mumble-online-user-anzeigen/</link>
		<comments>http://ra23.net/wop/2010/03/mumble-online-user-anzeigen/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 18:07:45 +0000</pubDate>
		<dc:creator>Andre Rein</dc:creator>
				<category><![CDATA[mumble]]></category>
		<category><![CDATA[baum]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[tree]]></category>

		<guid isPermaLink="false">http://ra23.net/wop/?p=33</guid>
		<description><![CDATA[Die Ausgabe von Kanälen in Mumble ist Anfangs leicht verwirrend, da ich im Netz keine Anleitung gefunden habe, wie man so eine Anzeige generiert, hier eine kleine Einstiegshilfe. Dazu sollte ich noch sagen, das es um die Darstellung der Kanäle/Benutzer in einer Baumstruktur geht. Die Kanäle/Benutzer einfach in einer Anzeige-Ebene als HTML ausgeben, stellt kein [...]]]></description>
			<content:encoded><![CDATA[<p>Die Ausgabe von Kanälen in Mumble ist Anfangs leicht verwirrend, da ich im Netz keine Anleitung gefunden habe, wie man so eine Anzeige generiert,<br />
hier eine kleine Einstiegshilfe. Dazu sollte ich noch sagen, das es um die Darstellung der Kanäle/Benutzer in einer Baumstruktur geht.<br />
Die Kanäle/Benutzer einfach in einer Anzeige-Ebene als HTML ausgeben, stellt kein Problem dar. Dafür sind Funktionen vorhanden.</p>
<p>Es geht hier explizit um die Darstellung, die die Tiefe der Kanäle und der Benutzer beachtet und demnach ausgibt:</p>
<pre lang="php">
#root-channel
  -subchannel1
  -subchannel2
    - subsubchannel21
      o User1
      o User2
  -subchannel3
</pre>
<p>Mumble verwendet eine Schnittstelle mit dem Namen Ice, die in PHP registriert sein muss.</p>
<p>Unter Debian benötigt man das Paket "php-zeroc-ice"<br />
Aktiviert wird das ganze unter: /etc/php5/conf.d/IcePHP.ini</p>
<pre lang="php">
extension = IcePHP.so
</pre>
<p>In der Konfigurationsdatei von php, gibt man den Link zu Murmur.ice ein. (Ist im Serverdownload enthalten)</p>
<p>php.ini</p>
<pre lang="php">
ice.slice=/pfad/zu/Murmur.ice
</pre>
<p>Nun stellt man noch sicher, das in der Konfigurationsdatei von Murmur folgendes enthalten ist:<br />
Murmur.ini</p>
<pre lang="php">
ice="tcp -h 127.0.0.1 -p 6502"
</pre>
<p>Wenn man nun den Murmur Server startet, sollte die ICE-Schnittstelle auf dem angegebenen Port zur Verfügung stehen, mit der wir jetzt agieren können.</p>
<p>Achtet darauf, das die Variable $ICE global sein muss, ansonsten funktioniert es leider nicht.<br />
Aufgerufen wird das ganze folgendermaßen:</p>
<pre name="code" class="php">
<?
  global $ICE;
  $output="";
  try{
    Ice_loadProfile();
    $base = $ICE->stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502");
    $meta = $base->ice_checkedCast("::Murmur::Meta");

    //paste in your serverid!
    $server= $meta->getServer(1);
    $myoutput=plotTreePlainTest($server->getTree());
  }
  catch (Ice_Exception $ex) {
    print_r($ex);
  }
echo $myoutput;
?>
</pre>
<p>Auch hier findet wieder eine globale Variable Verwendung. Die Variable kann natürlich auch als Referenz übergeben werden.</p>
<p>Hier die Funktion, die uns die HTML-Ausgabe macht:</p>
<pre name="code" class="php">

function plotTreePlainTest($tree,$indent=0, $first_run=true){
  global $output;
  if(is_object($tree)){
    if(is_array($tree->children)){
      $output.= '
<div ';
      if (!$first_run){
        if (is_object($tree->children[0])){
          $output.= '>'.str_repeat("&nbsp;", $indent).'+ ';
        }
        else {
          if (is_null($tree->users[0])){
            $display='style="display: none;" ';
          }
          $output.= $display.'>'.str_repeat("&nbsp;", $indent).'- ';
        }
      }
      else {
        $output.= ">o ";
      }
      $channelname=str_replace("=","",$tree->c->name);
      $channelname=str_replace("|","",$channelname);
      $channelname=str_replace("-","",$channelname);
      $channelname=preg_replace("/^[0-9]\ (.*)/","$1",$channelname);
      $output.= $channelname."</div>

";
      foreach ($tree->users as $k=>$v){
        $output.= str_repeat("&nbsp;", $indent+2);
        $output.= "".'<span style="color: green;"><b>'.$v->name."</b></span><br/>";
      }
      foreach ($tree->children as $k=>$v){
        if (is_object($tree->children[$k]))
        plotTreePlainTest($tree->children[$k],$indent+2,false);
      }
    }

  }
  return $output;
}
</pre>
<p>Das alles soll nur eine kleine Hilfestellung zur Anzeige der Channel und Benutzer unter Mumble geben.<br />
Ggf. erweitere ich den Code noch ein wenig, bzw. erläutere noch etwas mehr dazu, falls dies erwünscht ist.</p>
]]></content:encoded>
			<wfw:commentRss>http://ra23.net/wop/2010/03/mumble-online-user-anzeigen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SMF-SPAMD ein wenig aufgebohrt</title>
		<link>http://ra23.net/wop/2009/08/smf-spamd-ein-wenig-aufgebohrt/</link>
		<comments>http://ra23.net/wop/2009/08/smf-spamd-ein-wenig-aufgebohrt/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 02:02:40 +0000</pubDate>
		<dc:creator>Andre Rein</dc:creator>
				<category><![CDATA[milter-smf-spamd]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[milter]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[smf-spamd]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://ra23.net/wop/?p=20</guid>
		<description><![CDATA[Ich benutze schon eine ganze Weile die Milter smf-* von Eugene Kurmanin für Sendmail und bin sehr zufrieden damit. Das Programm smf-spamd dient dazu Emails an SpamAssassin weiter zu reichen. Wenn ein bestimmer einstellbarer Grenzwert bei der Überprüfung überschritten wird (in meinem Fall 15 Punkte), wird die Email mit einer Fehlermeldung abgelehnt. Da ich unter [...]]]></description>
			<content:encoded><![CDATA[<p>Ich benutze schon eine ganze Weile die <a href="http://smfs.sourceforge.net/index.html"> Milter smf-*</a> von Eugene Kurmanin<br />
für <a href="http://www.sendmail.org">Sendmail</a> und bin sehr zufrieden damit.<br />
Das Programm smf-spamd dient dazu Emails an <a href="http://spamassassin.apache.org/">SpamAssassin</a> weiter zu reichen.<br />
Wenn ein bestimmer einstellbarer Grenzwert bei der Überprüfung überschritten wird (in meinem Fall 15 Punkte), wird die Email mit einer Fehlermeldung abgelehnt.</p>
<p>Da ich unter anderem Emails von einem Server empfange der keinen Spamfilter verwendet, in dem speziellen Fall ist es eine Weiterleitung, werden auch sämtliche Mails abgelehnt die in diesem Fall über 15 Punkten liegen.<br />
Dies resultiert dann auf dem externen Mailserver in einem Mailer Error der an mich gerichtet ist und die Spam Mail ist im Anhang der Error Mail.</p>
<p>Damit ist natürlich nicht viel gewonnen und bedeutet nur Mehrarbeit.<br />
Eine Möglichkeit wäre den Host in die generelle Whitelist zu packen, dann wird die Mail aber schon beim eigentlichen Connect direkt durchgelassen ohne das eine Prüfung auf Spam erfolgt. </p>
<p>Der hier aufgeführte Patch führt eine zusätzliche Whitelist ein, die dieses Verhalten ändert.<br />
Kommt eine Mail von einem Host dessen IP in der extra Whitelist steht, wird sie vom Server nie abgelehnt, sondern sie durchläuft die Prüfung durch SpamAssassin. Es spielt keine Rolle ob sie als EXTRA SPAM identifiziert wurde, sie wird ganz normal weitergeleitet, jedoch wird wie gewünscht das Subject richtig umgeschrieben und kann somit lokal direkt in den Spamordner geschoben werden.</p>
<p><a href="http://ra23.net/wop/?attachment_id=19">Patch für smf-spamd -&gt; Download</a></p>
<pre name="code" class="diff">
diff -up -r smf-spamd-1.3.1/smf-config.h smf-spamd-1.3.1-modded/smf-config.h
--- smf-spamd-1.3.1/smf-config.h	2007-01-18 15:35:08.000000000 +0100
+++ smf-spamd-1.3.1-modded/smf-config.h	2009-08-08 03:51:05.000000000 +0200
@@ -5,10 +5,13 @@
  */

 /* Hosts/Networks whitelist (extended regex format) */
-#define WHITE_LIST	"(^127\\.|^192\\.168\\.|^10\\.)"
+#define WHITE_LIST     "(^127\\.|^192\\.168\\.|^10\\.)"
+
+/* Hosts/Networks which probably send EXTRA SPAM and should not be blocked*/
+#define WHITE_LIST_EXTRA   "(^1\\.2\\.3\\.)"

 /* Maximal message size */
-#define MAX_SIZE	131072 /* bytes */
+#define MAX_SIZE	5131072 /* bytes */

 /* Probable SPAM e-Mail messages Subject tagging */
 #define TAG_SUBJECT	1 /* set 0 to disable */
diff -up -r smf-spamd-1.3.1/smf-spamd.c smf-spamd-1.3.1-modded/smf-spamd.c
--- smf-spamd-1.3.1/smf-spamd.c	2007-01-18 15:35:08.000000000 +0100
+++ smf-spamd-1.3.1-modded/smf-spamd.c	2009-08-08 02:43:33.000000000 +0200
@@ -91,6 +91,10 @@ int daemon(int nochdir, int noclose) {
 static const char *ignore_connect = WHITE_LIST;
 static regex_t re_ignore_connect;

+static const char *no_ignore_connect = WHITE_LIST_EXTRA;
+static regex_t no_re_ignore_connect;
+
+
 struct context {
     char addr[64];
     char fqdn[MAXLINE];
@@ -470,12 +474,18 @@ static sfsistat smf_eom(SMFICTX *ctx) {
     elapsed = context->tend.tv_sec - context->tstart.tv_sec + (context->tend.tv_usec - context->tstart.tv_usec) / 1.0e6;
     if (ret == 1) {
 	if (context->score >= EXTRA_SPAM) {
+	  // if there is an entry in WHITELIST_EXTRA do not reject the message;
+	  if (no_ignore_connect[0] &#038;& regexec(&#038;no_re_ignore_connect, context->addr, 0, NULL, 0)){
 	    char reject[MAXLINE];

 	    syslog(LOG_NOTICE, "EXTRA SPAM (%.1f/%.1f), %.3fsec, %s, %s -> %s", context->score, context->threshold, elapsed, context->fqdn, context->from, context->rcpt);
 	    snprintf(reject, sizeof(reject), "Sorry, looks like spam. Contact %s to resolve this issue", CONTACT_ADDRESS);
 	    smfi_setreply(ctx, "554", "5.7.1", reject);
 	    return SMFIS_REJECT;
+          }
+          else{
+            syslog(LOG_NOTICE, "EXTRA SPAM WHITELISTED (%.1f/%.1f), %.3fsec, %s, %s -> %s", context->score, context->threshold, elapsed, context->fqdn, context->from, context->rcpt);
+          }
 	}
 	if (REDIRECT_SPAM) {
 	    if (context->rcpts) {
@@ -572,6 +582,7 @@ int main(int argc, char **argv) {
     int ret = 0;

     regcomp(&#038;re_ignore_connect, ignore_connect, REG_EXTENDED|REG_ICASE);
+    regcomp(&#038;no_re_ignore_connect, no_ignore_connect, REG_EXTENDED|REG_ICASE);
     tzset();
     openlog("smf-spamd", LOG_PID|LOG_NDELAY, SYSLOG_FACILITY);
     if (!strncmp(oconn, "unix:", 5))
</pre>
<p>Alles weitere zu smf-spamd kann man auf der Seite des Entwicklers nachschaun.</p>
<p>gruss<br />
Andre</p>
]]></content:encoded>
			<wfw:commentRss>http://ra23.net/wop/2009/08/smf-spamd-ein-wenig-aufgebohrt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://ra23.net/wop/2009/08/hello-world/</link>
		<comments>http://ra23.net/wop/2009/08/hello-world/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 19:27:18 +0000</pubDate>
		<dc:creator>Andre Rein</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hello]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://ra23.net/wop/?p=1</guid>
		<description><![CDATA[" #include int main(void){ printf("Hello World!"); } asdsadasd]]></description>
			<content:encoded><![CDATA[<p>"
<pre lang="c">#include
int main(void){
  printf("Hello World!");
}
</pre>
<p>asdsadasd</p>
]]></content:encoded>
			<wfw:commentRss>http://ra23.net/wop/2009/08/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

