Politiek (NL versie)

Normaal gesproken probeer ik me zoveel mogelijk afzijdig te houden van de politieke perikelen in het land. Ik denk dat een IT’er zich niet 123 bezighoud met de politieke situatie in een land. Ik zie dat gewone (Echte) contributors, ontwikkelaars en gebruikers gelijk zijn, ongeacht ras, politiek, religie, handicap etc. Dat is bijna niet mogelijk in de gewone wereld!

Buiten dat, de politieke situatie in Nederland veranderd dramatisch; Jan Modaal wordt hard geraakt, en de mensen die minder verdienen worden nog harder geraakt. De politieke leiding legt uit dat alles gewoon normaal is; dat niemand zich zorgen hoeft te maken etc. Maar ze vergeten misschien dat ze veel meer verdienen dan de groepen die ik zojuist opnoemde. Een verhoging van belastingen (daarover later meer) heeft op hun veel minder effect dan op de gewone man.

In Nederland hebben we de hoogste belastingen op benzine, een kleine 70% van het totale bedrag dat betaald wordt aan de pomp, gaat naar de staats-kas. In plaats van dat dat gebruikt wordt om de wegen etc te verbeteren, wordt er maar een klein deel gebruikt om dit soort activiteiten te ontplooien.

We hebben ook een zogenoemde milieu tax, verpakkings belasting, uniek in nederland, levert het land een kleine 18 miljard op. Dit zou gebruikt moeten worden om de natuur etc te verbeteren, maar helaas nog geen 1% van de opbrengsten worden hiervoor gebruikt. Wouter Bos lacht zich rot.

Normale belastingen gaan ook omhoog naar 20%, eten en andere belangrijke elementen zijn gemiddeld tussen de 6% en 30% gestegen.

De salarissen in het land zijn globaal gezien gestegen tussen de 2 en 5% (mijn gok, waarbij er ook groepen gewoon al jaren GEEN salaris verhoging krijgt); wat de duurdere prijzen nergens compenseert.

Dus in het kort, alles wordt veel duurder, de mensen worden uitgemolken in plaats van geholpen en niemand die opstaat om hier wat tegen te doen. Het is tijd dat daar wat aangedaan wordt. IEMAND moet opstaan en tegen dit politieke debakel vechten!

Een ander onderdeel van mijn klaagzang is dat de europese mensen een duidelijke NEE hebben gezegd tegen de europese grondwet. Eerst frankrijk en nederland door een publiekelijk referendum, daarna ierland. De nederlandse politieke leiding heeft echter de NEE verworpen en gezegd dat met een beetje constructief woord-aanpassen we alsnog JA kunnen zeggen tegen de grondwet. Tegen ierland is gezegd dat men waarschijnlijk een foutje heeft gemaakt want NEE is een vergissing. Men moet de poging maar opnieuw doen want dit is niet acceptabel. Hoe moeilijk kan het zijn om een NEE te begrijpen? Vast en zeker de politieke leiding die problemen ziet met hun inkomsten als europa er niet komt. Wordt toch wakker! De mensen hebben gezegd NEE, accepteer dat. Democratie is het vertegenwoordigen van de mensen van het land, deze zeggen NEE.

Ik word doodziek van de politieke leiders van dit land. Echter helaas heb ik te weinig kennis en ervaring om hierin iets te veranderen, wat ik echter wel weet is dat zolang er niemand opstaat, het leven alleen maar slechter wordt de komende jaren. Het land zal zich moeten verenigen en een vuist moeten maken!

Zo, tot zover mijn eerste (en misschien ook wel enigste) klaag-blog over de politieke situatie in Nederland. Voor engelstalige mensen is er ook een engelse versie beschikbaar.

Tagged with:
 

Politics

Normally I try to get away from the political situation in the country as much as possible. I feel that IT employee’s, shouldn’t actually bother with the political situation in a country. I see normal contributors, developers, users (not the whacked people that also pop up every now and then) as equal’s, independent by race, politics, religion, handicap, whatever. Something that is nearly impossible in the regular world.

That aside: the political situation in the Netherlands is changing dramatically. “Jan Modaal” is struck hard, not to mention the even less-earning people. The political leaders explain that everything is just regular, no worries etc. But they seem to forget that their salaries are much much higher then most people in the country, so increasing taxes (more on that later); doesn’t affect them as much as it does me, or others.

In the Netherlands we have the highest tax rate on the gasoline’s, a near 70% of the entire amount payed for gasoline flows to the state. Instead of it helping to improve roads and resolve traffic problems, just a limited amount of that money is being used to improve the roads et all.

We also have a few nature taxes, wrapping taxes which is unique in the Netherlands, provided the country with a near 18 billion euro’s. It should be spend on improving nature and stuff. But not even 1% is being used for that.

Regular tax-fee’s also increase to 20%, food and other important assets had an increase in prize that starts with 6% and stops at around 30%.

Salaries in the country globally rose with around 2 to 5% (my guess), which does not compensate the food increment prices at all.

So in short, everything is getting much more expensive, people are milked out instead of being helped, and no one actually stands up! It’s time to change that, someone has to stand up and offer resistence to this political debacle.

Another point of my ranting is that the European people said a loud NO to the European Consitution, first France and The Netherlands by public referendum, now Ireland as well. The Netherlands (Political team) rejected the NO and said “with a little word-smithing, we DO say YES to the consitution), towards Ireland it had been told: “it was a mistake, you should redo this, because you actually didn’t say no”. How hard can a NO be? Very hard in the opinion of the money-greeding people in the parlements. They see their profit drop in case the european constitution or whatever it is going to be called isn’t getting true. WAKE UP. The people said NO, ACCEPT THAT.

I get sick and tired of this country’s political leaders, sadly I lack knowledge and experience to really change something, but I do know that in case nobody steps up, life is getting much worse the upcoming years. The country has to unite, and pick a stand.

So far my first (and perhaps only) ranting about the political situation in the Netherlands. I will also translate this to the Dutch language for native readers.

Tagged with:
 

AviFauna

Friday we have been to Avifauna with Luca, a very nice day and a really good idea if you want to see some really nice birds! One of the examples is below:

Tagged with:
 

Current projects

I am currently working on a lot of projects,

At work I am involved with Cisco/Netscreen’s and Fortigate’s,

I am preparing two different presentations
- one for EuroBSDCon together with Tom Scholten (who did most work so far)
- one for an upcoming BSD-event in the netherlands, on the 13th of december in Utrect, BE THERE :-) ), – I am also trying to help with the BSD-event (assisting the organisers).

Personally:
- I am also working on writing an article that should help parents getting more insight in what their kids are doing online, and what simple grounds one can have to “Defend” the kid against nastiness on the internet (recently a topic was shown within the netherlands that certain people try to own webcam’s of kids so they can see them naked after showering. Horrible!),
- I am trying to write a firewall management environment (distributed) which can be used by pfSense and just regular BSD environments. I think that can really add up to the usage of *BSD related firewalls :-)
- I am also continuesly developing the freebsd dutch documentation project
- Doc work, WWW work, Secteam work, secteam-secretary work (slacking there), src/ work and MFC’s
- I need to get some appointments going so that I have a better agenda again
- Doing an exam in the near future again..
- Making some nice pictures of flowers and things in the environment here :-)
- Ranting about the political situation in the Netherlands, I’ll try to write an article about my view on what is happening (trying to get only facts and not my opinion, because that shouldn’t matter).
- Trying to see Denise and Luca as much as possible (ofcourse :D )

Life’s busy, but it keeps me going :-) ,

Tagged with:
 

FreeBSD Core Team

So, I recently added myself as a candidate for the FreeBSD Core Team, giving a short explaination about why I can be of help in my opinion :-) . So far 27% of all people had voted, so I hope that more people will vote to get the best team possible (With or without me ofcourse).

May the best team win :-)

 

Recent experiences

So, recently I obtained several new experiences :-) .

I am working with Fortigate machines (AFA1000′s) and Juniper Netscreen SSG550′s, which are both great machines to work with. I touched a couple of netscreens just a week before I started my new assignment, and now I work full time with them. Beyond that I also try to support the team I am in now with cisco/networking knowledge so that the team can keep on rolling (even if the grand-master will be on holiday within 2 months from now).

Apart from the work experience I also did some work in perl again and finished up check_honeynet.pl v2.0.3b (Which will eventually become v2.0) and I am playing around with svn and mirroring subversion stuff (For FreeBSD and my own projects).

Seeing my upcoming agenda makes it a bit challenging to properly give all my activities enough time, but I am sure I Can manage that just fine.

Tagged with:
 

The BSDCan conference writeup

After writing my previous post, I thought it would be better to writeup a single (longer) story that covered all days instead of just one ;-) (OK it got delayed a bit :) )

“The life of two FreeBSD Developers and a girlfriend traveling towards BSDCan”

BSDCan is one of the biggest BSD meetings / events in the year, many developers and contributors visit this event to share thoughts and express their opinions about whatever comes to mind.

The developers are: Ed Schouten, Remko Lodder and the girlfriend is Denise (my girlfriend) ;-)

On the 13th of may 2008, it was that time. We were going to fly with the three of us to Canada to visit the FreeBSD Developers Summit (which was planned just before the official conference) and the BSDCan Conference. Both Ed and my employer (Snow BV) asked us whether we wanted to participated in this conference and ofcourse we wanted to do so. For Ed this has a positive input on his final internship at our company, and for me it’s an opportunity to guide Ed along the path of FreeBSD, and to finally meet several people that I never met before (because they never visit Europe for example).

Thanks a lot for facilitating us Snow! We greatly appreciated it and we had a great conference!

Snow thought it was a great idea to let Ed travel to Canada to present his upcoming mpsafetty work to the developer crowd. I was also asked by the FreeBSD developers and by Snow to travel towards Canada, to guide Ed and to meet my fellow developers, some of which I had never seen before, Denise also wanted to travel along and Snow arranged everything so that we could actually go with the three of us…

The travel started very early, Denise and I needed to fetch the plane at 0715, to fly through London Heathrow towards Ottawa Airport. Ed had a flight later, and joined us at Heathrow airport before we left to Canada. We ate a bit, spotted some fellow FreeBSD members (Robert Watson, Doug Rabson and Poul-Henning Kamp), they were going to have the same plane as us (poor them :-) ).

The flight towards canada was a line-flight, not entirely full, so we had space near the emergency exits, and we also had a couch for the three of us. Plenty of space! Robert Watson had a entire couch for himself, which he used to workout some details (on his laptop).. Denise, Ed and I listened to music, watched a movie (in our personal entertainment system onboard of the plane) and talked a lot.

After arriving in Canada, we started the procedure to adopt to the time, in the Netherlands it was already late in the evening, while it was just noon in Canada. Very interesting to see if you never experienced it before.. We also had great fun at immigrations, we were seperated, and Denise got asked why she was traveling to canada etc. She said she visited the BSDCan event to meet other FreeBSD people, luckily for her they didn’t ask much beyond that, because simply she doesn’t now :-) . Robert, Doug and Poul-Henning where lucky to get picked up by Dan Langille (The BSDCan organiser); and we took the bus towards the university, a nice ride, with special lanes for the busses (dutch government, are you listening!?).

At the university we checked in, and put out all our stuff, and tried to find the other nerds that were also there. We found them at the Royal Oak (A cafe nearby), where we ate, drank and after a while returned to the residence to almost instantly fall asleep.

Ed and I woke up in the middle of the night, myself at 0400AM (canada time) and Ed at 0500AM, strange time to wake up, but it was already 10/11am in the Netherlands. That didn’t make us feel that well yet :( , the breakfast was served for the three of us.

Ed and I visited the two day FreeBSD Developers summit, a meeting of FreeBSD Developers and invited guests, while Denise traveled through Ottawa to see what was happening there. On the first day, Ed gave a talk about his project, and funnily enough, no resistance popped up. He even got support from various people that he should proceed, and finish this up and all. Very well presented and the results were terrific.

Other talks that day: GreenBSD (energy reducing development for FreeBSD), finstall, kernel booting through http, FreeBSD Embedded status update, Network Stack BoF, Bugbusting/Gnats BoF, Profiling and Debugging tools, release packaging tools, VImage & Virtualization BoF.

A productive first day, with very interesting topics. Later that day Denise and I headed out for dinner, while Ed joined the community and had dinner with them. Denise and I got accompanied by Colin Percival (FreeBSD’s Security Officer), we walked to the Royal Oak, had some good talks with the three of us and where we got later joined by Ed. We walked around a bit and had a drink here and there, and again headed to bed early, we needed to be fit for the second developers day.

The second day was again covered by multiple interesting talks:

Transparant TCP interception, NFS Lock manager, FreeBSD Foundation Update, What’s happening in the world of ports and portsmgr, TCP SMP Scalability en Revising Revision Control (about the big move from CVS to SVN, which happened in the timeframe between Canada and now). Ed and I also visited the syscons/input BoF, where we could speak natively, accompanied by Philip Paeps and Marcel Moolenaar. We also saw a practical example of Coverity, and we finally concluded the day with Denise and all developers in the Indian restaurant nearby the residence. One should ask Ed for his Cowboy Act, the people from Isilon can surely remember that part :-) .

The third day was the real opening of BSDCan itself, again multiple talks where given by developers and interested people in the BSD community. Ed and I spoke with an Apple developer about llvm, a BSD licensed C(++) compiler. Very interesting talk with the three of us. I also took part in the BSDA certification (which I (ofcourse) got).

In the evening the three of us (Ed, Denise and I) went to the Hardrock cafe, where we ate a nice big american burger, needed to show our ID’s while ordering beer (ehm I have a 5 year old kid…).

The fourth day we spend visiting the city a bit. We didn’t had the regular breakfast but had a sneakpeak at Cora’s. Here one should eat when he is in Ottawa. Very nice (and MUCH) food! After that we phoned home and visited the city with an amphibious bus, which drove us through the city. Very good way to see a lot of the city in one go. We also visited the river a bit (hey the bus could float, lets use that). After that we returned to the university and where just in time to see the closing ceremony. A funny rehash of what all happened during BSDCan, an auction for the homeless people near the university (Where a core-signed cap was worth 260dollars! and a few shirts 100+ dollars). Again we concluded the day with the three of us (Denise needed to spend time with us after being alone for much of the period) which we did at an Italian restaurant. Good food again!

The fifth day was our final day in Canada. We packed our suitcases, got hold of Brad Davis and his friend, who hold a table in Cora’s for us, where we again had (HUGE) breakfast. After that we walked around a bit in the city, saw some places we didn’t see the day before, and returned to the residence to pickup our stuff, and returned to the airport, with Peter Wemm and Doug Rabson near us.

We had a great flight back with a couple of developers, Bjoern Zeeb made some evil pictures of the crowd, try to find them :-)

to conclude: YOU MUST BE AT BSDCAN NEXT YEAR MMKAY?

 

New check_honeynet version released

It’s that time again, I released an alpha version for check_honeynet v2.0 (v2.0.a2 to be exact); which adds some minor new stuff to the setup. Next thing is to extend the minor new stuff (statistics, we dont warn everytime anymore, and stuff like that) and rewrite the entire codebase so that it’s even easier to use and read (hopefully); with as less packages (Externally) as possible (one should not have to install the entire perl-cpan repository to be able to use the script :-)

Check it out in the downloads section!

 

check_honeynet v2.0.a2

Release 2.0.a2 (Alpha quality) for check_honeynet is here :-) , go check it out!

PERL:
  1. #!/usr/bin/perl
  2. # $Id: check_honeynet.pl 801 2008-06-03 20:40:53Z remko $
  3. ###########################################################################
  4.  
  5. ###########################################################################
  6. # Copyright (C) 2005-2008, Remko Lodder <remko@FreeBSD.org>. All rights reserved.
  7. #
  8. # Redistribution and use in source and binary forms, with or without
  9. # modification, are permitted provided that the following conditions
  10. # are met:
  11. # 1. Redistributions of source code must retain the above copyright
  12. #    notice, this list of conditions and the following disclaimer.
  13. # 2. Redistributions in binary form must reproduce the above copyright
  14. #    notice, this list of conditions and the following disclaimer in the
  15. #    documentation and/or other materials provided with the distribution.
  16. #
  17. # THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  18. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. # ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
  21. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. # SUCH DAMAGE.
  28. ###########################################################################
  29.  
  30. ###########################################################################
  31. # Contributors:
  32. # Ivo Naninck, (Language), Marc Plaisier (language), Mart vd Wege (Mailer
  33. # suggestion),
  34. # Lance Spitzner (the most valueable feedback regarding the script).
  35. # Richard Arends (suggested the actual perl mailer; and gave a good example
  36. # on how to use the module),
  37. # Robert Blacquiere (showed me Simple::Config, which I am using now to
  38. # obtain configuration informatin, as well as write statistics to a
  39. # temporary file)
  40. #
  41. # Script:
  42. # This is a stand alone script written for honeynet.org. It's purpose is
  43. # to check the listed mirrors to see which one is outdated and notify
  44. # the administrator of the outdated mirror if needed. This way the
  45. # mirrors will always be within a certain timeframe and can be removed
  46. # if they are too outdated.
  47. #
  48. # Written in colaboration with Lance Spitzner <lance@honeynet.org>
  49. ###########################################################################
  50.  
  51. ###########################################################################
  52. # Differences between releases, started this between 1.5 and 1.6 sorry
  53. # for the loss of potential usefull information (although I might be able
  54. # to retrieve the missing data from my CVS branches).
  55. # Note that all the three version based versions are just bugfixes to some
  56. # degree.
  57. # Version       Who             What
  58. # 1.1           Remko           Initial script to check the mirrors.
  59. # 1.1->1.2      Remko
  60. # 1.2->1.3      Remko
  61. # 1.3->1.4      Remko
  62. # 1.4->1.5      Remko           Code cleanups, restructure of code; corrected
  63. #                               some bugs between various releases spotted
  64. #                               by Lance.
  65. # 1.5->1.6      Remko           Cleanups, changed structure for timestamp
  66. #                               retrieval; make it human readable and match
  67. #                               on a specific pattern. Made the version dependend
  68. #                               on the configuration version and visa-versa
  69. #                               to be able to make big config changes.
  70. #                               BF-1: Fix the email send options by using the
  71. #                                     correct Net::SMTP commands.
  72. #                               BF-1: Fix the parsing of the new mirrorprobe
  73. #                                     layout.
  74. #                               BF-2: Change the Mailer used to send out the
  75. #                                     report.
  76. # 1.6->1.7      Remko           Implement Config::Simple, makes configuration
  77. #                               much easier!
  78. # 1.7->2.0      Remko           a1: Implement that we can trace various sites with
  79. #                               multiple problems more easily by using a
  80. #                               semi-persisent configuration file.  This brings
  81. #                               the entire branch to an entirely new world.
  82. #                               Which is why we bump the version to 2.0
  83. #                               a2: Implement file-statistics checker, if the
  84. #                               file does not exist yet, we need to make sure
  85. #                               we know and that we can bypass certain readins
  86. #                               so that we are not going to get into trouble
  87. #                               later on.
  88. ###########################################################################
  89.  
  90. use strict;
  91. use warnings;
  92. use LWP::Simple;
  93. use Getopt::Std;
  94. use Mail::Sendmail;
  95. use Config::Simple;
  96.  
  97. ###########################################################################
  98. # variables. All configurable options are defined below. Please adjust them
  99. # to your need.
  100. ###########################################################################
  101.  
  102. # Version, author and script specific behaviour
  103. my $author              = 'Remko Lodder <remko@FreeBSD.org>';   # Name of the author
  104. my $name                = __FILE__;                             # Our scriptname.
  105. my $MAJOR               = '2';                                  # Our major version
  106. my $MINOR               = '0';                                  # Our minor version
  107. my $PATCHLEVEL          = 'a2';                                 # Our patchlevel
  108. my $version             = "$MAJOR.$MINOR.$PATCHLEVEL";          # Our version.
  109.  
  110. ###########################################################################
  111. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  112. # Do not edit anything below this line unless you know what you are doing.
  113. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  114. ###########################################################################
  115.  
  116. ###########################################################################
  117. # Prototypes, specify upfront what we are going to use if globally needed
  118. # and prototype arrays, hashes and functions.
  119. ###########################################################################
  120.  
  121. # create the option hash, we will use that later to add our option flags.
  122. my %option              = ();
  123.  
  124. # Template our arrays
  125. my (@MIRRORS);
  126.  
  127. # Template some standard variables
  128. my ($CONFIGFILE, $status, $reporthost, $timestamp,$target,
  129.     $enable_mail, $cfg, $cfg_out, $outfile, $alert_max,
  130.     $alert_min, $alert_mid, $mail_from, $mail_bcc, $mail_cc);
  131.  
  132. # Prototype functions
  133. sub fetch_data ($$);
  134. sub email_report ($$$);
  135. sub convert_input ($);
  136. sub process_mirrors (@);
  137. sub create_timestamp ($);
  138.  
  139. ###########################################################################
  140. # Script itself
  141. ###########################################################################
  142.  
  143. getopts("cC:f:F:hpR:tv", \%option);
  144.  
  145. my $config_flag   = 1 if $option{f};
  146. my $config_option = $option{f};
  147.  
  148. my $create_flag   = 1 if $option{c};
  149. my $help_flag     = 1 if $option{h};
  150. my $process_flag  = 1 if $option{p};
  151. my $test_flag     = 1 if $option{t};
  152. my $convert_flag  = 1 if $option{C};
  153. my $fetch_flag    = 1 if $option{F};
  154. my $retrieve_flag = 1 if $option{R};
  155.  
  156. # Simply assign the contents of the configuration parameter to the
  157. # configuration file variable, otherwise overrule it with the
  158. # default value
  159.  
  160. $CONFIGFILE     = $config_option || "./honeynet.cf";
  161.  
  162. # Read in current configuration.
  163. # This should always succeed, in case it doesn't then we cannot do
  164. # anything at all.
  165.  
  166. $cfg            = new Config::Simple($CONFIGFILE);
  167.  
  168. #####
  169. ##### Global variable assignment after reading config
  170. #####
  171.  
  172. # Read in some variales upfront, so that we can more
  173. # easily use them later on.
  174.  
  175. @MIRRORS        = $cfg->param('CONFIG.mirrors');
  176. $outfile        = $cfg->param('CONFIG.outfile');
  177. $enable_mail    = $cfg->param('CONFIG.enable_mail');
  178. $alert_max      = $cfg->param('CONFIG.alert_max');
  179. $alert_mid      = $cfg->param('CONFIG.alert_mid');
  180. $alert_min      = $cfg->param('CONFIG.alert_min');
  181. $mail_from      = $cfg->param('CONFIG.fromaddr');
  182. $mail_bcc       = $cfg->param('CONFIG.ccaddr');
  183. $mail_cc        = $cfg->param('CONFIG.mirroradmin');
  184.  
  185. if (-e "$outfile")
  186. {
  187.  
  188.         # Read in the statistics from our last run
  189.         $cfg_out        = new Config::Simple($outfile);
  190.  
  191.         # Make an instant backup before we do a new run.
  192.         $cfg_out->write("$outfile.orig");
  193. }
  194. else
  195. {
  196.         # Create the statistics file for our entire run
  197.         $cfg_out        = new Config::Simple(syntax=>'ini');
  198. }
  199.  
  200. # Make sure that there us a version statement in the configuration file, so that we can see whether we are
  201. # compabible or not.
  202.  
  203. if (!$cfg->param('CONFIG.version'))
  204. {
  205.         print "It appears that you do not have a version statement in your configuration file. This means that the version you are using now is
  206. too old, make sure that you obtain the latest one and update that to your needs.";
  207.         exit(1);
  208. }
  209.  
  210. if ($cfg->param('CONFIG.version'))
  211. {
  212.         my($version_def_major,$version_def_minor) = $cfg->param('CONFIG.version') =~ /(\d+)\.(\d+)/;
  213.  
  214.         # the script can defer between MAJOR and MINOR releases; bugfixes aka patchlevels are
  215.         # not affected by this and can thus be ignored.
  216.         # TODO: This check should be made more flexible in the future, version 1.4 and 1.5 share
  217.         # the same configuration file and should both pass.
  218.  
  219.         if(($version_def_major lt $MAJOR) or ($version_def_minor lt $MINOR))
  220.         {
  221.                 print "You appear to be using an older configuration file that might not be compatible with the current version of the
  222. script, please validate that you have the latest options included and copy over the version statement from the latest available configuration
  223. file. Make sure that the old version statement is overwritten!
  224. The current script runs on version: $version, while the configuration is for version $cfg->param('CONFIG.version')\n";
  225.                 exit(1);
  226.         }
  227. }
  228.  
  229. # Create a new timestamp that will be fed into the mirrors, which we can use to test the
  230. # age of the mirror.
  231.  
  232. if ($create_flag) {
  233.         create_timestamp($cfg->param('CONFIG.probefile'));
  234. }
  235.  
  236. elsif ($process_flag) {
  237.         # Process the mirrors using the hash we have for them.
  238.         process_mirrors(@MIRRORS);
  239. }
  240.  
  241. # test mode, printout information on screen.
  242. elsif($test_flag)
  243. {
  244.         # In test mode we dont send out emails.
  245.         $enable_mail = 0;
  246.  
  247.         print("$name: Starting\n");
  248.         print("$name: Processing mirrors\n");
  249.  
  250.         # Process the mirrors using the hash we have for them.
  251.         process_mirrors(@MIRRORS);
  252.  
  253.         print("$name: Finishing\n");
  254. }
  255.  
  256. # convert input from unixtime to human readable time.
  257. elsif($convert_flag)
  258. {
  259.         print "$option{C} resolves to " . convert_input($option{C}) . "\n";
  260. }
  261.  
  262. # fetch the mirrorprobe file from the given host
  263. elsif($fetch_flag)
  264. {
  265.         my $result = fetch_data($option{F}, $cfg->param('CONFIG.sourcefile'));
  266.         open(OUT, "> $cfg->param('CONFIG.outdir')/$option{F}.timestamp");
  267.                 print OUT $result;
  268.         close(OUT);
  269. }
  270.  
  271. # Fetch the mirror timestamp and parse it. Print the output back on the screen.
  272. elsif($retrieve_flag)
  273. {
  274.         my $result = fetch_data($option{R}, $cfg->param('CONFIG.sourcefile'));
  275.         print("$option{R} was last modified " . convert_input($result) . "\n");
  276. }
  277.  
  278. # People expect a help option, provide it for them.
  279. elsif ($help_flag)
  280. {
  281.         print_help();
  282. }
  283.  
  284. # No valid options had been given, fallback to the help information.
  285. else
  286. {
  287.         print_help();
  288. }
  289.  
  290. # print_help: expects no input, just prints the help information on how
  291. # the application should work.
  292. sub print_help
  293. {
  294.         print("Usage:\t$name [ -c ] [ -C <value> ] [ -f <configurationfile> ] [ -F <host> ] [ -h ] [ -p ] [ -R <host> ] [ -t ]
  295. \t-c\tCreate the timestamp for the localmachine. This timestamp can be used to determine when the mirror was last updated.
  296. \t-C\t<value> converts the unix timestamp to human readable format
  297. \t-f\t<filename> Use the specified configuration file
  298. \t-F\t<host> fetch the timestamp for an external host, for example: www.honeynet.nl
  299. \t-h\tprint this help.
  300. \t-p\tCheck the status of the mirrors, and report the output to us
  301. \t-t\tTest mode, does not send out emails, but prints the information on the screen.
  302. Version: $version
  303. Originally written by Remko Lodder <remko\@FreeBSD.org, for the honeynet project.\n");
  304. }
  305.  
  306. # create_timestamp: expects a variable filled with where we should store
  307. # the unixtime (for remote mirrors).
  308. sub create_timestamp ($)
  309. {
  310.         my $probefile = shift;
  311.         open(F_OUT, "> $probefile");
  312.                 print F_OUT "Mirrorprobe time: " . time() . "
  313. Local time: " . convert_input(time());
  314.         close F_OUT;
  315. }
  316.  
  317. # convert_input: expects unixtime and converts it to human readable time.
  318. sub convert_input ($)
  319. {
  320.         my $output      = scalar localtime(shift);
  321.         return $output;
  322. }
  323.  
  324. # fetch_data: gets two variables as input, one with the fqdn of the remote host and one
  325. # with the location of where we expect the remote file. XXX: This looks a bit ugly at the
  326. # moment.
  327. sub fetch_data ($$)
  328. {
  329.         my $source      = shift;
  330.         my $sourcefile  = shift;
  331.  
  332.         my $return_data = ();
  333.         my $data        = get("http://$source$sourcefile");
  334.  
  335.         # IF the remote data is present, take out the numberic time value and return that
  336.         # ELSE obscure the data, which will revert to 1969/1970 (depending on what the machine
  337.         # considers EPOCH).
  338.         if ($data)
  339.         {
  340.                 chomp $data;
  341.  
  342.                 $return_data = $data;
  343.                 $return_data =~ s/\n/\ /;
  344.                 if ($return_data =~ /\S+ \S+ (\d+) \S+/)
  345.                 {
  346.                         $return_data = $1;
  347.                 }
  348.                 return $return_data;
  349.         }
  350.  
  351.         else
  352.         {
  353.                 $data = 0;
  354.                 return $data;
  355.         }
  356. }
  357.  
  358. # proccess_mirrors: gets an array as input with all the mirrors in it. It will walk through all hosts
  359. # and do specific actions with them, like printing out a report, or emailing it to the remote
  360. # administrator. It keeps a record of the current statustime.
  361. sub process_mirrors (@) {
  362.         my %mirror_time;
  363.         my @mirror_list = @_;
  364.  
  365.         for my $target(@mirror_list)
  366.         {
  367.                 $mirror_time{$target} = fetch_data($target,$cfg->param('CONFIG.sourcefile'));
  368.  
  369.                 # We should probably dont need to use this since it is implied in the routine itself.
  370.                 if(!$mirror_time{$target})
  371.                 {
  372.                         $mirror_time{$target} = 0;
  373.                 }
  374.  
  375.                 # declare our local time before continueing.
  376.                 my $honeynet_ctime      = time();
  377.                 my $mirror_ctime        = $mirror_time{$target};
  378.                 my $mirror_difftime     = $honeynet_ctime - $mirror_time{$target};
  379.  
  380.                 # If the resulting number is less then zero, the remote host is outdated.
  381.                 my $mirror_timediff     = $cfg->param('CONFIG.timeout') - $mirror_difftime;
  382.  
  383.                 # Everything that has a calculated time which is bigger then the timeout is
  384.                 # on the right track, everything that isn't, gets either notified or the
  385.                 # output will be present on screen.
  386.                 if ($mirror_timediff gt "0")
  387.                 {
  388.                         if($cfg->param('CONFIG.verbose') ne "0")
  389.                         {
  390.                                 $status = "OK";
  391.                                 $timestamp = scalar localtime($mirror_time{$target});
  392.                                 $reporthost = $target;
  393.                                 write;          # Write out our template.
  394.                         }
  395.                                 next;
  396.                 }
  397.                 else
  398.                 {
  399.                         my $info = $cfg_out->param("mirrors.$target");
  400.                         if (defined $info && $info gt 0)
  401.                         {
  402.                                 if ($info eq $alert_max || $info eq $alert_mid || $info eq $alert_min)
  403.                                 {
  404.                                         # The email option is enabled and we found an outdated mirror
  405.                                         # jump to the email_report function.
  406.                                         if($enable_mail)
  407.                                         {
  408.                                                 email_report($target,$mirror_time{$target},$info);
  409.                                         }
  410.                                 }
  411.  
  412.                                 # Update our local statistics first before anything else
  413.                                 $cfg_out->param("mirrors.$target", $info+1);
  414.                                 $cfg_out->param("checktime.$target", scalar localtime($mirror_time{$target}));
  415.                         }
  416.                         else
  417.                         {
  418.                                 # The email option is enabled and we found an outdated mirror
  419.                                 # jump to the email_report function.
  420.                                 if ($enable_mail)
  421.                                 {
  422.                                         email_report($target,$mirror_time{$target}, $alert_min);
  423.                                 }
  424.  
  425.                                 # Begin our statistics with 1.
  426.                                 $cfg_out->param("mirrors.$target", 1);
  427.                                 $cfg_out->param("checktime.$target", scalar localtime($mirror_time{$target}));
  428.                         }
  429.  
  430.  
  431.                         if($cfg->param('CONFIG.verbose') ne "0")
  432.                         {
  433.                                 $status = "FAIL";
  434.                                 $timestamp = scalar localtime($mirror_time{$target});
  435.  
  436.                                 # Only override if the message has the old timestamp and thus is broken.
  437.                                 if($timestamp =~ /19[6-7]\d/)
  438.                                 {
  439.                                         $timestamp = "Mirrorprobe file problems!";
  440.                                 }
  441.                                 $reporthost = $target;
  442.                                 write;          # Write out our template.
  443.                         }
  444.                 }
  445.         }
  446.  
  447. # Specify how our output is going to look like. This generates a nice overview
  448. # on the current status of the various mirrors.  This is only being used if we
  449. # print verbose.
  450. # Below: HEADER
  451. format STDOUT_TOP =
  452. ----------------------------------------------------------------------------
  453. --------------------------- Honeynet Check results -------------------------
  454. ----------------------------------------------------------------------------
  455. Status  Site                                    Last changed
  456. .
  457.  
  458. # Format specifier for the content of the printout.
  459. format STDOUT =
  460. @<<<<  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  @<<<<<<<<<<<<<<<<<<<<<<<<<<
  461. $status, $reporthost,                           $timestamp
  462. .
  463. }
  464.  
  465. # email_report: expects a target and a mirror_time, sends out an email to
  466. # the desired administrator and informs them about the current status of
  467. # the mirror.
  468. sub email_report ($$$)
  469. {
  470.         my $status      = ();
  471.         my $alert_msg   = ();
  472.         my $target      = shift;
  473.         my $mirror_time = shift;
  474.         my $alert       = shift;
  475.         my $recipient   = $cfg->param("MIRRORS.$target") || $mail_cc;
  476.  
  477.         # Make the mirror time a human parseable time, if this matches the beginning of time
  478.         # (For computers at least). Tell that there is a problem.
  479.         $mirror_time    = scalar localtime($mirror_time);
  480.  
  481.         if ($mirror_time =~ /19[6-7]\d/)
  482.         {
  483.                 $status = "Your mirror seems to have troubles fetching the mirrorprobe file.";
  484.         }
  485.         else
  486.         {
  487.                 $status = "At this moment it seems that your mirror was last updated on $mirror_time.";
  488.         }
  489.         if ($alert eq $alert_max)
  490.         {
  491.                 $alert_msg = "NOTE WELL: This is the final warning you will be receiving.  Please repair the mirror as soon as possible. In the meantime we will remove your mirror.";
  492.         }
  493.         else
  494.         {
  495.                 $alert_msg = "NOTE WELL: This is alert number $alert for your host. Please be advised that our current maximum is at $alert_max.\n";
  496.         }
  497.  
  498.         my $message = "Hello $recipient,
  499. You are recieving this email because your Honeynet Project mirror ($target) seems to be outdated.
  500. $status
  501. Could you please check whether everything is working as expected?
  502. If there is something wrong or you do no longer wish to be a mirror, please notify $mail_cc
  503. Thanks for supporting the Honeynet Project!
  504. If you have questions or concerts, please do not hesitate to contact us!
  505. $alert_msg
  506. --
  507. The Honeynet Project Mirror Admins";
  508.  
  509.         # Fill our mailhash with information that we are going to send.
  510.         my %mail = (
  511.                 To              => "$recipient",
  512.                 From            => "$mail_from",
  513.                 Bcc             => "$mail_bcc",
  514.                 # only addresses are extracted from Bcc, real names disregarded
  515.                 Cc              => "$mail_cc",
  516.                 # Cc will appear in the header. (Bcc will not)
  517.                 Subject         => "$target seems to be outdated, please investigate",
  518.                 'X-Mailer'      => "$name $version using Mail::Sendmail version $Mail::Sendmail::VERSION",
  519.                 message         => "$message",
  520.         );
  521.  
  522.         # Add an additional header so that we can show that this is our thing.
  523.         $mail{'Honeynet.org : '} = "http://www.honeynet.org";
  524.  
  525.         # Send out the mail, if succesfull print that we did OK else
  526.         # give error.
  527.         if (sendmail %mail)
  528.         {
  529.                 print "Mail alert sent OK.\n";
  530.         }
  531.         else
  532.         {
  533.                 print "Error sending mail: $Mail::Sendmail::error \n"
  534.         }
  535. }
  536.  
  537. # And as a final action make sure we write out our configuration file.
  538. # Temporary to write out the exact config to our statistics file, later we will use this to write
  539. # down our run-time statistics into a "peristent" file.
  540.  
  541. $cfg_out->write($outfile);
  542.  
  543. # End of the script.

Tagged with:
 

BSDA

During BSDCan I took the liberty to see what BSDA is all about. It's a real good certification in my eyes to get you up and running with the BSD's, not very difficult (or at least not for me), but attractive enough for people that need papers to show and to have a goal for studying. All the basics are in there and a couple of more advanced questions as well (security related for example).

I got mine with 83%, goodluck for others that are also persuing this :-)

 
© 2003-2010 Evilcoder.org
Bear