SpacehuhnTech / WiFiDuck

Wireless keystroke injection attack platform
http://wifiduck.com
MIT License
2.09k stars 368 forks source link

is there any cli method rather then a web interface to execute the scripts? #74

Closed siddharthkhandelwal1 closed 2 years ago

siddharthkhandelwal1 commented 3 years ago

Please search for existing (open and closed) issues to avoid duplicates.

welcome[bot] commented 3 years ago

Thanks for opening your first issue here! 🎉
👉 Be sure to:
1. 📖 Have a look at the Wiki and README for information
2. 🔍 Search for similar issues (open and closed)
3. ✍ī¸ Provide enough information to understand, recreate and help out with your problem
4. ℹī¸ Let us know if you find a solution
5. 📕 Close the issue when your problem has been solved

spacehuhn commented 3 years ago

The web interface has a terminal if you mean that.

justusiv commented 2 years ago

When i read this comment i see more of like an access via API. I could see all kinds of fun use cases for it with automation, and it would really allow this to interface with anything and allow people to code against it in their language of choice. A fun random example that pops into my mind is one that unlocks my computer when i get home and locks it when i leave.

jstorrs commented 2 years ago

Here's a python script that runs /myscript on the duck using websockets:

import asyncio
from websockets import connect

uri = "ws://192.168.4.1/ws"

async def wifiduck_run(script):
    async with connect(uri) as websocket:
        await websocket.send(f"run {script}")
        await websocket.recv()

asyncio.run(wifiduck_run("/myscript"))

I think other websocket clients would probably work similarly, but I haven't tested them. Search script.js for calls to ws_send for other ideas.

justusiv commented 2 years ago

Thank you for posting that @jstorrs I was able to get it to work. Being able to write or update a script on the fly would be the other piece that would be very handy to have in the tool bag. Looks like there is a function "create" and "write" that would be useful.

justusiv commented 2 years ago

After a few minutes playing around i was able to get this to work. I did run into issues with spaces and new lines until i did this.

data = """STRING 123
STRING 456
"""

and

        await websocket.send(f'write {script} "{data}"')
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.