JuicyFiles

Table of Contents Linux Password Hash Files History Configuration Files Windows Coinfiguration Files Hash Files Windows System Info Linux Password Hash Files passwd, shadow Content – User passwod hashes Features – SHA256Crypt hash Location – /etc Handle – unshadow <passfile> <shadowfile> then hashcat or john History bash_history Content – bash history Features – may contain…

Services

Table of Contents Samba Enumeration Smbclient Crackmapexec Psexec_command or Usermap_script Msf Foothold MS_17_010 Psexec.py Psexec Msf Smb_login Msf DistCC Foothold CVE-2004-2687 Samba Enumeration Smbclient List all shares smbclient -L \\\\<URL>\\ Crackmapexec List all shares crackmapexec smb <ip> -u <username> -p <password> –shares Psexec_command or Usermap_script Msf Execute smb command auxiliary/admin/smb/psexec_command set COMMAND [command you want…

WebApplication

Table of Contents General Check List Initial Steps With Unprivileged User Account OWASP’s Guide HeartBleed Enumeration BurpSuite Dirbuster Gobuster Dirsearch Wfuzz PHP Info Page PHP Filter PHP Remote File Inclusion PHP Log Poisoning Wpscan Other Tools Foothold Identity Brute Forcing SQL Injection – URL SQL Injection – Web Form Directory Traversal XXE Injection Type Juggling…

0x0B-HackTheBox-Obscurity

Set up 目标机器在 10.10.10.168. Recon Nmap # Nmap 7.80 scan initiated Tue Apr 28 03:28:16 2020 as: nmap -A -T4 -p- -v -oN nmap.txt 10.10.10.168 adjust_timeouts2: packet supposedly had rtt of -935420 microseconds. Ignoring time. adjust_timeouts2: packet supposedly had rtt of -935420 microseconds. Ignoring time. adjust_timeouts2: packet supposedly had rtt of -1170053 microseconds. Ignoring time….

0x0A-HackTheBox-Base

Recon Nmap 目标开放了 22 和 80 端口。 查看一下网页。 有个 login 页面。 我先尝试了一下 sql injection,但是没有成功,无法登录。 截取了请求,也没有什么特别的。 Dirbuster 很快找到了换个 /login 目录是可以访问的。 重点是 config.php 和 .swp 两个文件。但是 config.php 没有什么内容,看一下 .swp 。 我尝试 vi -r login.php.sqp,但是无法恢复。 扩展阅读 VIM Recovery Mode 直接 vi 打开之后,是个乱码。 但是下面有字符串,那就用 strings 看一下。 这里看到了比较用户名密码的登录逻辑。 那么问题肯定在这里,只是我还不知道。 搜索一下 php strcmp exploit 很多 bypass,那这个肯定就是有漏洞可以利用了。 扩展阅读 PHP String Comparison Vulnerability…

0x09-HackTheBox-Guard

Recon Nmap 目标机器只开放了 22 端口。 之前的用户,daniel 和他的 private key 还是可以用来登录 10.10.10.50 代号 Guard 的机器。 进去之后发现 find, cd ,cat 这些都用不了,会显示 rbash: cd: restricted 这样的错误。 搜索一下 rbash,会发现 Linux 有一个限制环境 (restricted shell) 扩展阅读 GNU Restricted Shell Restricted Shell Explained 搜索 how to exit restricted shell 这篇文章 就有解除限制的方法。 用 less 是可以的 I’m in… 之后的内容不写了,不太切实际。主要学习一下 restricted shell。

0x08-HackTheBox-Markup

Markup Video Walkthrough 😄 Recon Nmap nmap 还在跑的时候,我就去这个 ip 看下有没有 web 服务。这是主页。 然后记得上一个 Included 结束的时候,在 login.sql 里有一个登陆信息(移步 这里查看),我试了一下果然登陆成功。 首页。 有个 cookie。 源码没有什么信息。 contact 页面假的,按钮点了没有任何反应。 order 页面,随便填了一些信息,点击提交显示已处理 我看到订单页面的源码里是提交到 process.php 我在地址栏直接访问,并添加了 null byte 在后面,防止 php 被执行,但是报错了。 加上两个 0 报错还不一样。 目标机器运行的技术栈全部暴漏了 – Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.2.28。 20 分钟过去了,我的 nmap 还没结束。 那就根据这个信息搜索一下漏洞好了。 Enumeration 搜索一下 apache 2.4.41 exploits 排前几位的文章都看了一下,没有发下有用信息。 openssl…

0x07-HackTheBox-Included

Recon Masscan nmap 超时了,换成 masscan 只开放了一个 80,又一个 webapp 练习。 Enumeration 主页是这这样的。我今天正好看了 这篇讲 Directory Traversal 的文章。 直接列出了 /etc/passwd 的内容。 打开源码,可以更清楚看到目标机器有一个普通用户 mike。 没有权限直接访问用户家目录。 再找找敏感信息。 我查看了 /home/mike/.ssh/,/home/mike/.bashrc,/tmp,没得到什么信息。 应为有 web 服务,配置文件可以看一下。 首先确定服务器的技术栈。 跑的是 apache 2.4。 搜索 几个地方可以查看。 没有发现什么有用的信息。 尝试下载本地的 php 代码,也没有奏效。 扩展阅读 OWASP Directory Traversal 如果能再地址栏直接执行命令,问题就解决了。 More Enumeration 看看系统信息。 都是 local 的漏洞。 再回去看 web。 跑一遍 dirsearch,但是并没有什么发现。 扩展阅读 这篇文章讲了很多关于 LFI…

0x06-HackTheBox-Lame

Lame Video Walkthrough 😀 Recon Nmap # Nmap 7.80 scan initiated Sun Apr 26 01:45:41 2020 as: nmap -A -T4 -p21,22,139,445 -oN nmap.txt 10.10. 10.3 Nmap scan report for 10.10.10.3 Host is up (0.32s latency). PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 2.3.4 |_ftp-anon: Anonymous FTP login allowed (FTP code 230) | ftp-syst: |…

0x05-HackTheBox-Magic

HackTheBox-Magic Video Walkthrough 😀 Recon Masscan ➜ Magic masscan -p 1-65535 10.10.10.185 -e tun0 –rate=1000 Starting masscan 1.0.5 (http://bit.ly/14GZzcT) at 2020-04-23 16:31:14 GMT — forced options: -sS -Pn -n –randomize-hosts -v –send-eth Initiating SYN Stealth Scan Scanning 1 hosts [65535 ports/host] Discovered open port 80/tcp on 10.10.10.185 Discovered open port 22/tcp on 10.10.10.185 ^Cwaiting several…