2323import os
2424import requests
2525import smtplib
26- import subprocess
2726import time
2827from signal import signal , alarm , SIGALRM
28+ from installer import upgradeFiles
2929
3030today = datetime .date .today ()
3131
@@ -226,84 +226,6 @@ def eyewitness(filename):
226226 print ("\a " )
227227
228228
229- def upgradeFiles ():
230- binpath = os .path .join (script_path , "bin" )
231- old_wd = os .getcwd ()
232- if not os .path .exists (binpath ):
233- os .makedirs (binpath )
234- else :
235- print ("Removing old bin directory: {}" .format (binpath ))
236- os .system ("rm -rf {}" .format (binpath ))
237- os .makedirs (binpath )
238- print ("Changing into domained home: {}" .format (script_path ))
239- os .chdir (script_path )
240- unameChk = str (subprocess .check_output (["uname" , "-am" ]))
241- if "kali" not in unameChk :
242- print ("\n \033 [1;31mKali Linux Recommended!\033 [1;37m" )
243- time .sleep (1 )
244- sublist3rUpgrade = (
245- "git clone https://github.com/aboul3la/Sublist3r.git ./bin/Sublist3r"
246- )
247- print ("\n \033 [1;31mInstalling Sublist3r \033 [1;37m" )
248- os .system (sublist3rUpgrade )
249- subInstallReq = "pip install -r bin/Sublist3r/requirements.txt"
250- os .system (subInstallReq )
251- print ("Sublist3r Installed\n " )
252- eyeWitnessUpgrade = "git clone https://github.com/FortyNorthSecurity/EyeWitness.git ./bin/EyeWitness"
253- print ("\n \033 [1;31mInstalling EyeWitness \033 [1;37m" + eyeWitnessUpgrade )
254- os .system (eyeWitnessUpgrade )
255- eyeInstallReq = "bash bin/EyeWitness/setup/setup.sh"
256- print ("\n \033 [1;31mRunning Command: \033 [1;37m" )
257- os .system (eyeInstallReq )
258- cpphantomjs = "cp phantomjs ./bin/EyeWitness/bin/"
259- os .system (cpphantomjs )
260- movephantomjs = "mv phantomjs bin/"
261- os .system (movephantomjs )
262- print ("\n EyeWitness Installed\n " )
263- enumallUpgrade = "git clone https://github.com/jhaddix/domain.git ./bin/domain"
264- print ("\n \033 [1;31mInstalling Enumall \033 [1;37m" )
265- print ("\n enumall Installed\n " )
266- os .system (enumallUpgrade )
267- knockpyUpgrade = "git clone https://github.com/guelfoweb/knock.git ./bin/knockpy"
268- print ("\n \033 [1;31mInstalling Knock \033 [1;37m" )
269- os .system (knockpyUpgrade )
270- print ("\n Knockpy Installed\n " )
271- sublstUpgrade = "git clone https://gist.github.com/jhaddix/86a06c5dc309d08580a018c66354a056 ./bin/sublst"
272- print ("\n \033 [1;31mCopying JHaddix All Domain List: \033 [1;37m" )
273- print ("\n JHaddix All Domain List Installed\n " )
274- os .system (sublstUpgrade )
275- SLsublstUpgrade = "wget -O ./bin/sublst/sl-domains.txt https://raw.githubusercontent.com/danielmiessler/SecLists/master/Discovery/DNS/sortedcombined-knock-dnsrecon-fierce-reconng.txt"
276- print ("\n \033 [1;31mCopying SecList Domain List \033 [1;37m" )
277- print ("\n SecList Domain List Installed\n " )
278- os .system (SLsublstUpgrade )
279- subbruteUpgrade = "git clone https://github.com/TheRook/subbrute.git ./bin/subbrute"
280- print ("\n \033 [1;31mInstalling Subbrute \033 [1;37m" )
281- os .system (subbruteUpgrade )
282- print ("\n Subbrute Installed\n " )
283- amassUpgrade = "go get -u github.com/OWASP/Amass/..."
284- print ("\n \033 [1;31mInstalling Amass \033 [1;37m" )
285- os .system (amassUpgrade )
286- subfinderUpgrade = "go get -u github.com/subfinder/subfinder"
287- print ("\n \033 [1;31mInstalling Subfinder \033 [1;37m" )
288- os .system (subfinderUpgrade )
289- massdnsUpgrade = "git clone --branch v0.2 --single-branch https://github.com/blechschmidt/massdns ./bin/massdns"
290- print ("\n \033 [1;31mInstalling massdns \033 [1;37m" )
291- os .system (massdnsUpgrade )
292- massdnsMake = "make -C ./bin/massdns"
293- os .system (massdnsMake )
294- print ("\n Massdns Installed\n " )
295- os .system ("cp ./bin/subbrute/resolvers.txt ./" )
296- if "kali" in unameChk :
297- reconNGInstall = "apt-get install recon-ng"
298- print ("\n \033 [1;31mInstalling Recon-ng \033 [1;37m" )
299- os .system (reconNGInstall )
300- print ("\n Recon-ng Installed\n " )
301- else :
302- print ("Please install Recon-ng - https://bitbucket.org/LaNMaSteR53/" )
303- print ("\n \033 [1;31mAll tools installed \033 [1;37m" )
304- print ("Changing back to old working directory: {}" .format (old_wd ))
305- os .chdir (old_wd )
306-
307229
308230def writeFiles (name ):
309231 """Writes info of all hosts from subhosts
@@ -329,10 +251,10 @@ def writeFiles(name):
329251 f .writelines ("\n \n " + name )
330252 for hosts in SubHosts :
331253 hosts = "" .join (hosts )
332- f .writelines ("\n " + hosts )
333- subdomainCounter += 1
334- os .remove (fileName )
335- print ("\n %s Subdomains discovered by %s" % (subdomainCounter , name ))
254+ f1 .writelines ("\n " + hosts )
255+ subdomainCounter = subdomainCounter + 1
256+ os .remove (massdnsFileName )
257+ print ("\n {} Subdomains discovered by massdns" . format (subdomainCounter ))
336258 except :
337259 print ("\n Error Opening %s File!\n " % name )
338260 return subdomainCounter
@@ -453,9 +375,7 @@ def options():
453375 os .system ("rm -r output" )
454376 newpath = r"output"
455377 os .makedirs (newpath )
456- if install :
457- upgradeFiles ()
458- elif upgrade :
378+ if install or upgrade :
459379 upgradeFiles ()
460380 else :
461381 if domain :
0 commit comments