stevemcilwain / quiver

Quiver is the tool to manage all of your tools for bug bounty hunting and penetration testing.
MIT License
206 stars 38 forks source link

Bug: qq-vars-set-output + qq-log-set #25

Closed fullstackpotato closed 4 years ago

fullstackpotato commented 4 years ago

Behavior Setting a location to create scaffolding (qq-vars-set-output) and then setting a log file (qq-log-set) will cause the qq-vars-set-output to loop within itself and set multiple folders for the __OUTPUT variable. (Example console output can be found at the bottom for readability)

Workaround: Don't run output before setting the log.

Proposed Solution: Within qq-log-set prevent the running of qq-vars-set-output if it's already set. Or add the logbook creation within the output function.

Function Suggestion: Would it be possible for qq-vars-set-output to create the top folder if it does not exist? For example if I wanted to create the folder "test" for the engagement, create this and then create the subfolders. e.g. /data/engagement/test and then sub folders within.

Currently if the folder doesn't not exist, the function will attempt to create the folders in /:

➜  test qq-vars-set-output
OUTPUT: 
mkdir: cannot create directory ‘/burp’: Permission denied
mkdir: cannot create directory ‘/target’: Permission denied
mkdir: cannot create directory ‘/domains’: Permission denied
mkdir: cannot create directory ‘/networks’: Permission denied
mkdir: cannot create directory ‘/recon’: Permission denied
mkdir: cannot create directory ‘/hosts’: Permission denied
mkdir: cannot create directory ‘/files’: Permission denied
mkdir: cannot create directory ‘/notes’: Permission denied

Example output of the bug:

➜  engagement cd test                                                                                                                                                                                                                                                                                                      
➜  test pwd                                                                                                                                                                                                                                                                                                                
/data/engagement/test                                                  
➜  test ll
total 8
drwxrwxrwx 1 root root    0 Mar 22 20:57 .
drwxrwxrwx 1 root root 8192 Mar 22 20:57 ..
➜  test qq-vars-set-output
OUTPUT: /data/engagement/test
➜  test qq-log-set                                 
OUTPUT: /data/engagement/test
mkdir: cannot create directory ‘burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n’: No such file or directory
mkdir: cannot create directory ‘burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n’: No such file or directory
mkdir: cannot create directory ‘burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n’: No such file or directory
mkdir: cannot create directory ‘burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n’: No such file or directory
mkdir: cannot create directory ‘burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n’: No such file or directory
mkdir: cannot create directory ‘burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n’: No such file or directory
mkdir: cannot create directory ‘burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n’: No such file or directory
mkdir: cannot create directory ‘burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n’: No such file or directory
mkdir: cannot create directory ‘burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n’: No such file or directory
touch: cannot touch 'burp'$'\n''data'$'\n''domains'$'\n''files'$'\n''hosts'$'\n''networks'$'\n''notes'$'\n''recon'$'\n''target'$'\n''/data/engagement/test/logbook.md': No such file or directory
qq-log-set:11: no such file or directory: burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n/data/engagement/test/logbook.md
qq-log-set:12: no such file or directory: burp\ndata\ndomains\nfiles\nhosts\nnetworks\nnotes\nrecon\ntarget\n/data/engagement/test/logbook.md
[+] burp
data
domains
files
hosts
networks
notes
recon
target
/data/engagement/test/logbook.md created.
➜  test qq-vars           
 __OUTPUT: burp
data
domains
files
hosts
networks
notes
recon
target
/data/engagement/test
 __IFACE: 
 __DOMAIN: 
 __NETWORK: 
 __RHOST: 
 __LHOST: 
 __URL: 
 __WORDLIST: 
 __PASSLIST: 
➜  test ls     
burp  data  domains  files  hosts  networks  notes  recon  target
➜  test ql "test"
[!] Log file not set or not found 
stevemcilwain commented 4 years ago

Fixed and enhanced