<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cupfighter.net &#187; script</title>
	<atom:link href="http://www.cupfighter.net/index.php/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cupfighter.net</link>
	<description>A blog by Schuberg Philis colleagues</description>
	<lastBuildDate>Thu, 09 Feb 2012 14:27:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>PowerShell V2 RTM has arrived&#8230;. also for Vista, XP and others</title>
		<link>http://www.cupfighter.net/index.php/2009/11/powershell-v2-has-arrived-also-for-vista-xp-and-others/</link>
		<comments>http://www.cupfighter.net/index.php/2009/11/powershell-v2-has-arrived-also-for-vista-xp-and-others/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 11:41:55 +0000</pubDate>
		<dc:creator>Hans van Veen</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[V2]]></category>
		<category><![CDATA[WinRM]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/index.php/2009/11/powershell-v2-has-arrived-also-for-vista-xp-and-others/</guid>
		<description><![CDATA[Late October PowerShell V2 was released for almost all Windows platforms. Check out http://support.microsoft.com/kb/968929 and download the version you need. Happy scripting!]]></description>
			<content:encoded><![CDATA[<p>Late October PowerShell V2 was released for almost all Windows platforms. Check out <a title="MS PowerShell" href="http://support.microsoft.com/kb/968929">http://support.microsoft.com/kb/968929</a> and download the version you need.</p>
<p>Happy scripting!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/11/powershell-v2-has-arrived-also-for-vista-xp-and-others/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Defcon talk: Breaking the &#8220;unbreakable&#8221; Oracle with Metasploit &#8211; Chris Gates and Mario Ceballos</title>
		<link>http://www.cupfighter.net/index.php/2009/08/defcon-oracle-metasploit/</link>
		<comments>http://www.cupfighter.net/index.php/2009/08/defcon-oracle-metasploit/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 07:46:54 +0000</pubDate>
		<dc:creator>Frank Breedijk</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Defcon]]></category>
		<category><![CDATA[metasploit]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[Patching]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[snort]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/?p=425</guid>
		<description><![CDATA[Chris and Mario presented and demonstrated the new Metasploit modules that are designed to find and identify Oracle databases, find the SIDs, brute force passwords and escalate privileges. An interesting comment is that they where actually able to evade Snort detection by base64 encoding the attack. Currently there are 9 privilege escalation exploits included in [...]]]></description>
			<content:encoded><![CDATA[<p>Chris and Mario presented and demonstrated the new Metasploit modules that are designed to find and identify Oracle databases, find the SIDs, brute force passwords and escalate privileges.</p>
<p>An interesting comment is that they where actually able to evade Snort detection by base64 encoding the attack.</p>
<p><span id="more-425"></span>Currently there are 9 privilege escalation exploits included in Metasploit, but they are a basis for further development.</p>
<p>The demonstration contained the following steps:</p>
<ul>
<li>TNSLIST -&gt; Version enumeration of TNS Listener</li>
<li>SIDENUM -&gt; Enumeration of the SIDs, this failed because it was an Oracle version 10 box</li>
<li>Burt force SID – Obtained the SID this way</li>
<li>Account brute fore – To get an account</li>
<li>Escalate to DBA – Get DBA privileges</li>
<li>Add JAVASYS privilege</li>
<li>Upload exploit</li>
<li>Run it via WINEXEC</li>
<li>Get a Shell prompt.</li>
</ul>
<p>All in all a good overview of what stuff is available to the Oracle pentester in the Metasploit Framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/08/defcon-oracle-metasploit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell: Finding next available driveletter</title>
		<link>http://www.cupfighter.net/index.php/2009/06/powershell-finding-next-available-driveletter/</link>
		<comments>http://www.cupfighter.net/index.php/2009/06/powershell-finding-next-available-driveletter/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 11:53:00 +0000</pubDate>
		<dc:creator>Hans van Veen</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/?p=266</guid>
		<description><![CDATA[Finding the next available driveletter on a system, excluding reserved driveletters, can be done using the following PowerShell 1-liner. [char[]]&#8221;DEFGJKLMNOPQRTUVWXY&#8221; &#124; ?{!(gdr $_ -ea &#8216;SilentlyContinue&#8217;)} &#124; select -f 1 The character array containing only valid driveletters (in this example A, B, C, H, I, S and Z are not to be used)  is piped to the where-object cmdlet [...]]]></description>
			<content:encoded><![CDATA[<p>Finding the next available driveletter on a system, excluding reserved driveletters, can be done using the following PowerShell 1-liner.</p>
<p style="PADDING-LEFT: 30px"><span style="color: #0000ff;"><em>[char[]]&#8221;DEFGJKLMNOPQRTUVWXY&#8221; | ?{!(gdr $_ -ea &#8216;SilentlyContinue&#8217;)} | select -f 1</em></span></p>
<p>The character array containing only valid driveletters (in this example A, B, C, H, I, S and Z are not to be used)  is piped to the where-object cmdlet which uses Get-PSDrive to filter out the non-used drive letters. These are then passed to the Select-Object cmdlet which only displays the 1st match.</p>
<p>Beware: the line above returns only the bare driveletter &#8211; no colon is appended.</p>
<p><span style="color: #0000ff;"><em></em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/06/powershell-finding-next-available-driveletter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Needs an OO Database but you have &#8220;only&#8221; Bash?</title>
		<link>http://www.cupfighter.net/index.php/2009/06/needs-an-oo-database-but-you-have-only-bash/</link>
		<comments>http://www.cupfighter.net/index.php/2009/06/needs-an-oo-database-but-you-have-only-bash/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 08:07:35 +0000</pubDate>
		<dc:creator>Enrico Romani</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[object oriented]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/?p=237</guid>
		<description><![CDATA[Have a look at this script from Stephane Chazelas appeared in the Appendix A of a very old version of the &#8220;Advanced Bash-Scripting Guide&#8221;. #!/bin/bash # obj-oriented.sh: Object-oriented programming in a shell script. # Script by Stephane Chazelas. person.new() # Looks almost like a class declaration in C++. { local obj_name=$1 name=$2 firstname=$3 birthdate=$4 eval "$obj_name.set_name() { eval [...]]]></description>
			<content:encoded><![CDATA[<p>Have a look at this script from Stephane Chazelas appeared in the Appendix A of a <em>very old</em> version of the &#8220;<strong>Advanced Bash-Scripting Guide&#8221;.</strong></p>
<pre class="PROGRAMLISTING">#!/bin/bash
# obj-oriented.sh: Object-oriented programming in a shell script.
# Script by Stephane Chazelas.

person.new()        # Looks almost like a class declaration in C++.
{
  local obj_name=$1 name=$2 firstname=$3 birthdate=$4

  eval "$obj_name.set_name() {
          eval \"$obj_name.get_name() {
                   echo \$1
                 }\"
        }"

  eval "$obj_name.set_firstname() {
          eval \"$obj_name.get_firstname() {
                   echo \$1
                 }\"
        }"

  eval "$obj_name.set_birthdate() {
          eval \"$obj_name.get_birthdate() {
            echo \$1
          }\"
          eval \"$obj_name.show_birthdate() {
            echo \$(date -d \"1/1/1970 0:0:\$1 GMT\")
          }\"
          eval \"$obj_name.get_age() {
            echo \$(( (\$(date +%s) - \$1) / 3600 / 24 / 365 ))
          }\"
        }"

  $obj_name.set_name $name
  $obj_name.set_firstname $firstname
  $obj_name.set_birthdate $birthdate
}

echo

person.new self Bozeman Bozo 101272413
# Create an instance of "person.new" (actually passing args to the function).

self.get_firstname       #   Bozo
self.get_name            #   Bozeman
self.get_age             #   28
self.get_birthdate       #   101272413
self.show_birthdate      #   Sat Mar 17 20:13:33 MST 1973

echo

# typeset -f
# to see the created functions (careful, it scrolls off the page).

exit 0</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/06/needs-an-oo-database-but-you-have-only-bash/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PowerShell: Comparing Version numbers</title>
		<link>http://www.cupfighter.net/index.php/2009/06/powershell-comparing-version-numbers/</link>
		<comments>http://www.cupfighter.net/index.php/2009/06/powershell-comparing-version-numbers/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 07:33:49 +0000</pubDate>
		<dc:creator>Hans van Veen</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Schuberg Philis]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/?p=209</guid>
		<description><![CDATA[Comparing version numbers can be tricky from time to time, before you know it you end up in auto-casting issues comparing strings to integers etc. The most common format of a version number in Windows is &#8220;Major. Minor. Build. Revision&#8221; where each individual item is a figure, but because of the separating dots PowerShell will treat [...]]]></description>
			<content:encoded><![CDATA[<p>Comparing version numbers can be tricky from time to time, before you know it you end up in auto-casting issues comparing strings to integers etc. The most common format of a version number in Windows is &#8220;Major. Minor. Build. Revision&#8221; where each individual item is a figure, but because of the separating dots PowerShell will treat each item as a string.</p>
<p>The .Net System.Version assembly offers a CompareTo method which can do the trick, as shown in the figure below.</p>
<p><img class="alignnone size-full wp-image-210" title="versions" src="http://www.cupfighter.net/wp-content/uploads/2009/06/versions.jpg" alt="versions" width="637" height="309" /></p>
<p>The CompareTo method will return 1, 0 or -1  depending whether the compare to version  is higher, equal or lower.</p>
<p><span style="color: #0000ff;">Thanks to Shay Levi (see the comment) I now know a better/faster method for comparing version numbers (thaks Shay). PowerShell has its own [vesion] type. This removes the need of loading the assembly and using New-Object. It still allows for using the CompareTo method and direct compare via -ge, -gt, etc.</span></p>
<p><span style="color: #0000ff;"><img class="alignnone size-full wp-image-227" title="versions-2" src="http://www.cupfighter.net/wp-content/uploads/2009/06/versions-2.jpg" alt="versions-2" width="624" height="321" /></span></p>
<p><span style="color: #0000ff;">The CompareTo method will distinguish between the 3 possibilities (&gt;, &lt; or =), but direct comparison might be sufficient in a script.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/06/powershell-comparing-version-numbers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PowerShell: Controlling Cmdlet parameters</title>
		<link>http://www.cupfighter.net/index.php/2009/06/powershell-controlling-cmdlet-parameters/</link>
		<comments>http://www.cupfighter.net/index.php/2009/06/powershell-controlling-cmdlet-parameters/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 13:52:19 +0000</pubDate>
		<dc:creator>Hans van Veen</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[cmdlet]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Schuberg Philis]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.cupfighter.net/?p=167</guid>
		<description><![CDATA[PowerShell allows for inline parameter control for some of its cmdlet parameters. Based upon commandline and/or inputfile content you might want to turm some of the cmdlet parameters on or off. For example: scripts manipulating files will often use the Get-ChildItem cmdlet in combination with the -recurse parameter, but not allways the subfolder files are required. Instead [...]]]></description>
			<content:encoded><![CDATA[<p>PowerShell allows for inline parameter control for some of its cmdlet parameters. Based upon commandline and/or inputfile content you might want to turm some of the cmdlet parameters on or off.</p>
<p>For example: scripts manipulating files will often use the Get-ChildItem cmdlet in combination with the -recurse parameter, but not allways the subfolder files are required. Instead off having multiple Get-ChildItem commandlines (each with their own set of parameters) a single line might be possible.</p>
<p>The following examples use the Get-ChildItem cmdlet to show what I mean.</p>
<p>The command in figure below will display all *.tmp files in the current folder and its subfolders.</p>
<p><img class="alignnone size-full wp-image-170" title="image11" src="http://www.cupfighter.net/wp-content/uploads/2009/06/image11.bmp" alt="Get-ChildItem without parameter control" width="552" height="226" /></p>
<p>By extending -recurse with :$false recursive lookup will be turned off.</p>
<p><img class="alignnone size-full wp-image-173" title="image2" src="http://www.cupfighter.net/wp-content/uploads/2009/06/image2.bmp" alt="Get-ChildItem with recures lookup turned off" width="557" height="213" /></p>
<p>On the otherhand, replacing $false with $true will turn recursive lookup on again.</p>
<p>So using a boolean variable we can turn recursive lookup on or off from within the script (-recurse:$RecurseOnOff). And of course this method also works for other parameters.</p>
<p><img class="alignnone size-full wp-image-174" title="image3" src="http://www.cupfighter.net/wp-content/uploads/2009/06/image3.bmp" alt="Get-ChildItem with multiple controls" width="556" height="238" /></p>
<p>And it does get stranger&#8230;.. in some occasions you can also reverse the default action of a parameter. Hence the following figure.</p>
<p><img class="alignnone size-full wp-image-175" title="image4" src="http://www.cupfighter.net/wp-content/uploads/2009/06/image4.bmp" alt="Reverse parameter action" width="560" height="195" /></p>
<p>The 1st command will show all files with exception of the *.tmp files. By appending :$false to -exclude, we turn -exclude into -include as demonstrated by the 2nd command.</p>
<p>This form of parameter manipulation offers a scala of possibilities. Using script parameters to control cmdlet behaviour can both decrease script size and complexity.</p>
<p>Have fun experimenting with this little trick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cupfighter.net/index.php/2009/06/powershell-controlling-cmdlet-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

