For When You Can't Have The Real Thing
[ start | index | login ]
start > Linux > Beacon Ping

Beacon Ping

Created by dave. Last edited by dave, 4 years and 183 days ago. Viewed 1,166 times. #1
[edit] [rdf]
labels
attachments
(2019-09-18)

Problem

I want systems I deploy here and there to send beacon pings back to head office.

Solution

#!/bin/bash

# Beacon ping to 436-front so we can locate the tap. # Characteristics to help identify it: # - the ICMP packet size will be 436 bytes (ie: our street address) # - the payload pattern is the system name in hex # Invoke from cron regularly; ie every minute or every five minutes. # Locate: # $ tcpdump -nni $IF -X icmp and host 139.60.169.2 # $ tcpdump -r $CAPTURE-FILE -nn -X icmp and host 139.60.169.2

# System name in hex, one space, no null-terminator: NAME=`uname -n` HEX=`echo "$NAME " | xxd -p | sed -e 's/0a$//'`

# Give me a ping Vasili, one ping only please. </RedOctober> ping -c 1 -w 1 -s 428 -q -p $HEX -n 139.60.16i8.32 > /var/tmp/beacon.last

Commentary

This probably isn't the stupidest computer trick I've ever done, but it's right up there.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt