Sometimes one needs to debug a protocol problem between client and server but what if the connection is encrypted with SSL/TLS? You can use this trick to reveal the unencrypted traffic.
Continue reading Eavesdropping HTTPS with HaproxyTag Archives: linux
E-mail to SMS
If you are dealing with network monitoring, you might consider using SMSes because they are completely independent. On the other hand, many monitoring systems don’t support HTTP calls (which is the usual way for sending them) but most of them support sending e-mails. Here I want to describe how to configure your server to receive e-mails and transform them to SMSes. Continue reading E-mail to SMS
Using socat for multicast receiving and proxying
socat is a very handy networking tool. Here are some examples for multicast manipulation
Receive multicast data to stdout or file
If you save common mpeg-ts IPTV multicast this way, you can play it with any decent player, like vlc or mplayer.
SRC=239.1.2.3;SRCP=1234;IF=eth0 socat -T 3 UDP4-RECV:$SRCP,bind=$SRC,ip-add-membership=$SRC:$IF,reuseaddr - socat -T 3 UDP4-RECV:$SRCP,bind=$SRC,ip-add-membership=$SRC:$IF,reuseaddr - > stream.ts
Create high-available multicast proxy
socat relays packets from 239.1.1.1:1234 to 239.2.1.1:1234 with multicast ttl=8.
If no packet arrives in 3 seconds (-T 3), socat exits and script runs another socat which joins another multicast 239.1.1.2:1234 and continues with relaying. You can add as many sources as you want, they will be used in a round-robin fashion. If you want to switch to next source, just kill currently running socat.
DST=239.2.1.1:1234 while true do SRC=239.1.1.1;SRCP=1234;IF=eth0 socat -T 3 UDP4-RECV:$SRCP,bind=$SRC,ip-add-membership=$SRC:$IF,reuseaddr UDP4-SENDTO:$DST,ip-multicast-ttl=8 SRC=239.1.1.2;SRCP=1234;IF=eth0 socat -T 3 UDP4-RECV:$SRCP,bind=$SRC,ip-add-membership=$SRC:$IF,reuseaddr UDP4-SENDTO:$DST,ip-multicast-ttl=8 ... done