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

Enhance Random Interval and Movement Functionality in HID Mouse Jiggler for Improved Stealth and Human-Like Behavior #746

Merged
merged 3 commits into from
May 3, 2024

Conversation

gushmazuko
Copy link
Contributor

@gushmazuko gushmazuko commented Apr 21, 2024

What's new

This pull request introduces significant enhancements to the HID Mouse Jiggler, aiming to improve its stealth capabilities and emulate human-like behavior more effectively. The updates include:

  1. Random Intervals: Replaced fixed movement intervals with a random interval system. Users can set a minimum and maximum time range, within which the device randomly determines when to move the mouse. This unpredictability helps in evading detection by systems that monitor for regular patterns, such as anti-cheat software.

  2. Dynamic Mouse Movements: Mouse movements are now randomized in both direction and distance, further mimicking human behavior. This variability makes the movements less predictable and more natural, which is crucial for bypassing systems that analyze movement patterns for regularity.

  3. User Interface Enhancements: Updated the UI to facilitate easy setting of the minimum and maximum intervals through the device’s buttons. The interface displays these settings, allowing users to adjust the behavior to match their specific needs more closely.

These improvements aim to make the Mouse Jiggler more effective in environments where sophisticated software might detect less sophisticated tools. By enhancing the randomness and naturalness of the movements, the device becomes a more robust tool in scenarios requiring continuous, unnoticeable activity.

Demo video:
Watch the video

BJ8bhwheA

Verification

  • Apps -> USB -> USB Keyboard & Mouse -> Mouse Jiggler
  • Adjust Min & Max intervals settings and start
  • Use pynput python library to track mouse movements
get_mouse_jiggler.py
from pynput.mouse import Listener
import time
import math
import keyboard

# Global variables to track time and position
last_time = time.time()
last_position = (0, 0)

def on_move(x, y):
  global last_time, last_position

  # Calculate the interval and length of movement
  current_time = time.time()
  interval = current_time - last_time
  dx = x - last_position[0]
  dy = y - last_position[1]
  distance = math.sqrt(dx ** 2 + dy ** 2)

  # Calculate the direction of movement
  if distance > 0:
      angle = math.atan2(dy, dx)
      angle_degrees = math.degrees(angle)
      print(f"Interval: {interval:.2f} sec, Length: {distance:.2f} pixels, Direction: {angle_degrees:.2f} degrees")

  # Update time and position for the next event
  last_time = current_time
  last_position = (x, y)

# Start the mouse listener in a separate thread
listener = Listener(on_move=on_move)
listener.start()

print("Press 'esc' to stop recording.")

# Wait for the 'esc' key press
keyboard.wait('esc')

# Stop the listener
listener.stop()
print("Recording stopped.")

Checklist (For Reviewer)

  • PR has description of feature/bug
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@xMasterX
Copy link
Member

Hello, Checklist (For Reviewer) is made for Reviewer, for person who is going to review and merge your PR

do not fill it, do not edit it after me second time, thanks

@gushmazuko
Copy link
Contributor Author

Hello, Checklist (For Reviewer) is made for Reviewer, for person who is going to review and merge your PR

do not fill it, do not edit it after me second time, thanks

Sorry, I didn't notice

@xMasterX
Copy link
Member

xMasterX commented May 3, 2024

Hello, I made some changes, srand acts as empty function in flipper's system, stdlib is not required, and be aware that rand() basically does return (furi_hal_random_get() & RAND_MAX);

I removed unused parts and done ./fbt format on the code

Screenshot 2024-05-03 at 21 15 34

@xMasterX xMasterX merged commit a27aa03 into DarkFlippers:dev May 3, 2024
@Luk164
Copy link

Luk164 commented May 6, 2024

I understand that this upgrade is meant to help mouse jiggler be more stealthy, but it also made it so I have to keep turning it off when I come back to desk because it may accidentally cause clicking on the wrong button. Could this instead be made into separate "stealth jiggler" mode and the old one brought back please?

@Airmonkdev
Copy link

Airmonkdev commented May 9, 2024

Thanks for this new feature but I agree with Luk164, I'd prefer the old way so I was able to let it run also while I'm working.
Is it possible to have 2 separate app or the choice to use stealth mode or previous behavior?

Also, not clear how can I set the Jiggler to make a movement every 5sec for example?

Thanks and keep up the great work!

@gushmazuko
Copy link
Contributor Author

Hello @Luk164 I understand the need for a separate "stealth jiggler" mode. We can certainly implement this by creating two separate applications, one for the stealth mode and another for the previous behavior.

@Airmonkdev To use seconds instead of minutes, you will need to replace the minutes by seconds in the code. Alternatively, we can (i think) add an option on the screen to change the interval units between seconds and minutes.

@Airmonkdev
Copy link

Hi Gushmazuko,
thanks for the reply!
I think having two separate apps will be great. Do you think this could happens with the next 074 version or it will require much time?

@xMasterX
Copy link
Member

xMasterX commented May 15, 2024

Hello everyone who was requesting making two possible options (keeping old version and adding new too)
All is already done, please wait for next dev build and check dev branch for new commits, all will be published today

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

Successfully merging this pull request may close these issues.

None yet

4 participants