<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4653711704745711900</id><updated>2024-10-19T14:21:08.534-07:00</updated><title type='text'>Informations technologies</title><subtitle type='html'>All about informations technologies</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://greendark-team.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>58</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-4695432145246546091</id><published>2021-01-30T03:02:00.003-08:00</published><updated>2021-01-30T03:02:42.431-08:00</updated><title type='text'>Odoo 14 requirements installation - the easy way !!! one command solution !!!</title><content type='html'>To install odoo 14 requirements (python 3 libraries )&amp;nbsp; you need a lot off work , installing&amp;nbsp; other dev headers to compile python code sources , for that i decide to make a github repository&amp;nbsp; that contains all required libraries .whl files , all you need to do is :&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1- install python 3.9 in your system .&lt;/div&gt;&lt;div&gt;2- clone github repo :&amp;nbsp;https://github.com/ibrahimdsv/odoo14-wheels.git&lt;/div&gt;&lt;div&gt;3- go to the folder off your system ( if your system is windows go to : wheels_win32 , else if your system is linux go to wheels_linux) with this command : cd wheels_win32 or cd wheels_linux .&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4- execute this command :&amp;nbsp;&lt;span style=&quot;background-color: white; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;pip install --no-index --find-links . -r requirements.txt&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;Thats all enjoy your odoo 14 environnement is ready !!! .&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/4695432145246546091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/4695432145246546091'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2021/01/odoo-14-requirements-installation-easy.html' title='Odoo 14 requirements installation - the easy way !!! one command solution !!!'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-5008588721545406208</id><published>2016-04-27T02:29:00.003-07:00</published><updated>2016-04-27T02:29:58.614-07:00</updated><title type='text'>How an IDS Works</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Now that we have looked at some of the capabilities of an IDS as far as alerting &lt;br /&gt;on malicious traffic, it’s time to take a closer look at what exactly IDSs can keep &lt;br /&gt;an eye on, what data sources they use to do this monitoring, how they separate &lt;br /&gt;attack traffic from normal traffic, and some possible responses to seeing malicious &lt;br /&gt;traffic. &lt;br /&gt;What the IDS Is Watching ??&lt;br /&gt;Let’s start by looking at what your IDS is able to see.This is going to depend &lt;br /&gt;greatly on what type of IDS it is, and where it’s placed in your network. IDSs are &lt;br /&gt;classified by their functionality, loosely grouped into the following three categories:&lt;br /&gt;
&lt;br /&gt;
■&amp;nbsp; Network-Based Intrusion Detection System (NIDS) &lt;br /&gt;■&amp;nbsp; Host-Based Intrusion Detection System (HIDS) &lt;br /&gt;■&amp;nbsp; Distributed Intrusion Detection System (DIDS) &lt;br /&gt;Network IDS &lt;br /&gt;The NIDS derives its name from the fact that it monitors an entire network seg­&lt;br /&gt;ment, or subnet.This is done by changing the mode on the NIDS’ network &lt;br /&gt;interface card (NIC). Normally, a NIC operates in nonpromiscuous mode, lis­&lt;br /&gt;tening only for packets destined for its own media access control (MAC) address. &lt;br /&gt;Other packets are not forwarded up the stack for analysis; they are ignored.To &lt;br /&gt;monitor all traffic on the subnet, not just those packets addressed to the NIDS &lt;br /&gt;machine itself, the NIDS must accept all packets and forward them up the stack. &lt;br /&gt;This is known as promiscuous mode. &lt;br /&gt;In promiscuous mode, the NIDS can eavesdrop on all communications &lt;br /&gt;on the network segment. However, that’s not all that is necessary to ensure that &lt;br /&gt;your NIDS is capable of listening to all traffic on the subnet.The network device &lt;br /&gt;immediately upstream of your NIDS must also be configured to send all packets &lt;br /&gt;on the subnet to your NIDS. If that device is a hub, all packets are automatically &lt;br /&gt;sent since all ports on a hub receive all traffic flowing through the hub. However, &lt;br /&gt;if that device is a switch, you may have to put the port on the switch into a &lt;br /&gt;monitoring mode, turning it into a span port. After setting up your NIDS, it is &lt;br /&gt;advisable to run a sniffing tool on the interface, to ensure that you can see all &lt;br /&gt;traffic on the subnet. &lt;br /&gt;The advantage of a NIDS is that it has no impact on the systems or networks &lt;br /&gt;it is monitoring. It doesn’t add any load to the hosts, and an attacker who com­&lt;br /&gt;promises one of the systems being watched can’t touch the NIDS and may not &lt;br /&gt;even know it is there. One downside of the monitoring is maxing out your span &lt;br /&gt;ports that you are allotted on a given network, and maxing out the bandwidth &lt;br /&gt;on the span itself. If you have 20 100MB ports spanning to one port, you begin &lt;br /&gt;filling up backplane… once that 5GB or 11GB backplane is saturated, you are in &lt;br /&gt;a world of hurt.&lt;br /&gt;
In view of emerging privacy regulations, monitoring network communi­cations is a responsibility that must be considered carefully. Make sure that you are familiar with your local legal requirements for such activity. &lt;br /&gt;In Figure 1.1, we see a network using three NIDS.The units have been&amp;nbsp; placed on strategic network segments and can monitor network traffic for all devices on the segment.This configuration represents a standard perimeter secu­rity network topology where the screened subnets housing the public servers are protected by NIDSs. When a public server is compromised on a screened subnet, the server can become a launching platform for additional exploits. Careful mon­itoring is necessary to prevent further damage.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhck4VS7k7LMSuFL0cUoiMmI9iICBlceNoYrubiIUnxUaCQavUZJnLkbO8Y7-LBzTMirJaqvLFcmdjN5r15REdSuae-YP39IwzF1GItdFvd2eziBQMW92p8KezZ9rXRGrZj_xo7_fDFbsUY/s1600/net.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;261&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhck4VS7k7LMSuFL0cUoiMmI9iICBlceNoYrubiIUnxUaCQavUZJnLkbO8Y7-LBzTMirJaqvLFcmdjN5r15REdSuae-YP39IwzF1GItdFvd2eziBQMW92p8KezZ9rXRGrZj_xo7_fDFbsUY/s400/net.jpg&quot; width=&quot;400&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp;The internal host systems are protected by an additional NIDS to mitigate &lt;br /&gt;exposure to internal compromise.The use of multiple NIDS within a network is an example of a defense-in-depth security architecture.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Host-Based IDS &lt;br /&gt;Host-based IDSs, or HIDSs, differ from NIDSs in two ways. First, an installed &lt;br /&gt;HIDS protects only the system on which it resides, not the entire subnet, and &lt;br /&gt;second, the network card of a system with a HIDS installed normally operates in &lt;br /&gt;nonpromiscuous mode.This can be an advantage in some cases—not all NICs &lt;br /&gt;are capable of promiscuous mode, although most modern NICs are. In addition, &lt;br /&gt;promiscuous mode can be CPU intensive for a slow host machine. &lt;br /&gt;Another advantage of HIDS is the ability to tailor the ruleset to be very spe­&lt;br /&gt;cific to the particular host system. For example, there is no need to configure mul­&lt;br /&gt;tiple rules designed to detect Network File System (NFS) exploits on a host that is &lt;br /&gt;not using the NFS. Being able to fine-tune your ruleset will enhance performance &lt;br /&gt;and decrease false positives (or true positives that you simply don’t care about).The &lt;br /&gt;major advantage of a HIDS, however, lies in its capability to detect specific changes &lt;br /&gt;to the files and operating system of its host. It can monitor file sizes and checksums &lt;br /&gt;to ensure that crucial system files are not maliciously modified without someone &lt;br /&gt;noticing. It can intercept rogue system calls that may be an attempt at exploiting a &lt;br /&gt;local vulnerability. Moreover, it can watch traffic within a system that never crosses &lt;br /&gt;the network, and therefore would never be seen by the NIDS. &lt;br /&gt;There are a few downsides to electing to use a HIDS.You’ll have to choose &lt;br /&gt;one that is tailored to your operating system. If you have many different oper­&lt;br /&gt;ating systems on your network and want to use the same vendor for all your &lt;br /&gt;HIDSs, you may have to do a little shopping to find the right vendor that sup­&lt;br /&gt;ports all of your operating systems. A HIDS will add load to the host on which it &lt;br /&gt;is configured, as the HIDS process(es) will consume resources.This is usually not &lt;br /&gt;a problem on an individual’s desktop, but can become one on a busy network &lt;br /&gt;server. Make sure you are familiar with the details of any HIDS that you choose &lt;br /&gt;and how it operates—some HIDSs will watch file accesses, usage times, process &lt;br /&gt;loads, and/or system calls, while others may also watch network activity from the &lt;br /&gt;point of view of that host. Know what features you want in your HIDS, and &lt;br /&gt;make sure that the HIDS you select will support those features on all the plat­&lt;br /&gt;forms you need.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
In addition, maintaining a large network of systems with many HIDS &lt;br /&gt;deployed can be very challenging.The HIDS solution alone does not always scale &lt;br /&gt;well, and without centralized management, you may be a very busy system &lt;br /&gt;administrator indeed trying to keep up with all those alerts. &lt;br /&gt;Figure 1.2 depicts a network using a HIDS on specific servers and host com­&lt;br /&gt;puters. As previously mentioned, the ruleset for the HIDS on the mail server is &lt;br /&gt;customized to protect it from mail server exploits, while the Web server rules are &lt;br /&gt;tailored for Web exploits. During installation, individual host machines can be &lt;br /&gt;configured with a common set of rules. New rules can be loaded periodically to &lt;br /&gt;account for new vulnerabilities.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB8xOeipEta2ZQXGABqqDa8n5Pgwb3qdW4zU36lmnJFZSr6d1wgC_639ZxQiMRf3hny-CqRi7VVM6fVVl1tJdjHuekH54iqZp5HcDyDIhOfhAMyWhTxzZiYtPrW2ynvaP1wlVP06-HeWKp/s1600/net2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;261&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB8xOeipEta2ZQXGABqqDa8n5Pgwb3qdW4zU36lmnJFZSr6d1wgC_639ZxQiMRf3hny-CqRi7VVM6fVVl1tJdjHuekH54iqZp5HcDyDIhOfhAMyWhTxzZiYtPrW2ynvaP1wlVP06-HeWKp/s400/net2.png&quot; width=&quot;400&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp;Distributed IDS :&lt;br /&gt;A Distributed Intrusion Detection System, or DIDS, is a combination of NIDS &lt;br /&gt;sensors, HIDS sensors, or both, distributed across your enterprise, and all &lt;br /&gt;reporting to a central correlation system. Attack logs are generated on the sensors &lt;br /&gt;and uploaded (either periodically or continuously) to the central server station &lt;br /&gt;where they can be stored in a central database. New attack signatures are created or downloaded to the management station as they become available, and can &lt;br /&gt;then be downloaded to the sensors on an as-needed basis.The different kinds of &lt;br /&gt;sensors may or may not be managed by the same server, and the management &lt;br /&gt;servers are frequently separate from the servers that collect the logs.The rules for &lt;br /&gt;each sensor can be tailored to meet its individual needs, suiting the network or &lt;br /&gt;the host that each sensor monitors. Alerts can be forwarded to a messaging &lt;br /&gt;system located on the correlation system station and used to notify the IDS &lt;br /&gt;administrator.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/5008588721545406208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/5008588721545406208'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2016/04/how-ids-works.html' title='How an IDS Works'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhck4VS7k7LMSuFL0cUoiMmI9iICBlceNoYrubiIUnxUaCQavUZJnLkbO8Y7-LBzTMirJaqvLFcmdjN5r15REdSuae-YP39IwzF1GItdFvd2eziBQMW92p8KezZ9rXRGrZj_xo7_fDFbsUY/s72-c/net.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-7390310590901887829</id><published>2016-04-26T04:50:00.000-07:00</published><updated>2016-04-26T04:50:11.060-07:00</updated><title type='text'>Creating a Strong Firewall Security  Policy:in checkpoint firewall product</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Using the Firewall Rule Base The firewall is the core of a well-defined network security policy. The goal of the Check Point Firewall Rule Base is to create rules that only allow the specified connections.&lt;br /&gt;
&lt;br /&gt;
Managing the Firewall Rule Base Use SmartDashboard to easily create and configure Firewall rules for a strong security policy.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg106xv_xm8-bByyo3zZDokOzZ-EDyt_Urue3iDSnAwHSw-C7j_pQREdaeowWZWe6uv4o2Uqyg69IPj1mdhNlQWYWd3lIORLKTNum-yFDL920pUuJXWOsfr0uNTv33i0tM5Yg2HBc5CPJsH/s1600/check1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg106xv_xm8-bByyo3zZDokOzZ-EDyt_Urue3iDSnAwHSw-C7j_pQREdaeowWZWe6uv4o2Uqyg69IPj1mdhNlQWYWd3lIORLKTNum-yFDL920pUuJXWOsfr0uNTv33i0tM5Yg2HBc5CPJsH/s640/check1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
These are the fields that manage the rules for the Firewall security policy.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
No:&amp;nbsp; Rule number in the Firewall Rule Base. Implied rules do not have a number.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Hits : Number of connections that match this rule. &lt;br /&gt;Name : Name that the system administrator gives this rule.&lt;br /&gt;Source : Network object that starts the connection.&lt;br /&gt;Destination : Network object that completes the connection.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
VPN : Definitions of the allowed or blocked traffic between VPN sites.&lt;br /&gt;Service : Type of network service that is allowed or blocked.&lt;br /&gt;Action:&amp;nbsp; Firewall action that is done when traffic matches the rule.&lt;br /&gt;Track&amp;nbsp; :Tracking and logging action that is done when traffic matches the rule.&lt;br /&gt;Install On&amp;nbsp; :Network objects that will get the rule(s) of the security policy. The Policy Targets option installs the rule(s) on all Security Gateways.&lt;br /&gt;Time : Time period that the Firewall enforces this rule.&lt;br /&gt;Comment : An optional field that lets you summarize the rule.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
for more details about checkpoint firewalls configuration download this manual :&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;http://downloads.checkpoint.com/dc/download.htm?ID=22913&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7390310590901887829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7390310590901887829'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2016/04/creating-strong-firewall-security.html' title='Creating a Strong Firewall Security  Policy:in checkpoint firewall product'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg106xv_xm8-bByyo3zZDokOzZ-EDyt_Urue3iDSnAwHSw-C7j_pQREdaeowWZWe6uv4o2Uqyg69IPj1mdhNlQWYWd3lIORLKTNum-yFDL920pUuJXWOsfr0uNTv33i0tM5Yg2HBc5CPJsH/s72-c/check1.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-6820747279174098124</id><published>2016-04-26T04:34:00.002-07:00</published><updated>2016-04-26T04:36:06.697-07:00</updated><title type='text'>SOFTWARE-DEFINED PROTECTION Modern security architecture powered by collaborative intelligence</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Business today is driven by free-flowing information. Corporate data travels through the cloud and mobile &lt;br /&gt;devices and radiates through ideas and posts in social networks. BYOD, mobility and cloud computing have &lt;br /&gt;revolutionized static IT environments, introducing the need for dynamic networks and infrastructures.&lt;br /&gt;But if our IT environment has changed quickly, the threat landscape has changed even faster. The&lt;br /&gt;sophistication and velocity of this evolution is growing exponentially by unleashing new attack types &lt;br /&gt;frequently, combining known and unknown threats, taking advantage of “zero-day” vulnerabilities, and &lt;br /&gt;utilizing hidden malware inside documents, websites, hosts and networks.&lt;br /&gt;In a world with high-demanding IT infrastructures and networks, where perimeters are no longer well defined, &lt;br /&gt;and where threats grow more intelligent every day, we need to define the right way to protect enterprises in the &lt;br /&gt;ever changing threat landscape. &lt;br /&gt;There is a wide proliferation of point security products; however these products tend to be reactive and &lt;br /&gt;tactical in nature rather than architecturally oriented. Today’s corporations need a single architecture that combines high performance network security devices with real-time proactive protections. &lt;br /&gt;A new paradigm is needed to protect organizations proactively.&lt;br /&gt;Software-defined Protection is a new, pragmatic security architecture and methodology. It offers an infrastructure that is modular, agile and most importantly, SECURE.&lt;br /&gt;Such architecture must protect organizations of all sizes at any location: headquarters networks, branch offices, roaming through smartphones or mobile devices, or when using cloud environments. &lt;br /&gt;Protections should automatically adapt to the threat landscape without the need for security administrators to&amp;nbsp; follow up manually on thousands of advisories and recommendations. These protections must integrate&amp;nbsp; seamlessly into the larger IT environment, and the architecture must provide a defensive posture that collaboratively leverages both internal and external intelligent sources. &lt;br /&gt;The Software Defined Protection (SDP) architecture partitions the security infrastructure into&lt;br /&gt;three interconnected layers:&lt;br /&gt;•&amp;nbsp; An Enforcement Layer that is based on physical, virtual and host-based security enforcement points&lt;br /&gt;and that segments the network as well as executes the protection logic in high-demand environments. &lt;br /&gt;•&amp;nbsp; A Control Layer that analyzes different sources of threat information and generates protections and &lt;br /&gt;policies to be executed by the Enforcement Layer. &lt;br /&gt;•&amp;nbsp; A Management Layer that orchestrates the infrastructure and brings the highest degree of agility to the entire architecture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/6820747279174098124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/6820747279174098124'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2016/04/software-defined-protection-modern.html' title='SOFTWARE-DEFINED PROTECTION Modern security architecture powered by collaborative intelligence'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-3439519040918858273</id><published>2015-02-10T02:37:00.002-08:00</published><updated>2015-02-10T02:38:49.529-08:00</updated><title type='text'>GHOST critical liux security hole</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Description&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;Heap-based buffer overflow in the __nss_hostname_digits_dots function in glibc 2.2, and other 2.x versions before 2.18, allows context-dependent attackers to execute arbitrary code via vectors related to the (1) gethostbyname or (2) gethostbyname2 function, aka &quot;GHOST.&quot; The GHOST vulnerability is a serious weakness in the Linux glibc library. It allows attackers to remotely take complete control of the victim system without having any prior knowledge of system credentials. CVE-2015-0235 has been assigned to this issue. Qualys security researchers discovered this bug and worked closely with Linux distribution vendors. And as a result of that we are releasing this advisory today as a coordinated effort, and patches for all distribution are available January 27, 2015.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What is glibc?:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;The GNU C Library or glibc is an implementation of the standard C library and a core part of the Linux operating system. Without this library a Linux system will not function.&lt;br /&gt;
What is the vulnerability? During a code audit Qualys researchers discovered a buffer overflow in the __nss_hostname_digits_dots() function of glibc. This bug can be triggered both locally and remotely via all the gethostbyname*() functions. Applications have access to the DNS resolver primarily through the gethostbyname*() set of functions. These functions convert a hostname into an IP address.&lt;br /&gt;
During a code audit performed internally at Qualys, discovered a buffer overflow in the __nss_hostname_digits_dots() function of the GNU C Library (glibc). This bug is reachable both locally and remotely via the gethostbyname*() functions, so we decided to analyze it -- and its impact -- thoroughly, and named this vulnerability &quot;GHOST&quot;.&lt;br /&gt;
Main conclusions are:&amp;nbsp;Via gethostbyname() or gethostbyname2(), the overflowed buffer is located in the heap. Via gethostbyname_r() or gethostbyname2_r(), the overflowed buffer is caller-supplied (and may therefore be located in the heap, stack, .data, .bss, etc; however, we have seen no such call in practice).&lt;br /&gt;
 At most size of(char *) bytes can be overwritten (ie, 4 bytes on 32-bit machines, and 8 bytes on 64-bit machines). Bytes can be overwritten only with digits (&#39;0&#39;...&#39;9&#39;), dots (&#39;.&#39;), and a terminating null character (&#39;\0&#39;).&lt;br /&gt;
Despite these limitations, arbitrary code execution can be achieved. As a proof of concept, we developed a full-fledged remote exploit against the Exim mail server, bypassing all existing protections (ASLR, PIE, and NX) on both 32-bit and 64-bit machines. We will publish our exploit as a Metasploit module in the near future.&lt;br /&gt;
 The first vulnerable version of the GNU C Library is glibc-2.2, released on November 10, 2000.&lt;br /&gt;
 We identified a number of factors that mitigate the impact of this bug. In particular, we discovered that it was fixed on May 21, 2013 (between the releases of glibc-2.17 and glibc-2.18). Unfortunately, it was not recognized as a security threat; as a result, most stable and long-term-support distributions were left exposed (and still are):Debian 7 (wheezy), Red Hat Enterprise Linux 6 &amp;amp; 7, CentOS 6 &amp;amp; 7,Ubuntu 12.04, for example.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Analysis&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The vulnerable function, __nss_hostname_digits_dots(), is called internally by the glibc in nss/getXXbyYY.c (the non-reentrant version) and nss/getXXbyYY_r.c (the reentrant version). However, the calls are surrounded by #ifdef HANDLE_DIGITS_DOTS, a macro defined only in:&lt;br /&gt;
 inet/gethstbynm.c&lt;br /&gt;
 inet/gethstbynm2.c&lt;br /&gt;
 inet/gethstbynm_r.c&lt;br /&gt;
 inet/gethstbynm2_r.c&lt;br /&gt;
 nscd/gethstbynm3_r.c&lt;br /&gt;
These files implement the gethostbyname*() family, and hence the only way to reach __nss_hostname_digits_dots() and its buffer overflow. The purpose of this function is to avoid expensive DNS lookups if the hostname argument is already an IPv4 or IPv6 address.&lt;br /&gt;
The code below comes from glibc-2.17:&lt;br /&gt;
35 int&lt;br /&gt;
36 __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,&lt;br /&gt;
37 char **buffer, size_t *buffer_size,&lt;br /&gt;
38 size_t buflen, struct hostent **result,&lt;br /&gt;
39 enum nss_status *status, int af, int *h_errnop)&lt;br /&gt;
40 {&lt;br /&gt;
..&lt;br /&gt;
57 if (isdigit (name[0]) || isxdigit (name[0]) || name[0] == &#39;:&#39;)&lt;br /&gt;
58 {&lt;br /&gt;
59 const char *cp;&lt;br /&gt;
60 char *hostname;&lt;br /&gt;
61 typedef unsigned char host_addr_t[16];&lt;br /&gt;
62 host_addr_t *host_addr;&lt;br /&gt;
63 typedef char *host_addr_list_t[2];&lt;br /&gt;
64 host_addr_list_t *h_addr_ptrs;&lt;br /&gt;
65 char **h_alias_ptr;&lt;br /&gt;
66 size_t size_needed;&lt;br /&gt;
85 size_needed = (sizeof (*host_addr)&lt;br /&gt;
86 + sizeof (*h_addr_ptrs) + strlen (name) + 1);&lt;br /&gt;
87&lt;br /&gt;
88 if (buffer_size == NULL)&lt;br /&gt;
89 {&lt;br /&gt;
90 if (buflen &amp;lt; size_needed)&lt;br /&gt;
91 {&lt;br /&gt;
..&lt;br /&gt;
95 goto done;&lt;br /&gt;
96 }&lt;br /&gt;
97 }&lt;br /&gt;
98 else if (buffer_size != NULL &amp;amp;&amp;amp; *buffer_size &amp;lt; size_needed)&lt;br /&gt;
99 {&lt;br /&gt;
100 char *new_buf;&lt;br /&gt;
101 *buffer_size = size_needed;&lt;br /&gt;
102 new_buf = (char *) realloc (*buffer, *buffer_size);&lt;br /&gt;
103&lt;br /&gt;
104 if (new_buf == NULL)&lt;br /&gt;
105 {&lt;br /&gt;
...&lt;br /&gt;
114 goto done;&lt;br /&gt;
115 }&lt;br /&gt;
116 *buffer = new_buf;&lt;br /&gt;
117 }&lt;br /&gt;
...&lt;br /&gt;
121 host_addr = (host_addr_t *) *buffer;&lt;br /&gt;
122 h_addr_ptrs = (host_addr_list_t *)&lt;br /&gt;
123 ((char *) host_addr + sizeof (*host_addr));&lt;br /&gt;
124 h_alias_ptr = (char **) ((char *) h_addr_ptrs + sizeof (*h_addr_ptrs));&lt;br /&gt;
125 hostname = (char *) h_alias_ptr + sizeof (*h_alias_ptr);&lt;br /&gt;
126&lt;br /&gt;
127 if (isdigit (name[0]))&lt;br /&gt;
128 {&lt;br /&gt;
129 for (cp = name;; ++cp)&lt;br /&gt;
130 {&lt;br /&gt;
131 if (*cp == &#39;\0&#39;)&lt;br /&gt;
132 {&lt;br /&gt;
133 int ok;&lt;br /&gt;
134&lt;br /&gt;
135 if (*--cp == &#39;.&#39;)&lt;br /&gt;
136 break;&lt;br /&gt;
...&lt;br /&gt;
142 if (af == AF_INET)&lt;br /&gt;
143 ok = __inet_aton (name, (struct in_addr *) host_addr);&lt;br /&gt;
144 else&lt;br /&gt;
145 {&lt;br /&gt;
146 assert (af == AF_INET6);&lt;br /&gt;
147 ok = inet_pton (af, name, host_addr) &amp;gt; 0;&lt;br /&gt;
148 }&lt;br /&gt;
149 if (! ok)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to reach the overflow at line 157, the hostname argument must meet the following requirements:&lt;br /&gt;
 Its first character must be a digit (line 127).&lt;br /&gt;
 Its last character must not be a dot (line 135).&lt;br /&gt;
 It must comprise only digits and dots (line 197) (we call this the &quot;digits-and-dots&quot; requirement).&lt;br /&gt;
 It must be long enough to overflow the buffer. For example, the non-reentrant gethostbyname*() functions initially allocate their buffer with a call to malloc(1024) (the &quot;1-KB&quot; requirement).&lt;br /&gt;
Impact of this Bug&lt;br /&gt;
The impact of this bug is reduced significantly by the following&lt;br /&gt;
Reasons:&lt;br /&gt;
 A patch already exists (since May 21, 2013), and has been applied and tested since glibc-2.18, released on August 12, 2013:&lt;br /&gt;
[BZ #15014]&lt;br /&gt;
 nss/getXXbyYY_r.c (INTERNAL (REENTRANT_NAME))&lt;br /&gt;
[HANDLE_DIGITS_DOTS]: Set any_service when digits-dots parsing was successful.&lt;br /&gt;
 nss/digits_dots.c (__nss_hostname_digits_dots): Remove redundant variable declarations and reallocation of buffer when parsing as IPv6 address. Always set NSS status when called from reentrant functions. Use NETDB_INTERNAL instead of TRY_AGAIN when buffer too small. Correct computation of needed size.&lt;br /&gt;
 nss/Makefile (tests): Add test-digits-dots.&lt;br /&gt;
 nss/test-digits-dots.c: New test.&lt;br /&gt;
 The gethostbyname*() functions are obsolete; with the advent of IPv6, recent applications use getaddrinfo() instead.&lt;br /&gt;
 Many programs, especially SUID binaries reachable locally, use gethostbyname() if, and only if, a preliminary call to inet_aton() fails. However, a subsequent call must also succeed (the &quot;inet-aton&quot; requirement) in order to reach the overflow: this is impossible, and such programs are therefore safe.&lt;br /&gt;
 Most of the other programs, especially servers reachable remotely, use gethostbyname() to perform forward-confirmed reverse DNS (FCrDNS, also known as full-circle reverse DNS) checks. These programs are generally safe, because the hostname passed to gethostbyname() has normally been pre-validated by DNS software:&lt;br /&gt;
&quot;a string of labels each containing up to 63 8-bit octets, separated by dots, and with a maximum total of 255 octets.&quot; This makes it impossible to satisfy the &quot;1-KB&quot; requirement&lt;br /&gt;
&lt;br /&gt;
Actually, glibc&#39;s DNS resolver can produce hostnames of up to(almost) 1025 characters (in case of bit-string labels, and special or non-printable characters). But this introduces backslashes (&#39;\\&#39;)&lt;br /&gt;
and makes it impossible to satisfy the &quot;digits-and-dots&quot; requirement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/3439519040918858273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/3439519040918858273'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2015/02/description-buffer-overflow-in.html' title='GHOST critical liux security hole'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-771362044886431958</id><published>2015-01-20T02:42:00.001-08:00</published><updated>2015-01-20T02:42:53.376-08:00</updated><title type='text'>ADVANCED WIRESHARK FEATURES</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Once you master the basic concepts of&lt;br /&gt;Wireshark, you will probably want to delve&lt;br /&gt;further into some of its more advanced&lt;br /&gt;features. In this chapter we’ll look at some of&lt;br /&gt;these powerful features, including name resolution,&lt;br /&gt;protocol dissection, and packet reassembly.&lt;br /&gt;Name Resolution&lt;br /&gt;Network data is transported via various alphanumeric addressing systems&lt;br /&gt;that are often too long or complicated to remember, such as the physical&lt;br /&gt;hardware address 00:16:CE:6E:8B:24. Name resolution (also called name lookup)&lt;br /&gt;is the process a protocol uses to convert one identifying address into&lt;br /&gt;another. For example, while a computer might have the physical address&lt;br /&gt;00:16:CE:6E:8B:24, the DNS and ARP protocols allow us to see its name as&lt;br /&gt;Marketing-2. By associating easy-to-read names with these cryptic addresses,&lt;br /&gt;we make them easier to remember and identify.&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/771362044886431958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/771362044886431958'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2015/01/advanced-wireshark-features.html' title='ADVANCED WIRESHARK FEATURES'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-180016139240679737</id><published>2013-03-16T00:21:00.001-07:00</published><updated>2013-03-16T00:21:20.754-07:00</updated><title type='text'>galaxy s4 exploit</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;copy post-body&quot;&gt;
 &lt;div class=&quot;image-container&quot; style=&quot;text-align: center;&quot;&gt;
 &lt;a href=&quot;http://www.engadget.com/2012/12/16/security-exploit-opens-samsung-exynos-devices-to-attack/&quot;&gt;&lt;img alt=&quot;Security exploit opens Samsung Galaxy S III, Note II to attack, could let apps from Google Play write to Kernel&quot; src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/12/samsung-exynos-exploit-1355712553.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Amid the &lt;a href=&quot;http://www.engadget.com/tag/xda-developers/&quot;&gt;XDA community&#39;s&lt;/a&gt; ongoing quest to &lt;a href=&quot;http://www.engadget.com/tag/root/&quot;&gt;root&lt;/a&gt;
 every Android handset it comes across, one forum user appears to have 
found a serious exploit that affects certain Exynos devices. While 
fiddling with his &lt;a href=&quot;http://www.engadget.com/tag/GalaxySIII/&quot;&gt;Galaxy S III&lt;/a&gt;,
 XDA user Alephzain discovered a way to obtain root without flashing 
with Odin. The Samsung kernel apparently allows read / write access to 
all physical memory on the device, including the kernel itself. This 
makes for an easy root, Alephzain writes, but leaves devices open to 
attack -- allowing Kernel code injections and RAM dumps from 
malware-laden apps from the Google Play store.&lt;br /&gt;
 It isn&#39;t the only avenue for attack on an Android handset, but it &lt;em&gt;is&lt;/em&gt;
 an exceedingly easy attack. Luckily, a community fostered fix seems 
pretty simple too -- XDA user RyanZA has already created a patch to 
modify write permissions on affected devices -- though Galaxy S III 
users are reporting that the fix cripples the phone&#39;s camera app. So 
far, Alephzain has confirmed that the Galaxy S II, III, Note II and the &lt;a href=&quot;http://www.engadget.com/2011/12/15/meizu-mx-review/&quot;&gt;Meizu MX&lt;/a&gt;
 are at risk, but notes that the exploit might work on any device 
running a Exynos 4210 or 4412 processor. Samsung has not yet made a 
comment about the vulnerability, but forum members say that the issue 
has been reported. As for the exploit&#39;s lasting implications? Head on 
over to the XDA forums to join the discussion.&lt;br /&gt;
 &lt;strong&gt;Update&lt;/strong&gt;: François Simond (aka &lt;a href=&quot;http://www.engadget.com/tag/Supercurio/&quot;&gt;Supercurio&lt;/a&gt;) wastes no time &lt;a href=&quot;http://www.engadget.com/2011/12/02/supercurio-brings-carrier-iq-detection-to-the-people-pitchfork/&quot;&gt;plugging holes&lt;/a&gt;,
 and has already released a root-free fix for the vulnerability. 
Simond&#39;s solution is wrapped up in a simple APK, and requires no root, 
no flashing and no special know-how. It can be enabled or disabled 
manually, too -- allowing Galaxy S III users to regain full use of their
 front-facing camera, which as previously stated, is disrupted by the 
fix. Best of all, it&#39;s free -- skip on over to Project Voodoo at the 
source to get protected.&lt;br /&gt;
 &lt;strong&gt;Update 2: &lt;/strong&gt;Our good friend&lt;strong&gt; &lt;/strong&gt;Supercurio also brought our attention to a statement released by Samsung France to &lt;a href=&quot;http://www.lemonde.fr/technologies/article/2012/12/17/une-faille-de-securite-affecte-les-derniers-smartphones-samsung_1807624_651865.html&quot;&gt;&lt;em&gt;Le Monde&lt;/em&gt;&lt;/a&gt;:
 the company will be issuing an official patch &quot;very quickly,&quot; and it 
emphasized that this is an issue &quot;only if a malicious application is 
installed.&quot; Obviously, for now you can use Supercurio&#39;s patch to ease 
your mind.&lt;br /&gt;
 
  

 

 
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/180016139240679737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/180016139240679737'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2013/03/galaxy-s4-exploit.html' title='galaxy s4 exploit'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-5749648296736382750</id><published>2013-03-16T00:18:00.003-07:00</published><updated>2013-03-16T00:18:49.802-07:00</updated><title type='text'>IPhone 5 hacked</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
successfully breached an iPhone 4S at the mobile Pwn2Own hacker contest held this week at the &lt;a href=&quot;http://thehackernews.com/2012/09/android-404-multiple-zero-day.html&quot;&gt;EUSecWest event in Amsterdam&lt;/a&gt;.&lt;br /&gt;

&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;


&lt;/div&gt;
&lt;div id=&quot;aim21031362292816445189&quot;&gt;
&lt;br /&gt;
As we reported that&amp;nbsp;Joost Pol and Daan Keuper won the mobile Pwn2Own 
contest by compromising a fully patched iPhone 4S device and stealing 
contacts, browsing history, photos and videos from the phone.&lt;br /&gt;
&lt;br /&gt;
The vaunted security of the iPhone (4S) took an epic fail tumble during 
the event when they was able to build an exploit for a vulnerability in 
WebKit to beat Apple&#39;s code-signing features and the MobileSafari 
sandbox. The same bug is present in the iOS6 Golden Master development 
code base, which means iPhone 5 is &amp;nbsp;also vulnerable to the same exploit.
 Apple iPads and iPod Touch devices are also vulnerable.&lt;br /&gt;
&lt;br /&gt;
&quot;&lt;b&gt;&lt;i&gt;We specifically chose this one because it was present in iOS 6, 
which means the new iPhone coming out today will be vulnerable to this 
attack&lt;/i&gt;&lt;/b&gt;,&quot; Pol said.&amp;nbsp;The duo won $30,000 for their efforts.&lt;br /&gt;
&lt;br /&gt;
A good thief can hack into your personal data given enough time, we estimate that may mean a full working day of hacking.
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/5749648296736382750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/5749648296736382750'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2013/03/iphone-5-hacked.html' title='IPhone 5 hacked'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-8847789771063416210</id><published>2013-03-16T00:14:00.001-07:00</published><updated>2013-03-16T00:14:13.431-07:00</updated><title type='text'>Windows 8 exploit </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Less that a week after Microsoft &lt;a href=&quot;http://www.net-security.org/secworld.php?id=13841&quot;&gt;released&lt;/a&gt; is long awaited Windows 8, with &lt;a href=&quot;http://www.net-security.org/secworld.php?id=13848&quot;&gt;new and improved&lt;/a&gt; security features, French bug hunters VUPEN Security have announced that they have &lt;a href=&quot;https://twitter.com/VUPEN/status/263283188175106048&quot; target=&quot;_new&quot;&gt;created&lt;/a&gt; an exploit for the new OS version that takes advantage of several zero-day flaws.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the light of this discovery, the &lt;a href=&quot;https://twitter.com/cBekrar/status/261604452455313409&quot; target=&quot;_new&quot;&gt;tweet&lt;/a&gt; that VUPEN CEO and head researcher Chaouki Bekrar posted upon the OS&#39;s release seems almost to mock Microsoft&#39;s efforts.&lt;br /&gt;
&lt;br /&gt;
The company, which has become well known in security circles following their &lt;a href=&quot;http://www.net-security.org/secworld.php?id=9545&quot;&gt;decision&lt;/a&gt;
 to begin selling information about software vulnerabilities instead of 
sharing them with developers, is for quite some time now one of the 
biggest players in the &lt;a href=&quot;http://www.net-security.org/secworld.php?id=12631&quot;&gt;vulnerability market&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Their research team has &lt;a href=&quot;http://www.net-security.org/secworld.php?id=11001&quot;&gt;repeatedly&lt;/a&gt; &lt;a href=&quot;http://www.net-security.org/secworld.php?id=12569&quot;&gt;demonstrated&lt;/a&gt;
 their abilities during the annual Pwn2Own contest at the CanSecWest 
conference, which proved to be very good advertising for the company.&lt;br /&gt;
&lt;br /&gt;
VUPEN Security sells information about vulnerabilities and ready-made 
exploits to NATO governments and &quot;partners&quot;, intelligence agencies and 
corporations, who use the information for both offensive and defensive 
purposes.&lt;br /&gt;
&lt;br /&gt;
&quot;The in-depth technical details of the flaws will be shared with our 
customers and they can use them to protect their critical 
infrastructures against potential attacks or for national security 
purposes,” Bekrar &lt;a href=&quot;http://www.forbes.com/sites/andygreenberg/2012/10/31/government-funded-hackers-say-theyve-already-defeated-all-of-windows-8s-new-security-measures/&quot; target=&quot;_new&quot;&gt;commented&lt;/a&gt; this latest news for Forbes. &lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/8847789771063416210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/8847789771063416210'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2013/03/windows-8-exploit.html' title='Windows 8 exploit '/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-4585229082318978133</id><published>2012-05-29T02:50:00.003-07:00</published><updated>2012-05-29T02:50:50.419-07:00</updated><title type='text'>OsmocomBB: A tool for GSM protocol level security</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/g-g2b0aMuyY?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; osmocombb its good ?????,,,&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/4585229082318978133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/4585229082318978133'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2012/05/osmocombb-tool-for-gsm-protocol-level.html' title='OsmocomBB: A tool for GSM protocol level security'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-7890560706506796603</id><published>2012-05-29T02:45:00.001-07:00</published><updated>2012-05-29T02:47:33.076-07:00</updated><title type='text'>hacking GSM Networks ...illustration ..its real NoW ...</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;object class=&quot;BLOGGER-youtube-video&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot; data-thumbnail-src=&quot;http://1.gvt0.com/vi/fH_fXSr-FhU/0.jpg&quot; height=&quot;266&quot; width=&quot;320&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/fH_fXSr-FhU&amp;fs=1&amp;source=uds&quot; /&gt;

&lt;param name=&quot;bgcolor&quot; value=&quot;#FFFFFF&quot; /&gt;

&lt;embed width=&quot;320&quot; height=&quot;266&quot;  src=&quot;http://www.youtube.com/v/fH_fXSr-FhU&amp;fs=1&amp;source=uds&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; watch the video and you will be able to do anything in the gsm network like any other &amp;nbsp; &amp;nbsp;&amp;nbsp; network ..so&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; have a nice day ......&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7890560706506796603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7890560706506796603'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2012/05/hacking-gsm-networks-illustration-its.html' title='hacking GSM Networks ...illustration ..its real NoW ...'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-6680678298847596187</id><published>2012-03-11T05:15:00.000-07:00</published><updated>2012-03-11T05:17:18.309-07:00</updated><title type='text'>The First Windows 8 exploit ????????</title><content type='html'>&lt;p&gt;According to &lt;a href=&quot;http://www.zdnet.com/blog/hardware/windows-8-bootkit-demo/16572&quot; rel=&quot;nofollow&quot;&gt;ZDNET&lt;/a&gt; Peter’s  hack is believed to be the first proof-of-concept that has found a  vulnerability in Microsoft’s new operating system which will launch in  2012.&lt;/p&gt; &lt;p&gt;After the exploit has been launched the OS operates under the SYSTEM  account which then lets a hacker run a command prompt where they can  defeat the User Account Control by avoiding the user prompt.&lt;/p&gt; &lt;p&gt;The &lt;a title=&quot;Microsoft To Roll Out Office 15 Beta On January 15&quot; href=&quot;http://www.inquisitr.com/162375/microsoft-to-roll-out-office-15-beta-on-january-15/&quot;&gt;Windows 8 OS&lt;/a&gt;  is currently in Beta testing and the exploit will likely be fixed ahead  of shipping however the small size of the code and the ease for which  it was executed still deal a small humiliating blow to Microsoft as the  company continues to emphasize their platforms stronger security  standards via Windows Defender improvements.&lt;/p&gt; &lt;p&gt;Included with the new system is a real-time detection and protection  suite along with a SmartScreen filtering system for Windows 8 and  security improvements to Internet Explroer.&lt;/p&gt;&lt;div style=&quot;overflow: hidden; color: rgb(0, 0, 0); background-color: transparent; text-align: left; text-decoration: none; border: medium none;&quot;&gt;Read more at  &lt;a style=&quot;color: #003399;&quot; href=&quot;http://www.inquisitr.com/162698/windows-8-bootkit-exploit-already-discovered-video-demonstration/#sShmvlH8K18UAMIJ.99&quot;&gt;http://www.inquisitr.com/162698/windows-8-bootkit-exploit-already-discovered-video-demonstration/#sShmvlH8K18UAMIJ.99&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/6680678298847596187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/6680678298847596187'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2012/03/first-windows-8-exploit.html' title='The First Windows 8 exploit ????????'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-8419896087285554704</id><published>2012-02-22T00:33:00.001-08:00</published><updated>2012-02-22T02:18:17.531-08:00</updated><title type='text'>programing for smart card in QT how to :SOLVED</title><content type='html'>to start programing for smart card in QT is a problem , why ...........???&lt;br /&gt;because the library of winscard.h in windows SDK does not properly included ,so&lt;br /&gt;the problem is solved ,we will go step by step :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1- download windows sdk and install it .&lt;br /&gt;2- in QT create a new project (gui or console).&lt;br /&gt;3- copy this files ( SCardErr.h  , winscard.h  ,winsmcrd.h)  from the directory of widows sdk  and paste him into the directory of your project .&lt;br /&gt;4-add him to your project from QT interface , after that they will appear in the&lt;br /&gt;       headers group in QT interface.&lt;br /&gt;5-in the file .pro of your project add this&lt;br /&gt;&lt;br /&gt;win32:LIBS += &quot;C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/WinSCard.lib&quot; \&lt;br /&gt;               &quot;C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/SCardDlg.Lib&quot; \&lt;br /&gt;                   &quot;C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/wscapi.lib&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;HEADERS  += mainwindow.h \&lt;br /&gt;   winscard.h \&lt;br /&gt;   SCardErr.h \&lt;br /&gt;   winsmcrd.h&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6- add this lines to your header file  (mainwindow.h)&lt;br /&gt;&lt;br /&gt;#include &quot;winscard.h&quot;&lt;br /&gt;#include &quot;windows.h&quot;&lt;br /&gt;#include &quot;winnt.h&quot;&lt;br /&gt;#include &quot;iostream&quot;&lt;br /&gt;#include &quot;SCardErr.h&quot;&lt;br /&gt;#include &quot;winsmcrd.h&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7- after that the smart card api is included properly.&lt;br /&gt;8-you can start programing using all classes and functions in winscard.h   .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;**** winscard api use the windows api types so to convert from windows types to QT types (QString ,QByteArray) so i will put it here another day .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*************   to get more information about smart card in QT post here your Questions or send me a mail to roky2003@gmail.com   ..................................&lt;br /&gt;please post your opinion ...................................................................................&lt;br /&gt;authors : Debeche Ibrahim and Boukazoula Mehdi ----------from algeria&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          &lt;r display=&quot;&quot; the=&quot;&quot; qstring=&quot;&quot; data=&quot;&quot;&gt;&lt;string one=&quot;&quot; advance=&quot;&quot; next=&quot;&quot; preader=&quot;pReader&quot; 0=&quot;&quot; ll=&quot;test.split(&amp;quot;&quot; qstringlist=&quot;&quot; contain=&quot;&quot; all=&quot;&quot; can=&quot;&quot; get=&quot;&quot; any=&quot;&quot; into=&quot;&quot; a=&quot;&quot; by=&quot;&quot; calling=&quot;&quot; or=&quot;&quot; convert=&quot;&quot; from=&quot;&quot; lptstr=&quot;&quot; if=&quot;&quot; multiple=&quot;&quot; readers=&quot;&quot; connected=&quot;&quot; have=&quot;&quot; list=&quot;&quot; and=&quot;&quot; want=&quot;&quot; to=&quot;&quot; use=&quot;&quot; him=&quot;&quot; separately=&quot;&quot; you=&quot;&quot; must=&quot;&quot; put=&quot;&quot; every=&quot;&quot; in=&quot;&quot; an=&quot;&quot; lpstr=&quot;&quot; so=&quot;&quot; the=&quot;&quot; procedure=&quot;&quot; is=&quot;&quot; like=&quot;&quot; this=&quot;&quot; qstring=&quot;&quot; reader=&quot;&quot; for=&quot;&quot; int=&quot;&quot; t=&quot;0&quot;&gt;&lt;reader.count();t++) ff=&quot;reader.at(t);&quot; qbytearray=&quot;&quot; bool=&quot;&quot; var=&quot;ff.toInt(&amp;amp;ok,16);&quot; now=&quot;&quot; connect=&quot;&quot; card=&quot;&quot; readercardhandle=&quot;NULL;&quot; lreturn=&quot;SCardConnect(&quot; dwap=&quot;&quot; start=&quot;&quot; sending=&quot;&quot; send=&quot;&quot; apdu=&quot;&quot; commands=&quot;&quot; ex=&quot;&quot; a4=&quot;&quot; 00=&quot;&quot; 02=&quot;&quot; df=&quot;&quot; c0=&quot;&quot; put=&quot;&quot; command=&quot;&quot; in=&quot;&quot; like=&quot;&quot; this=&quot;&quot; apducom=&quot;00 A4 00 00 02 DF C0&quot; me=&quot;&quot; i=&quot;&quot; use=&quot;&quot; a=&quot;&quot; function=&quot;&quot; to=&quot;&quot; do=&quot;&quot; that=&quot;&quot; scardhandle=&quot;&quot; qstring=&quot;&quot; scard_io_request=&quot;&quot; dword=&quot;&quot; qstringlist=&quot;&quot; lst=&quot;strAPDU.split(&amp;quot;&quot; byte=&quot;&quot; for=&quot;&quot; int=&quot;&quot; t=&quot;0&quot;&gt;&lt;lst.count();t++) ff=&quot;lst.at(t);&quot; bool=&quot;&quot; var=&quot;ff.toInt(&amp;amp;ok,16);&quot; dword=&quot;&quot; asize=&quot;lst.count();&quot; lreturn=&quot;NULL;&quot; rsize=&quot;sizeof(Response);&quot; if=&quot;&quot; scard_s_success=&quot;&quot; insert=&quot;&quot; your=&quot;&quot; smart=&quot;&quot; card=&quot;&quot; else=&quot;&quot; info=&quot;&quot; success=&quot;&quot; qbytearray=&quot;&quot; qstringlist=&quot;&quot; for=&quot;&quot; int=&quot;&quot; i=&quot;0;i&amp;lt;Rsize&quot; qstring=&quot;&quot; gg=&quot;string.at(i);&quot; str1=&quot;&quot;&gt;&lt;gg; i=&quot;i+2;&quot; return=&quot;&quot; call=&quot;&quot; function=&quot;&quot; response=&quot;&quot; is=&quot;&quot; qstring=&quot;&quot; it=&quot;&quot; s=&quot;&quot; like=&quot;&quot; this=&quot;&quot; 90=&quot;&quot; 00=&quot;&quot; you=&quot;&quot; can=&quot;&quot; do=&quot;&quot; any=&quot;&quot; thing=&quot;&quot; with=&quot;&quot; resp=&quot;sendapdu(readerCardHandle,apducom);&quot; string=&quot;&quot; ex=&quot;&quot; put=&quot;&quot; him=&quot;&quot; textedit=&quot;&quot; after=&quot;&quot; finishing=&quot;&quot; apdu=&quot;&quot; commands=&quot;&quot; disconnect=&quot;&quot; the=&quot;&quot; lreturn=&quot;SCardDisconnect(readerCardHandle,&quot; get=&quot;&quot; more=&quot;&quot; information=&quot;&quot; about=&quot;&quot; smart=&quot;&quot; card=&quot;&quot; in=&quot;&quot; qt=&quot;&quot; here=&quot;&quot; questions=&quot;&quot; or=&quot;&quot; send=&quot;&quot; me=&quot;&quot; a=&quot;&quot; mail=&quot;&quot; to=&quot;&quot; com=&quot;&quot; please=&quot;&quot; post=&quot;&quot; your=&quot;&quot; opinion=&quot;&quot; authors=&quot;&quot; debeche=&quot;&quot; ibrahim=&quot;&quot; and=&quot;&quot; boukazoula=&quot;&quot; mehdi=&quot;&quot; from=&quot;&quot; algeria=&quot;&quot;&gt;&lt;/gg;&gt;&lt;/lst.count();t++)&gt;&lt;/reader.count();t++)&gt;&lt;/string&gt;&lt;/r&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/8419896087285554704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/8419896087285554704'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2012/02/programing-for-smart-card-in-qt-how-to.html' title='programing for smart card in QT how to :SOLVED'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-5188198575952291358</id><published>2011-10-07T01:05:00.000-07:00</published><updated>2016-04-26T05:00:48.046-07:00</updated><title type='text'>snort rules (network intrusion detection system)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
How the rules files are organized ?&lt;br /&gt;
Snort’s rules directory sorts hundreds of rules into rules files according to&lt;br /&gt;
their purpose. Although the rules are cataloged a few different ways and&lt;br /&gt;
some of the rule categories have overlapping domains, there’s certainly a&lt;br /&gt;
method to the madness.&lt;br /&gt;
Rules files fit into eight major categories:&lt;br /&gt;
ߜ Low-level protocols (icmp, netbios, tcp, udp)&lt;br /&gt;
ߜ High-level protocols (http, ftp, dns, pop3, imap)&lt;br /&gt;
ߜ Web server specific (web-attack, web-cgi, web-client)&lt;br /&gt;
ߜ Exploit specific (shellcode, backdoor, exploit)&lt;br /&gt;
ߜ Service impacting (dos, ddos)&lt;br /&gt;
ߜ Policy specific (policy, info, misc, porn)&lt;br /&gt;
ߜ Scanning and probing activities (scan, bad-traffic)&lt;br /&gt;
ߜ Viruses, worms, and other malware (virus)&lt;br /&gt;
The best way to find out how the whole rule system works is to get your&lt;br /&gt;
hands dirty with a typical example:&lt;br /&gt;
alert tcp $EXTERNAL_NET any -&amp;gt; $HTTP_SERVERS $HTTP_PORTS (msg:”WEB-IIS CodeRed v2 root.exe access”;flow:to_server,established;uricontent:”/root.exe”; nocase; classtype:web application-attack; reference:url,&lt;br /&gt;
www.cert.org/advisories/CA-2001 19.html; sid:1256; rev:7;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;

&lt;script async src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- block1 --&gt;
&lt;ins class=&quot;adsbygoogle&quot;
     style=&quot;display:inline-block;width:728px;height:90px&quot;
     data-ad-client=&quot;ca-pub-4311679709643890&quot;
     data-ad-slot=&quot;5966665031&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
This rule demonstrates many of the options that you’re likely to encounter&lt;br /&gt;
with your own setup. We picked the Code Red worm alert from the web-&lt;br /&gt;
iis.rules file as our starting point.&lt;br /&gt;
Here’s a piece-by-piece explanation of that Code Red worm rule, which&lt;br /&gt;
appeared earlier in this section:&lt;br /&gt;
ߜ The alert directive (in bold in the following alert snippet) tells Snort&lt;br /&gt;
that if the packet matches this rule, then the rule should send its output&lt;br /&gt;
through the alert facility.&lt;br /&gt;
alert tcp $EXTERNAL_NET any -&amp;gt; $HTTP_SERVERS&lt;br /&gt;
$HTTP_PORTS...&lt;br /&gt;
The overwhelming majority of Snort’s rules use the alert facility,&lt;br /&gt;
although optionally, you can use the log facility. Chapter 6 explains the&lt;br /&gt;
difference between these two facilities.&lt;br /&gt;
ߜ The tcp keyword is an argument that identifies which network protocols&lt;br /&gt;
the rule applies to. The following alert snipped shows the tcp keyword&lt;br /&gt;
in bold:&lt;br /&gt;
alert tcp $EXTERNAL_NET any -&amp;gt; $HTTP_SERVERS&lt;br /&gt;
$HTTP_PORTS...&lt;br /&gt;
Because the tcp keyword is specified, Snort knows to match this rule&lt;br /&gt;
only to network traffic using the TCP protocol (other protocols, such as&lt;br /&gt;
UDP) will be ignored.&lt;br /&gt;
ߜ The network source and destination arguments are highlighted in bold&lt;br /&gt;
in the following statement:&lt;br /&gt;
alert tcp $EXTERNAL_NET any -&amp;gt; $HTTP_SERVERS&lt;br /&gt;
$HTTP_PORTS...&lt;br /&gt;
The preceding network source and destination arguments (including&lt;br /&gt;
port numbers) tell Snort to alert on any traffic that is either&lt;br /&gt;
• From the $EXTERNAL_NET on any port&lt;br /&gt;
• To any of our Web servers on the defined Web ports.&lt;br /&gt;
The network source and destination arguments use the variables estab-&lt;br /&gt;
lished at the beginning of the snort.conf file (the arguments beginning&lt;br /&gt;
with the $). These substitutions provide convenience and readability for&lt;br /&gt;
managing a large collection of rules, which can easily top a few thousand&lt;br /&gt;
entries.     The last part of the rule gets even more granular with information the&lt;br /&gt;
rule should match on, as well as what Snort should do if the rule does&lt;br /&gt;
match . The following snippet shows what this looks like:&lt;br /&gt;
(msg:”WEB-IIS CodeRed v2 root.exe access”; flow:to_server,established;&lt;br /&gt;
uricontent:”/root.exe”; nocase; classtype:web application-&lt;br /&gt;
attack; reference:url, www.cert.org/advisories/CA-2001-19.html;&lt;br /&gt;
sid:1256; rev:7;)&lt;br /&gt;
• A few other tests tucked away in that last section must be passed&lt;br /&gt;
before an alert is generated. The flow: and uricontent: keywords&lt;br /&gt;
further refine the rule. In this case, if the uricontent (URI stands for&lt;br /&gt;
universal resource identifier) contains the text “/root.exe”. The&lt;br /&gt;
flow says that the connection should be going to the server and&lt;br /&gt;
should already be established. IP listed in your var HTTP_SERVERS&lt;br /&gt;
section of snort.conf, then an alert is generated with the message&lt;br /&gt;
“WEB-IIS CodeRed v2 root.exe access”.&lt;br /&gt;
Snort also identifies the type of attack by classifying it as a “web&lt;br /&gt;
applications-attack.” It further identifies the exact nature of the&lt;br /&gt;
alert setting the “sid” (Snort IDentification) field to 1256. Sids are&lt;br /&gt;
unique identifiers to Snort. They can nail down an offense to exactly one&lt;br /&gt;
alert. The reference: keyword provides a log entry regarding any other&lt;br /&gt;
information that’s known about the nature of the attack. References are&lt;br /&gt;
often URLs to security-related Web sites, such as CERT, Whitehats, or&lt;br /&gt;
SecurityFocus, which provide advisories on what the attack is and how&lt;br /&gt;
to patch for it (if possible). In our Code Red example, we point to the&lt;br /&gt;
CERT Web site with the following URL:&lt;br /&gt;
http://www.cert.org/advisories/CA-2001-19.html&lt;br /&gt;
Figure 8-1 shows a graphical overview of how a Snort rule is laid out. In it,&lt;br /&gt;
you see many of the bits and pieces of a rule.&lt;br /&gt;
Flow or direction operators represent how traffic is traversing the network.&lt;br /&gt;
Their use is pretty straightforward:&lt;br /&gt;
ߜ The &amp;gt; operator tells Snort that the network on the left should be regarded&lt;br /&gt;
as the source, and the one on the right should be the destination.&lt;br /&gt;
There isn’t a &amp;lt;- operator. All instances using it are written by flip-&lt;br /&gt;
flopping the arguments around the &amp;gt; command.&lt;br /&gt;
ߜ The &amp;lt;&amp;gt; operator will match any traffic between the network on the left&lt;br /&gt;
and the network on the right, regardless of which network originated the&lt;br /&gt;
traffic.&lt;br /&gt;
The directionless operator (&amp;lt;&amp;gt;) can sometimes cause a bit of confusion&lt;br /&gt;
with its use. It seems to makes sense that you would inspect traffic flowing&lt;br /&gt;
both ways from one computer or network to another, but that inspection&lt;br /&gt;
happens infrequently. Most Snort rules look something like this:&lt;br /&gt;
$EXTERNAL_NET any -&amp;gt; (internal host / port)&lt;br /&gt;
A rule that matches too broadly (which the preceding rule would do if it&lt;br /&gt;
contained &amp;lt;&amp;gt;) produces a huge Snort log and unduly burdens the pro-&lt;br /&gt;
cessing engine as it inspects everything that passes by.&lt;br /&gt;
Elements of the rule header&lt;br /&gt;
Sifting through the directory of rules shows that all the rules contain header&lt;br /&gt;
information, though most have a jumble of different items in their bodies. The&lt;br /&gt;
header is just a front-end filter that separates out traffic by using five key sift-&lt;br /&gt;
ing factors: source IP address, destination IP address, source port, destination&lt;br /&gt;
port, and protocol.&lt;br /&gt;
Rule actions&lt;br /&gt;
Snort comes built-in with five different rule actions. Each gives you a lot of&lt;br /&gt;
power in building your arsenal.&lt;br /&gt;
Before changing the default behavior of your Snort rules, spend some time&lt;br /&gt;
watching it operate in your environment and use its output to help you&lt;br /&gt;
reduce noisy false positives.&lt;br /&gt;
Here are Snort’s five rule actions:&lt;br /&gt;
ߜ The log action merely logs the offending packets to the output logging&lt;br /&gt;
that we set up when the Snort sensor was configured. The output plug-&lt;br /&gt;
ins options are many and varied, giving you a rich set of choices. A per-&lt;br /&gt;
rule log directive lets you customize logging down to a remarkable level.&lt;br /&gt;
ߜ The alert action can print a log entry and post a notification when&lt;br /&gt;
some event is associated with a higher priority and probably needs a&lt;br /&gt;
personal touch.&lt;br /&gt;
The alert action is the default action for most rules that come with&lt;br /&gt;
Snort. Snort’s job, after all, is to alert us of an attack on our network!&lt;br /&gt;
ߜ The pass action can ignore a matched packet and continue processing.&lt;br /&gt;
The pass action is useful when you’re tuning your rules and need to dis-&lt;br /&gt;
able some of the noisier ones so that you can actually see the output of&lt;br /&gt;
what you’re working with.&lt;br /&gt;
ߜ The most powerful of the Snort actions is the activate keyword.&lt;br /&gt;
Activate operates in concert with the dynamic action by triggering an&lt;br /&gt;
alert and running what’s specified by the associated dynamic rule.&lt;br /&gt;
The activate/dynamic pair is ideal for catching a complex series of&lt;br /&gt;
attacks that may otherwise go unnoticed.&lt;br /&gt;
ߜ The dynamic action is associated with a rule that shouldn’t run until&lt;br /&gt;
another event is encountered. You combine the dynamic action with&lt;br /&gt;
the activate action to set up a second level of processing in certain&lt;br /&gt;
circumstances.&lt;br /&gt;
The activate/dynamic pair isn’t often used in common Snort setups,&lt;br /&gt;
but it can be a handy tool for advanced intrusion detection.&lt;br /&gt;
Protocols&lt;br /&gt;
Snort, as a network IDS, must operate on the lowest level of the network to&lt;br /&gt;
do its job. Snort grabs Ethernet frames directly from the wire. Inside of those&lt;br /&gt;
frames are the four protocols that the free version of Snort normally scans: IP,&lt;br /&gt;
ICMP, TCP, and UDP.&lt;br /&gt;
Snort’s developers are attempting include other protocols, such as HTTP,&lt;br /&gt;
802.11, and ARP. The keywords for building your rules should include only&lt;br /&gt;
one of the original four.&lt;br /&gt;
For example, let’s say employees aren’t allowed to use the eBay auction Web&lt;br /&gt;
site on the job. A particular employee has been reprimanded for spending&lt;br /&gt;
hours browsing eBay, and HR wants to monitor his behavior. The following&lt;br /&gt;
rule logs all Web traffic that contains ebay.com coming from the host&lt;br /&gt;
192.168.1.18 with the message eBaying:&lt;br /&gt;
log tcp 192.168.1.18/32 any -&amp;gt; any 80 (msg:”eBaying”; uricontent:”ebay.com”;)&lt;br /&gt;
Source/destination&lt;br /&gt;
The last part of a well-formed Snort rule is probably the most important&lt;br /&gt;
piece of configuration data: The two IP address ranges that are involved with&lt;br /&gt;
the communication. The source and destination networks are identified in a&lt;br /&gt;
rule that takes this form:&lt;br /&gt;
(source network) (port) -&amp;gt; (destination network) (port)&lt;br /&gt;
CIDR (Classless Inter Domain Routing) notation is used for the network argu-&lt;br /&gt;
ments. CIDR notation is that funny way of expressing an IP address using a /&lt;br /&gt;
and another number — for example, 10.35.24.0/24, which means a Class C&lt;br /&gt;
network of 254 hosts on network 10.35.24.0 (plus the first and last&lt;br /&gt;
addresses that are reserved for the network address and the broadcast&lt;br /&gt;
address, namely 10.35.24.0 and 10.35.24.255).&lt;br /&gt;
For the Snort rules files, you really deal with only two types of entries:&lt;br /&gt;
ߜ Networks (which contain a /)&lt;br /&gt;
ߜ Hosts (which omit /)&lt;br /&gt;
Omitting / is a shorthand way of saying, “Just the single IP address, if&lt;br /&gt;
you please.” For example, the address 10.35.24.66 indicates just one&lt;br /&gt;
host for matching against.&lt;br /&gt;
You can also enter ranges of port numbers, similar to ranges of IP addresses.&lt;br /&gt;
Most of the examples that we cover in this chapter are single ports, such as&lt;br /&gt;
80 for the Web port, 443 for the encrypted Web port, and 25 for sendmail.&lt;br /&gt;
The entire range of available ports extends from 0 to 65535.&lt;br /&gt;
For a range of ports, you just place a colon between the two ports. The fol-&lt;br /&gt;
lowing rule looks for any traffic containing “ebay.com” occuring on any TCP&lt;br /&gt;
port between 1 and 1023.&lt;br /&gt;
log tcp 192.168.1.18/32 any -&amp;gt; any 1:1023 (msg:”eBaying”;&lt;br /&gt;
uricontent:”ebay.com”;)&lt;br /&gt;
You can also include the maximum and minimum ports ranges by simply&lt;br /&gt;
leaving off a number. For example :1023 means a range of ports from 0–1023,&lt;br /&gt;
and 1024: refers to a range of 1024–65535.&lt;br /&gt;
Wildcards&lt;br /&gt;

&lt;script async src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- block1 --&gt;
&lt;ins class=&quot;adsbygoogle&quot;
     style=&quot;display:inline-block;width:728px;height:90px&quot;
     data-ad-client=&quot;ca-pub-4311679709643890&quot;
     data-ad-slot=&quot;5966665031&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;

Wildcards simplify rules. Wildcards work just like those “splat” asterisks that&lt;br /&gt;
you can type into a DOS window or Unix shell to list only certain files. In&lt;br /&gt;
Snort, the any keyword is the most powerful wildcard — and it’s all over the&lt;br /&gt;
place. You’re allowed to use the any wildcard in both the network and port&lt;br /&gt;
configurations: any matches everything for the category you placed it in.&lt;br /&gt;
In the preceding section, we used the any wildcard in a couple of places. When&lt;br /&gt;
the host 192.168.1.18 tries to start a communication on any port with any&lt;br /&gt;
host on ports 1–1023 with the text “ebay.com” as part of a URI, then . . . bingo!&lt;br /&gt;
That’s a match, and the message eBaying appears in the logs.&lt;br /&gt;
Elements of the rule body&lt;br /&gt;
After being mangled by the pre-processors and whittled down by the filters of&lt;br /&gt;
the rule’s header, the rule’s body contains a virtual cornucopia of tests.&lt;br /&gt;
The most powerful test is pattern-matching what slips through for either spe-&lt;br /&gt;
cific keywords, phrases, or strings of binary data. Often, this inspection is the&lt;br /&gt;
most critical, because what’s being searched for is the “fingerprint” of the&lt;br /&gt;
attack itself.&lt;br /&gt;
Many of the most powerful features of Snort’s detection engine reside in the&lt;br /&gt;
body of the rule. Each feature has a different style, syntax, and set of options.&lt;br /&gt;
This flexibility can make rule management somewhat complicated, but very&lt;br /&gt;
worthwhile.&lt;br /&gt;
The layout of the rule body&lt;br /&gt;
Snort’s rule body must follow this specific structure:&lt;br /&gt;
ߜ The body section of a rule is always wrapped by one set of parentheses.&lt;br /&gt;
ߜ Body options (keywords, instructions, tests, and commands) are within&lt;br /&gt;
the parentheses.&lt;br /&gt;
ߜ Each body option is separated by a semicolon.&lt;br /&gt;
ߜ Each body option usually conforms to this format (the value is wrapped&lt;br /&gt;
in double quotes):&lt;br /&gt;
item: “value”;&lt;br /&gt;
ߜ The entire line is terminated with a semicolon.&lt;br /&gt;
While the structure contains a lot of punctuation, it helps keeps things&lt;br /&gt;
straight for both Snort and the person managing it.&lt;br /&gt;
The “content” option&lt;br /&gt;
Content analysis flushes out specific attack signatures within the packet. The&lt;br /&gt;
particulars of the content option is applied to each and every packet that&lt;br /&gt;
matches the header of the rule and can be expressed in either plain text form&lt;br /&gt;
(ASCII) or geek-speak (Hexadecimal).&lt;br /&gt;
Worms, viruses, and server cracks are normally transmitted onto your network&lt;br /&gt;
as raw machine code, which, to the naked eye, looks like gobbledy-gook, but is&lt;br /&gt;
in fact a series of instructions that harm your computers and servers.&lt;br /&gt;
Content matching is typically done at the application layer (Layer 7) of the&lt;br /&gt;
OSI networking model.&lt;br /&gt;
Text content matching (ASCII)&lt;br /&gt;
As a simple scenario for demonstration purposes, let’s say you’re concerned&lt;br /&gt;
about employees trading computer hacking information within your organiza-&lt;br /&gt;
tion. You can create a rule that generates an alert whenever an e-mail is sent&lt;br /&gt;
to your primary mail server (the mail server’s IP address is 172.16.30.7)&lt;br /&gt;
containing the word “hacking”. The mail port is 25; most mail is transmitted&lt;br /&gt;
using the TCP protocol, so the following rule illustrates how we can use the&lt;br /&gt;
content keyword to craft a rule to meet our goal.&lt;br /&gt;
alert tcp $EXTERNAL_NET any -&amp;gt; 172.16.30.7 25 (msg:”Found hacking reference in&lt;br /&gt;
e-mail”; content:”hacking”;)&lt;br /&gt;
Content analysis (by either text or hexadecimal matching) is used in more&lt;br /&gt;
than two-thirds of the rules that come with Snort.&lt;br /&gt;
Hexadecimal content matching&lt;br /&gt;
Hexadecimal (hex) content, although expressed differently than ASCII text, is&lt;br /&gt;
ultimately treated the same as ASCII by the Snort processing engine. In both&lt;br /&gt;
cases, the text is reduced to what the computer deals with best: bits, which is&lt;br /&gt;
then matched against the data streaming across your network. Hex is just a&lt;br /&gt;
shorthand way of representing the zeros and ones of binary machine code.&lt;br /&gt;
Hexadecimal is like a numerical alphabet that is 16 characters long, as com-&lt;br /&gt;
pared with English (which has 26 letters) or decimal math (which has 10&lt;br /&gt;
numerals). Hexadecimal is often referred to as base-16 because the “alpha-&lt;br /&gt;
bet” it uses has only 16 “letters” (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F). Hexadecimal&lt;br /&gt;
strings entered into a Snort rule body contain only those characters and&lt;br /&gt;
none others. If you create a hexadecimal string with nonhex characters,&lt;br /&gt;
expect that Snort will turn up its nose.&lt;br /&gt;
Here’s a real example right out of the rules directory:&lt;br /&gt;
alert tcp $EXTERNAL_NET any -&amp;gt; $HOME_NET 22 (msg:”EXPLOIT ssh CRC32 overflow&lt;br /&gt;
filler”; flow:to_server,established; content:”|00 00 00 00 00 00&lt;br /&gt;
00 00 00 00 00 00 00 00 00 00 00 00|”; reference:bugtraq,2347;&lt;br /&gt;
reference:cve,CVE-2001-0144; classtype:shellcode-detect; sid:1325;&lt;br /&gt;
rev:3;)&lt;br /&gt;
To use a hex match for content searching, wrap the hexadecimal characters&lt;br /&gt;
to find with the pipe symbols (|). White space can separate out single bytes&lt;br /&gt;
of hexadecimal data (“00 00”). Snort ignores the white space, which is only&lt;br /&gt;
there to preserve the readability to the rule crafter.&lt;br /&gt;
The preceding rule is meant to watch for an attempted exploitation of the&lt;br /&gt;
Secure Shell server application (sshd) by scanning traffic coming from any-&lt;br /&gt;
where on the external network and destined for your home network on port&lt;br /&gt;
22 (the sshd port). The content search is a long series of binary zeros (18&lt;br /&gt;
sets of two, to be exact). How can a pattern of zeros be unique? A pattern of&lt;br /&gt;
zeros is frequently found in attack code and is often a give-away that some-&lt;br /&gt;
one is doing something you don’t like.&lt;br /&gt;
Mixing it up&lt;br /&gt;
You can mix and match the style of content searching without confusing&lt;br /&gt;
Snort. As long as the binary data you want to search for has the bookends of&lt;br /&gt;
the pipe characters, that block of text can be intermingled with other, plain&lt;br /&gt;
ASCII text. What follows is a good example from the back-door.rules file.&lt;br /&gt;
alert tcp $EXTERNAL_NET any -&amp;gt; $HOME_NET 12345:12346 (msg:”BACKDOOR netbus get-&lt;br /&gt;
info”; flow:to_server,established; content:”GetInfo|0d|”; refer-&lt;br /&gt;
ence:arachnids,403; classtype:misc-activity; sid:110; rev:3;)&lt;br /&gt;
Notice how the content search string is constructed: GetInfo|0d|. This&lt;br /&gt;
string tells Snort’s pattern matching subsystem to watch for the text phrase&lt;br /&gt;
GetInfo with a carriage return at the end. Pretty nifty, eh? Inserting hex into&lt;br /&gt;
a plain text string is useful for representing characters that can’t be repre-&lt;br /&gt;
sented by plain text, such as a carriage return. You can drift between text and&lt;br /&gt;
binary content all within the same search string.&lt;br /&gt;
The “depth” option&lt;br /&gt;
It would be nice if malicious content always occurred at the beginning or end&lt;br /&gt;
of a packet. Unfortunately, malicious content can occur almost anywhere in a&lt;br /&gt;
packet. The depth option specifies how many bytes into a packet the Snort&lt;br /&gt;
processor should look before moving on to the next rule.&lt;br /&gt;
The main reason for using the depth option is to restrict the search to the&lt;br /&gt;
most likely places where a match is found, without wasting valuable proces-&lt;br /&gt;
sor resources to search the entire packet. For example, if you want to find the&lt;br /&gt;
HTTP protocol version as part of a Web site communication, look in the first&lt;br /&gt;
few hundred bytes. Because a packet may be as large as 1,500 bytes (less the&lt;br /&gt;
header overhead), it makes a lot of sense to give Snort a break, especially if&lt;br /&gt;
what it must look through are millions upon millions of packets.&lt;br /&gt;
The following rule from the web-misc.rules file reveals that you need only&lt;br /&gt;
15 bytes to catch the sadmind worm. Hence, the content GET x http/1.0 is&lt;br /&gt;
always encountered at the very beginning of the packet.&lt;br /&gt;
web-misc.rules:alert tcp $EXTERNAL_NET any -&amp;gt; $HTTP_SERVERS $HTTP_PORTS&lt;br /&gt;
(msg:”WEB-MISC sadmind worm access”; flow:to_server,established;&lt;br /&gt;
content:”GET x HTTP/1.0”; offset:0; depth:15; classtype:attempted-&lt;br /&gt;
recon; reference:url,www.cert.org/advisories/CA-2001-11.html;&lt;br /&gt;
sid:1375; rev:5;)&lt;br /&gt;
The “nocase” option&lt;br /&gt;
The nocase option, which appears in more than a third of the rules that ship&lt;br /&gt;
with Snort, basically says to ignore the case of the characters submitted for&lt;br /&gt;
searching. Because the nocase directive takes no arguments, it’s normally&lt;br /&gt;
just used with a terminating semicolon. The following example from the&lt;br /&gt;
info.rules file finds the text LOGIN FAILED or LoGIn FaIlEd on a telnet&lt;br /&gt;
session port.&lt;br /&gt;
alert tcp $HOME_NET 23 -&amp;gt; $EXTERNAL_NET any (msg:”INFO TELNET Bad Login”; con-&lt;br /&gt;
tent: “Login failed”; nocase; flow:from_server,established;&lt;br /&gt;
classtype:bad-unknown; sid:492; rev:6;)&lt;br /&gt;
The “offset” option&lt;br /&gt;
Another tool that gives us a more precise scope on where in the packet to&lt;br /&gt;
look is the offset option. Offset works by skipping over the number of bytes&lt;br /&gt;
supplied to the right of the colon. So, offset:90 skips the first 90 bytes of&lt;br /&gt;
the packet and then begins searching for the string given as part of the con-&lt;br /&gt;
tent keyword. Offset and depth work nicely together to make the search area&lt;br /&gt;
of a packet limited to a window that is bracketed by the two. Basically, if you&lt;br /&gt;
know where to look and what to look for, you can use these two options to&lt;br /&gt;
help Snort get a fast grip on where to spend its time.&lt;br /&gt;
The Uniform Resource Identifier (URI) option&lt;br /&gt;
You can use the uricontent option to conduct a similar type of content&lt;br /&gt;
searching. Its purpose is similar to the depth and offset options: to reduce&lt;br /&gt;
the overall processing burden on Snort as it watches for more attacks to&lt;br /&gt;
effectively do its job.&lt;br /&gt;
The uricontent option works much like the content one, except it restricts&lt;br /&gt;
its searching to only URIs in the payload of the packet. URIs (Uniform&lt;br /&gt;
Resource Identifiers) in Snort can specify other protocols than http, such as&lt;br /&gt;
ftp, gopher, rsync, and https.&lt;br /&gt;
The uricontent option only searches for the given text in URIs that is found&lt;br /&gt;
in the packet. If URIs aren’t present, no match occurs. URI searching is good&lt;br /&gt;
for catching malicious commands that are readily evident as they often&lt;br /&gt;
appear in the location request to a Web server. The following rule from the&lt;br /&gt;
web-iis.rules file shows an exploit attempt against the IIS server using&lt;br /&gt;
both content and uricontent analysis:&lt;br /&gt;
alert tcp $EXTERNAL_NET any -&amp;gt; $HTTP_SERVERS $HTTP_PORTS (msg:”WEB-IIS .asa HTTP&lt;br /&gt;
header buffer overflow attempt”; flow:to_server,established; con-&lt;br /&gt;
tent:”HTTP|2F|”; nocase; uricontent:”.asa”; nocase;&lt;br /&gt;
content:”|3A|”; content:”|0A|”; content:”|00|”; reference:bug-&lt;br /&gt;
traq,4476; classtype:web-application-attack; sid:1802; rev:4;)&lt;br /&gt;
A couple of interesting characteristics about this rule are worth discussing:&lt;br /&gt;
ߜ When nocase follows a string, its effect is upon the content string&lt;br /&gt;
immediately prior.&lt;br /&gt;
ߜ The nocase option has no effect upon binary search strings. Leaving it&lt;br /&gt;
off of those strings just helps the overall flow of the rule.&lt;br /&gt;
Classification&lt;br /&gt;
The classification options provide an overall description of a rule, along with&lt;br /&gt;
other helpful information about the rule, that can be used by the Snort pro-&lt;br /&gt;
gram itself and a system administrator. These options include the Snort ID,&lt;br /&gt;
the alert message to appear in the alert log, the rule revision number, the&lt;br /&gt;
alert priority, the alert classification, and external references for the exploit&lt;br /&gt;
or vulnerability that triggered the alert.&lt;br /&gt;
Snort IDs&lt;br /&gt;
Quite a few options help organize and classify detected alerts. The Snort ID&lt;br /&gt;
(sid) option is unique to the Snort system and a good way to get a handle on&lt;br /&gt;
classifications.&lt;br /&gt;
The format of the Snort ID value is the same as it as other classification&lt;br /&gt;
options. For example, a proper usage is as follows:&lt;br /&gt;
sid:&lt;id_value&gt;;&lt;br /&gt;When you get the hang of building your own sets of rules, assign each custom&lt;br /&gt;rule a unique sid number somewhere above the 1,000,000 mark. That way,&lt;br /&gt;updates to the Snort rule base won’t accidentally collide with your custom&lt;br /&gt;rule. Table 8-1 gives you a breakdown of the uses for sid ranges.&lt;br /&gt;default level and rate how important or impacting a particular rule is to your&lt;br /&gt;unique environment. For example, the following command assigns the rule&lt;br /&gt;associated with it the highest priority: 1.&lt;br /&gt; priority:1;&lt;br /&gt;Classtype&lt;br /&gt;The classtype option can organize rules into major groups. A few dozen differ-&lt;br /&gt;ent classification types are spread over three priority levels, which are&lt;br /&gt;described in Tables 8-2, 8-3 and 8-4. For inclusion in a rule, the syntax is&lt;br /&gt; classtype:&lt;class_type_name&gt;;&lt;br /&gt;   Table 8-2            Priority 1 Classifications (Critical Severity)&lt;br /&gt;   classtype                        Description&lt;br /&gt;                                    Attempted privilege escalation to an&lt;br /&gt;   attempted-admin&lt;br /&gt;                                    Administrator level&lt;br /&gt;                                    Attempted privilege escalation to a User level&lt;br /&gt;   attempted-user&lt;br /&gt;                                    Discovered executable code&lt;br /&gt;   shellcode-detect&lt;br /&gt;                                    Achieved successful privilege escalation to an&lt;br /&gt;   successful-admin&lt;br /&gt;                                    Administrator level&lt;br /&gt;                                    Achieved successful privilege escalation to a&lt;br /&gt;   successful-user&lt;br /&gt;                                    User level&lt;br /&gt;                                    Discovered software code of a Trojan Network&lt;br /&gt;   trojan-activity&lt;br /&gt;                                    Attack&lt;br /&gt;                                    Failed privilege escalation to a User level&lt;br /&gt;   unsuccessful-user&lt;br /&gt;                                    Identified an attack upon a Web server’s appli-&lt;br /&gt;   web application attack&lt;br /&gt;                                    cation software&lt;br /&gt;   Table 8-3         Priority 2 Classifications (Intermediate Severity)&lt;br /&gt;   classtype                      Description&lt;br /&gt;                                  Attempted denial-of-service attack&lt;br /&gt;   attempted-dos&lt;br /&gt;                                  Attempted information collection&lt;br /&gt;   attempted-recon&lt;br /&gt;                                  (reconnaissance)&lt;br /&gt;                                  Potentially bad traffic seen (malformed)&lt;br /&gt;   bad-unknown&lt;br /&gt;                          Denial-of-service attack possibly underway&lt;br /&gt;denial-of-service&lt;br /&gt;                          A catch-all category&lt;br /&gt;misc-attack&lt;br /&gt;                          Detection or use of a nonstandard protocol&lt;br /&gt;non-standard-protocol&lt;br /&gt;                          Portmap decode detected&lt;br /&gt;rpc-portmap-decode&lt;br /&gt;                          Denial of service detected&lt;br /&gt;successful-dos&lt;br /&gt;                          Large-scale information collection&lt;br /&gt;successful –recon-&lt;br /&gt;                          (reconnaissance)&lt;br /&gt;largescale&lt;br /&gt;                          Limited information collection (reconnaissance)&lt;br /&gt;successful –recon-&lt;br /&gt;limited&lt;br /&gt;                          Strange or unusual filename was detected&lt;br /&gt;suspicious-filename-&lt;br /&gt;detect&lt;br /&gt;                          Strange username was found attempting to&lt;br /&gt;suspicious-login&lt;br /&gt;                          login&lt;br /&gt;                          System call was detected&lt;br /&gt;suspicious-call-detect&lt;br /&gt;                          A client was abnormally using a network port&lt;br /&gt;unusual-client-port-&lt;br /&gt;connection&lt;br /&gt;                          Access was made to a potentially vulnerable&lt;br /&gt;web-application-&lt;br /&gt;                          web-app&lt;br /&gt;activity&lt;br /&gt;Table 8-4         Priority 3 Classifications (Low Severity)&lt;br /&gt;classtype                      Description&lt;br /&gt;                               A “ping” packet was detected&lt;br /&gt;icmp-event&lt;br /&gt;                               Some behavior was detected that may be&lt;br /&gt;misc-activity&lt;br /&gt;                               considered a policy warning&lt;br /&gt;                               A host or network was being scanned&lt;br /&gt;network-scan&lt;br /&gt;                               Regular usage activity was detected&lt;br /&gt;non-suspicious&lt;br /&gt;                               A protocol instruction was decoded&lt;br /&gt;protocol-command-decode&lt;br /&gt;                               A pattern of specific bytes was detected&lt;br /&gt;string-detect&lt;br /&gt;                               Unknown or unclassified traffic&lt;br /&gt;unknownRevision and versions&lt;br /&gt;The Snort people thought ahead and even included a way to keep a version&lt;br /&gt;tracking on each individual rule. The software industry uses many version&lt;br /&gt;management schemes because the field is so fluid and so dynamic that tight&lt;br /&gt;change control is almost a necessity. The format of the option is&lt;br /&gt;  rev:&amp;lt;#&amp;gt;;&lt;br /&gt;Very few rules that come with Snort (less than 10 percent) have a revision&lt;br /&gt;number of only 1. Busy enterprise networks are sometimes hostile and fast-&lt;br /&gt;paced environments. Sometimes, rules are quickly added during the heat of a&lt;br /&gt;malicious event so that immediate visibility is provided to the security man-&lt;br /&gt;agers who must monitor the attack. After some analysis and a firmer under-&lt;br /&gt;standing of the events takes shape, Snort’s rules are then revised (often only&lt;br /&gt;subtly) to reflect what’s known about the event.&lt;br /&gt;Messaging and output&lt;br /&gt;The mesg option creates a customized output message that can be included&lt;br /&gt;with any logs, alerts, and data dumps processed by the detection engine. By&lt;br /&gt;looking through the rules directory, you can see that the fabricators of the&lt;br /&gt;rules file have added messages to almost all the entries that they include.&lt;br /&gt;The following is an example of the format of the mesg directive in use:&lt;br /&gt;  alert tcp $EXTERNAL_NET any -&amp;gt; $SMTP_SERVERS 25 (msg:”SMTP sendmail 5.5.5&lt;br /&gt;                 exploit”; flow:to_server,established; content:”mail&lt;br /&gt;                 from|3a20227c|”; nocase; reference:arachnids,119;&lt;br /&gt;                 classtype:attempted-admin; sid:662; rev:4;)&lt;br /&gt;See how cleverly the Snort makers had the output of this mail exploit attempt&lt;br /&gt;reported as “SMTP sendmail 5.5.5 exploit”? Describing the nature of an attack&lt;br /&gt;in plain English helps you in the long run (especially when you’re searching&lt;br /&gt;through logs at trying to track down a breach).&lt;br /&gt;External references&lt;br /&gt;The second most powerful (and widely used) feature within a Snort rule is&lt;br /&gt;the external reference option. You can reference Web-based resources that&lt;br /&gt;provide you with tons of additional data on an attack or probe right in the&lt;br /&gt;Snort logs.&lt;br /&gt;A few different formats are used. Nearly all are Web site front-ends that look&lt;br /&gt;up an attack based on a unique identifier. For example, using the example in&lt;br /&gt;the preceding section, we find the following: reference:arachnids,119;&lt;br /&gt;Thanks to this command, when Snort encounters this Sendmail attack, it pro-&lt;br /&gt;vides a URL where the user can find out more about the Sendmail attack.&lt;br /&gt;Table 8-5 gives a list of Snort’s external references.&lt;br /&gt;Keyword   URL Base&lt;br /&gt;bugtraq   http://www.securityfocus.com/bid/&lt;br /&gt;cve       http://cve.mitre.org/cgi-bin/cvename.cgi?name=&lt;br /&gt;arachNIDS http://www.whitehats.com/info/IDS&lt;br /&gt;McAfee    http://vil.nai.com/vil/content/v_&lt;br /&gt;Nessus    http://cgi.nessus.org/plugins/dump.php3?id=&lt;br /&gt;url       http:// (a general URL that’s passed straight through)&lt;br /&gt;Proper use of the external keyword takes this form:&lt;br /&gt;  Reference: &lt;system&gt; &lt;value&gt;&lt;br /&gt;You can tie together any number of reference options as long as they’re sepa-&lt;br /&gt;rated by a semicolon.&lt;br /&gt;Advanced options and deep dark secrets&lt;br /&gt;The advanced options give you a peek into the dark side: the stuff of the&lt;br /&gt;geek-chic and the wizards of computer security.&lt;br /&gt;Flow control&lt;br /&gt;The flow control option lets you define the direction of a network stream. All&lt;br /&gt;network communications have two endpoints and a direction, so Snort can&lt;br /&gt;be configured to alert whenever one of many other triggers is tripped. Snort’s&lt;br /&gt;internal engine must do some fancier processing for the flow control (includ-&lt;br /&gt;ing some on-the-fly packet reconstruction), but it’s certainly worth the over-&lt;br /&gt;head because it lets you know whether an attack actually worked or not.&lt;br /&gt;Regular expressions&lt;br /&gt;A regular expression (regex in computer-nerd circles) is the incredibly power-&lt;br /&gt;ful voodoo of using wildcards to match substrings within other strings.&lt;br /&gt;Without jumping into the deep end of this black art, a regular expression&lt;br /&gt;combined with a Snort rule makes for powerful mojo!&lt;br /&gt;Protocol options&lt;br /&gt;Because of Snort’s primary function to act as a low-level packet trap and fil-&lt;br /&gt;tering device, it can make lots of specific selections based on granular net-&lt;br /&gt;work protocol components. For example, sometimes hackers use specialized&lt;br /&gt;or fragmented packets to tease at the edge of networks for information about&lt;br /&gt;     what they may find if they break in. These probing and recon expeditions&lt;br /&gt;     may otherwise go unnoticed by a system administrator or a security package&lt;br /&gt;     not configured to watch for such errant behavior. Snort’s native IP rules&lt;br /&gt;     options put a huge amount of power at your fingertips.&lt;br /&gt;     How does Snort deal with all those rules?&lt;br /&gt;     Managing the files and their contents, let alone keeping a huge decision tree&lt;br /&gt;     running, is a fine programmatic accomplishment.&lt;br /&gt;     Snort keeps track of all those intricate rules (some with more than 20 differ-&lt;br /&gt;     ent options) with some fancy data processing internally. Without getting too&lt;br /&gt;     bogged down, the process of reading in a particular rule is governed by a&lt;br /&gt;     string parser, which cuts apart the rule into its component parts, which are&lt;br /&gt;     then stored into a series of linked lists.&lt;br /&gt;     Snort is a busy, complex, and low-level application. Every small or subtle&lt;br /&gt;     error that goes undetected or that causes minor annoyances can snowball&lt;br /&gt;     into a huge performance issue under certain circumstances. Although it&lt;br /&gt;     doesn’t happen often, a misplaced command or configuration option can&lt;br /&gt;     cause downtime or data loss.&lt;br /&gt;Rule Refinements&lt;br /&gt;     This section is the fun part of tweaking specific rules to match your environ-&lt;br /&gt;     ment. We recommend a regular strategy of nosing through your Snort output.&lt;br /&gt;     As time passes, the composition of your network changes, and the minefield&lt;br /&gt;     of vulnerabilities expands.&lt;br /&gt;     Trimming the fat&lt;br /&gt;     Likely the first refinement that any IDS guru recommends, almost to the point&lt;br /&gt;     of being a broken record, is to reduce your false positives by stripping the&lt;br /&gt;     dead wood from your rules files.&lt;br /&gt;     We recommend that you sit down with a map of your network and a list of&lt;br /&gt;     your network connected assets (operating systems and exposed services are&lt;br /&gt;     the most critical) and build a table of your computer resources that can be&lt;br /&gt;     attacked. From there you comment out those rules that just don’t matter. If&lt;br /&gt;     you have ten Windows NT servers running MS Project Server and nothing&lt;br /&gt;     else, there’s little need for a thousand Linux/Unix rules.&lt;br /&gt;Commenting out unneeded rules is a simple matter: Just edit the file contain-&lt;br /&gt;ing the rule and place a “#” before the first character of the rule type (gener-&lt;br /&gt;ally “alert”).&lt;br /&gt;Chapter 9 includes more tuning methods that reduce false positives and the&lt;br /&gt;reasons why removing the extra noise keeps your Snort a-snorting.&lt;br /&gt;Making adjustments&lt;br /&gt;Small changes to the rules files of your setup can keep your Snort installation&lt;br /&gt;running at peak efficiency. By refining the rules that you are already running&lt;br /&gt;with Snort, you generate better reports, waste less time reviewing them, and&lt;br /&gt;react faster.&lt;br /&gt;Before editing any Snort rule file, it’s highly recommended that you do the&lt;br /&gt;following:&lt;br /&gt;   ߜ Always make a backup of that rule file.&lt;br /&gt;   ߜ Make sure that you use a plain text editor that doesn’t add any funky for-&lt;br /&gt;      matting or characters when you save the file. The vi program in Linux&lt;br /&gt;      and Notepad in Windows are good examples.&lt;br /&gt;Start by finding a rule that can use some tweaking. Maybe this DNS rule was&lt;br /&gt;misclassed:&lt;br /&gt;  alert udp $EXTERNAL_NET 53 -&amp;gt; $HOME_NET any (msg:”DNS SPOOF query response PTR&lt;br /&gt;                 with TTL\: 1 min. and no authority”; con-&lt;br /&gt;                 tent:”|85800001000100000000|”;&lt;br /&gt;                 content:”|c00c000c00010000003c000f|”; classtype:bad-unknown;&lt;br /&gt;                 sid:253; rev:2;)&lt;br /&gt;Out of the box, it’s classified as a “bad-unknown” alert. Maybe it should be&lt;br /&gt;reclassified as a reconnaissance or information probe, consistent with an&lt;br /&gt;“attempted-recon” tag. To change the rule, just edit the dns.rules (the file&lt;br /&gt;that contains the rule we’re modifying) and change it to something like&lt;br /&gt;  alert udp $EXTERNAL_NET 53 -&amp;gt; $HOME_NET any (msg:”DNS SPOOF query response PTR&lt;br /&gt;                 with TTL\: 1 min. and no authority”; con-&lt;br /&gt;                 tent:”|85800001000100000000|”;&lt;br /&gt;                 content:”|c00c000c00010000003c000f|”; classtype:attempted-recon;&lt;br /&gt;                 sid:253; rev:3;)&lt;br /&gt;We bumped up the revision number to 3 so that another person can see that&lt;br /&gt;something’s changed.&lt;br /&gt;If you plan on making lots of changes to the base rules that come with Snort,&lt;br /&gt;keep a local backup copy of the original version outside of the directory that&lt;br /&gt;Snort uses to manage its configuration. If you upgrade Snort without keeping&lt;br /&gt;copies of all your custom tweaking, you may accidentally overwrite the&lt;br /&gt;whole lot with one punch of the enter key!&lt;br /&gt;Building a rule from whole cloth&lt;br /&gt;In some cases, a new rule is needed. Situations that might require a new rule&lt;br /&gt;include:&lt;br /&gt;   ߜ Some sort of odd behavior on the network has been noticed: Maybe an&lt;br /&gt;      abnormal amount of data is transferred on the network after hours, or a&lt;br /&gt;      particular server is rebooting for no apparent reason. An investigation&lt;br /&gt;      begins to determine what these oddities mean, and based on captured&lt;br /&gt;      network data, you can create a rule that matches the odd event.&lt;br /&gt;   ߜ A new attack hits the Internet. There are no existing Snort rules that&lt;br /&gt;      match the attack, so you decide to create a rule on your own.&lt;br /&gt;For almost all configurations, the standard set of rules (if regularly updated)&lt;br /&gt;can be just what the doctor ordered. The need to build a whole rule from&lt;br /&gt;scratch isn’t an everyday occurrence.&lt;br /&gt;Here’s a real-world situation that we can use as an example. While on-site at a&lt;br /&gt;customer’s facility, we heard that its network was acting irrationally and that&lt;br /&gt;the customer needed our help in isolating the cause of it. After an hour of&lt;br /&gt;tracking back a huge amount of network bandwidth coming from two work-&lt;br /&gt;station computers, we found that they were infected with some sort of virus.&lt;br /&gt;We diagnosed a virus by running a packet sniffer and capturing all of those&lt;br /&gt;workstations’ network communications.&lt;br /&gt;All of that techno-sleuthing work we did can be best summarized into a&lt;br /&gt;packet capture, or at least a fair approximation of one. What follows is a snip-&lt;br /&gt;pet of what we were looking at:&lt;br /&gt;  15:30:05.000913 10.3.232.38.1522 &amp;gt; 192.168.4.81.1434: udp 376&lt;br /&gt;  0x0000   4500 0194 bec2 0000 6d11 d406 d963 055d        E.......m....c.]&lt;br /&gt;  0x0010   d8ab 0224 1069 059a 0180 6b52 0401 0101        ...$.i....kR....&lt;br /&gt;  0x0020   0101 0101 0101 0101 0101 0101 0101 0101        ................&lt;br /&gt;  0x0030   0101 0101 0101 0101 0101 0101 0101 0101        ................&lt;br /&gt;  0x0040   0101 0101 0101 0101 0101 0101 0101 0101        ................&lt;br /&gt;  0x0050   0101 0101 0101 0101 0101 0101 0101 0101        ................&lt;br /&gt;  0x0060   0101 0101 0101 0101 0101 0101 0101 0101        ................&lt;br /&gt;  0x0070   0101  0101 0101 0101 0101 0101 01dc c9b0       ................&lt;br /&gt;  0x0080   42eb  0e01 0101 0101 0101 70ae 4201 70ae       B.........p.B.p.&lt;br /&gt;  0x0090   4290  9090 9090 9090 9068 dcc9 b042 b801       B........h...B..&lt;br /&gt;  0x00a0   0101  0131 c9b1 1850 e2fd 3501 0101 0550       ...1...P..5....P&lt;br /&gt;  0x00b0   89e5  5168 2e64 6c6c 6865 6c33 3268 6b65       ..Qh.dllhel32hke&lt;br /&gt;  0x00c0   726e  5168 6f75 6e74 6869 636b 4368 4765       rnQhounthickChGe&lt;br /&gt;  0x00d0   7454  66b9 6c6c 5168 3332 2e64 6877 7332       tTf.llQh32.dhws2&lt;br /&gt;  0x00e0   5f66  b965 7451 6873 6f63 6b66 b974 6f51       _f.etQhsockf.toQ&lt;br /&gt;  0x00f0   6873  656e 64be 1810 ae42 8d45 d450 ff16       hsend....B.E.P..&lt;br /&gt;  0x0100   508d  45e0 508d 45f0 50ff 1650 be10 10ae       P.E.P.E.P..P....&lt;br /&gt;  0x0110   428b  1e8b 033d 558b ec51 7405 be1c 10ae       B....=U..Qt.....&lt;br /&gt;  0x0120   42ff  16ff d031 c951 5150 81f1 0301 049b       B....1.QQP......&lt;br /&gt;  0x0130   81f1  0101 0101 518d 45cc 508b 45c0 50ff       ......Q.E.P.E.P.&lt;br /&gt;  0x0140   166a  116a 026a 02ff d050 8d45 c450 8b45       .j.j.j...P.E.P.E&lt;br /&gt;  0x0150   c050  ff16 89c6 09db 81f3 3c61 d9ff 8b45       .P........&lt;a ...e=&quot;&quot; 000913=&quot;&quot; 0151=&quot;&quot; 01c2=&quot;&quot; 01d8=&quot;&quot; 0350=&quot;&quot; 0490=&quot;&quot; 0829=&quot;&quot; 09db=&quot;&quot; 0c40=&quot;&quot; 0x0160=&quot;&quot; 0x0170=&quot;&quot; 0x0180=&quot;&quot; 0x0190=&quot;&quot; 108d=&quot;&quot; 1522=&quot;&quot; 16=&quot;&quot; 3c61=&quot;&quot; 45b0=&quot;&quot; 5031=&quot;&quot; 6681=&quot;&quot; 81f3=&quot;&quot; 88c1=&quot;&quot; 8945=&quot;&quot; 89c6=&quot;&quot; 8b45=&quot;&quot; 8d14=&quot;&quot; 8d45=&quot;&quot; a=&quot;&quot; ac50=&quot;&quot; ad=&quot;&quot; all=&quot;&quot; also=&quot;&quot; an=&quot;&quot; and=&quot;&quot; any=&quot;&quot; appropriate=&quot;&quot; as=&quot;&quot; at=&quot;&quot; b46a=&quot;&quot; b48d=&quot;&quot; bandage=&quot;&quot; being=&quot;&quot; build=&quot;&quot; busted=&quot;&quot; by=&quot;&quot; bytes=&quot;&quot; c050=&quot;&quot; c1e2=&quot;&quot; c28d=&quot;&quot; c951=&quot;&quot; can=&quot;&quot; catch=&quot;&quot; chopped=&quot;&quot; construct=&quot;&quot; d9ff=&quot;&quot; dump=&quot;&quot; e204=&quot;&quot; ebca=&quot;&quot; ers=&quot;&quot; example=&quot;&quot; f178=&quot;&quot; few=&quot;&quot; ff16=&quot;&quot; ffd6=&quot;&quot; first=&quot;&quot; fun=&quot;&quot; gives=&quot;&quot; goal=&quot;&quot; had=&quot;&quot; hex=&quot;&quot; href=&quot;https://www.blogger.com/null&quot; in=&quot;&quot; infest=&quot;&quot; information=&quot;&quot; into=&quot;&quot; is=&quot;&quot; its=&quot;&quot; just=&quot;&quot; know=&quot;&quot; known=&quot;&quot; line=&quot;&quot; made=&quot;&quot; making=&quot;&quot; more=&quot;&quot; nauseum=&quot;&quot; necessary=&quot;&quot; need=&quot;&quot; network=&quot;&quot; new=&quot;&quot; novel=&quot;&quot; number=&quot;&quot; of=&quot;&quot; offending=&quot;&quot; on=&quot;&quot; our=&quot;&quot; out=&quot;&quot; outbreak=&quot;&quot; p1=&quot;&quot; p=&quot;&quot; part=&quot;&quot; ran=&quot;&quot; repeated=&quot;&quot; represent=&quot;&quot; review=&quot;&quot; rule=&quot;&quot; s=&quot;&quot; same=&quot;&quot; seeing=&quot;&quot; segment=&quot;&quot; sequence=&quot;&quot; signature=&quot;&quot; snort=&quot;&quot; sql=&quot;&quot; started=&quot;&quot; string=&quot;&quot; t=&quot;&quot; that=&quot;&quot; the=&quot;&quot; these=&quot;&quot; this=&quot;&quot; time=&quot;&quot; tion=&quot;&quot; to=&quot;&quot; trace=&quot;&quot; two=&quot;&quot; ultimately=&quot;&quot; unplugged=&quot;&quot; was=&quot;&quot; we=&quot;&quot; were=&quot;&quot; what=&quot;&quot; where=&quot;&quot; with=&quot;&quot; worm=&quot;&quot; you=&quot;&quot;&gt; 192.168.4.81.1434: udp 376&lt;br /&gt;Table 8-6 identifies the meaning of each of the preceding line’s component&lt;br /&gt;elements.&lt;br /&gt;    Table 8-6                     Components of Packet Trace&lt;br /&gt;    Description                          Value&lt;br /&gt;    Time packet was sent                 15.30:05.000913&lt;br /&gt;    Source address                       10.3.232.38&lt;br /&gt;   Description                           Value&lt;br /&gt;   Source port                           1522&lt;br /&gt;   Destination address                   192.168.4.81&lt;br /&gt;   Destination port                      1434&lt;br /&gt;   Protocol                              UDP&lt;br /&gt;   Packet size (bytes)                   376&lt;br /&gt;All that’s needed from Table 8-6 are the protocol and the destination port.&lt;br /&gt;The source IP address, source port, and destination IP address show up dif-&lt;br /&gt;ferently when coming from and going to different systems. Remember, we’re&lt;br /&gt;looking for new instances of this worm, not the infected systems we already&lt;br /&gt;know about. Coupled with the signature that was scissored from that big&lt;br /&gt;block of packet data, that’s the complete makings of a fledgling Snort rule. All&lt;br /&gt;the pieces fit together like this:&lt;br /&gt;  alert udp $EXTERNAL_NET any -&amp;gt; $HOME_NET 1434 (msg:”New MSSQL Worm A-&lt;br /&gt;                  Multiplyin’”; content:”|c050 ff16 89c6 09db 81f3 3c61 d9ff 8b45|”;&lt;br /&gt;                  sid:1000001; rev:1;)&lt;br /&gt;The preceding example highlights the following best-practices in creating a&lt;br /&gt;Snort rule:&lt;br /&gt;   ߜ We followed the path of the good Snort administrator and made the&lt;br /&gt;      Snort ID equal to 1,000,000.&lt;br /&gt;   ߜ The revision is marked as 1, meaning that this attempt was our first at&lt;br /&gt;      drafting a rule to achieve the wanted results.&lt;br /&gt;After testing, if our signature isn’t right or other elements need tweaking, we&lt;br /&gt;can make the changes and increase the rev number to reflect the changes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;/value&gt;&lt;/system&gt;&lt;/class_type_name&gt;&lt;/id_value&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/5188198575952291358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/5188198575952291358'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/10/snort-rules-network-intrusion-detection.html' title='snort rules (network intrusion detection system)'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-8929466004036548436</id><published>2011-09-26T09:07:00.000-07:00</published><updated>2011-09-26T09:08:15.242-07:00</updated><title type='text'>British man charged with hacking attacks</title><content type='html'>&lt;p&gt;A British man was charged Wednesday with mounting denial of service attacks on three websites, Scotland Yard announced.&lt;/p&gt;&lt;p&gt;Ryan  Cleary, 19, was charged with attacking the websites of Britain&#39;s  Serious Organised Crime Agency, British Phonographic Agency and  International Federation of the Phonographic Industry.&lt;/p&gt;&lt;p&gt;He is due to appear in court Thursday, police said.&lt;/p&gt;&lt;p&gt;The alleged attacks all took place between October and June, police said.&lt;/p&gt;&lt;p&gt;The computer hacking group LulzSec denied Tuesday that Cleary was a significant member of the group.&lt;/p&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/8929466004036548436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/8929466004036548436'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/british-man-charged-with-hacking.html' title='British man charged with hacking attacks'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-1147314748674566275</id><published>2011-09-26T08:54:00.000-07:00</published><updated>2011-09-26T08:55:41.345-07:00</updated><title type='text'>SIA Approved Contractors in ITsecurity in UK</title><content type='html'>&lt;h3&gt;May we introduce you to Network Securities UK, the premier guarding company in the UK.&lt;/h3&gt;                              &lt;div class=&quot;mainBodyInnerText&quot;&gt;We are an SIA approved security  company offering security services throughout the UK from our  operational centre in Leeds, West Yorkshire. &lt;br /&gt;&lt;br /&gt;   &lt;/div&gt;                         &lt;div class=&quot;mainBodyInner&quot;&gt;           &lt;h3&gt;Why use Network Securities?&lt;/h3&gt;          &lt;/div&gt;                    &lt;div class=&quot;mainBodyHighlight&quot;&gt;                                 &lt;div class=&quot;mainBodyInnerText&quot;&gt;           &lt;ul&gt;&lt;li&gt;Our clients are personally account managed.&lt;/li&gt;&lt;li&gt;We meet your security needs with a one to one point of contact.&lt;/li&gt;&lt;li&gt;The highest possible levels of service at guarding and management levels.&lt;/li&gt;&lt;li&gt;We are an SIA approved contractor.&lt;/li&gt;&lt;li&gt;All our officers are SIA registered.&lt;/li&gt;&lt;li&gt;We have achieved SAFE contractor approved status.&lt;/li&gt;&lt;li&gt;Our headquarters have an excellent geographical location with improved motorway links.&lt;/li&gt;&lt;li&gt;We provide national coverage.&lt;/li&gt;&lt;li&gt;Our offices are manned 24/7 - 365 days of the year, a service unique to Network Securities UK.&lt;/li&gt;&lt;/ul&gt;                                    &lt;/div&gt;                    &lt;/div&gt;                                        &lt;div class=&quot;mainBodyInner&quot;&gt;           &lt;h3&gt;&lt;br /&gt;SIA Approved Contractors&lt;/h3&gt;          &lt;/div&gt;                                                    We insist that all our security officers hold valid SIA licences  and we are proud to have been awarded SIA Approved Contractor Status as  a security company.  We strenuously recommend to any business or  individual looking for security services to always engage SIA approved  contractors as this SIA award confers the highest levels of trust,  reliability and professionalism; something that Network Securities UK  provides consistently whether in Leeds, Yorkshire or the wider UK. &lt;br /&gt;&lt;br /&gt;                 Not every security company or provider of security services are  SIA approved contractors.  Since the founding of our company in Leeds  and during our years of growth throughout Yorkshire we have encountered  unsatisfactory security companies who do not have SIA approved  contractor status and who are not able to offer security services to the  consistently high standards of Network Securities UK.  We believe that  our commitment to reliable, professional security services is the reason  why we are SIA Approved Contractors and the reason why we have  successfully grown throughout Leeds, Yorkshire and the UK as a whole.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/1147314748674566275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/1147314748674566275'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/sia-approved-contractors-in-itsecurity.html' title='SIA Approved Contractors in ITsecurity in UK'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-9073344003814630309</id><published>2011-09-24T23:21:00.000-07:00</published><updated>2011-09-24T23:26:48.315-07:00</updated><title type='text'>eScan ISS from MicroWorld</title><content type='html'>4/2008&lt;br /&gt;Virus has always been a daily problem for the end users. System is on&lt;br /&gt;vulnerable state as soon as they are turned on. Which means, when they do file share&lt;br /&gt;with other computer’s or over the Internet, they tend to be even more vulnerable to the viruses on loose in the Internet. This being the case, users who depend on information technology and&lt;br /&gt;computer system for many different purposes would like to have a toolkit that takes of all&lt;br /&gt;their headache to trace and find viruses within a system. More than finding one, it is best to quarantine and log the entire process of virus scans. Quick Start Installation is very simple as they are very similar to the Windows based installing software. It is a&lt;br /&gt;point-and-click installation and the software will do everything else for you. Figure 1, shows the admin panel window of the eScan toolkit. It has very simple and elegant features for all kinds of users to use the tool. It can work on scheduled way and&lt;br /&gt;always has different Active protection levels. The users can choose the drive to scan from&lt;br /&gt;the On Demand window and click the “Scan”button. Once the scan is performed, a list of&lt;br /&gt;malwares will be logged and displayed at the same time in order for the users to be aware&lt;br /&gt;of the viruses spotted on their system. Figure 2, shows the scanning window that opens when&lt;br /&gt;the user starts the scan. eScan is updated on a regular fashion and it makes it very easy for users&lt;br /&gt;to do an auto-update check, where the software does everything for the users.&lt;br /&gt;Advantages&lt;br /&gt;It is quick and easy for installation, performing scan, running updates and choosing the various&lt;br /&gt;modes of the software to run on. The manual is well structure for users who get stuck at some&lt;br /&gt;point of time, when using this software. The logs store every granular detail of the scan, which&lt;br /&gt;helps even the beginner level users to easily understand the virus-infected file. It updates very&lt;br /&gt;frequently too. Disadvantage In general terms, a anti-virus products will always have its limitations. We can only have signatures for a known Malware, known to the security&lt;br /&gt;researchers of an organization designing such products. Hence, anti-virus products cannot&lt;br /&gt;identify certain viruses for which it does not have the signature. This is a major disadvantage for&lt;br /&gt;any anti-virus software. Other than that, I did not see any other disadvantages running this&lt;br /&gt;product. by Anushree Reddy, AOL Inc.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/9073344003814630309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/9073344003814630309'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/escan-iss-from-microworld.html' title='eScan ISS from MicroWorld'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-8629020811522246377</id><published>2011-09-24T23:19:00.000-07:00</published><updated>2011-09-24T23:20:42.988-07:00</updated><title type='text'>WHEN HACKERS ARE HACKED</title><content type='html'>In the past few months there have been many discussions about hackers being&lt;br /&gt;hacked back through the tools they use. The trend is steady and increasing.&lt;br /&gt;More and more tools advertised in the most notorious hackers and security professionals&lt;br /&gt; mailing lists and websites hide keyloggers or even rootkits.Penetration testing tools and brute forcers seem the most infected. While at the beginning this appeared as the attempt&lt;br /&gt;of hackers to hack other hackers, some rumors and some (reverse engineering)&lt;br /&gt;findings uncovered that the authorities may be behind this infection. With this new tactic&lt;br /&gt;and new anti hacking-tools laws enforced in some European countries, tracking back&lt;br /&gt;hacking tools consumers through rootkits can be the ultimate proof of crime.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/8629020811522246377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/8629020811522246377'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/when-hackers-are-hacked.html' title='WHEN HACKERS ARE HACKED'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-6684673918153088533</id><published>2011-09-24T23:05:00.000-07:00</published><updated>2011-09-24T23:17:30.191-07:00</updated><title type='text'>ATM MACHINES EASILY HACKED, DO YOU NEED MONEY?</title><content type='html'>When the SQL Slammer worm shut down over 10,000 ATM&#39;s belonging to Bank of&lt;br /&gt;America there was a big surprise in the security industry. Nobody would have&lt;br /&gt;suspected that such important machines were being powered by Windows PC&#39;s connected to the Internet.&lt;br /&gt;Now, once again, researchers have demonstrated the possibility of stealing&lt;br /&gt;the sensitive information that card holders entered into ATM&#39;s by hacking them with a&lt;br /&gt;Windows 0 day exploit. Martin Macmillan, business development director with ATM&lt;br /&gt;security specialist Level Four Software,&lt;br /&gt;said that Banks have preferred to use common operating systems, like Windows,&lt;br /&gt;to give intelligence to ATM&#39;s thus exposing them to the same risks of a home PC.&lt;br /&gt;Keeping them secure translates into regular software updates and patching.&lt;br /&gt;But further security problems due to poor design implementations in which only the&lt;br /&gt;PIN is encrypted while card numbers and expiration dates are sent in the clear. In the&lt;br /&gt;end the number of ATM&#39;s, counting all of those small machines not under the direct&lt;br /&gt;control of the Banks, makes it very difficult for any large scale solution to work and&lt;br /&gt;work in a timely fashion, to prevent the 0 day attacks. – another tough one!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/6684673918153088533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/6684673918153088533'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/atm-machines-easily-hacked-do-you-need.html' title='ATM MACHINES EASILY HACKED, DO YOU NEED MONEY?'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-7132448441026273640</id><published>2011-09-24T11:17:00.003-07:00</published><updated>2011-09-24T11:17:59.493-07:00</updated><title type='text'>Packet Fence 3.0.0</title><content type='html'>&lt;dl id=&quot;F105290&quot; class=&quot;file&quot;&gt;&lt;dd class=&quot;detail&quot;&gt;&lt;p&gt;PacketFence is a network access control (NAC)  system. It is actively maintained and has been deployed in numerous  large-scale institutions. It can be used to effectively secure networks,  from small to very large heterogeneous networks. PacketFence provides  NAC-oriented features such as registration of new network devices,  detection of abnormal network activities including from remote snort  sensors, isolation of problematic devices, remediation through a captive  portal, and registration-based and scheduled vulnerability scans.&lt;/p&gt;&lt;/dd&gt;&lt;dd class=&quot;change&quot;&gt;&lt;span&gt;Changes&lt;/span&gt;: This is a major release focused  on several new features. It has a redesigned captive portal, complete  guest management including self-registration of devices by email  activation or SMS, and pre-registered guest creation by administrators.  It has a new feature to secure network access on unmanageable (consumer)  devices (so-called inline enforcement). Bandwidth tracking with RADIUS  accounting, RHEL / CentOS 6 support, and several usability improvements  are in as well. Several things that annoyed the developers but that  involved breaking changes have been fixed. &lt;/dd&gt;&lt;/dl&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7132448441026273640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7132448441026273640'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/packet-fence-300_24.html' title='Packet Fence 3.0.0'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-1711858790368596356</id><published>2011-09-24T11:17:00.001-07:00</published><updated>2011-09-24T11:17:56.420-07:00</updated><title type='text'>Packet Fence 3.0.0</title><content type='html'>&lt;dl id=&quot;F105290&quot; class=&quot;file&quot;&gt;&lt;dd class=&quot;detail&quot;&gt;&lt;p&gt;PacketFence is a network access control (NAC)  system. It is actively maintained and has been deployed in numerous  large-scale institutions. It can be used to effectively secure networks,  from small to very large heterogeneous networks. PacketFence provides  NAC-oriented features such as registration of new network devices,  detection of abnormal network activities including from remote snort  sensors, isolation of problematic devices, remediation through a captive  portal, and registration-based and scheduled vulnerability scans.&lt;/p&gt;&lt;/dd&gt;&lt;dd class=&quot;change&quot;&gt;&lt;span&gt;Changes&lt;/span&gt;: This is a major release focused  on several new features. It has a redesigned captive portal, complete  guest management including self-registration of devices by email  activation or SMS, and pre-registered guest creation by administrators.  It has a new feature to secure network access on unmanageable (consumer)  devices (so-called inline enforcement). Bandwidth tracking with RADIUS  accounting, RHEL / CentOS 6 support, and several usability improvements  are in as well. Several things that annoyed the developers but that  involved breaking changes have been fixed. &lt;/dd&gt;&lt;/dl&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/1711858790368596356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/1711858790368596356'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/packet-fence-300.html' title='Packet Fence 3.0.0'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-7660759743312120441</id><published>2011-09-24T11:16:00.001-07:00</published><updated>2011-09-24T11:16:39.439-07:00</updated><title type='text'>Nightwing 0.7.8</title><content type='html'>&lt;dl id=&quot;F105286&quot; class=&quot;file&quot;&gt;&lt;dd class=&quot;detail&quot;&gt;&lt;p&gt;Nightwing allows the creation of quickly deployed  wireless networks without the need to make complicated configurations.  With the implementation of a Mesh technology called B.A.T.M.A.N,  Nightwing allows the extension of wireless networks with a simple way of  adding devices that works with minimal human intervention. It has  public and private connection interfaces, and the ability to filter  content using OpenDNS. It is designed with security in mind, and has low  hardware requirements.&lt;/p&gt;&lt;/dd&gt;&lt;dd class=&quot;change&quot;&gt;&lt;span&gt;Changes&lt;/span&gt;: This release allows you to make  the Private AP optional, as well as the configuration for this new  feature in nw_conf and the Web Admin Interface. Marking in the Traffic  Shaping script has changed. Special characters are allowed in passwords  in the Web Admin Interface. The layout of the Web Admin interface has  changed. You can reboot uhttpd thru the Web Admin interface. The page is  refreshed in some browsers after the config is applied. Wireless mode  selection has been added to the config page. &lt;/dd&gt;&lt;/dl&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7660759743312120441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7660759743312120441'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/nightwing-078.html' title='Nightwing 0.7.8'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-7529468721736381554</id><published>2011-09-24T11:13:00.000-07:00</published><updated>2011-09-24T11:14:29.295-07:00</updated><title type='text'>Red Hat Security Advisory 2011-1326-01</title><content type='html'>Red Hat Security Advisory 2011-1326-01 - Pango is a library used for the  layout and rendering of internationalized text. A buffer overflow flaw  was found in HarfBuzz, an OpenType text shaping engine used in Pango. If  a user loaded a specially-crafted font file with an application that  uses Pango, it could cause the application to crash or, possibly,  execute arbitrary code with the privileges of the user running the  application. Users of pango are advised to upgrade to these updated  packages, which contain a backported patch to resolve this issue. After  installing this update, you must restart your system or restart the X  server for the update to take effect.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7529468721736381554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7529468721736381554'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/red-hat-security-advisory-2011-1326-01.html' title='Red Hat Security Advisory 2011-1326-01'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-7331537591601869455</id><published>2011-09-24T11:11:00.000-07:00</published><updated>2011-09-24T11:12:13.554-07:00</updated><title type='text'>John The Ripper 1.7.8 Jumbo 7 release</title><content type='html'>&lt;dl id=&quot;F105291&quot; class=&quot;file&quot;&gt;&lt;dd class=&quot;detail&quot;&gt;&lt;p&gt;John the Ripper is a fast password cracker,  currently available for many flavors of Unix, Windows, DOS, BeOS, and  OpenVMS. Its primary purpose is to detect weak Unix passwords. It  supports several crypt(3) password hash types commonly found on Unix  systems, as well as Windows LM hashes. On top of this, many other hash  types are added with contributed patches, and some are added in John the  Ripper Pro.&lt;/p&gt;&lt;/dd&gt;&lt;dd class=&quot;change&quot;&gt;&lt;span&gt;Changes&lt;/span&gt;: Support for cracking of  encrypted PKZIP archives, Mac OS X 10.7 salted SHA-512 hashes, and  DES-based tripcodes has been added. Optional OpenMP parallelization has  been added for salted SHA-1 hashes of Mac OS X 10.4-10.6. DIGEST-MD5  cracker has been revised to be usable without requiring source code  customizations. Experimental support for dynamically loaded plugins has  been added. &quot;.include&quot; directive support and duplicate rule suppression  have been added for john.conf. Support for additional character  encodings and related features has been added. Numerous other  enhancements have been made. &lt;/dd&gt;&lt;/dl&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7331537591601869455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/7331537591601869455'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/john-ripper-178-jumbo-7-release.html' title='John The Ripper 1.7.8 Jumbo 7 release'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4653711704745711900.post-2461672423459438710</id><published>2011-09-24T10:57:00.000-07:00</published><updated>2011-09-24T11:08:10.507-07:00</updated><title type='text'>Firewall Concepts</title><content type='html'>&lt;h1&gt;Firewall Concepts&lt;br /&gt;       &lt;/h1&gt;                        e=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&amp;gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&gt;         &lt;/span&gt;With all the possible security threats roaming around the Internet today, a security firewall should be considered a mandatory necessity for any computer systems connected to the Internet. A firewall is a networking device which is used to separate private networks from external access by providing a certain level of security rules and controls.&lt;br /&gt;    &lt;br /&gt;       A simple firewall can be configured to block all access to certain networks, workstations and communication ports. A more complex firewall is capable of inspecting each individual packet that attempts to pass through it and ensures that they are correctly formatted and appropriate to the services provided for (or by) the internal network, this is called a packet filtering firewall.&lt;br /&gt;    &lt;br /&gt;       This chapter will explain some of the concepts for &lt;span style=&quot;font-family:monospace;&quot;&gt;iptables&lt;/span&gt; and packet forwarding which can be used to secure your private network. The example configurations provided in each section are only designed to provide an introduction into each of those specific sections, while an example firewall script has been included which will provide simple but effective security for your networked system.&lt;br /&gt;    &lt;br /&gt;       &lt;table style=&quot;width: 100%; text-align: left;&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td style=&quot;vertical-align: middle; text-align: center; width: 52px;&quot;&gt;&lt;img style=&quot;width: 24px; height: 24px;&quot; alt=&quot;Note !!&quot; src=&quot;http://www.brennan.id.au/images/note.gif&quot; /&gt;&lt;/td&gt;                &lt;td style=&quot;color: rgb(255, 153, 102);&quot;&gt;Many of the newer broadband modems provide built-in firewall features that allow for stateful packet inspection and detailed network address translations, which are capable of providing a high security level for your internal network.&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;h2&gt;&lt;a name=&quot;forwarding&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.brennan.id.au/06-Firewall_Concepts.html#top&quot;&gt;Packet Forwarding&lt;/a&gt;&lt;br /&gt;       &lt;/h2&gt;          Packet forwarding is a simple concept where the server allows data packets to pass from one network to another. As with the diagram below, packets from the private network are allowed to be forwarded through the server and out to the ISP and vice versa.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-family:monospace;&quot;&gt;                                  &lt;/span&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;                            /-----------------------\&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          /-----------------\      |   Server (Routing)    |      /-----------------\&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          | Private Network |------|  eth1 : 192.168.1.1   |      | ISP Connection  |&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          | 192.168.1.0/24  |      |-----------------------|      | REMOTE IP ADDR  |&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          \-----------------/      | eth0 : 123.123.123.2  |------| 123.123.123.1   |&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;                                   \-----------------------/      \-----------------/&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;       There are a few initial considerations. First, the server must have networks or gateways defined in its routing table so it can make an informed decision where the packet needs to be passed to. Second, the server must have packet forwarding enabled. Thirdly, if the routed packets came from an &lt;a href=&quot;http://www.ietf.org/rfc/rfc1918.txt&quot;&gt;RFC1918&lt;/a&gt; private subnet, they must be translated into globally routed IP addresses (NAT covered later) before they will be accepted out on the Internet.&lt;br /&gt;    &lt;br /&gt;       Packet forwarding can be enabled either manually as required by the superuser, or automatically when the system starts the networking service. To manually enable or disable packet forwarding, use the respective commands listed below.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;[bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;[bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;echo 0 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       To enable automatic packet forwarding for whenever the network service is active, make the following changes in your &lt;span style=&quot;font-family:monospace;&quot;&gt;/etc/sysctl.conf&lt;/span&gt; file.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;[bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;vi /etc/sysctl.conf&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;net.ipv4.ip_forward = 1&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;table style=&quot;width: 100%; text-align: left;&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td style=&quot;vertical-align: middle; text-align: center; width: 52px;&quot;&gt;&lt;img style=&quot;width: 24px; height: 24px;&quot; alt=&quot;Note !!&quot; src=&quot;http://www.brennan.id.au/images/note.gif&quot; /&gt;&lt;/td&gt;                &lt;td style=&quot;color: rgb(255, 153, 102);&quot;&gt;It is common practice for users to have manual control over packet forwarding, and to active or disable the function within their firewall control scripts. However setting packet forwarding to start automatically will be more suitable for a dedicated server.&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;h2&gt;&lt;a name=&quot;filtering&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.brennan.id.au/06-Firewall_Concepts.html#top&quot;&gt;Packet Filtering&lt;/a&gt;&lt;br /&gt;       &lt;/h2&gt;          Packet filtering is also a reasonably simple concept (true), however it can be very daunting for new users that don&#39;t fully understand how it works, so let&#39;s cover the basics first and build it up.&lt;br /&gt;    &lt;br /&gt;       In packet forwarding the kernel is either allowed to move packets between different subnets or is not, and if it is, the decisions are made from the kernel&#39;s routing table. In packet filtering an application called &lt;span style=&quot;font-family:monospace;&quot;&gt;iptables&lt;/span&gt; (&lt;a href=&quot;http://www.netfilter.org/&quot;&gt;www.netfilter.org&lt;/a&gt;) stores a list of programmed rules which are individually tested against every packet that either tries to enter, pass through, or exit any of the system&#39;s network devices. Each rule is used to test the packet in a sequential order and if the packet matches any of the rules it is either accepted or rejected depending on the global policy and rule definitions. &lt;span style=&quot;font-family:monospace;&quot;&gt;iptables&lt;/span&gt; is your firewall application and is one of the networking frameworks for your Linux kernel.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-family:monospace;&quot;&gt;iptables&lt;/span&gt; essentially has this name because it stores the rulesets into a group of three tables which each provide different capabilities depending on the rules and the order they are applied. We will only examine the &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; and &lt;span style=&quot;font-family:monospace;&quot;&gt;nat&lt;/span&gt; tables here, the &lt;span style=&quot;font-family:monospace;&quot;&gt;mangle&lt;/span&gt; table is used for specialised packet alteration which is beyond our scope. The following table displays the &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; iptables and the three built-in chains.&lt;br /&gt;    &lt;br /&gt;       &lt;table style=&quot;width: 100%; text-align: left;&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td style=&quot;font-weight: bold; width: 150px;&quot;&gt;Table Name&lt;br /&gt;             &lt;/td&gt;                &lt;td style=&quot;font-weight: bold; width: 150px;&quot;&gt;Chain Name&lt;br /&gt;             &lt;/td&gt;                &lt;td style=&quot;font-weight: bold;&quot;&gt;Chain Details&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;              &lt;tr&gt;                &lt;td style=&quot;width: 150px; font-family: monospace;&quot; colspan=&quot;1&quot; rowspan=&quot;3&quot;&gt;filter&lt;br /&gt;             &lt;/td&gt;                &lt;td style=&quot;width: 150px; font-family: monospace;&quot;&gt;INPUT&lt;br /&gt;             &lt;/td&gt;                &lt;td&gt;For any packet coming into the system&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;              &lt;tr&gt;                &lt;td style=&quot;width: 150px; font-family: monospace;&quot;&gt;FORWARD&lt;br /&gt;             &lt;/td&gt;                &lt;td&gt;For any packet that is being routed through the system&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;              &lt;tr&gt;                &lt;td style=&quot;width: 150px; font-family: monospace;&quot;&gt;OUTPUT&lt;br /&gt;             &lt;/td&gt;                &lt;td&gt;For any packet that is leaving the system&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       To list the &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; table and its rules you can use the following command.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;[bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -t filter -nvL&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       The &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; table is the default table when working with &lt;span style=&quot;font-family:monospace;&quot;&gt;iptables&lt;/span&gt;, so there is no need to add &#39;&lt;span style=&quot;font-family:monospace;&quot;&gt;-t filter&lt;/span&gt;&#39; at the command prompt.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;[bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -nvL&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;Chain INPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       You should see an output similar to above, if not then stop the iptables service and output the table again. From the listing you can see the three built in chains, and their default policies are all set to &lt;span style=&quot;font-family:monospace;&quot;&gt;ACCEPT&lt;/span&gt;, which means the firewall is inactive.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;[bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;/etc/init.d/iptables stop&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       The output from the top listing does not provide much information, so let&#39;s populate the table with some of our own rules. Type the following commands at the prompt then output a listing of the table again.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;01- [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -P INPUT DROP&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         02- [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -P FORWARD DROP&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         03- [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -P OUTPUT DROP&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         04- [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -A INPUT  -i lo -j ACCEPT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         05- [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -A OUTPUT -o lo -j ACCEPT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         06- [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -A INPUT  -i ppp0 -p tcp --sport 80 -j ACCEPT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         07- [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -A OUTPUT -o ppp0 -p tcp --dport 80 -j ACCEPT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         08- [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -A INPUT  -i eth1 -s 192.168.1.0/24 -p tcp --dport 3128 -j ACCEPT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         09- [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -A OUTPUT -o eth1 -d 192.168.1.0/24 -p tcp --sport 3128 -j ACCEPT&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -nvL&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td style=&quot;width: 20px;&quot;&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;01-&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         04-&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         06-&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         08-&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         02-&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         03-&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         05-&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         07-&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         09-&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;                &lt;td style=&quot;color: rgb(255, 153, 102);&quot;&gt;Chain INPUT (policy DROP 0 packets, 0 bytes)&lt;br /&gt;        pkts bytes target     prot opt in     out     source               destination&lt;br /&gt;           0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0&lt;br /&gt;           0     0 ACCEPT     tcp  --  ppp0   *       0.0.0.0/0            0.0.0.0/0           tcp spt:80&lt;br /&gt;           0     0 ACCEPT     tcp  --  eth1   *       192.168.1.0/24       0.0.0.0/0           tcp dpt:3128&lt;br /&gt;          &lt;br /&gt;       Chain FORWARD (policy DROP 0 packets, 0 bytes)&lt;br /&gt;        pkts bytes target     prot opt in     out     source               destination&lt;br /&gt;          &lt;br /&gt;       Chain OUTPUT (policy DROP 0 packets, 0 bytes)&lt;br /&gt;        pkts bytes target     prot opt in     out     source               destination&lt;br /&gt;           0     0 ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0&lt;br /&gt;           0     0 ACCEPT     tcp  --  *      ppp0    0.0.0.0/0            0.0.0.0/0           tcp dpt:80&lt;br /&gt;           0     0 ACCEPT     tcp  --  *      eth1    0.0.0.0/0            192.168.1.0/24      tcp spt:3128&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       The nine commands which you typed above have been numbered along with their output so they can be easily identified in the second table.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Lines 01-03:&lt;/span&gt; The first three commands set the default (&lt;span style=&quot;font-family:monospace;&quot;&gt;-P&lt;/span&gt;) policy on all the chains to &lt;span style=&quot;font-family:monospace;&quot;&gt;DROP&lt;/span&gt; everything, unless suitable rules inside the chain will &lt;span style=&quot;font-family:monospace;&quot;&gt;ACCEPT&lt;/span&gt; them. This is the most secure method of filtering as any packet that is now to pass through any of the chains, must have a specific rule written for it.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Lines 04-05:&lt;/span&gt; These two commands have (&lt;span style=&quot;font-family:monospace;&quot;&gt;-A&lt;/span&gt;) appended two &lt;span style=&quot;font-family:monospace;&quot;&gt;ACCEPT&lt;/span&gt; rules. The &lt;span style=&quot;font-family:monospace;&quot;&gt;OUTPUT&lt;/span&gt; rule (05) allows any packet to (&lt;span style=&quot;font-family:monospace;&quot;&gt;-o&lt;/span&gt;) leave via the loopback device and the &lt;span style=&quot;font-family:monospace;&quot;&gt;INPUT&lt;/span&gt; rule (04) allows packets to re-enter (&lt;span style=&quot;font-family:monospace;&quot;&gt;-i&lt;/span&gt;) via the loopback.&lt;br /&gt;    &lt;br /&gt;       Because the chains are using a default &lt;span style=&quot;font-family:monospace;&quot;&gt;DROP&lt;/span&gt; policy, they restrict the server from accessing any of its own services running on the local host, like DNS. A basic rule like this allows the server to access all loopback services without restriction.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Lines 06-07:&lt;/span&gt; The next two (&lt;span style=&quot;font-family:monospace;&quot;&gt;-A&lt;/span&gt;) appended rules are more specific, lets look at the outbound one first. The &lt;span style=&quot;font-family:monospace;&quot;&gt;OUTPUT&lt;/span&gt; rule (07) specifies that any packet going out the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-o&lt;/span&gt;) ppp0 interface using (&lt;span style=&quot;font-family:monospace;&quot;&gt;-p&lt;/span&gt;) protocol &lt;span style=&quot;font-family:monospace;&quot;&gt;TCP&lt;/span&gt; is &lt;span style=&quot;font-family:monospace;&quot;&gt;ACCEPT&lt;/span&gt;ed if its going to &lt;span style=&quot;font-family:monospace;&quot;&gt;port 80&lt;/span&gt;. The &lt;span style=&quot;font-family:monospace;&quot;&gt;INPUT&lt;/span&gt; rule (06) specifies that any packet coming in the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-i&lt;/span&gt;) ppp0 interface using (&lt;span style=&quot;font-family:monospace;&quot;&gt;-p&lt;/span&gt;) protocol &lt;span style=&quot;font-family:monospace;&quot;&gt;TCP&lt;/span&gt; is &lt;span style=&quot;font-family:monospace;&quot;&gt;ACCEPT&lt;/span&gt;ed if its coming from &lt;span style=&quot;font-family:monospace;&quot;&gt;port 80&lt;/span&gt;.&lt;br /&gt;    &lt;br /&gt;       You should be able to pick this up, it says that we are allowed to access external web servers from our own server, but there are no forward rules for the internal network to surf the Internet. We should also allow our internal network the ability to access external web servers too shouldn&#39;t we? Let&#39;s look at the next rules then.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Lines 08-09:&lt;/span&gt; The last &lt;span style=&quot;font-family:monospace;&quot;&gt;INPUT&lt;/span&gt; rule (08) which has been (&lt;span style=&quot;font-family:monospace;&quot;&gt;-A&lt;/span&gt;) appended to the chain allows any packets from the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-s&lt;/span&gt;) source network of &lt;span style=&quot;font-family:monospace;&quot;&gt;192.168.1.0/24&lt;/span&gt; if they enter through the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-i&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;eth1&lt;/span&gt; device and if they are the &lt;span style=&quot;font-family:monospace;&quot;&gt;TCP&lt;/span&gt; (&lt;span style=&quot;font-family:monospace;&quot;&gt;-p&lt;/span&gt;) protocol and are going to the (&lt;span style=&quot;font-family:monospace;&quot;&gt;--dport&lt;/span&gt;) destination port of &lt;span style=&quot;font-family:monospace;&quot;&gt;3128&lt;/span&gt;.  The matching &lt;span style=&quot;font-family:monospace;&quot;&gt;OUTPUT&lt;/span&gt; rule (09) has been (&lt;span style=&quot;font-family:monospace;&quot;&gt;-A&lt;/span&gt;) appended to the chain and allows any packets that are going out (&lt;span style=&quot;font-family:monospace;&quot;&gt;-o&lt;/span&gt;) the &lt;span style=&quot;font-family:monospace;&quot;&gt;eth1&lt;/span&gt; interface to (&lt;span style=&quot;font-family:monospace;&quot;&gt;-d&lt;/span&gt;) destination network &lt;span style=&quot;font-family:monospace;&quot;&gt;192.168.1.0/24&lt;/span&gt; using the &lt;span style=&quot;font-family:monospace;&quot;&gt;TCP&lt;/span&gt; (&lt;span style=&quot;font-family:monospace;&quot;&gt;-p&lt;/span&gt;) protocol if it came from the (&lt;span style=&quot;font-family:monospace;&quot;&gt;--sport&lt;/span&gt;) source port of &lt;span style=&quot;font-family:monospace;&quot;&gt;3128&lt;/span&gt;.&lt;br /&gt;    &lt;br /&gt;       These two are fairly detailed rules, they say that anyone on the internal network (192.168.1.0/24) is allowed to send packets to the squid proxy server (3128) through the internal eth1 interface and the results can be returned to the workstation.&lt;br /&gt;    &lt;br /&gt;       If you use a strict &lt;span style=&quot;font-family:monospace;&quot;&gt;DROP&lt;/span&gt; policy like above, its important to note that you may need two rules that complement each other in order for data to flow out and back in again.&lt;br /&gt;    &lt;br /&gt;       &lt;h3&gt;A Walk Through&lt;/h3&gt;          To better understand the above filtering example, its best to walk the configuration through the same way a packet would be subject to the filtering table&#39;s definitions, one rule at a time. Remember, every packet of data has certain attributes, source/destination addresses, source/destination ports, the interfaces they are coming in and out and the type of protocol being used, the filtering will reject any packet whose attributes dont match any of the rules in our chains.&lt;br /&gt;    &lt;br /&gt;       A person using the workstation (in the network example below) wishes to access the resources of the web server located on the Internet, can a direct connection be established? No, all the policies are set to &lt;span style=&quot;font-family:monospace;&quot;&gt;DROP&lt;/span&gt; and there is no &lt;span style=&quot;font-family:monospace;&quot;&gt;FORWARD&lt;/span&gt; rules defined, so it simply can not occur.&lt;br /&gt;    &lt;br /&gt;       Can the proxy server access the web server on the Internet? Yes, the proxy server has the rights to access anything which is TCP based operating at port 80 out through the ppp0 link, which is to a web server. Can you see the &lt;span style=&quot;font-family:monospace;&quot;&gt;ACCEPT&lt;/span&gt; rules for the packet&#39;s attributes in the complementing &lt;span style=&quot;font-family:monospace;&quot;&gt;INPUT&lt;/span&gt; and &lt;span style=&quot;font-family:monospace;&quot;&gt;OUTPUT&lt;/span&gt; chains?&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-family:monospace;&quot;&gt;                                  &lt;/span&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;                            /-----------------------\&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          /-----------------\      |  Proxy Server (3128)  |      /---------------\&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          |   Workstation   |------|  eth1 : 192.168.1.1   |      |  Web Server   |&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          |   192.168.1.10  |      |  ppp0 : 123.123.123.2 |------| (TCP port 80) |&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          \-----------------/      |    lo : 127.0.0.1     |      \---------------/&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;                                   \-----------------------/&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;      The only way now for the workstation to access anything, is via the proxy server application running at port 3128, which in turn can access any web server resources on the Internet and return the requested information to the workstation. Are the required rules in the table?&lt;br /&gt;    &lt;br /&gt;       How does this work without any forwarding rules? Easy, the proxy server is an application that requests resources on behalf of a client, so the request comes into the proxy from the client, and now the request goes out to the web server from the proxy, as though it was requesting the information itself. This happens at the application layer, because its the proxy application which forwards the clients original request, so forwarding at the IP layer is not required here.&lt;br /&gt;    &lt;br /&gt;       Hopefully you have been able to pick up the filtering concepts mentioned above, if you have, well done. The proxy server situation was a little tricky, but was introduced to give you an understanding that particular packets and resources can still be shaped to suit your security requirements by incorporating them into your network design.&lt;br /&gt;    &lt;br /&gt;       Thats a brief introduction to packet filtering, the ability to write and chain together rules that selectively accept or deny any packets that do not meet the security requirements for your network.&lt;br /&gt;    &lt;br /&gt;       What happens to the filter table when you type these following commands? View the table&#39;s output after each one and see if you can recognise the effects of the rules, and which direction the packets can pass (i.e., are they going to an internal or external resource). View &quot;&lt;span style=&quot;font-weight: bold; font-family:monospace;&quot; &gt;man iptables&lt;/span&gt;&quot; for further assistance.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;[bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -I INPUT  2 -i ppp0 -p tcp --dport ftp -j ACCEPT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -I OUTPUT 2 -o ppp0 -p tcp --sport ftp -j ACCEPT&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -D INPUT  -i ppp0 -p tcp --sport 80 -j ACCEPT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -D OUTPUT -o ppp0 -p tcp --dport 80 -j ACCEPT&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -A INPUT  -p icmp --icmp-type any -j ACCEPT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -A OUTPUT -p icmp --icmp-type any -j ACCEPT&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -I INPUT  -m state --state INVALID -j LOG --log-prefix &quot;INVALID Input: &quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         [bash]# i&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;ptables -I INPUT  -m state --state INVALID -j DROP&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;iptables -F&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         [bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;/etc/init.d/iptables restart&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;h2&gt;&lt;a name=&quot;nat&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.brennan.id.au/06-Firewall_Concepts.html#top&quot;&gt;Network Address Translation&lt;/a&gt;&lt;br /&gt;       &lt;/h2&gt;          Network Address Translation (NAT) is the ability to change a data packets destination or source IP address on-the-fly, so the packet looks like it came from (or is going to) a different address than the original (also works on port numbers).&lt;br /&gt;    &lt;br /&gt;       There are many reasons why we should use NAT, here are a few:&lt;br /&gt;       &lt;ul&gt;&lt;li&gt;Frees the requirement to use large amounts of &#39;real&#39; IP addresses (cheaper),&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;Allows packets from a private (&lt;a href=&quot;http://www.ietf.org/rfc/rfc1918.txt&quot;&gt;RFC1918&lt;/a&gt;) network to be globally routed out to the Internet,&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;Allows packets on the Internet to be routed into a private (&lt;a href=&quot;http://www.ietf.org/rfc/rfc1918.txt&quot;&gt;RFC1918&lt;/a&gt;) network,&lt;/li&gt;&lt;li&gt;It masks the true amount of private workstations, as all external traffic appears to come from the one source,&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;It allows inbound traffic to be sent to different internal hosts (bastions) depending on the resources requested, and&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;It does not disclose any security details of the internal private network.&lt;/li&gt;&lt;/ul&gt;          The &lt;span style=&quot;font-family:monospace;&quot;&gt;iptables&lt;/span&gt; package also provides support for NAT and has a built-in &lt;span style=&quot;font-family:monospace;&quot;&gt;nat&lt;/span&gt; table just for that purpose. Below is a listing of the default chains that are found in the &lt;span style=&quot;font-family:monospace;&quot;&gt;nat&lt;/span&gt; table and an explanation of how they are applied.&lt;br /&gt;     &lt;br /&gt;        &lt;table style=&quot;width: 100%; text-align: left;&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr style=&quot;color: rgb(255, 153, 102);&quot;&gt;                &lt;td style=&quot;font-weight: bold; width: 150px;&quot;&gt;Table Name&lt;br /&gt;             &lt;/td&gt;                &lt;td style=&quot;font-weight: bold; width: 150px;&quot;&gt;Chain Name&lt;br /&gt;             &lt;/td&gt;                &lt;td style=&quot;font-weight: bold;&quot;&gt;Chain Details&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;              &lt;tr style=&quot;color: rgb(255, 153, 102);&quot;&gt;                &lt;td style=&quot;width: 150px; font-family: monospace;&quot; colspan=&quot;1&quot; rowspan=&quot;3&quot;&gt;nat&lt;br /&gt;             &lt;/td&gt;                &lt;td style=&quot;width: 150px; font-family: monospace;&quot;&gt;PREROUTING&lt;br /&gt;             &lt;/td&gt;                &lt;td&gt;For altering packets as they are entering the system (before filter INPUT)&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;              &lt;tr style=&quot;color: rgb(255, 153, 102);&quot;&gt;                &lt;td style=&quot;width: 150px; font-family: monospace;&quot;&gt;POSTROUTING&lt;br /&gt;             &lt;/td&gt;                &lt;td&gt;For altering packets as they are exiting the system (after filter OUTPUT)&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;              &lt;tr&gt;                &lt;td style=&quot;width: 150px; font-family: monospace; color: rgb(255, 153, 102);&quot;&gt;OUTPUT&lt;br /&gt;             &lt;/td&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;For altering  packets before leaving the local system (before the routing table)&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       As the naming suggests, the &lt;span style=&quot;font-family:monospace;&quot;&gt;PREROUTING&lt;/span&gt; and &lt;span style=&quot;font-family:monospace;&quot;&gt;POSTROUTING&lt;/span&gt; chains are applied before or after any kernel routing decisions are made, so the packets can then be routed to match any new changes which have been made to the destination or source addresses.&lt;br /&gt;    &lt;br /&gt;       To list the contents of the &lt;span style=&quot;font-family:monospace;&quot;&gt;nat&lt;/span&gt; table, issue the following command at the prompt.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; color: rgb(255, 153, 102);font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;[bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -t nat -nvL&lt;/span&gt; &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;h2&gt;&lt;a name=&quot;snat&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.brennan.id.au/06-Firewall_Concepts.html#top&quot;&gt;Source NAT&lt;/a&gt;&lt;br /&gt;       &lt;/h2&gt;          Source NAT deals with changing the source address of any packets that pass through the NAT device, assuming they meet the criteria of the specified policies and chains. This allows workstations on a private network to send data packets through the NAT device which changes the source address in the packet&#39;s header before sending the packet onto the Internet. When the packet reaches its destination and is processed, the distant host returns the packet using the adjusted address as the new destination address, and delivers it back to the NAT device. The NAT device stores a list in memory of all the packets it adjusts, so when they are returned, the packets can be redirected to the real originator of the packets on the internal private network.&lt;br /&gt;    &lt;br /&gt;       Source NAT can be written for inbound and outbound packets, but are more commonly used for outbound.&lt;br /&gt;    &lt;br /&gt;       For a packet to be subject to SNAT, lets consider the following details:&lt;br /&gt;       &lt;ul&gt;&lt;li&gt;The packet has meet at least one rule in all three &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; chains (&lt;span style=&quot;font-family:monospace;&quot;&gt;INPUT, FORWARD, OUTPUT&lt;/span&gt;),&lt;/li&gt;&lt;li&gt;The packet has been checked against the kernel routing table, and a decision on where to route has been made,&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;As the packet leaves the NAT device, the source address is changed to the NATs external IP address,&lt;/li&gt;&lt;li&gt;The NAT device remembers the real owner of the packet.&lt;br /&gt;         &lt;/li&gt;&lt;/ul&gt;          It all sounds rather confusing, so lets go straight to an example. Type the following rules at the command prompt and then display the contents of the &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; and &lt;span style=&quot;font-family:monospace;&quot;&gt;nat&lt;/span&gt; tables with the last command (typed as one line).&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; color: rgb(255, 153, 102);font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;01- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -P INPUT ACCEPT&lt;/span&gt;&lt;br /&gt;       02- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -P FORWARD DROP&lt;/span&gt;&lt;br /&gt;       03- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -P OUTPUT ACCEPT&lt;/span&gt;&lt;br /&gt;       04- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -A FORWARD -i eth1 -o ppp0 -s 192.168.1.0/24 -p tcp --dport 80 -j ACCEPT&lt;/span&gt;&lt;br /&gt;       05- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -A FORWARD -i ppp0 -o eth1 -d 192.168.1.0/24 -p tcp --sport 80 -j ACCEPT&lt;/span&gt;&lt;br /&gt;       06- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.1.0/24 -j SNAT --to-source 123.123.123.2&lt;/span&gt;&lt;br /&gt;       07- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;/span&gt;&lt;br /&gt;          &lt;br /&gt;       [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -nvL ; iptables -t nat -nvL&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td style=&quot;color: rgb(255, 153, 102);&quot;&gt;01-&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;       02-&lt;br /&gt;          &lt;br /&gt;       04-&lt;br /&gt;       05-&lt;br /&gt;          &lt;br /&gt;       03-&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;       06-&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;             &lt;/td&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;Chain INPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain FORWARD (policy DROP 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;             0     0 ACCEPT     tcp  --  eth1   ppp0    192.168.1.0/24       0.0.0.0/0           tcp dpt:80&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;             0     0 ACCEPT     tcp  --  ppp0   eth1    0.0.0.0/0            192.168.1.0/24      tcp spt:80&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;             0     0 SNAT       all  --  *      ppp0    192.168.1.0/24       0.0.0.0/0           to:123.123.123.2&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Lines 01-03:&lt;/span&gt; The first three commands have now defined the global policies for the three built-in chains for the &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; table.&lt;br /&gt;    &lt;br /&gt;       To keep the example a little easier to understand, we are going to accept everything that is classed as &lt;span style=&quot;font-family:monospace;&quot;&gt;INPUT&lt;/span&gt; or &lt;span style=&quot;font-family:monospace;&quot;&gt;OUTPUT&lt;/span&gt;, and for security we are dropping anything trying to pass through (&lt;span style=&quot;font-family:monospace;&quot;&gt;FORWARD&lt;/span&gt;) the NAT unless we allow it.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Lines 04-05:&lt;/span&gt; The two forward rules are quite specific. Rule 04 says that any packet that comes in (&lt;span style=&quot;font-family:monospace;&quot;&gt;-i&lt;/span&gt;) the &lt;span style=&quot;font-family:monospace;&quot;&gt;eth1&lt;/span&gt; interface and goes (&lt;span style=&quot;font-family:monospace;&quot;&gt;-o&lt;/span&gt;) out the &lt;span style=&quot;font-family:monospace;&quot;&gt;ppp0&lt;/span&gt; device from the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-s&lt;/span&gt;) source network of &lt;span style=&quot;font-family:monospace;&quot;&gt;192.168.1.0/24&lt;/span&gt; can be &lt;span style=&quot;font-family:monospace;&quot;&gt;ACCEPT&lt;/span&gt;ed if its going to (&lt;span style=&quot;font-family:monospace;&quot;&gt;--dport&lt;/span&gt;) destination port &lt;span style=&quot;font-family:monospace;&quot;&gt;80&lt;/span&gt;; a web server. Rule 05 is the matching rule allowing the packet to return back through the NAT.&lt;br /&gt;    &lt;br /&gt;       We don&#39;t have any &lt;span style=&quot;font-family:monospace;&quot;&gt;INPUT&lt;/span&gt; or &lt;span style=&quot;font-family:monospace;&quot;&gt;OUTPUT&lt;/span&gt; restrictions here, so we only need to write and match rules that allow packets to pass through (&lt;span style=&quot;font-family:monospace;&quot;&gt;FORWARD&lt;/span&gt;) the NAT. In the diagram below, when a HTTP(80) request comes from the private network, it is allowed to pass through the NAT and continue to the web server out on the Internet. But what are the packet&#39;s attributes? Its source address is still 192.168.1.x, so when it reaches its destination, the web server does not know where it came from because its a private non-routable &lt;a href=&quot;http://www.ietf.org/rfc/rfc1918.txt&quot;&gt;RFC1918&lt;/a&gt; IP address, so the server will probably just drop it. No packets will ever be returned.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-family:monospace;&quot;&gt;                                  &lt;/span&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;                            /-----------------------\&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          /-----------------\      |  NAT Gateway Device   |      /---------------\&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          | Private Network |------|  eth1 : 192.168.1.1   |      |  Web Server   |&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          | 192.168.1.0/24  |      |  ppp0 : 123.123.123.2 |------| (TCP port 80) |&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;          \-----------------/      \-----------------------/      \---------------/&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;         Line 06:&lt;/span&gt; This rule is our solution to the above problem. This rule is applied after the routing decisions have been made and the packet is about to depart for the web server out on the Internet. It says, any packet that goes (&lt;span style=&quot;font-family:monospace;&quot;&gt;-o&lt;/span&gt;) out the &lt;span style=&quot;font-family:monospace;&quot;&gt;ppp0&lt;/span&gt; interface from the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-s&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;192.168.1.0/24&lt;/span&gt; network is to have the source address rewritten as &lt;span style=&quot;font-family:monospace;&quot;&gt;123.123.123.2&lt;/span&gt;.&lt;br /&gt;    &lt;br /&gt;       Now when the packet reaches the Internet web server, it can be processed normally and returned to &lt;span style=&quot;font-family:monospace;&quot;&gt;123.123.123.2&lt;/span&gt; (the NAT device), where it will automatically be rewritten again and sent back to the original workstation on the internal private network.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Line 07:&lt;/span&gt; This command tells the kernel that it is allowed to forward packets between any of its network devices. These packets are still subject to the iptables rulesets.&lt;br /&gt;    &lt;br /&gt;       Some important points about SNAT to remember are:&lt;br /&gt;       &lt;ul&gt;&lt;li&gt;SNAT is used in the &lt;span style=&quot;font-family:monospace;&quot;&gt;POSTROUTING&lt;/span&gt; chain after the kernel routing decisions have been made,&lt;/li&gt;&lt;li&gt;Forwarding rules need to be suitable to allow packets in both directions,&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;The &quot;&lt;span style=&quot;font-family:monospace;&quot;&gt;--to-source&lt;/span&gt;&quot; address should be the external IP address which will be visible on the packets return, and&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;SNAT should not be used for dynamic links where the IP address is likely to change (see masquerading, next).&lt;/li&gt;&lt;/ul&gt;       &lt;br /&gt;       &lt;h2&gt;&lt;a name=&quot;masquerading&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.brennan.id.au/06-Firewall_Concepts.html#top&quot;&gt;IP Masquerading&lt;/a&gt;&lt;br /&gt;       &lt;/h2&gt;          Put simply, masquerading is a form of SNAT which should be used for all dynamic interfaces where the IP address is likely to be different each time we connect. This is perfect for our dynamic IP broadband accounts, and saves having to rewrite large SNAT rules each time we connect to the Internet. SNAT remembers connection state information (to a degree) if a static connection was to drop, however using masquerading the connection state information is reset each time the interface is (de)activated. Masquerading automates SNAT for dynamic IP connections.&lt;br /&gt;    &lt;br /&gt;       Because masquerading is so easy (true) we are going to use some state tracking attributes in our rules. Type the following rules at the command prompt and display a listing of the &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; and &lt;span style=&quot;font-family:monospace;&quot;&gt;nat&lt;/span&gt; tables.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; color: rgb(255, 153, 102);font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;01- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -P INPUT ACCEPT&lt;/span&gt;&lt;br /&gt;       02- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -P FORWARD DROP&lt;/span&gt;&lt;br /&gt;       03- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -P OUTPUT ACCEPT&lt;/span&gt;&lt;br /&gt;       04- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -A FORWARD -i ppp0 -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;/span&gt;&lt;br /&gt;       05- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -A FORWARD -i eth1 -o ppp0 -s 192.168.1.0/24 -j ACCEPT&lt;/span&gt;&lt;br /&gt;       06- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.1.0/24 -j MASQUERADE&lt;/span&gt;&lt;br /&gt;       07- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;/span&gt;&lt;br /&gt;          &lt;br /&gt;       [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -nvL ; iptables -t nat -nvL&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;01-&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         02-&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         04-&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         05-&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         03-&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         06-&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;           &lt;br /&gt;             &lt;/td&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;Chain INPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain FORWARD (policy DROP 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;             0     0 ACCEPT     all  --  ppp0   *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;             0     0 ACCEPT     tcp  --  eth1   ppp0    192.168.1.0/24       0.0.0.0/0&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;             0     0 MASQUERADE all  --  *      ppp0    192.168.1.0/24       0.0.0.0/0&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;           &lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Lines 01-03:&lt;/span&gt; The first three commands have now defined the global policies for the three built-in chains for the &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; table.&lt;br /&gt;    &lt;br /&gt;       To keep the example a little easier to understand, we are going to accept everything that is classed as &lt;span style=&quot;font-family:monospace;&quot;&gt;INPUT&lt;/span&gt; or &lt;span style=&quot;font-family:monospace;&quot;&gt;OUTPUT&lt;/span&gt;, and for security we are dropping anything trying to pass through (&lt;span style=&quot;font-family:monospace;&quot;&gt;FORWARD&lt;/span&gt;) the NAT unless we explicitly allow it.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Line 04:&lt;/span&gt; Rule 04 deals with the connection state and says, any packet that comes in the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-i&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;ppp0&lt;/span&gt; interface must (&lt;span style=&quot;font-family:monospace;&quot;&gt;-m&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;match&lt;/span&gt; a certain &lt;span style=&quot;font-family:monospace;&quot;&gt;state&lt;/span&gt;, and the &lt;span style=&quot;font-family:monospace;&quot;&gt;state&lt;/span&gt; must ensure the packet is in response to an already &lt;span style=&quot;font-family:monospace;&quot;&gt;RELATED&lt;/span&gt; or &lt;span style=&quot;font-family:monospace;&quot;&gt;ESTABLISHED&lt;/span&gt; connection.&lt;br /&gt;    &lt;br /&gt;       Basically only allow packets to be forwarded into the private network if the packet is in response to an already &lt;span style=&quot;font-family:monospace;&quot;&gt;RELATED&lt;/span&gt; or &lt;span style=&quot;font-family:monospace;&quot;&gt;ESTABLISH&lt;/span&gt; connection. This rule will not allow any &lt;span style=&quot;font-family:monospace;&quot;&gt;NEW&lt;/span&gt; connections to be initiated from the external network a connection must already exist&lt;span style=&quot;font-family:monospace;&quot;&gt;&lt;/span&gt;ed, so any packet coming inside will be in response to a current connection that could have only be initiated from the internal network.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Line 05:&lt;/span&gt; This is a simple rule that will forward any packets from the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-i&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;eth1&lt;/span&gt; interface and out the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-o&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;ppp0&lt;/span&gt; interface if they are from the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-s&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;192.168.1.0/24&lt;/span&gt; source network.&lt;br /&gt;    &lt;br /&gt;       This is rule does not detail any connection state so it will allow all connection types, but most important is the &lt;span style=&quot;font-family:monospace;&quot;&gt;NEW&lt;/span&gt; connection state that it can pass. This rule allows internal workstations to create new connections, and matches rule 4 which allow the packets to return.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Line 06:&lt;/span&gt; This rule does the exact same as if it were a &lt;span style=&quot;font-family:monospace;&quot;&gt;SNAT&lt;/span&gt; rule, however being a &lt;span style=&quot;font-family:monospace;&quot;&gt;MASQUERADE&lt;/span&gt; rule means it will use the IP address that is currently assigned to the &lt;span style=&quot;font-family:monospace;&quot;&gt;ppp0&lt;/span&gt; interface when the packet passes through the NAT device.&lt;br /&gt;    &lt;br /&gt;       Any packets that now pass from the internal private network out into the Internet will have its source address rewritten as the external IP address of the NAT device.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Line 07:&lt;/span&gt; This command tells the kernel that it is allowed to forward packets between any of its network devices. These packets are still subject to the iptables rulesets.&lt;br /&gt;    &lt;br /&gt;       Remember, masquerading should always be used for dynamic IP connections.&lt;br /&gt;    &lt;br /&gt;       &lt;h3&gt;Dangerous Masquerading Rule&lt;/h3&gt;          Beware of this rule, it is too relaxed and does not specify which direction the packets should be masqueraded. In fact, this rule allows masquerading in BOTH directions. Always specify an (&lt;span style=&quot;font-family:monospace;&quot;&gt;-o&lt;/span&gt;) out interface parameter to make the rule work in one direction only.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; color: rgb(255, 153, 102);font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;[bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -t nat -A POSTROUTING -j MASQUERADE&lt;/span&gt; &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;table style=&quot;width: 100%; text-align: left;&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td style=&quot;vertical-align: middle; text-align: center; width: 52px;&quot;&gt;&lt;img style=&quot;width: 24px; height: 24px;&quot; alt=&quot;Warning !!&quot; src=&quot;http://www.brennan.id.au/images/warning.gif&quot; /&gt;&lt;/td&gt;                &lt;td&gt;WARNING: The above rule is dangerous, it allows masquerading in both directions.&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;h2&gt;&lt;a name=&quot;dnat&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.brennan.id.au/06-Firewall_Concepts.html#top&quot;&gt;Destination NAT&lt;/a&gt;&lt;/h2&gt;          Destination NAT deals with changing the destination address of any packets before they are subjected to any routing decisions. This allows specific traffic to be rewritten so it suits a particular rule and can then be redirected depending on the global policies and destinations required.&lt;br /&gt;    &lt;br /&gt;       In its most typical application, DNAT is normally used to change incoming packets that are destined for a particular service or host, and it rewrites the destination addresses so the packets can pass to a different host located inside the private network, normally a DMZ.&lt;br /&gt;    &lt;br /&gt;       When DNAT occurs, the original host (which is located external of the private network) is not aware the packets have been redirected and that the returning data is from a different server. It should be transparent to the originator.&lt;br /&gt;    &lt;br /&gt;       The following commands can be typed at the command prompt, and the &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; and &lt;span style=&quot;font-family:monospace;&quot;&gt;nat&lt;/span&gt; tables displayed using the last command.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; color: rgb(255, 153, 102);font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;01- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -P INPUT ACCEPT&lt;/span&gt;&lt;br /&gt;       02- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -P FORWARD DROP&lt;/span&gt;&lt;br /&gt;       03- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -P OUTPUT ACCEPT&lt;/span&gt;&lt;br /&gt;       04- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -A FORWARD -i eth1 -o ppp0 -s 192.168.1.0/24 -j ACCEPT&lt;/span&gt;&lt;br /&gt;       05- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -A FORWARD -i ppp0 -o eth1 -p tcp --dport 80 -j ACCEPT&lt;/span&gt;&lt;br /&gt;       06- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.2:80&lt;/span&gt;&lt;br /&gt;       07- [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;/span&gt;&lt;br /&gt;          &lt;br /&gt;       [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -nvL ; iptables -t nat -nvL&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;table face=&quot;monospace&quot; style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; &quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td style=&quot;color: rgb(255, 153, 102);&quot;&gt;01-&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;       02-&lt;br /&gt;          &lt;br /&gt;       04-&lt;br /&gt;       05-&lt;br /&gt;          &lt;br /&gt;       03-&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;       06-&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;             &lt;/td&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;Chain INPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain FORWARD (policy DROP 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;             0     0 ACCEPT     all  --  eth1   ppp0    192.168.1.0/24       0.0.0.0/0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;             0     0 ACCEPT     tcp  --  ppp0   eth1    0.0.0.0/0            192.168.1.0/24      tcp dpt:80&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;             0     0 DNAT       tcp  --  ppp0   *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80 to:192.168.1.2:80&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;         Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;          pkts bytes target     prot opt in     out     source               destination&lt;/span&gt;&lt;br /&gt;           &lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Lines 01-03:&lt;/span&gt; The first three commands have now defined the global policies for the three built-in chains for the &lt;span style=&quot;font-family:monospace;&quot;&gt;filter&lt;/span&gt; table.&lt;br /&gt;    &lt;br /&gt;       To keep the example a little easier to understand, we are going to accept everything that is classed as &lt;span style=&quot;font-family:monospace;&quot;&gt;INPUT&lt;/span&gt; or &lt;span style=&quot;font-family:monospace;&quot;&gt;OUTPUT&lt;/span&gt;, and for security we are dropping anything trying to pass through the NAT unless we allow it.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Line 04-05:&lt;/span&gt; The first &lt;span style=&quot;font-family:monospace;&quot;&gt;FORWARD&lt;/span&gt; rule (04) allows any packets coming in the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-i&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;eth1&lt;/span&gt; interface and out the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-o&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;ppp0&lt;/span&gt; interface if they have come from the internal (&lt;span style=&quot;font-family:monospace;&quot;&gt;-s&lt;/span&gt;) source &lt;span style=&quot;font-family:monospace;&quot;&gt;192.168.1.0/24&lt;/span&gt; network. The second &lt;span style=&quot;font-family:monospace;&quot;&gt;FORWARD&lt;/span&gt; rule (05) allows any packets coming in the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-i&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;ppp0&lt;/span&gt; interface and out the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-o&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;eth1&lt;/span&gt; interface that are using the &lt;span style=&quot;font-family:monospace;&quot;&gt;TCP&lt;/span&gt; (&lt;span style=&quot;font-family:monospace;&quot;&gt;-p&lt;/span&gt;) protocol if they are going to (&lt;span style=&quot;font-family:monospace;&quot;&gt;--dport&lt;/span&gt;) destination port &lt;span style=&quot;font-family:monospace;&quot;&gt;80&lt;/span&gt;.&lt;br /&gt;    &lt;br /&gt;       These two rules complement each other, the first allows outgoing packets to be forwarded from the internal network and the second rule allows incoming packets to be forwarded into the private network but only if they are going to a web server (port 80).&lt;br /&gt;    &lt;br /&gt;       Is this going to work? Well lets look at the incoming packet&#39;s attributes with the following diagram. The remote host that originally sent the data requested a web page URL of &quot;http://www.example.com&quot; which resolved to the IP address of 123.123.123.2 and the packet was sent on its way. When it arrives at the NAT device, the destination address is still 123.123.123.2 so it must be handled by that IP address or rejected. But the web server is inside the network, what do we do?&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-family:monospace;&quot;&gt;                                  &lt;/span&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;                            &lt;/span&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;                                /-----------------------\&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;      /---------------------\      |  Server (Routing)     |      /-----------------\&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;      | Internal Web Server |------|  eth1 : 192.168.1.1   |      | Remote Computer |&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;      |   192.168.1.2(80)   |      |  ppp0 : 123.123.123.2 |------| (Internet Zone) |&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;      \---------------------/      \-----------------------/      \-----------------/&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;       This is where DNAT is able to change the destination address of the incoming packet, and put the new address in its place (&lt;span style=&quot;font-family:monospace;&quot;&gt;192.168.1.2(80)&lt;/span&gt;). Because DNAT is &lt;span style=&quot;font-family:monospace;&quot;&gt;PREROUTING&lt;/span&gt;, the packet is now subjected to the kernel routing table which points the new packet to the internal network. Lastly, there must exist a rule in the &lt;span style=&quot;font-family:monospace;&quot;&gt;FORWARD&lt;/span&gt; chain which will allow the packet to pass through, and there is, rule 05.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Line 06:&lt;/span&gt; This is a &lt;span style=&quot;font-family:monospace;&quot;&gt;PREROUTING&lt;/span&gt; rule in the &lt;span style=&quot;font-family:monospace;&quot;&gt;nat&lt;/span&gt; table, if any packets come in through the (&lt;span style=&quot;font-family:monospace;&quot;&gt;-i&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;ppp0&lt;/span&gt; interface and are (&lt;span style=&quot;font-family:monospace;&quot;&gt;-p&lt;/span&gt;) &lt;span style=&quot;font-family:monospace;&quot;&gt;TCP&lt;/span&gt; packets going to (&lt;span style=&quot;font-family:monospace;&quot;&gt;--dport&lt;/span&gt;) destination of port &lt;span style=&quot;font-family:monospace;&quot;&gt;80&lt;/span&gt;, then they are to be rewritten and sent to the host &lt;span style=&quot;font-family:monospace;&quot;&gt;192.168.1.2:80&lt;/span&gt; instead.&lt;br /&gt;    &lt;br /&gt;       &lt;span style=&quot;font-weight: bold;&quot;&gt;Line 07:&lt;/span&gt; This command tells the kernel that it is allowed to forward packets between any of its network devices. These packets are still subject to the iptables rulesets.&lt;br /&gt;    &lt;br /&gt;       DNAT declarations are reasonably easy because the destination header can be rewritten before the routing table is queried. Some important points to remember are:&lt;br /&gt;    &lt;br /&gt;       &lt;ul&gt;&lt;li&gt;DNAT can rewrite packets as they enter the Firewall (before routing),&lt;/li&gt;&lt;li&gt;If the new destination host is hacked, the Firewall host is not affected,&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;Do not DNAT a packet to another system that will DNAT it back (routing loops),&lt;/li&gt;&lt;li&gt;The &quot;--to-destination&quot; address does not have to be on the internal network, and&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;DNAT can also be used internally to protect vital systems from nasty employees.&lt;br /&gt;         &lt;/li&gt;&lt;/ul&gt;       &lt;br /&gt;       &lt;h2&gt;&lt;a name=&quot;examplescript&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.brennan.id.au/06-Firewall_Concepts.html#top&quot;&gt;Example Firewall Script&lt;/a&gt;&lt;/h2&gt;          The following is an example firewall script which uses all of the concepts covered already in this chapter. It should therefore be relatively easy to understand, implement and maintain.&lt;br /&gt;    &lt;br /&gt;       The firewall script is designed to separate and secure the private network (eth1) from the Internet traffic (ppp0), while providing some flexibility for the internal network which is being masqueraded.&lt;br /&gt;    &lt;br /&gt;       &lt;table face=&quot;monospace&quot; style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; &quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;             &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;[bash]# &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;vi /root/firewall.sh&lt;/span&gt;&lt;/td&gt;           &lt;/tr&gt;           &lt;tr style=&quot;color: rgb(255, 153, 102);&quot;&gt;                &lt;td&gt;#!/bin/sh&lt;br /&gt;       #&lt;br /&gt;       #       Example Firewall Script&lt;br /&gt;          &lt;br /&gt;       ###############################################################&lt;br /&gt;       ### Define interfaces here&lt;br /&gt;     EXT_DEV=ppp0&lt;br /&gt;       INT_DEV=eth1&lt;br /&gt;       INT_NET=192.168.1.0/24&lt;br /&gt;          &lt;br /&gt;       ### Loading firewall modules&lt;br /&gt;       modprobe ip_conntrack&lt;br /&gt;       modprobe ip_conntrack_ftp&lt;br /&gt;          &lt;br /&gt;       ###############################################################&lt;br /&gt;       ### Enable Packet Forwarding&lt;br /&gt;       echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;          &lt;br /&gt;       ### Remove all previous rules, and delete any user defined chains&lt;br /&gt;       iptables -F&lt;br /&gt;       iptables -X&lt;br /&gt;       iptables -t nat -F&lt;br /&gt;        iptables -t nat -X&lt;br /&gt;          &lt;br /&gt;       ### Set the default policies to drop&lt;br /&gt;       iptables -P INPUT   DROP&lt;br /&gt;       iptables -P OUTPUT  DROP&lt;br /&gt;       iptables -P FORWARD DROP&lt;br /&gt;          &lt;br /&gt;       ### Loopback device OK&lt;br /&gt;      iptables -A INPUT  -i lo -s 127.0.0.0/8 -d 127.0.0.0/8 -j ACCEPT&lt;br /&gt;      iptables -A OUTPUT -o lo -s 127.0.0.0/8 -d 127.0.0.0/8 -j ACCEPT&lt;br /&gt;         &lt;br /&gt;       ### Allow all ICMP Traffic (optional) - IN, OUT and THROUGH.&lt;br /&gt;      iptables -A INPUT   -p icmp --icmp-type any -j ACCEPT&lt;br /&gt;       iptables -A OUTPUT  -p icmp --icmp-type any -j ACCEPT&lt;br /&gt;      iptables -A FORWARD -p icmp --icmp-type any -j ACCEPT&lt;br /&gt;         &lt;br /&gt;      ### Allow all Internal traffic to Server&lt;br /&gt;       iptables -A INPUT  -i $INT_DEV -s $INT_NET -d $INT_NET -j ACCEPT&lt;br /&gt;       iptables -A OUTPUT -o $INT_DEV -s $INT_NET -d $INT_NET -j ACCEPT&lt;br /&gt;          &lt;br /&gt;       ###############################################################&lt;br /&gt;       ### OUTBOUND Rule: Allow ALL packets out the external device&lt;br /&gt;       iptables -A OUTPUT  -o $EXT_DEV -j ACCEPT&lt;br /&gt;       iptables -A FORWARD -i $INT_DEV -o $EXT_DEV -j ACCEPT&lt;br /&gt;          &lt;br /&gt;       ###############################################################&lt;br /&gt;       ### MASQUERADING: All packets from the internal network will&lt;br /&gt;       ### appear as if they had originated from the firewall.&lt;br /&gt;       iptables -t nat -A POSTROUTING -o $EXT_DEV -s $INT_NET -j MASQUERADE&lt;br /&gt;          &lt;br /&gt;       ###############################################################&lt;br /&gt;       ### INBOUND Rule: Allow ALL EXT packets if a connection already exists (See &quot;NEW&quot; Inbound Rules)&lt;br /&gt;       iptables -A INPUT   -i $EXT_DEV -m state --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;      iptables -A FORWARD -i $EXT_DEV -m state --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;          &lt;br /&gt;  &lt;br /&gt;#&lt;br /&gt;       ### INBOUND Rules: Allow ONLY NEW packets on these ports.&lt;br /&gt;  #&lt;br /&gt;     &lt;br /&gt;       # New INBOUND Connection: FTP (with TLS)&lt;br /&gt;  iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 20  -j ACCEPT&lt;br /&gt;  iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 21  -j ACCEPT&lt;br /&gt;     &lt;br /&gt;       # New INBOUND Connection: Secure Shell&lt;br /&gt;  iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 22  -j ACCEPT&lt;br /&gt;     &lt;br /&gt;       # New INBOUND Connection: SMTP and SMTPS (over TLS/SSL)&lt;br /&gt;  iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 25  -j ACCEPT&lt;br /&gt;  iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 465 -j ACCEPT&lt;br /&gt;     &lt;br /&gt;       # New INBOUND Connection: HTTP (Plain and SSL)&lt;br /&gt;  iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 80  -j ACCEPT&lt;br /&gt;      iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 443 -j ACCEPT&lt;br /&gt;     &lt;br /&gt;       # New INBOUND Connection: LDAPS Server (over SSL)&lt;br /&gt;  iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 636 -j ACCEPT&lt;br /&gt;     &lt;br /&gt;  # New INBOUND Connection: IMAPS Email Clients (over SSL)&lt;br /&gt;  iptables -A INPUT -i $EXT_DEV -m state --state NEW -m tcp -p tcp --syn --dport 993 -j ACCEPT&lt;br /&gt;  &lt;br /&gt;###&lt;br /&gt;#    Squid Transparent Proxy: Enable rule for transparent proxy redirection&lt;br /&gt;# Redirect all WWW (port 80) OUTBOUNT packets to the Squid Server on port 3128&lt;br /&gt;#iptables -t nat -A PREROUTING -i $INT_DEV -s $INT_NET -p tcp --dport 80  -j REDIRECT --to-port 3128&lt;br /&gt;     &lt;br /&gt;  &lt;br /&gt;  #&lt;br /&gt;       ### INBOUND DNAT (redirection) Rules: Allow ONLY NEW packets on these ports and redirect to internal services.&lt;br /&gt;  #&lt;br /&gt;     &lt;br /&gt;       ### INBOUND Rule: Redirect ALL packets to the INTERNAL workstation - HTTP&lt;br /&gt;       #iptables -t nat -A PREROUTING -i $EXT_DEV -p tcp --dport 80 -j DNAT --to-destination wkstn1.example.com:80&lt;br /&gt;       #iptables -A FORWARD -i $EXT_DEV -o $INT_DEV -p tcp --dport 80 -j ACCEPT&lt;br /&gt;          &lt;br /&gt;       ### INBOUND Rule: Redirect ALL packets to the INTERNAL workstation - HTTPS&lt;br /&gt;       #iptables -t nat -A PREROUTING -i $EXT_DEV -p tcp --dport 443 -j DNAT --to-destination wkstn1.example.com:443&lt;br /&gt;       #iptables -A FORWARD -i $EXT_DEV -o $INT_DEV -p tcp --dport 443 -j ACCEPT&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       After the firewall script has been executed and the new firewall rules are active, the iptable settings can be saved so they are automatically implemented when the firewall is next started.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left;  color: rgb(255, 153, 102);font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;[bash]# &lt;span style=&quot;font-weight: bold; color: rgb(255, 153, 102);&quot;&gt;sh /root/firewall.sh&lt;/span&gt;&lt;br /&gt;    [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;/etc/init.d/iptables save&lt;/span&gt; &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       You should now restart the iptables service and see if the tables and chains are the same.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left;  color: rgb(255, 153, 102);font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;[bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;/etc/init.d/iptables restart&lt;/span&gt;&lt;br /&gt;       [bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;iptables -nvL ; iptables -t nat -nvL&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       If you intend to use the initscripts to automatically start the iptables service, then any firewall modules that are needed will have to be manually added to the init script.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left;  color: rgb(255, 153, 102);font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;[bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;vi /etc/init.d/iptables&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       &lt;table style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left; font-family: monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;&lt;span style=&quot;color: rgb(255, 153, 102);&quot;&gt;IPTABLES_MODULES=&quot;ip_conntrack ip_conntrack_ftp&quot;&lt;/span&gt;&lt;br /&gt;             &lt;/td&gt;              &lt;/tr&gt;                                       &lt;/tbody&gt; &lt;/table&gt;       &lt;br /&gt;       You can check to see if the modules loaded automatically by listing all of modules currently being used by the kernel.&lt;br /&gt;    &lt;br /&gt;       &lt;table  style=&quot;width: 100%; background-color: rgb(220, 220, 220); text-align: left;  color: rgb(255, 153, 102);font-family:monospace;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;&gt;            &lt;tbody&gt;              &lt;tr&gt;                &lt;td&gt;[bash]# &lt;span style=&quot;font-weight: bold;&quot;&gt;lsmod&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/2461672423459438710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4653711704745711900/posts/default/2461672423459438710'/><link rel='alternate' type='text/html' href='http://greendark-team.blogspot.com/2011/09/firewall-concepts.html' title='Firewall Concepts'/><author><name>ibrahim debeche</name><uri>http://www.blogger.com/profile/11602313676658021992</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyl_hwyiHsWtq4SdcNVYGKrXibqv4JsuG-xoUSpnIgkkAVfYChse7MBC_EMurXjm-lS9HXp1sMY_o2_AOzOzzq2AkJBbiUCN9UTSKiB_NY4S_46CWDeJYp_3NgP_SwUM/s130/images.jpg'/></author></entry></feed>