diff options
| author | 5epi0l <91630053+5epi0l@users.noreply.github.com> | 2025-11-16 06:19:32 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-16 06:19:32 +0530 |
| commit | 993a971b5569fb11708d557cdc8ecda1cc44277c (patch) | |
| tree | 0e7cbef850d944bf66207cfcc68b98faf589693d /TimeFix/fixtime.py | |
| parent | e8d9039c740efcd25b66b43bde0389f53d9db78a (diff) | |
Update and rename clock_skew.py to TimeFix/fixtime.py
Diffstat (limited to 'TimeFix/fixtime.py')
| -rw-r--r-- | TimeFix/fixtime.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/TimeFix/fixtime.py b/TimeFix/fixtime.py new file mode 100644 index 0000000..a9f2235 --- /dev/null +++ b/TimeFix/fixtime.py @@ -0,0 +1,46 @@ +# Clock_skew.py +# Author: 5epi0l +# Date: 16/11/2025 +# License: MIT +# Description: + + + +import requests +import os +import argparse + +parser = argparse.ArgumentParser() +parser.add_argument("--url", help="Target URL", required=True) + +args = parser.parse_args() + + + + +def get_date(): + print("[*] Fetching time") + try: + r = requests.get(args.url + "/:5985/WSMAN") + date_header = r.headers.get("Date") + time = date_header.split()[4] + if time: + print("[*] time fetched: ", time) + return time + else: + print("[-] Could not get remote time") + except Exception as e: + print("[*] An error has occured: ", e) + +def set_date(): + time = get_date() + try: + print("[*] Syncing time") + os.system("sudo timedatectl set-ntp off") + os.system(f"sudo date -u --set {time}") + print("[*] time Synced") + except Exception as e: + print("[-] An error has occured: ", e) + + +set_date() |
