I was trying a machine on vulnhub and I found port 139 open that was samba-4.3.11.
I searched for an exploit for that particular version and I found the is_known_pipename()
exploit. But when I ran it, I saw it uses port 445. I read some articles saying port 139 and 445 are similar but 139 is an older version of samba so the exploit should have worked here too?
Is it necessary to have the same port given by default in the exploit to exploit a machine even though is has a vulnerable version?
If I find a vulnerable version but on a different port can't I exploit it?
Also I read about the exploit and saw it writes to the smbshare folder. I tried putting a file from my local machine to the vulnerable machine in its tmp share folder and was successful so if I was able to upload the file why is the exploit not working on pory 139?