Skip to content

Commit 0a55606

Browse files
committed
Release
1 parent 7e6de45 commit 0a55606

File tree

3 files changed

+209
-2
lines changed

3 files changed

+209
-2
lines changed

README.md

Lines changed: 116 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,116 @@
1-
# Soon :)
2-
Coding right now...
1+
<h1 align="center">🛡️ AnyGrab 🛡️</h1>
2+
3+
<p align="center">
4+
<a href="https://www.python.org" target="_blank"><img src="https://img.shields.io/badge/Language-Python-blue?style=for-the-badge&logo=python" /></a>
5+
<a href="https://t.me/swezy" target="_blank"><img src="https://img.shields.io/badge/Telegram-@Swezy-blue?style=for-the-badge&logo=telegram" /></a>
6+
<br>
7+
<code>Leave a ⭐ if you like this Repository</code>
8+
</p>
9+
10+
---
11+
12+
## 🚩 Project overview
13+
14+
**AnyGrab** is a Python utility that continuously **monitors AnyDesk connections** on your system and displays **remote IP addresses and ports** in a beautiful **gradient CLI interface**. It includes a **persistent blacklist** to avoid duplicate entries and supports **console transparency** for a sleek look.
15+
16+
> [!CAUTION]
17+
> This tool is intended for **educational and personal monitoring purposes only**.
18+
> Do **not** use it for unauthorized access, exploitation, or malicious activity.
19+
> The author and contributors are **not** responsible for any misuse of this code.
20+
21+
---
22+
23+
## ✨ Features
24+
25+
* 👀 **Monitor AnyDesk Connections** — Detect running AnyDesk processes and log their active connections.
26+
* 🧠 **Persistent Blacklist** — Avoid duplicate IP addresses by storing them in a persistent blacklist.
27+
* 🌈 **Gradient CLI Interface** — Uses `rgbprint` for beautiful color gradients and scrolling messages.
28+
* 🖥️ **Console Transparency** — Adjustable transparency for a modern and aesthetic CLI.
29+
***Real-time Monitoring** — Continuously checks AnyDesk connections and prints updates in real-time.
30+
31+
---
32+
33+
## 🧭 How It Works
34+
35+
1. Run the tool (`python main.py`).
36+
2. The program **monitors AnyDesk processes** on your system.
37+
3. When AnyDesk is detected, it **grabs active remote connections** and displays:
38+
* Remote IP
39+
* Port
40+
4. The program **ignores local-link addresses** (`169.254.x.x`) and common ports like 80 and 443.
41+
5. **Duplicate IPs are blacklisted** automatically to avoid repeated notifications.
42+
6. The CLI displays messages in **color gradients** and scroll animations for a premium visual experience.
43+
44+
---
45+
46+
## 🧰 Requirements
47+
48+
* 🐍 Python **3.9+**
49+
* 📦 Dependencies:
50+
51+
```bash
52+
pip install rgbprint psutil colorama
53+
```
54+
55+
* 🖥️ Windows operating system (for console transparency and netstat)
56+
57+
---
58+
59+
## 📝 Repository structure
60+
61+
```/
62+
├─ assets/ ➔ Screenshots of the Program in action
63+
│ └─ preview.png ➔ A screenshot of the Program running
64+
├─ main.py ➔ Main program logic and CLI
65+
├─ LICENSE ➔ License file
66+
└─ README.md ➔ Read me file
67+
```
68+
69+
---
70+
71+
## 🖼️ Preview
72+
73+
<p align="center">
74+
<img src="https://img.shields.io/badge/UI-Gradient%20CLI-blueviolet?style=for-the-badge"/>
75+
<br><br>
76+
<img src="https://github.com/SwezyDev/AnyGrab/blob/main/assets/preview.png?raw=true" alt="Program preview">
77+
</p>
78+
79+
---
80+
81+
## ⚙️ Technical Details
82+
83+
* Uses `psutil` to detect running AnyDesk processes.
84+
* Uses `subprocess` with `netstat` to capture TCP connections.
85+
* Filters out **LISTENING** ports and local-link addresses.
86+
* Console transparency is implemented via `ctypes` and Windows API.
87+
* Gradient and scrolling effects are handled via the `rgbprint` library.
88+
* Persistent blacklist ensures each IP is printed only once.
89+
90+
---
91+
92+
## ⚖️ License
93+
94+
Distributed under the **MIT License**. See `LICENSE` for more information.
95+
96+
---
97+
98+
## 🙌 Credits & contact
99+
100+
* Maintainer: [@SwezyDev](https://github.com/SwezyDev) — reach out via Telegram: [@Swezy](https://t.me/swezy)
101+
* Inspiration: System monitoring utilities and public security research.
102+
103+
---
104+
105+
## 🚨 Disclaimer
106+
107+
This project is intended for **personal learning and monitoring**.
108+
Do **not** use it to intrude on other people's systems or conduct unauthorized actions.
109+
This tool is **not affiliated with, endorsed by, or sponsored by AnyDesk** in any way.
110+
111+
---
112+
113+
## 📣 Final note
114+
115+
This project is made for **educational purposes and visual monitoring**.
116+
Use responsibly — do **not** exploit or misuse.

assets/preview.png

14.7 KB
Loading

main.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
from rgbprint import gradient_print, gradient_scroll, Color
2+
import subprocess
3+
import ctypes
4+
import psutil
5+
import time
6+
import os
7+
8+
BLACKLIST = set() # Persistent global blacklist to avoid duplicate entries
9+
10+
class utility:
11+
logo = """
12+
█████ ██████
13+
███████████ ██████
14+
████████████████ ███████
15+
█████████████████████ ██████
16+
██████████████████████████ ██████ Against Indian Scammers
17+
█████████████████████████████ ██████ Coded by Swezy <3
18+
█████████████████████████ ██████
19+
███████████████████ ██████
20+
███████████████ ██████
21+
█████████ ██████
22+
█████ █████
23+
""" # Logo
24+
25+
def console_transparency():
26+
percentage = 10 # Set the transparency level (0-100)
27+
hwnd = ctypes.windll.kernel32.GetConsoleWindow() # Get the console window handle
28+
styles = ctypes.windll.user32.GetWindowLongW(hwnd, -20) # Get the current window styles
29+
styles |= 0x80000 # Add the layered style
30+
ctypes.windll.user32.SetWindowLongW(hwnd, -20, styles) # Set the new window styles
31+
ctypes.windll.user32.SetLayeredWindowAttributes(hwnd, 0, int(255 * (100 - percentage) / 100), 2) # Set the transparency
32+
33+
def find_anydesk():
34+
pids = []
35+
for p in psutil.process_iter(["pid", "name"]): # Iterate over all processes
36+
if "anydesk" in p.info["name"].lower(): # Check if the process name contains "anydesk"
37+
pids.append(str(p.info["pid"])) # Add the PID to the list
38+
return pids # Return the list of AnyDesk PIDs
39+
40+
41+
def grab(anydesk_pid):
42+
gradient_print(f"[#] AnyGrab is Connected! --> {anydesk_pid}", start_color=Color.ghost_white, end_color=Color.sky_blue) # Print running message
43+
44+
while True: # Infinite loop to monitor AnyDesk connections
45+
try: # Try block to handle exceptions
46+
output = subprocess.check_output("netstat -p TCP -n -a -o", shell=True).decode(errors="ignore").splitlines() # Get netstat output
47+
anydesk_pids = utility.find_anydesk() # Find AnyDesk PIDs
48+
anydesk_addy = {} # Reset AnyDesk addresses
49+
50+
for line in output: # Iterate over netstat output lines
51+
for pid in anydesk_pids: # Iterate over AnyDesk PIDs
52+
if pid in line and "LISTENING" not in line: # Check if the line contains the PID and is not listening
53+
try: # Try block to handle exceptions
54+
parts = line.split() # Split the line into parts
55+
if len(parts) < 5: # Skip malformed lines
56+
continue # Continue to the next line
57+
remote = parts[2] # Get the remote address
58+
if ':' not in remote: # Check if the remote address is valid
59+
continue # Continue to the next line
60+
ip_, port_ = remote.rsplit(":", 1) # Split the remote address into IP and port
61+
anydesk_addy[ip_] = int(port_) # Store the IP and port in the dictionary
62+
except Exception: # Handle exceptions
63+
continue # Continue to the next iteration
64+
65+
for ip, port in anydesk_addy.items(): # Iterate over the AnyDesk addresses
66+
if not ip.startswith("169.254.") and port not in [80, 443] and ip not in BLACKLIST: # Ignore local link addresses and check blacklist
67+
gradient_print(f" [!] {ip}:{port}", start_color=Color.ghost_white, end_color=Color.sky_blue) # Print the address
68+
BLACKLIST.add(ip) # Add the address to the blacklist
69+
70+
except Exception: # Handle exceptions
71+
continue # Continue to the next iteration
72+
73+
74+
def main():
75+
os.system("mode 83,30") # Set console size
76+
77+
while True:
78+
os.system("cls") # Clear the console
79+
gradient_print(utility.logo, start_color=Color.ghost_white, end_color=Color.sky_blue) # Print the logo
80+
gradient_scroll("[+] Waiting for AnyDesk", start_color=Color.ghost_white, end_color=Color.violet) # Print waiting message
81+
82+
pid = utility.find_anydesk() # Find AnyDesk PID
83+
84+
if pid: # If AnyDesk is running
85+
anydesk_pid = pid[0] # Get the first PID
86+
grab(anydesk_pid) # Call the grab function
87+
88+
time.sleep(1) # Sleep for 1 second before checking again
89+
90+
91+
if __name__ == "__main__":
92+
utility.console_transparency() # Set console transparency
93+
main() # Call the main function

0 commit comments

Comments
 (0)