Skip to content

Instantly share code, notes, and snippets.

@shentonfreude
Created November 21, 2013 23:37
Show Gist options
  • Save shentonfreude/7591952 to your computer and use it in GitHub Desktop.
Save shentonfreude/7591952 to your computer and use it in GitHub Desktop.
!/bin/sh
# 2013-11-21 Chris Shenton <[email protected]>
# Send an Oracle TNS 'ping' to the host and port specified.
# If it's Oracle, we should get a response like:
# C"7(DESCRIPTION=(TMP=)(VSNNUM=0)(ERR=0)(ALIAS=l_ORCL_001))
# String from base64 encoding packet sent by:
# http://www.jammed.com/~jwa/hacks/security/tnscmd/tnscmd
tnsstr="AFcAAAEAAAABNgEsAAAIAH//fwgAAAABAB0AOgAAAAAAAAAAAAAAAAAAAAA05gAAAAEAAAAAAAAAAChDT05ORUNUX0RBVEE9KENPTU1BTkQ9cGluZykp"
echo $tnsstr | base64 --decode | nc $1 $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment