<?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>webstersprodigy.net &#187; nikto</title>
	<atom:link href="http://webstersprodigy.net/tag/nikto/feed/" rel="self" type="application/rss+xml" />
	<link>http://webstersprodigy.net</link>
	<description>Me trying to learn how to use a computer</description>
	<lastBuildDate>Sat, 04 Feb 2012 01:17:01 +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>Nessus with Nikto &#8211; Running out of memory</title>
		<link>http://webstersprodigy.net/2009/12/nessus-with-nikto-running-out-of-memory/</link>
		<comments>http://webstersprodigy.net/2009/12/nessus-with-nikto-running-out-of-memory/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 22:38:51 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[GrayHat]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[nikto]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=645</guid>
		<description><![CDATA[Kind of an annoying problem, but sometimes nikto runs out of control. This is made worse by nessus, which can have a lot of nikto instances running at once.]]></description>
			<content:encoded><![CDATA[<p>Kind of an annoying problem, but sometimes nikto runs out of control. This is made worse by nessus, which can have a lot of nikto instances running at once.</p>
<blockquote><p>
Dec 29 13:03:10 mopey-macky kernel: [72355.838027] Free swap  = 0kB<br />
Dec 29 13:03:10 mopey-macky kernel: [72355.838031] Total swap = 5855684kB<br />
Dec 29 13:03:10 mopey-macky kernel: [72355.866431] 1048576 pages RAM<br />
Dec 29 13:03:10 mopey-macky kernel: [72355.866436] 38328 pages reserved<br />
Dec 29 13:03:10 mopey-macky kernel: [72355.866440] 9361 pages shared<br />
Dec 29 13:03:10 mopey-macky kernel: [72355.866444] 1000493 pages non-shared<br />
Dec 29 13:03:10 mopey-macky kernel: [72355.866451] Out of memory: kill process 6730 (run-mozilla.sh) score 665297 or a child<br />
Dec 29 13:03:10 mopey-macky kernel: [72355.866556] Killed process 6734 (thunderbird-bin)
</p></blockquote>
<p>Yes, that was fun, randomly killed processes because I&#8217;m out of memory. some instances of nikto were taking 2gb of memoy and spidering infinitely over these dynamic pages.</p>
<p>To fix, I added a stupid watchdog script.</p>
<pre class="brush: python; title: ; notranslate">
#!/usr/bin/python

import subprocess
import time

#percent of memory the nikto is taking
MAXMEMPERCENT = 13
#time is in hours
MAXTIME = 1
#time in seconds to check
SLEEPYTIME = 60
lfile=open(&quot;./nikto_wd.log&quot;, &quot;a&quot;)

while 1:
  p1 = subprocess.Popen([&quot;ps&quot;, &quot;aux&quot;], stdout=subprocess.PIPE)
  p2 = subprocess.Popen([&quot;grep&quot;, &quot;nikto&quot;], stdin=p1.stdout, stdout=subprocess.PIPE)
  output = p2.communicate()[0].split(&quot;\n&quot;)

  for line in output:
    #print line
    thisline = line.split()
    try:
      if (&quot;/usr/bin/perl&quot; in thisline[10] and thisline[3] != &quot;&quot; and thisline[9] != &quot;&quot;):
        memusage =  float(thisline[3])
        hours = int(thisline[9][0])
        #process needs to be killed
        if int(hours) &gt; MAXTIME or float(memusage) &gt; MAXMEMPERCENT:
          print &quot;die, zombie scum&quot;, thisline
          lfile.write(&quot;die, zombie scum &quot; + str(thisline) + &quot;\n&quot;)
          subprocess.call([&quot;kill&quot;, thisline[1]])
    except IndexError:
      pass
  lfile.flush()
  time.sleep(SLEEPYTIME)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/12/nessus-with-nikto-running-out-of-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

