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

Hastebin and capturing images of the users screen? #7

Open
jbrink90 opened this issue Sep 25, 2023 · 1 comment
Open

Hastebin and capturing images of the users screen? #7

jbrink90 opened this issue Sep 25, 2023 · 1 comment

Comments

@jbrink90
Copy link

May I ask the purpose of the code in these locations?

snippet.py

def get_img(msg):
	chrome_options = webdriver.ChromeOptions()

	chrome_options.binary_location = os.environ.get("GOOGLE_CHROME_BIN")
	chrome_options.add_argument('--disable-dev-shm-usage')
	chrome_options.add_argument('--no-sandbox')
	chrome_options.add_argument("--headless")
	chrome_options.add_argument('window-size=2560x10000')
	driver = webdriver.Chrome(executable_path=os.environ.get("CHROMEDRIVER_PATH"), chrome_options=chrome_options)

	driver.maximize_window()

	base64_string = base64.b64encode(msg.encode("ascii"))
	base64_string = base64_string.decode("ascii").replace("+", "%2B")

	driver.get(f"https://ray.so/?code={base64_string}&background=true&darkMode=true&colors=breeze&padding=64&title=Code&language=javascript")

	driver.execute_script("document.querySelector('section.controls').remove();")

	ret = driver.find_element_by_class_name("drag-control-points").screenshot_as_png
	driver.quit()
	return ret

app.py

TELEGRAM_KEY = os.environ.get("TELEGRAM_KEY")
CHAT_ID = -1001520685235

bot = None
try:
    bot = Bot(TELEGRAM_KEY)
except Exception as e:
    print("Telegram bot couldn't start", e)

...

@app.route("/submit/", methods=["POST"])
@limiter.limit("5/hour")
def submit():
    code = request.json["code"]

    image = get_img(code)
    req = requests.post('https://hastebin.com/documents', data=code)

    if bot: bot.send_document(chat_id=CHAT_ID, document=image, filename="New Submission", caption=f'https://hastebin.com/{req.json()["key"]}')

    return "", 204
@lunaDHD
Copy link

lunaDHD commented Mar 28, 2025

Looks to me like is pretty simply submitting the custom sorts to a image hosting site so they can see how it works? /submit/ with a limit of 5 an hour looks pretty obviously like a API it contacts when it submits an image, and its referencing "code" which sounds like the code captured from the textbox. Pretty obvious IMO but maybe i'm missing something.

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

No branches or pull requests

2 participants