Created
May 18, 2017 21:41
-
-
Save omarkurt/c538d5fd4bf277fd97a71d73c0ae2bff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pipeline/tasks/base_task' | |
require 'pipeline/util' | |
require 'nokogiri' | |
class Pipeline::AltDNSScanner < Pipeline::BaseTask | |
Pipeline::Tasks.add self | |
include Pipeline::Util | |
def initialize(trigger, tracker) | |
super(trigger, tracker) | |
@name = 'AltDNSScanner' | |
@description = "AltDNS Subdomain scanner" | |
@stage = :code | |
@labels << "code" << "python" << "rails" | |
end | |
def run | |
Dir.chdir '/home/app/tools/altdns' | |
@results_file = Tempfile.new(['altdnsresult', '.txt']) | |
# ./altdns.py -i subdomains.txt -o data_output -w words.txt -r -s results_output.txt | |
runsystem(true,'python', 'altdns.py', '-i', 'subdomains.txt', '-o', 'data_output', '-w', 'words.txt', '-r', '-s', "#{@results_file.path}") | |
@result = File.open("#{@results_file.path}").read | |
end | |
def analyze | |
begin | |
@result.each_line do |line| | |
description = "Subdomain detected Detected" | |
uri = line | |
namelink = null | |
bug_type = 'website issue' | |
severity = "High " | |
location = "" | |
line = "" | |
code = "" | |
user_input = "" | |
advisory = "" | |
solution = "" | |
cvss_score = "" | |
file = "" | |
source = {:scanner => @name, :file => file, :line => line, :code => code} | |
fprint = fingerprint("#{description}#{uri}#{namelink}") | |
report bug_type,description,source,severity,fprint,line,location,user_input, advisory,solution,cvss_score | |
end | |
rescue Exception =>e | |
Pipeline.warn e.message | |
Pipeline.warn e.backtrace | |
end | |
ensure | |
FileUtils.rm @results_file | |
end | |
def supported? | |
cmd = `/home/app/tools/altdns/altdns.py -v` | |
return cmd.to_s.include?("altdns.py") ? true: false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@omarkurt i tried adding AltDNSScanner tool to Jackhammer but i don't think its working. Can you help me how to integrate this tool and the steps.