<?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>P1 Labs &#187; analysis</title>
	<atom:link href="http://labs.p1sec.com/tag/analysis/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.p1sec.com</link>
	<description>P1 Security Labs</description>
	<lastBuildDate>Wed, 31 Dec 2014 00:24:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1</generator>
	<item>
		<title>Huawei reverse engineering: legacy and new network elements surprises</title>
		<link>http://labs.p1sec.com/2013/05/23/huawei-reverse-engineering-legacy-and-new-show-surprises/</link>
		<comments>http://labs.p1sec.com/2013/05/23/huawei-reverse-engineering-legacy-and-new-show-surprises/#comments</comments>
		<pubDate>Thu, 23 May 2013 09:44:58 +0000</pubDate>
		<dc:creator><![CDATA[Philippe Langlois]]></dc:creator>
				<category><![CDATA[Huawei Core]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Reverse engineering]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[huawei]]></category>
		<category><![CDATA[ppc]]></category>
		<category><![CDATA[reverse]]></category>
		<category><![CDATA[telecom]]></category>
		<category><![CDATA[vkb]]></category>
		<category><![CDATA[vulndev]]></category>
		<category><![CDATA[vulnres]]></category>
		<category><![CDATA[vxworks]]></category>

		<guid isPermaLink="false">http://labs.p1sec.com/?p=170</guid>
		<description><![CDATA[Sometime, reverse engineering for bug hunting reveals some fun stuff. So of course, when you&#8217;re dealing with Core Network elements such as Huawei MSC, MSC Proxy and SoftSwitch MSoftX 3000, you don&#8217;t expect to find these Chinese ASCII arts of an octopus being killed by an angel (!): We ca...]]></description>
				<content:encoded><![CDATA[<p>Sometime, reverse engineering for bug hunting reveals some fun stuff.</p>
<p>So of course, when you&#8217;re dealing with Core Network elements such as <a href="http://www.huawei.com/en/products/core-network/singlecore/fixed-softswitch/index.htm">Huawei MSC, MSC Proxy and SoftSwitch MSoftX 3000</a>, you don&#8217;t expect to find these Chinese ASCII arts of an octopus being killed by an angel (!):</p>
<p><a href="http://labs.p1sec.com/wp-content/uploads/2013/05/Screen-Shot-2013-05-23-at-11.33.39-AM1.png"><img class="alignnone size-full wp-image-173" alt="Screen Shot 2013-05-23 at 11.33.39 AM" src="http://labs.p1sec.com/wp-content/uploads/2013/05/Screen-Shot-2013-05-23-at-11.33.39-AM1.png" width="576" height="454" /></a></p>
<p>We can see that internally, this is called &#8220;Cool Beauty System 1.0.3&#8243; build (?) 35808001, by HuaWei R&amp;D CN (Research and Development Core Network).</p>
<p>We see also that this design dates back from when Huawei was spelled internally HuaWei, that is probably from the 1980s even if the build time of this firmware image (VxWorks Tornado based) is from 2010.</p>
<p>&nbsp;</p>
<p>and even less usual but more interesting to find the PCB schematics in ASCII art (!!):</p>
<p><a href="http://labs.p1sec.com/wp-content/uploads/2013/05/Screen-Shot-2013-05-23-at-11.33.57-AM.png"><img class="alignnone size-full wp-image-172" alt="Screen Shot 2013-05-23 at 11.33.57 AM" src="http://labs.p1sec.com/wp-content/uploads/2013/05/Screen-Shot-2013-05-23-at-11.33.57-AM.png" width="556" height="486" /></a></p>
<p>That reveals it&#8217;s running (well&#8230; we saw that earlier) on PowerPC RISC processor MPC750 by Freescale Semiconductor, Inc. Here is the datasheet <a href="http://labs.p1sec.com/wp-content/uploads/2013/05/MPC750.pdf">MPC750 RISC Processor by Freescale</a>. Please note the JTAG interface on page 15.</p>
<p>By googling the other components, you will find the pinout of the JTAG interfaces of each chip as well as the UART and the way to to In-Circuit debugging (and dumping) of the bootrom.</p>
<p>Thanks to Huawei engineers for this moments of fun and education. Is it best practice to teach reverse engineers what your hardware architecture looks like?</p>
<p>Oh&#8230; and thanks for the 4 new vulnerabilities added in the <a href="http://www.p1sec.com/corp/products/vulnerability-knowledge-base-vkb/">VKB</a> based on this reverse engineering and bug hunting session.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.p1sec.com/2013/05/23/huawei-reverse-engineering-legacy-and-new-show-surprises/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SS7 traffic analysis with Wireshark</title>
		<link>http://labs.p1sec.com/2013/04/04/ss7-traffic-analysis-with-wireshark/</link>
		<comments>http://labs.p1sec.com/2013/04/04/ss7-traffic-analysis-with-wireshark/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 13:30:31 +0000</pubDate>
		<dc:creator><![CDATA[Laurent Ghigonis]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[pcap]]></category>
		<category><![CDATA[ss7]]></category>
		<category><![CDATA[telecom]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://labs.p1sec.com/?p=13</guid>
		<description><![CDATA[The problem with wireshark Primary usage of wireshark is to visualize packets coming from traditional IP traffic, that is why default wireshark settings provides a relatively good overview of IP packets for most of the use cases. The problem is that this configuration is not at all suitable for spec...]]></description>
				<content:encoded><![CDATA[<h1>The problem with wireshark</h1>
<p>Primary usage of wireshark is to visualize packets coming from traditional IP traffic, that is why default wireshark settings provides a relatively good overview of IP packets for most of the use cases.</p>
<p>The problem is that this configuration is not at all suitable for specific needs of Telecom traffic analysis, and does not give you a quick vision when you are working on an SS7 Pcap.</p>
<p>Here is an example of SS7 traffic using default wireshark settings:</p>
<p><a href="http://labs.p1sec.com/wp-content/uploads/2013/04/Labs_wireshark_no_color_rules_mobicents.png"><img class="alignnone size-large wp-image-65" alt="Labs_wireshark_no_color_rules_mobicents" src="http://labs.p1sec.com/wp-content/uploads/2013/04/Labs_wireshark_no_color_rules_mobicents-1024x562.png" width="625" height="343" /></a>(click on image to enlarge)</p>
<p>With default wireshark configuration:</p>
<ul>
<li>You cannot see the interesting addresses in packet list view due to different addressing in SS7 and multiple layers involved.</li>
<li>You see only one color for all different SS7 traffic types, because wireshark pre-configures coloring only for standard protocols.</li>
</ul>
<h3>Why SS7 traffic is more complex to analyze</h3>
<p>First, <strong>SS7 Addressing is more complex than IP</strong> :<br />
Instead of only <strong>IP + port </strong>tuples to represent endpoints of IP communication, in SS7 you use <strong>Global Titles</strong> (GT), <strong>Point Codes</strong> (PC or SPC) and <strong>Sub-System Numbers</strong> (SSN), that can be used as follow:</p>
<ul>
<li>Global Title (GT)</li>
<li>Global Title + Sub-System Number (GT + SSN)</li>
<li>Point Code (PC)</li>
<li>Point Code + Sub-System Number (PC + SSN)</li>
<li>Sub-System Number (SSN)</li>
</ul>
<p>Secondly, their are <strong>much more network layers involved in Telecom traffic</strong> than on usual IP only traffic. On typical SS7 traffic you face in order:</p>
<ul>
<li>Ethernet</li>
<li>Multiprotocol Label Switching (MPLS)</li>
<li>Internet Protocol (IP)</li>
<li>Stream Control Transmission Protocol (SCTP)</li>
<li>MTP Level 3 (MTP3) User Adaptation Layer (M3UA)</li>
<li>Signalling Connection Control Part (SCCP)</li>
<li>Transaction Capabilities Application Part (TCAP)</li>
<li>Mobile Application Part (MAP)</li>
</ul>
<p>Each of these layer contains more parameters compared to IP.</p>
<p>Besides, many small packet flags are critically important, such as M3UA Network Indicator (Coded on 1 Byte, it represents the type of SS7 link : Internal, National or International).</p>
<h1>Customize your wireshark</h1>
<h2>Customize Wireshark columns</h2>
<p>You can customize the display columns of Wireshark to show GT and SSN in the packet list view, and do this in a separate profile to have different views on your packet depending of your activity.</p>
<p><a href="http://labs.p1sec.com/wp-content/uploads/2013/04/wireshark_ss7_columns_anon.png"><img alt="wireshark_ss7_columns_anon" src="http://labs.p1sec.com/wp-content/uploads/2013/04/wireshark_ss7_columns_anon-1024x587.png" width="663" height="379" /></a></p>
<p>(click on image to enlarge)</p>
<h3>How to configure column display (wireshark &gt;= 1.8.0)</h3>
<ol>
<li>Create a new profile : Go to &#8220;Edit &gt; Configuration Profiles&#8221;, click on Add and call it &#8220;SS7&#8243;.</li>
<li>Add a column: Right click on the packet list view column titles and go in &#8220;Column Preferences&#8221;. In this window, click on &#8220;Add&#8221; to add a column, and set it&#8217;s name by clicking on it in the columns list.</li>
<li>Set the field type in the &#8220;Field Type&#8221; of your new column, select &#8220;Custom&#8221;. Now you can enter your wireshark expression in &#8220;Field Name&#8221;, for example sccp.calling.digits or sccp.called.ssn.</li>
<li>Click on &#8220;Apply&#8221;: you will have your new column in your Wireshark packet list view.</li>
</ol>
<p>NOTE: This can be generalized to any Wireshark expression, so you can display any data you want from the pcap in the columns view.</p>
<p><a href="http://labs.p1sec.com/wp-content/uploads/2013/04/wireshark_ss7_columns_conf.png"><img alt="wireshark_ss7_columns_conf" src="http://labs.p1sec.com/wp-content/uploads/2013/04/wireshark_ss7_columns_conf-1024x592.png" width="625" height="361" /></a></p>
<p>(click on image to enlarge)</p>
<h3>Exporting / Importing columns setting</h3>
<p>The following file stores the configuration for your Wireshark profile:</p>
<p><i>/home/user/</i>.wireshark./profiles/SS7/preferences</p>
<p>Example:</p>
<pre>[...]
# Packet list column format.
# Each pair of strings consists of a column title and its format.
gui.column.format:
	"No.", "%m",
	"Time", "%t",
	"cgGT", "%Cus:sccp.calling.digits:0:R",
	"cgSSN", "%Cus:sccp.calling.ssn:0:R",
	"cdGT", "%Cus:sccp.called.digits:0:R",
	"cdSSN", "%Cus:sccp.called.ssn:0:R",
	"Protocol", "%p",
	"Length", "%L",
	"Info", "%i"
[...]</pre>
<h2>Customize Wireshark coloring rules</h2>
<p>To get a better overview of the SS7 traffic and identify types of messages just by looking quickly at them, you can customize wireshark coloring rules. Each rule is defined by one filter (using the same syntax as usual wireshark display filters), and a set of 2 colors (foreground and background colors).</p>
<p>Here is an overview of 4 basic coloring rules applied on typical SS7 traffic: <a href="http://labs.p1sec.com/wp-content/uploads/2013/04/Labs_wireshark_color_rules_04_anon.png"><img class="alignnone size-large wp-image-61" alt="Labs_wireshark_color_rules_04_anon" src="http://labs.p1sec.com/wp-content/uploads/2013/04/Labs_wireshark_color_rules_04_anon-1024x562.png" width="625" height="343" /></a></p>
<p>(click on image to enlarge)</p>
<p>On the above screenshot, MAP layer is identified by yellow or green background color, whether the message is a MAP invoke (request) or MAP returnResultLast (answer).TCAP Abort (cancellation of TCAP dialog due to error) has a pink background, and TCAP Begin (initialization of TCAP dialog) has a light blue background (Not visible on the screenshot).</p>
<h3>How to configure coloring rules (wireshark &gt;= 1.8.0)</h3>
<ol>
<li>Go to &#8220;View &gt; Coloring Rules&#8221;.</li>
<li>Click on &#8220;New&#8221; to add a new rule.</li>
<li>Enter a wireshark display filter in &#8220;String:&#8221; text box. For example, to match MAP invoke messages you can use the filter &#8220;gsm_map.old.Component == 1&#8243;.</li>
<li>Choose one foreground and one background color for this filter, then click &#8220;OK&#8221;</li>
</ol>
<p>NOTE: coloring rules will be tried in order until one filter matches, top filter having the highest priority.</p>
<p><a href="http://labs.p1sec.com/wp-content/uploads/2013/04/Labs_wireshark_color_rules_02.png"><img class="alignnone size-full wp-image-44" alt="Labs_wireshark_color_rules_02" src="http://labs.p1sec.com/wp-content/uploads/2013/04/Labs_wireshark_color_rules_02.png" width="750" height="679" /></a></p>
<p>(click on image to enlarge)</p>
<h3>Exporting / Importing coloring rules</h3>
<ol>
<li>Go to &#8220;View &gt; Coloring Rules&#8221;.</li>
<li>Optional: select one or more filtering rules to export by clicking on them. (Ctrl + Click to select multiple filters).</li>
<li>Click on &#8220;Export&#8221;.</li>
<li>Choose an output filename and optionally check the box &#8220;Export only selected filters&#8221;.</li>
</ol>
<p>You will get a file like <a href="http://labs.p1sec.com/wp-content/uploads/2013/04/Labs_wireshark_colorfilters_ss7.txt">this one</a>:</p>
<pre># DO NOT EDIT THIS FILE!  It was created by Wireshark
@MAP ReturnResultLast@gsm_map.old.Component == 2@[61023,65535,29648][0,0,0]
@MAP Invoke@gsm_map.old.Component == 1@[37006,53439,22070][0,0,0]
@TCAP abort@tcap.abort@[65535,52907,60113][0,0,0]
@TCAP begin@tcap.begin@[36382,59634,65535][0,0,0]</pre>
<p>This file can then be used to import coloring rules on another host.</p>
<p>&nbsp;</p>
<p>That&#8217;s it ! Don&#8217;t hesitate to comment with you&#8217;re own Wireshark tricks.</p>
<p>In a future blogpost, we&#8217;ll see how to use Wireshark to edit a PCAP, in order to forge packets or anonimize a PCAP file.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.p1sec.com/2013/04/04/ss7-traffic-analysis-with-wireshark/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
