Skip to content

Commit

Permalink
added console command execution example
Browse files Browse the repository at this point in the history
  • Loading branch information
SadParad1se committed Jul 18, 2024
1 parent 8174bd7 commit 7765324
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 1 addition & 4 deletions examples/execute_module_with_output.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import time

from snek_sploit import MetasploitClient, ModuleType, SessionInformation
from snek_sploit import MetasploitClient


def main():
# Initialize client
client = MetasploitClient("msf", "root", disable_https_warnings=True)
console = client.consoles.create()

Expand Down
13 changes: 13 additions & 0 deletions examples/run_command_in_console.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from snek_sploit import MetasploitClient


def main():
client = MetasploitClient("msf", "root", disable_https_warnings=True)
console = client.consoles.create()

result = console.execute("db_nmap 127.0.0.1")
print(result)


if __name__ == "__main__":
main()

0 comments on commit 7765324

Please sign in to comment.