2023-03-09 12:27:18 +00:00
id : js-analyse
2023-03-13 18:58:46 +00:00
2023-03-09 12:27:18 +00:00
info :
2023-03-13 18:58:46 +00:00
name : JS Analyse
2023-03-09 12:27:18 +00:00
author : ayadim
2023-03-10 12:22:06 +00:00
severity : info
description : |
This process involves extracting tokens, endpoints, URIs, and variable names from the JS file and analyzing them for any potential weaknesses that could be exploited. By extracting and analyzing these elements, potential security threats can be identified, allowing for proactive measures to be taken to mitigate any risks associated with the application. This process can be used as part of a comprehensive bug-hunting strategy to ensure the security of an application.
2023-03-13 18:58:46 +00:00
metadata :
2023-06-04 08:13:42 +00:00
verified : true
2023-12-12 23:25:50 +00:00
tags : file,js-analyse,js
2023-03-09 12:27:18 +00:00
file :
- extensions :
- js
2023-03-13 18:58:46 +00:00
2023-03-09 12:27:18 +00:00
extractors :
- type : regex
2023-03-13 18:58:46 +00:00
name : extracted-token
2023-03-09 12:27:18 +00:00
regex :
2024-02-17 16:18:34 +00:00
- "(?i)(([a-z0-9]+)[-|_])?(key|password|passwd|pass|pwd|private|credential|auth|cred|creds|secret|access|token|secretaccesskey)([-|_][a-z]+)?(\\s)*(:|=)+"
2023-03-13 18:58:46 +00:00
2023-03-09 12:27:18 +00:00
- type : regex
2023-03-13 18:58:46 +00:00
name : extracted-endpoints
2023-03-09 12:27:18 +00:00
regex :
- "(?i)('|\")((\\.{0,2})|([a-z0-9-_]*))/([a-z0-9-_/=:&?\\.]+)('|\")"
- "(?i)}\\s*/[a-z0-9-_?=&/]+"
- "(?i)path\\s*(:|=)\\s*('|\")[a-z0-9-_?=&:\\./]+('|\")"
2023-03-13 18:58:46 +00:00
2023-03-09 12:27:18 +00:00
- type : regex
2023-03-13 18:58:46 +00:00
name : extracted-uri
2023-03-09 12:27:18 +00:00
regex :
2024-02-17 16:18:34 +00:00
- "(?i)([a-z]{2,10}):(//|/)[a-z0-9\\./?&-_=:]+"
2024-03-15 04:27:19 +00:00
2024-02-17 16:18:34 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : amazon-access-key
2024-02-17 16:18:34 +00:00
regex :
- "(?i)(A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}"
2024-03-15 04:27:19 +00:00
2024-03-13 22:03:38 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : amazon-s3-url
2024-03-13 22:03:38 +00:00
regex :
- "(?i)([a-z0-9_\\-\\.]+\\.s3\\.amazonaws\\.com)"
- "(?i)([a-z0-9\\.-]+\\.s3-[a-z0-9-\\.]+\\.amazonaws\\.com)"
- "(?i)[a-z0-9\\.-]+\\.s3-website[\\.-](eu|ap|us|ca|sa|cn)"
- "(?i)(s3://[a-z0-9_\\-\\./]+)"
- "(?i)(s3\\.amazonaws\\.com/[a-z0-9/_\\-\\.]+)"
- "(?i)(s3\\.console\\.aws\\.com/s3/buckets/[a-z0-9/_\\-\\.]+)"
- "(?i)(s3-[a-z0-9-\\.]\\.amazonaws\\.com/[a-z0-9/_\\-\\.]+)"
2024-03-15 04:27:19 +00:00
2024-03-13 22:03:38 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : github-personal-access-token
2024-03-13 22:03:38 +00:00
regex :
- "(?i)(ghp_[a-z0-9]{36}|github_pat_[a-z0-9]{82})"
2024-03-15 04:27:19 +00:00
2024-03-13 22:03:38 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : github-oauth-access-token
2024-03-13 22:03:38 +00:00
regex :
- "(?i)(gho_[a-zA-Z0-9]{36})"
2024-03-15 04:27:19 +00:00
2024-03-13 22:03:38 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : github-app-token
2024-03-13 22:03:38 +00:00
regex :
- "\b((?:ghu|ghs)_[a-zA-Z0-9]{36})\b"
2024-03-15 04:27:19 +00:00
2024-03-13 22:03:38 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : authorization-basic
2024-03-13 22:03:38 +00:00
regex :
- "(?i)(Authorization:\\sbasic\\s+[a-z0-9=:_\\-+/]{5,100})"
2024-03-15 04:27:19 +00:00
2024-03-13 22:03:38 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : authorization-bearer
2024-03-13 22:03:38 +00:00
regex :
- "(?i)(Authorization:\\sbearer\\s+[a-z0-9=:_\\-\\.+/]{5,100})"
2024-03-15 04:27:19 +00:00
2024-03-13 22:03:38 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : rsa-private-key
2024-03-13 22:03:38 +00:00
regex :
- "(?i)(-----BEGIN RSA PRIVATE KEY-----)"
2024-03-15 04:27:19 +00:00
2024-03-13 22:03:38 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : ssh-dsa-private-key
2024-03-13 22:03:38 +00:00
regex :
- "(?i)(-----BEGIN DSA PRIVATE KEY-----)"
2024-03-15 04:27:19 +00:00
2024-03-13 22:03:38 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : ssh-ec-private-key
2024-03-13 22:03:38 +00:00
regex :
- "(?i)(-----BEGIN EC PRIVATE KEY-----)"
2024-03-15 04:27:19 +00:00
2024-03-13 22:03:38 +00:00
- type : regex
2024-03-15 04:27:19 +00:00
name : potential-ajax-request
2024-03-13 22:03:38 +00:00
regex :
- "(?i)(new\\s+xmlhttprequest\\(\\)|\\$\\.ajax\\(\\{)"
2024-03-19 03:38:58 +00:00
# digest: 4a0a00473045022100a1dfbb218bb6e589fe608e853b26ab2acd789a197a02d92e3f0499331b80e03602206ac9cf015a855085c501f0e372f587e6dd518133e9bb9781de0d34ee15266bb9:922c64590222798bb761d5b6d8e72950