Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

db checks and new nessus_vulns_cleaner

  • Loading branch information...
commit 89ef2ef0613c057a5b33d30dfb27a1f30a2e64a3 1 parent 0da5f79
m-1-k-3 authored
View
8 scripts/resource/auto_brute.rc
@@ -38,6 +38,14 @@ else
verbose = 0
end
+# Test and see if we have a database connected
+begin
+ framework.db.hosts
+rescue ::ActiveRecord::ConnectionNotEstablished
+ print_error("Database connection isn't established")
+ return
+end
+
def jobwaiting(maxjobs,verbose) #thread handling for poor guys
while(framework.jobs.keys.length >= maxjobs)
::IO.select(nil, nil, nil, 2.5)
View
8 scripts/resource/auto_cred_checker.rc
@@ -14,6 +14,14 @@ else
verbose = 0
end
+# Test and see if we have a database connected
+begin
+ framework.db.hosts
+rescue ::ActiveRecord::ConnectionNotEstablished
+ print_error("Database connection isn't established")
+ return
+end
+
def jobwaiting(verbose)
maxjobs=15 #throtteling if we get too much jobs
while(framework.jobs.keys.length >= maxjobs)
View
8 scripts/resource/auto_pass_the_hash.rc
@@ -32,6 +32,14 @@ else
verbose = 0
end
+# Test and see if we have a database connected
+begin
+ framework.db.hosts
+rescue ::ActiveRecord::ConnectionNotEstablished
+ print_error("Database connection isn't established")
+ return
+end
+
def infos(serv,creds,host)
print_line("")
print_line("====================================")
View
8 scripts/resource/autocrawler.rc
@@ -15,6 +15,14 @@ end
threadspercrawler = "4" #check this ... now its default
+# Test and see if we have a database connected
+begin
+ framework.db.hosts
+rescue ::ActiveRecord::ConnectionNotEstablished
+ print_error("Database connection isn't established")
+ return
+end
+
def jobwaiting() #thread handling for poor guys ...
maxjobs=15 #throttling if we get too much jobs
while(framework.jobs.keys.length >= maxjobs)
View
8 scripts/resource/basic_discovery.rc
@@ -45,6 +45,14 @@ else
nmap = 0
end
+# Test and see if we have a database connected
+begin
+ framework.db.hosts
+rescue ::ActiveRecord::ConnectionNotEstablished
+ print_error("Database connection isn't established")
+ return
+end
+
def jobwaiting(maxjobs,verbose) #thread handling for poor guys
while(framework.jobs.keys.length >= maxjobs)
::IO.select(nil, nil, nil, 2.5)
View
44 scripts/resource/nessus_vulns_cleaner.rc
@@ -0,0 +1,44 @@
+# nessus_cleaner.rc
+# Author: m-1-k-3 (Web: http://www.s3cur1ty.de / Twitter: @s3cur1ty_de)
+#
+# after importing the nesssus results, typically we have lots of mess in our vuln database
+# cause we dont use the vuln infos which just have a Nessus ID (NSS) we could clean them out
+# of our database
+
+<ruby>
+# having a counter is nice
+count = 0
+
+#we look in the global datastore for a global VERBOSE option and use it
+if (framework.datastore['VERBOSE'] == "true")
+ verbose = 1
+else
+ verbose = 0
+end
+
+# Test and see if we have a database connected
+begin
+ framework.db.hosts
+rescue ::ActiveRecord::ConnectionNotEstablished
+ print_error("Database connection isn't established")
+ return
+end
+
+
+if (framework.db.workspace.vulns.size > 0)
+ print_line("starting with #{framework.db.workspace.vulns.size} vulnerabilities")
+end
+
+framework.db.workspace.vulns.each do |vuln|
+ next if (vuln.refs.to_s !~ /NSS/)
+ next if (vuln.refs.size > 1)
+ if (verbose == 1)
+ print_line("#{vuln.refs.to_s}")
+ print_line("deleting Nessus stuff ...")
+ end
+ vuln.destroy
+ count = count +1
+end
+print_line("cleaned out #{count} vulnerabilities, results with #{framework.db.workspace.vulns.size} vulnerabilities")
+</ruby>
+
View
20 scripts/resource/port_cleaner.rc
@@ -4,17 +4,25 @@
# This Metasploit RC-File could be used to clean up your metasploit database from closed ports
<ruby>
+# Test and see if we have a database connected
+begin
+ framework.db.hosts
+rescue ::ActiveRecord::ConnectionNotEstablished
+ print_error("Database connection isn't established")
+ return
+end
+
counter = 0
framework.db.hosts.each do |host|
host.services.each do |serv|
next if not serv.host
- if (serv.state != ServiceState::Open)
- print_line("cleaning closed services (Port: #{serv.port.to_i} / Host: #{host.address})")
- run_single("services -d -p #{serv.port.to_i} -r #{serv.proto} #{host.address}")
+ if (serv.state != ServiceState::Open)
+ print_line("cleaning closed services (Port: #{serv.port.to_i} / Host: #{host.address})")
+ run_single("services -d -p #{serv.port.to_i} -r #{serv.proto} #{host.address}")
counter = counter + 1
- next
- end
- end
+ next
+ end
+ end
end
print_line("")
print_line("cleaned #{counter} closed ports")
View
8 scripts/resource/portscan.rc
@@ -41,6 +41,14 @@ else
nmap = 0
end
+# Test and see if we have a database connected
+begin
+ framework.db.hosts
+rescue ::ActiveRecord::ConnectionNotEstablished
+ print_error("Database connection isn't established")
+ return
+end
+
print_line("")
print_line("starting portscanners ...")
print_line("")
View
6 scripts/resource/wmap_autotest.rc
@@ -16,7 +16,7 @@ else
#define a file in our .msf4 directory which we use for our webaudits
profile = framework.datastore['WMAP_PROFILE']
end
-print_line("Profile: #{profile}")
+
#default to 50 Threads
if (framework.datastore['THREADS'] == nil)
run_single("setg THREADS 50")
@@ -24,11 +24,7 @@ end
#we look in the global datastore for a global VERBOSE option and use it
if (framework.datastore['VERBOSE'] == "true")
-<<<<<<< HEAD
verbose = 1
-=======
- verbose = 1
->>>>>>> 1a364df37e9e9302f22cdc857fd0a99cea174481
else
verbose = 0
end
Please sign in to comment.
Something went wrong with that request. Please try again.