|
| 1 | +--- |
| 2 | +title: "Angularjs CSTI Scanner" |
| 3 | +category: "scanner" |
| 4 | +type: "Repository" |
| 5 | +state: "in progress" |
| 6 | +usecase: "Find AngularJS websites vulnerable to template injections" |
| 7 | +--- |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +AngularJS Client-Side Template Injection Scanner (acstis) is a open source scanner for |
| 12 | +finding possible template injection vulnerabilities on websites using AngularJS. |
| 13 | + |
| 14 | +For more information visit the projects github site <https://github.com/tijme/angularjs-csti-scanner> |
| 15 | + |
| 16 | +## Deployment |
| 17 | + |
| 18 | +The gitleaks scanner can be deployed with helm: |
| 19 | + |
| 20 | +```bash |
| 21 | +helm upgrade --install acstis secureCodeBox/acstis |
| 22 | +``` |
| 23 | + |
| 24 | +## Scanner configuration |
| 25 | + |
| 26 | +The only mandatory parameter is: |
| 27 | +- `-d`: The url to scan (e.g. https://angularjs.org/). |
| 28 | + |
| 29 | +Optional arguments: |
| 30 | + |
| 31 | +```bash |
| 32 | +-c, --crawl use the crawler to scan all the entire domain |
| 33 | +-vp, --verify-payload use a javascript engine to verify if the payload was executed (otherwise false positives may occur) |
| 34 | +-av ANGULAR_VERSION, --angular-version ANGULAR_VERSION manually pass the angular version (e.g. 1.4.2) if the automatic check doesn't work |
| 35 | +-vrl VULNERABLE_REQUESTS_LOG, --vulnerable-requests-log VULNERABLE_REQUESTS_LOG log all vulnerable requests to this file (e.g. /var/logs/acstis.log or urls.log) |
| 36 | +-siv, --stop-if-vulnerable (crawler option) stop scanning if a vulnerability was found |
| 37 | +-pmm, --protocol-must-match (crawler option) only scan pages with the same protocol as the startpoint (e.g. only https) |
| 38 | +-sos, --scan-other-subdomains (crawler option) also scan pages that have another subdomain than the startpoint |
| 39 | +-soh, --scan-other-hostnames (crawler option) also scan pages that have another hostname than the startpoint |
| 40 | +-sot, --scan-other-tlds (crawler option) also scan pages that have another tld than the startpoint |
| 41 | +-md MAX_DEPTH, --max-depth MAX_DEPTH (crawler option) the maximum search depth (default is unlimited) |
| 42 | +-mt MAX_THREADS, --max-threads MAX_THREADS (crawler option) the maximum amount of simultaneous threads to use (default is 20) |
| 43 | +-iic, --ignore-invalid-certificates (crawler option) ignore invalid ssl certificates |
| 44 | +``` |
| 45 | +
|
| 46 | +**Do not** override the option `-vrl` or `--vulnerable-requests-log`. It is already configured for automatic findings parsing. |
| 47 | +
|
| 48 | +### Request configuration |
| 49 | +
|
| 50 | +Because *acstis* does not provide provide command line arguments for configuring the sent requests, |
| 51 | +you have to mount a config map into the scan container on a specific location. Your additional config map should be |
| 52 | + mounted to `/acstis/config/acstis-config.py`. For example create a config map: |
| 53 | +
|
| 54 | + ```bash |
| 55 | +kubectl create configmap --from-file /path/to/my/acstis-config.py acstis-config |
| 56 | +``` |
| 57 | +
|
| 58 | + And mount it into the container: |
| 59 | +
|
| 60 | + ```yaml |
| 61 | + volumes: |
| 62 | + - name: "acstis-config" |
| 63 | + configMap: |
| 64 | + name: "acstis-config" |
| 65 | + volumeMounts: |
| 66 | + - name: "acstis-config" |
| 67 | + mountPath: "/acstis/config/" |
| 68 | +``` |
| 69 | +
|
| 70 | +#### Configuration options in *acstis-config.py* |
| 71 | +
|
| 72 | +Add the following snippets to the *acstis-config.py* file to enable further options. |
| 73 | +The options are python code which will be injected into the *acstis* script before execution. |
| 74 | +
|
| 75 | +**Basic Authentication** |
| 76 | +```text |
| 77 | +options.identity.auth = HTTPBasicAuth("username", "password") |
| 78 | +``` |
| 79 | +
|
| 80 | +**Cookies** |
| 81 | +```text |
| 82 | +options.identity.cookies.set(name='tasty_cookie', value='yum', domain='finnwea.com', path='/cookies') |
| 83 | +options.identity.cookies.set(name='gross_cookie', value='blech', domain='finnwea.com', path='/elsewhere') |
| 84 | +``` |
| 85 | +
|
| 86 | +**Headers** |
| 87 | +```text |
| 88 | +options.identity.headers.update({ |
| 89 | + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", |
| 90 | + "Authorization": "Bearer ey3jafoe.2jefo..." |
| 91 | +}) |
| 92 | +``` |
| 93 | +
|
| 94 | +**Proxies** |
| 95 | +```text |
| 96 | +options.identity.proxies = { |
| 97 | + # No authentication |
| 98 | + # 'http': 'http://host:port', |
| 99 | + # 'https': 'http://host:port', |
| 100 | +
|
| 101 | + # Basic authentication |
| 102 | + # 'http': 'http://user:pass@host:port', |
| 103 | + # 'https': 'https://user:pass@host:port', |
| 104 | +
|
| 105 | + # SOCKS |
| 106 | + 'http': 'socks5://user:pass@host:port', |
| 107 | + 'https': 'socks5://user:pass@host:port' |
| 108 | +} |
| 109 | +``` |
| 110 | +
|
| 111 | +**Scope options** |
| 112 | +```text |
| 113 | +options.scope.protocol_must_match = False |
| 114 | +
|
| 115 | +options.scope.subdomain_must_match = True |
| 116 | +
|
| 117 | +options.scope.hostname_must_match = True |
| 118 | +
|
| 119 | +options.scope.tld_must_match = True |
| 120 | +
|
| 121 | +options.scope.max_depth = None |
| 122 | +
|
| 123 | +options.scope.request_methods = [ |
| 124 | + Request.METHOD_GET, |
| 125 | + Request.METHOD_POST, |
| 126 | + Request.METHOD_PUT, |
| 127 | + Request.METHOD_DELETE, |
| 128 | + Request.METHOD_OPTIONS, |
| 129 | + Request.METHOD_HEAD |
| 130 | +] |
| 131 | +``` |
| 132 | +
|
| 133 | +## Chart Configuration |
| 134 | +
|
| 135 | +| Key | Type | Default | Description | |
| 136 | +|-----|------|---------|-------------| |
| 137 | +| image.repository | string | `"docker.io/securecodebox/scanner-acstis"` | Container Image to run the scan | |
| 138 | +| image.tag | string | `nil` | defaults to the charts version | |
| 139 | +| parseJob.ttlSecondsAfterFinished | string | `nil` | seconds after which the kubernetes job for the parser will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ | |
| 140 | +| parserImage.repository | string | `"docker.io/securecodebox/parser-acstis"` | Parser image repository | |
| 141 | +| parserImage.tag | string | defaults to the charts version | Parser image tag | |
| 142 | +| scannerJob.env | list | `[]` | Optional environment variables mapped into each scanJob (see: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/) | |
| 143 | +| scannerJob.extraContainers | list | `[]` | Optional additional Containers started with each scanJob (see: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) | |
| 144 | +| scannerJob.extraVolumeMounts | list | `[]` | Optional VolumeMounts mapped into each scanJob (see: https://kubernetes.io/docs/concepts/storage/volumes/) | |
| 145 | +| scannerJob.extraVolumes | list | `[]` | Optional Volumes mapped into each scanJob (see: https://kubernetes.io/docs/concepts/storage/volumes/) | |
| 146 | +| scannerJob.resources | object | `{}` | CPU/memory resource requests/limits (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/, https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/) | |
| 147 | +| scannerJob.securityContext | object | `{}` | Optional securityContext set on scanner container (see: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) | |
| 148 | +| scannerJob.ttlSecondsAfterFinished | string | `nil` | seconds after which the kubernetes job for the scanner will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ | |
| 149 | +
|
0 commit comments