Friday, November 25, 2016

dates with SelfSign certificate and openssl

I was playing around with self-signings  certificates on openssl   and notice a day  typo  in the signed certificate. My goal was to see how many days can you set a certificate for.



OpenSSL> version
OpenSSL 0.9.8zg 14 July 2015



( notice the date and the cert import failure in  F5 BIGIP LTM the appliance was probably say WTF  51 days in  OCT?????  )







Image result for laugh


2799 years !





















So finally I was able to have the certificate signed and successfully imported. Look at the dates now.





Ken Felix

NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com

     ^      ^
=(  @  @ )=
         o 
        /  \

Wednesday, November 23, 2016

A simple means for using F5 adtest for diagnostic and queries for MicrosoftAD

In my day job our IT team struggles for collection of diagnostics when using a F5-APM for vpn and webportal access.

Tools exist for the  query  ActiveDirectory directly but you can use the f5 cli  adtest tool to query ActiveDirectory.



What this does is allow for  directed requested to your AD servers to gather details from AD. This ensure that AD is working & the F5 has access with the proper credentials for AD query.

I placed a simple script that allows for querying AD and gather  information against our Entrust ID attributes and memberOf group memberships. You can adjust  the script and grep on items revelant  to your case.


Image result for bash
( content of my check-ad-bash-script )

#
#
#
# script for checking the AD  details for a user  ( group )

A=thef5adqueryaccountname
W="thef5querypassword"
#
#


echo "Hello,  This script will output  Entrust and Group MemberOF details for the name user account"

echo -n "Enter the USERNAME  press [ENTER]: "
read name
echo


echo ""

# craft the menu of the company AD servers  ( add lines for the  number of ad-servers )
#
read -n 1 -p "What AD server would you like to query ? (A/B/C/D) " resp;

case $resp in

# set  the business AD servers
    A)
        n=1.1.1.1;;
    B)
        n=1.1.1.2;;
    C)
        n=1.1.1.3;;
    D)
        n=1.1.1.4;;
    *)
        exit;;


esac


echo ""
echo ""


# set the  variable and find the hostname of the AD server
#
D=`host $n  | awk ' { print$5}'`

echo " *** Querying the Entrust Details from  AD server  $n $D  &  against  user $name  *** "


#
#

adtest -t query -h $n -r yourdomain.com -A $A  -u $name    -g -FG -W $W -d 10 | grep trust

sleep 2;

echo ""
echo " *** Querying the user $name and the    memberOf group details  ***"
echo ""

adtest -t query -h $n -r yourdomain.com -A $A  -u $name   -g -FG -W $W -d 10 | grep memberO

echo ""
echo "Finish!"




Ken

F5 APM policy on a VS with a portal access checklist


Here's a few checklist items when diagnostics of portal access  within a F5 with APM policies.

Portal access is a means for  providing  external users access to internal or even external websites and by rerouting and writing the requested URI for the requested target.

Check out a typical  portal access  mountain-top  view of a typical use for a internal only web servers that needs outside users to access theses  internal services. This is a typical use case for APM policy and for portal rewrites.




















Things to check for when it does not work

1: ensure that you have SNAT enabled on VirtualServer that has the accesspolicy &  a rewrite profile on the virtual-server






NOTE:  the VS will use the SNAT pool when making the client connection to the site and present the output to the user who has access the webportal ( aka webtop )


2: ensure the links are correct and reachable from the F5 for the hosted URI. Check for  typos or incorrect paths.

  curl  with the interface option could be very  helpful




3: the portal  resources has to be applied in a webtop for the advance resource assignments ensure  you add the resource

4: use the f5  reporting to  validate that user is receiving the resource

5: use tcpdump or tshark on  the f5 if you suspect  layer3 issues

e.g  from bash shell

 tmsh -c "list net vlan one-line"
 tmsh -c "list net self  one-line"

tcpdump -n -i <interfacename>  host x.x.x.x  and por 80 or 443




A sample portal cfg for a URI hosted site that's made available in a F5  webtop portal





The advantages of this approach for deploying  portal access


  • you can provide  security for HTTP-only websites
  • host either  URI or static content , and require access-policy controls 
  • control user access based on User-Agent type for support OSes
  • demand AUTHENTICATION for applications that does not support or have  server-side authentications functions
  • reduce public exposure and ipv4 address usage ( the single portal  door provide access )
  • reduce the need for UCC or *cards certificates for aach internal hosted site
  • can add MFA for authentication requires
  •  Provide access to external websites that are locked down to a certain  network or ip-ranges
  • provide end-users access to sites that have zero internal access
  • ensure tighter security with regards to SSL/TLS and for older applications that doesn't support TLSv1.x




Ken Felix

NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com

     ^      ^
=(  @  @ )=
         o 
        /  \



Friday, November 18, 2016

How to recover a lost BiG-IP F5 SECRET

If your familiar with a BIGIP F5, once you apply the   secret for  RADIUS or TACACS it is hash.

The quick and sure way to recover these secrets is to build a radius health check and set the debug option and  monitor the output. This is great if you have ucs config file &  with a secret that's unknown or not recorded.

The output within the  debug message will display the  text of the secret. The steps are;

1: craft a radius-health monitor and include some type of secret and enable the  'debug'





2: from the tmsh  list the radius monitor and edit the ltm monitor radius <mon-name> and replace the earlier  secret with the  hashed secret you want to decrypt.


e.g

 edit ltm monitor radius TEST







3:  From  F5 the unix bash shell find the debugged output after you have apply the  health monitor a defined pool, cat the  output and that would be your recovered secret. This works for recovering both RADIUS or TACACS secrets.





NOTE: this does not work for  users or admin  accounts, they are hashed using a one crypt function.
 The user password in the RADIUS health check will also be displayed





















Ken Felix

NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com

     ^      ^
=(  @  @ )=
         o 
        /  \

How to recover a lost f5 c secret

If your familiar with a BIGIP F5, once you apply the   secret for  RADIUS or TACACS it is hash.

The quick and sure way to recover these secrets is to build a radius health check and set the debug option and  monitor the output. This is great if you have ucs config file &  with a secret that's unknown or not recorded.

The output within the  debug message will display the  text of the secret. The steps are;

1: craft a radius-health monitor and include some type of secret and enable the  'debug'





2: from the tmsh  list the radius monitor and edit the ltm monitor radius <mon-name> and replace the earlier  secret with the  hashed secret you want to decrypt.


e.g

 edit ltm monitor radius TEST







3:  From  F5 the unix bash shell find the debugged output after you have apply the  health monitor a defined pool, cat the  output and that would be your recovered secret. This works for recovering both RADIUS or TACACS secrets.





NOTE: this does not work for  users or admin  accounts, they are hashed using a one crypt function.


Ken Felix

NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com

     ^      ^
=(  @  @ )=
         o 
        /  \