I continue to publish some my coding. Hostcheck is a simple Perl script that can be useful to quickly check if a list of host is up. It just read a host file and check if the host are available doing a ping test or trying to open a socket. Nothing great, but it may [...]
Hacked !
This blog got hacked yesterday. It looks like some spammer managed to inject some PHP code into almost all *.php files of WordPress. It was not just like the classic SQL injection that is usually used to post some malicious post. The following code was added : <?php echo ‘<script type="text/javascript">function count(str){var res = "";for(i [...]
Perl : how to monitor a service remotely using sockets
I came to program my first Perl script based on sockets, after setting an IPSEC tunnel.
This tunnel is linking the remote peer and the local peer through an OpenBSD VPN gateway (managed with Isakmp).
The problem is that this connection is limited time, for access right reason. So it is not a 24 hours standard tunnel, but rather an on-demand type connection.
Note that the connection is automatically reseted by the remote peer, by invaliding the cookie of the connection and therefore obliging to renegotiate the VPN tunnel from the beginning : phase 1 of the key exchange.
In one word, the Isakmp service has to be restarted every time we need the tunnel to be up.
Of course, this is not the purpose of Isakmp to have such a mecanism and what is interesting is to start the tunnel from the local peer, every time it needs to do some transfer.
The graph below summarizes the situation :
IPSEC tunnel with OpenBSD as a VPN gateway
That why I came to develop a script that listen on a socket and allow that peer to remotely restart the Isakmp service.
OpenVPN and DNS on a linux client
I got a weired issue with Linux clients while it worked fine with Windows machines. For some reason, the /etc/resolv.conf did not get updated.
I found out a workaround thanks to this page.
Of course, your server configuration file must contain (if 192.168.1.1 is your DNS server):
push "dhcp-option DNS 192.168.1.1"




