Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/CyberStrikeus/CyberStrike --skill wstg-conf-09명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
macOS post-exploitation for credential harvesting, DTrace monitoring, TCC bypass, and stealth operations via native tools
Windows userland post-exploitation for credential harvesting, monitoring, AMSI/ETW bypass, and stealth operations
Kubernetes post-exploitation for container escape, secret extraction, RBAC abuse, and cluster persistence
SOC 직업 분류 기준
SKILL.md 표시 중
| name | wstg-conf-09 |
| description | Test File Permission |
| category | configuration |
| owasp_id | WSTG-CONF-09 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["misconfiguration","hardening","server","wstg","conf"] |
| tech_stack | ["php","java","asp","nodejs"] |
| cwe_ids | ["CWE-434"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
WSTG-CONF-09
Test File Permission
Incorrect file permissions can expose sensitive data, allow unauthorized modifications, or enable code execution. This test examines file and directory permissions to identify overly permissive settings that could be exploited by attackers. Proper file permissions are a critical component of defense-in-depth security.
# List permissions in web directory
ls -la /var/www/html/
# Recursive listing
ls -laR /var/www/html/
# Using namei for path permissions
namei -l /var/www/html/config/database.php
# Find world-writable files
find /var/www/html -perm -0002 -type f
# Find world-writable directories
find /var/www/html -perm -0002 -type d
find /var/www/html -perm -4000 - f
find /var/www/html -user root - f
# Configuration files
ls -la /var/www/html/config/
ls -la /var/www/html/.env
ls -la /var/www/html/wp-config.php
# Should be readable only by web server user
# Recommended: 640 or 600
# Log files
ls -la /var/log/apache2/
ls -la /var/log/nginx/
# Database files
ls -la /var/lib/mysql/
# Upload directories should not allow execution
ls -la /var/www/html/uploads/
ls -la /var/www/html/media/
ls -la /var/www/html/files/
# Check for executable files in upload dirs
find /var/www/html/uploads -type f \( -name "*.php" -o -name "*.sh" -o -name "*.pl" \)
# List permissions
icacls C:\inetpub\wwwroot\
# Recursive
icacls C:\inetpub\wwwroot\ /T
# Check specific file
icacls C:\inetpub\wwwroot\web.config
# Try to access sensitive files via web
curl -s https://target.com/.htaccess
curl -s https://target.com/web.config
curl -s https://target.com/config/database.yml
curl -s https://target.com/.env
# Check for directory listing
curl -s https://target.com/uploads/
curl -s https://target.com/config/
curl -s https://target.com/logs/
| Tool | Description | Usage |
|---|---|---|
| ls | List files | ls -la /path |
| namei | Path permissions | namei -l /path/to/file |
| find | Find files | find /path -perm mode |
| stat | File status | stat /path/to/file |
| getfacl | ACL permissions | getfacl /path/to/file |
| Tool | Description |
|---|---|
| icacls | Display/modify ACLs |
| AccessChk | Sysinternals tool |
| AccessEnum | Permission enumeration |
| Tool | Description |
|---|---|
| Lynis | Security auditing |
| Linux Exploit Suggester | Permission checks |
#!/bin/bash
WEBROOT=${1:-"/var/www/html"}
echo "=== FILE PERMISSION AUDIT ==="
echo "Web Root: $WEBROOT"
echo ""
# World-writable files
echo "[+] World-writable files:"
find "$WEBROOT" -perm -0002 -type f 2>/dev/null
# World-writable directories
echo ""
echo "[+] World-writable directories:"
find "$WEBROOT" -perm -0002 -type d 2>/dev/null
# SUID files
echo ""
echo "[+] SUID files:"
find "$WEBROOT" -perm -4000 -type f 2>/dev/null
# Config files with loose permissions
echo ""
echo "[+] Config files with permissions > 640:"
find "$WEBROOT" -name "*.conf" -o -name "*.config" -o -name "*.ini" -o -name "*.env" 2>/dev/null | while read file; do
perms=$(stat -c %a "$file" 2>/dev/null)
if [ "$perms" -gt 640 ]; then
echo "$file: $perms"
fi
done
# PHP files in upload directories
echo ""
echo "[+] PHP files in upload directories:"
for dir in uploads files media documents; do
find "$WEBROOT/$dir" -name "*.php" 2>/dev/null
done
echo ""
echo "[+] Audit complete"
# Web files (read-only)
find /var/www/html -type f -exec chmod 644 {} \;
# Directories (read + execute)
find /var/www/html -type d -exec chmod 755 {} \;
# Configuration files (restrictive)
chmod 640 /var/www/html/config/*.php
chmod 640 /var/www/html/.env
# Upload directories (no execution)
chmod 755 /var/www/html/uploads
# Use .htaccess to prevent PHP execution
# Set ownership
chown -R www-data:www-data /var/www/html
# Files: 644 (rw-r--r--)
find /var/www/html -type f -exec chmod 644 {} \;
# Directories: 755 (rwxr-xr-x)
find /var/www/html -type d -exec chmod 755 {} \;
# Config files: 640 (rw-r-----)
chmod 640 /var/www/html/config/*
chmod 640 /var/www/html/.env
chmod 640 /var/www/html/wp-config.php
# Private keys: 600 (rw-------)
chmod 600 /var/www/html/keys/*
chmod 600 ~/.ssh/id_rsa
# Set permissions
chmod 755 /var/www/html/uploads
# Apache - Prevent PHP execution
# Create /var/www/html/uploads/.htaccess
echo "php_flag engine off" > /var/www/html/uploads/.htaccess
# Or use FilesMatch
cat > /var/www/html/uploads/.htaccess << 'EOF'
<FilesMatch "\.(php|phtml|php3|php4|php5|php7|phps|phar)$">
Require all denied
</FilesMatch>
EOF
# Nginx - Prevent PHP execution in uploads
location ~* /uploads/.*\.php$ {
deny all;
}
# Logs readable only by root/admin
chmod 640 /var/log/apache2/*
chmod 640 /var/log/nginx/*
# Owned by root
chown root:adm /var/log/apache2/*
| Finding | CVSS | Severity |
|---|---|---|
| World-writable config file | 9.8 | Critical |
| Executable in upload dir | 9.8 | Critical |
| World-readable credentials | 7.5 | High |
| Overly permissive directories | 5.3 | Medium |
| CWE ID | Title | Description |
|---|---|---|
| CWE-732 | Incorrect Permission Assignment for Critical Resource | Improper file permissions |
| CWE-276 | Incorrect Default Permissions | Default permissions too permissive |
| CWE-284 | Improper Access Control | Access control failure |
[ ] Web directory permissions reviewed
[ ] Configuration file permissions checked
[ ] Sensitive files restricted (600/640)
[ ] Upload directories checked
[ ] No PHP files in upload directories
[ ] Log file permissions verified
[ ] World-writable files identified
[ ] SUID/SGID files reviewed
[ ] Ownership verified
[ ] Remediation recommendations provided