spellshift / realm

Realm is a cross platform Red Team engagement platform with a focus on automation and reliability.
https://docs.realm.pub/
GNU General Public License v3.0
414 stars 29 forks source link

sys.ncat UDP hangs. #752

Open hulto opened 5 months ago

hulto commented 5 months ago

Describe the bug sys.ncat UDP hangs for a long time when it doesn't receive a response. This is not an ideal behavior.

To Reproduce

  1. Start a UDP listener with nc sudo nc -l -v -u 1337
  2. Verify it's listening on 1337 sudo ss -ptuan | grep 1337
  3. Create the following test eldritch file:
    
    def main():
    pivot.ncat("127.0.0.1", 1337, "Hello World", "udp")

main()


4. Run the test code `golem:$ cargo run -- /tmp/test.eldritch`
5. See the listener receive the message
6. Notice that the golem process doesn't exit until you send and enter back over the UDP socket.

_The same behavior occurs if port 1337 isn't open or is getting dropped by the FW_

**Expected behavior**
The ncat function should expose a timeout variable with a sensible default eg. 3 seconds.

**Screenshots**
<img width="1311" alt="image" src="https://github.com/spellshift/realm/assets/7121375/62f53ff2-24c7-4815-8850-a6cfdac84d69">