Wednesday, September 23, 2015

Stash password from a .sth file by using perl

#!/usr/bin/perl -w
use strict;
die "Usage: $0 <stash file>" if $#ARGV!=0;
my $file=$ARGV[0];
open(F,$file) || die "Can't open $file: $!";
my $stash;
read F,$stash,1024;
my @unstash=map {$_^0xf5} unpack("C*",$stash);
foreach my $c (@unstash){
last if $c eq 0;
printf "%c",$c;
}

Sunday, September 20, 2015

Simple script to caputure socket connection information on SM Policy server




# Written by Kishore Thotakoora to troubleshoot Q3-2015 login.fcc latency issues
#!/bin/ksh

host=`hostname`

count1707=`netstat -an | grep 1707 | wc -l`
echo "=======================================================================" >> /opt/siteminder/netegrity/log/NoOfConnections.log
echo `date` >> /opt/siteminder/netegrity/log/NoOfConnections.log
echo "=======================================================================" >> /opt/siteminder/netegrity/log/NoOfConnections.log
echo "No of Sockets established to 1707 are: $count1707" >> /opt/siteminder/netegrity/log/NoOfConnections.log
count1708=`netstat -an | grep 1708 | wc -l`
echo "No of Sockets established to 1708 are: $count1708" >> /opt/siteminder/netegrity/log/NoOfConnections.log

count44443_ESTABLISHED=`netstat -an | grep 44443 | grep ESTABLISHED | wc -l`
echo "No of Sockets established to 44443 are: $count44443_ESTABLISHED" >> /opt/siteminder/netegrity/log/NoOfConnections.log
count44443_SYN_SENT=`netstat -an | grep 44443 | grep SYN_SENT | wc -l`
echo "No of connections Attempts to establish a connection on 44443 are: $count44443_SYN_SENT" >> /opt/siteminder/netegrity/log/NoOfConnections.log

Tuesday, September 1, 2015

Siteminder: webagent registration with policy server

Below command has to run as user/root on the host where webagent lying on

Syntax
/ihs/SYSsiteminder/32bit/12.5.0.732/webagent/bin/smreghost -i <PolicyServer_hostname>:44441 -u siteminder -p <password> -hc CATHostSettings -hn `hostname` -f  <Path>/conf/SMHosts.conf



You will get a below message:

Host Registration written to <Path>/conf/SMHosts_CAT.conf'

After the registration, You must see your host in policy server Trusted host list


Note: If the agent is already registered with policy server we might encountered with below exception. In that case you can use that previous generated file if you have with you. Otherwise you can regenerate again by running above command.


Registration failed (Unable to create trusted host).

Below is the snippet of Policy server console: