mirror of
https://github.com/codingo/Interlace.git
synced 2026-02-01 05:04:47 +01:00
Merge pull request #40 from codingo/proxy-feature
Added in proxy feature
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
__version__ = '1.3.5'
|
||||
__version__ = '1.4.0'
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ from os import access, W_OK
|
||||
import sys
|
||||
from re import compile
|
||||
from random import sample
|
||||
from math import ceil
|
||||
|
||||
|
||||
class InputHelper(object):
|
||||
@@ -67,11 +68,28 @@ class InputHelper(object):
|
||||
test = list()
|
||||
|
||||
if not variable in sample(commands, 1)[0]:
|
||||
return commands
|
||||
return commands
|
||||
|
||||
for replacement in replacements:
|
||||
for command in commands:
|
||||
test.append(str(command).replace(variable, str(replacement)))
|
||||
test.append(str(command).replace(variable, str(replacement)))
|
||||
|
||||
tmp_commands.update(test)
|
||||
return tmp_commands
|
||||
|
||||
@staticmethod
|
||||
def _replace_variable_array(commands, variable, replacement):
|
||||
tmp_commands = set()
|
||||
counter = 0
|
||||
|
||||
test = list()
|
||||
|
||||
if not variable in sample(commands, 1)[0]:
|
||||
return commands
|
||||
|
||||
for command in commands:
|
||||
test.append(str(command).replace(variable, str(replacement[counter])))
|
||||
counter += 1
|
||||
|
||||
tmp_commands.update(test)
|
||||
return tmp_commands
|
||||
@@ -124,7 +142,7 @@ class InputHelper(object):
|
||||
targetFile = sys.stdin
|
||||
for target in targetFile:
|
||||
if target.strip():
|
||||
ranges.add(target.strip())
|
||||
ranges.add(target.strip())
|
||||
|
||||
# process exclusions first
|
||||
if arguments.exclusions:
|
||||
@@ -207,6 +225,18 @@ class InputHelper(object):
|
||||
else:
|
||||
protocols = arguments.proto
|
||||
final_commands = InputHelper._replace_variable_for_commands(final_commands, "_proto_", protocols)
|
||||
|
||||
# process proxies
|
||||
if arguments.proxy_list:
|
||||
proxy_list = list()
|
||||
for proxy in arguments.proxy_list:
|
||||
if proxy.strip():
|
||||
proxy_list.append(proxy.strip())
|
||||
|
||||
if len(proxy_list) < len(final_commands):
|
||||
proxy_list = ceil(len(final_commands) / len(proxy_list)) * proxy_list
|
||||
|
||||
final_commands = InputHelper._replace_variable_array(final_commands, "_proxy_", proxy_list)
|
||||
|
||||
return final_commands
|
||||
|
||||
@@ -272,6 +302,13 @@ class InputParser(object):
|
||||
type=lambda x: InputHelper.check_positive(parser, x)
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-pL', dest='proxy_list', required=False,
|
||||
help='Specify a list of proxies.',
|
||||
metavar="FILE",
|
||||
type=lambda x: InputHelper.readable_file(parser, x)
|
||||
)
|
||||
|
||||
commands = parser.add_mutually_exclusive_group(required=True)
|
||||
commands.add_argument(
|
||||
'-c', dest='command',
|
||||
|
||||
@@ -12,14 +12,14 @@ class OutputHelper(object):
|
||||
|
||||
self.verbose = arguments.verbose
|
||||
self.silent = arguments.silent
|
||||
self.seperator = "=============================================="
|
||||
self.seperator = "================================================================================="
|
||||
|
||||
def print_banner(self):
|
||||
if self.silent:
|
||||
return
|
||||
|
||||
print(self.seperator)
|
||||
print("Interlace v%s\tby Michael Skelton (@codingo_)" % __version__)
|
||||
print("Interlace v%s\tby Michael Skelton (@codingo_) & Sajeeb Lohani (@sml555_)" % __version__)
|
||||
print(self.seperator)
|
||||
|
||||
def terminal(self, level, target, command, message=""):
|
||||
|
||||
20
README.md
20
README.md
@@ -29,6 +29,7 @@ Dependencies will then be installed and Interlace will be added to your path as
|
||||
| -cL | Specify a list of commands to execute over each target or domain |
|
||||
| -o | Specify an output folder variable that can be used in commands as \_output\_ |
|
||||
| -p | Specify a list of port variable that can be used in commands as \_port\_. This can be a single port, a comma delimited list, or use dash notation |
|
||||
| -pL | Specify a list of proxies |
|
||||
| --proto | Specify protocols that can be used in commands as \_proto\_ |
|
||||
| -rp | Specify a real port variable that can be used in commands as \_realport\_ |
|
||||
| --no-cidr | If set then CIDR notation in a target file will not be automatically be expanded into individual hosts |
|
||||
@@ -72,9 +73,9 @@ You could use interlace to run over any number of targets within this file using
|
||||
bash
|
||||
```
|
||||
➜ /tmp interlace -tL ./targets.txt -threads 5 -c "nikto --host _target_ > ./_target_-nikto.txt" -v
|
||||
==============================================
|
||||
Interlace v1.0 by Michael Skelton (@codingo_)
|
||||
==============================================
|
||||
=========================================================================
|
||||
Interlace v1.0 by Michael Skelton (@codingo_) & Sajeeb Lohani (@sml555_)
|
||||
=========================================================================
|
||||
[14:33:23] [THREAD] [nikto --host hackerone.com > ./hackerone.com-nikto.txt] Added to Queue
|
||||
[14:33:23] [THREAD] [nikto --host bugcrowd.com > ./bugcrowd.com-nikto.txt] Added to Queue
|
||||
```
|
||||
@@ -87,9 +88,9 @@ Using the above example, let's assume you want independent scans to be run for b
|
||||
|
||||
```
|
||||
➜ /tmp interlace -tL ./targets.txt -threads 5 -c "nikto --host _target_:_port_ > ./_target_-_port_-nikto.txt" -p 80,443 -v
|
||||
==============================================
|
||||
Interlace v1.0 by Michael Skelton (@codingo_)
|
||||
==============================================
|
||||
=========================================================================
|
||||
Interlace v1.0 by Michael Skelton (@codingo_) & Sajeeb Lohani (@sml555_)
|
||||
=========================================================================
|
||||
[14:33:23] [THREAD] [nikto --host hackerone.com:80 > ./hackerone.com-nikto.txt] Added to Queue
|
||||
[14:33:23] [THREAD] [nikto --host bugcrowd.com:80 > ./hackerone.com-nikto.txt] Added to Queue
|
||||
[14:33:23] [THREAD] [nikto --host bugcrowd.com:443 > ./bugcrowd.com-nikto.txt] Added to Queue
|
||||
@@ -163,6 +164,13 @@ To run a virtual host scan against every target within `192.168.12.0/24` despire
|
||||
interlace -t 192.168.12.0/24 -e 192.168.12.0/26 -c "vhostscan _target_ -oN _output_/_target_-vhosts.txt" -o ~/scans/ -threads 50
|
||||
```
|
||||
|
||||
## Run Nikto Using Multiple Proxies
|
||||
Using the above example, let's assume you want independent scans to be via different proxies for the same targets. You would then use the following:
|
||||
|
||||
```
|
||||
➜ /tmp interlace -tL ./targets.txt -pL ./proxies.txt -threads 5 -c "nikto --host _target_:_port_ -useproxy _proxy_ > ./_target_-_port_-nikto.txt" -p 80,443 -v
|
||||
```
|
||||
|
||||
|
||||
|
||||
# Authors and Thanks
|
||||
|
||||
Reference in New Issue
Block a user