Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Meterpreter - scanner/discovery/udp_probe doesn't work with pivot #540

Open
AlanFoster opened this issue Feb 19, 2022 · 0 comments
Open

Comments

@AlanFoster
Copy link

Running udp_probe on host:

msf6 auxiliary(scanner/discovery/udp_probe) > run rhosts=172.16.83.1/24

[+] Discovered DNS on 172.16.83.1:53 (....etc....)
[+] Discovered NetBIOS on 172.16.83.3:137 (....etc...)
[*] Scanned  26 of 256 hosts (10% complete)
... etc ...

Opening Python Meterpreter:

use payload/python/meterpreter_reverse_tcp
generate -o shell.py -f raw lhost=127.0.0.1 PythonMeterpreterDebug=true MeterpreterTryToFork=false
to_handler

Run the payload in a separate tab:

python3 shell.py

Add a route for the newly opened session:

route add 172.16.83.1 255.255.255.0 -1

Single rhost doesn't work:

msf6 auxiliary(scanner/discovery/udp_probe) > run rhosts=172.16.83.1

[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Multiple rhosts crashes the meterpreter session:

msf6 auxiliary(scanner/discovery/udp_probe) > run rhosts=172.16.83.1/24
[*] 127.0.0.1 - Meterpreter session 5 closed.  Reason: Died

Python log:

[*] running method core_channel_open
[*] core_channel_open dispatching to handler: channel_open_stdapi_net_udp_client
[*] added channel id: 14 type: MeterpreterSocketUDPClient
[*] sending response packet
[*] running method core_channel_write
[-] method core_channel_write resulted in error: #1
[*] sending response packet
Traceback (most recent call last):
  File "/Users/user/metasploit-framework/shell.py", line 1728, in <module>
    met.run()
  File "/Users/user/metasploit-framework/shell.py", line 1365, in run
    if select.select([channel.fileno()], [], [], 0)[0]:
ValueError: file descriptor cannot be a negative integer (-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant