GitBook
5.56K subscribers
268 photos
4 videos
390 files
866 links
ctf, pentest, writeUps, osint, labs,
tipsุŒ GitBooks, Notion
Web pentest, bug bounty
Download Telegram
Grep tips for Javascript Analysis

๐Ÿ’กNote: cat * is for all files from the folder.


๐ŸŸฃExtracting JavaScript Files from recursive Directories
find /path/to/your/folders -name "*.js" -exec mv {} /path/to/target/folder/ \;


๐ŸŸฃSearching for API Keys and Secrets
cat * | grep -rE "apikey|api_key|secret|token|password|auth|key|pass|user"


๐ŸŸฃDetecting Dangerous Function Calls
cat * | grep -rE "eval|document\.write|innerHTML|setTimeout|setInterval|Function"


๐ŸŸฃChecking for URL Manipulation
cat * | grep -rE "location\.href|location\.replace|location\.assign|window\.open"


๐ŸŸฃSearching for Cross-Origin Requests
cat * | grep -rE "XMLHttpRequest|fetch|Access-Control-Allow-Origin|withCredentials" /path/to/js/files


๐ŸŸฃAnalyzing postMessage Usage
cat * | grep -r "postMessage"


๐ŸŸฃFinding Hardcoded URLs or Endpoints
cat * | grep -rE "https?://|www\."


๐ŸŸฃLocating Debugging Information
cat * | grep -rE "console\.log|debugger|alert|console\.dir"


๐ŸŸฃInvestigating User Input Handling
cat * | grep -rE "document\.getElementById|document\.getElementsByClassName|document\.querySelector|document\.forms"


#infosec #cybersecurity #bugbounty #pentest #bugbountyTips #JS
โค3