원클릭으로
http-basic-auth
Verification guide specific to HTTP Basic Authentication credentials.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Verification guide specific to HTTP Basic Authentication credentials.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Effective usage of GitHub API tools for fetching secret scanning alerts and locations.
Guidelines for setting up isolated testing environments for secret validation scripts.
Techniques for analyzing code context around secret locations to understand usage and intent.
Strategies for cloning repositories with full history into the workspace for analysis.
Use the validate-secrets tool for deterministic secret validation when a matching validator is available.
Guidelines for testing secrets that provide access to internal systems and networks.
| name | http-basic-auth |
| agent | analysis |
| description | Verification guide specific to HTTP Basic Authentication credentials. |
| phase | 3-verification |
| secret-type | http_basic_authentication_header |
This skill provides specific guidance for validating HTTP Basic Authentication credentials.
HTTP Basic Auth credentials appear as:
| Format | Example |
|---|---|
| Base64 encoded | YmlsbHk6c2VjcmV0cGFzc3dvcmQ= |
| Decoded | username:password |
| In header | Authorization: Basic YmlsbHk6c2VjcmV0cGFzc3dvcmQ= |
# Decode base64 to see username:password
echo "YmlsbHk6c2VjcmV0cGFzc3dvcmQ=" | base64 -d
# Output: billy:secretpassword
HTTP Basic Auth appears in code as:
xhr.setRequestHeader('Authorization', 'Basic YmlsbHk6c2VjcmV0cGFzc3dvcmQ=');
// or
$.ajax({
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization', 'Basic ' + btoa(user + ':' + pass));
}
});
import requests
response = requests.get(url, auth=('username', 'password'))
# or explicit header
headers = {'Authorization': 'Basic YmlsbHk6c2VjcmV0cGFzc3dvcmQ='}
response = requests.get(url, headers=headers)
curl -u username:password https://api.example.com/
# or
curl -H "Authorization: Basic YmlsbHk6c2VjcmV0cGFzc3dvcmQ=" https://api.example.com/
# Decode and parse
ENCODED="YmlsbHk6c2VjcmV0cGFzc3dvcmQ="
DECODED=$(echo "$ENCODED" | base64 -d)
USERNAME=$(echo "$DECODED" | cut -d: -f1)
PASSWORD=$(echo "$DECODED" | cut -d: -f2-)
echo "Username: $USERNAME"
echo "Password: $PASSWORD"
Look in the surrounding code for:
# Using curl
curl -u "$USERNAME:$PASSWORD" "$TARGET_URL" -v
# Check response codes:
# 200-299: Auth successful (TRUE_POSITIVE)
# 401: Unauthorized (likely invalid/rotated)
# 403: Forbidden (valid user, no access)
#!/usr/bin/env python3
"""Validate HTTP Basic Authentication credentials."""
import base64
import requests
import json
import sys
def decode_basic_auth(encoded: str) -> tuple[str, str]:
"""Decode base64 Basic Auth to (username, password)."""
decoded = base64.b64decode(encoded).decode('utf-8')
username, password = decoded.split(':', 1)
return username, password
def test_basic_auth(url: str, username: str, password: str) -> dict:
"""
Test HTTP Basic Auth credentials against target URL.
Returns:
dict with test results
"""
result = {
"url": url,
"username": username,
"password_length": len(password),
"valid": False,
}
try:
response = requests.get(
url,
auth=(username, password),
timeout=10,
allow_redirects=False
)
result["status_code"] = response.status_code
if response.status_code in [200, 201, 202, 204]:
result["valid"] = True
result["verdict"] = "TRUE_POSITIVE - Authentication successful"
elif response.status_code == 401:
result["valid"] = False
result["verdict"] = "Likely FALSE_POSITIVE - Authentication failed (401)"
elif response.status_code == 403:
result["valid"] = True # User exists but no permission
result["verdict"] = "TRUE_POSITIVE - User authenticated but forbidden (403)"
else:
result["verdict"] = f"INCONCLUSIVE - Unexpected status {response.status_code}"
except requests.exceptions.Timeout:
result["error"] = "Connection timeout"
result["verdict"] = "INCONCLUSIVE - Cannot reach endpoint"
except requests.exceptions.ConnectionError as e:
result["error"] = str(e)
result["verdict"] = "INCONCLUSIVE - Connection failed"
except Exception as e:
result["error"] = str(e)
result["verdict"] = f"ERROR - {e}"
return result
if __name__ == "__main__":
# Configuration
ENCODED_CRED = "YmlsbHk6c2VjcmV0cGFzc3dvcmQ="
TARGET_URL = "http://app1.internal.github.com/api/v1/method/"
# Decode credential
username, password = decode_basic_auth(ENCODED_CRED)
print(f"Testing: {username}:{'*' * len(password)}")
# Test
result = test_basic_auth(TARGET_URL, username, password)
# Output
print(json.dumps(result, indent=2))
# Exit code
sys.exit(0 if result.get("valid") else 1)
| Status Code | Meaning | Verdict |
|---|---|---|
| 200-204 | Request successful | TRUE_POSITIVE |
| 401 | Unauthorized | Likely FALSE_POSITIVE (invalid/rotated) |
| 403 | Forbidden | TRUE_POSITIVE (valid user, no access) |
| 404 | Not Found | Check if endpoint exists |
| 5xx | Server Error | INCONCLUSIVE |
| Timeout | Connection timeout | INCONCLUSIVE (may be internal) |
test, example, demo, adminpassword, 123456, changemelocalhost, 127.0.0.1, example.comInclude in your report:
username:password (mask password in report)Similar verification approach applies to:
http_bearer_tokenhttp_digest_auth