• 0 赞同
    2 帖子
    101 浏览

    TG联系方式:https://t.me/pg6532121

  • 0 赞同
    1 帖子
    174 浏览
    尚无回复
  • 0 赞同
    2 帖子
    562 浏览

    手动获取cookie,然后循环执行requsts请求不行吗?requests请求有加密参数?

  • 求抢票代码

    开源分享
    0 赞同
    1 帖子
    445 浏览
    尚无回复
  • 求助、制作一个自动流程

    技术交流
    0 赞同
    3 帖子
    2k 浏览

    Selenium:用于自动化网页操作,比如自动输入账号、密码、验证码,选择表单位置等。
    Pandas:用于读取 Excel 数据。

    1、读取 Excel 表格数据:

    import pandas as pd
    #读取 Excel 表格数据
    excel_path = '你的本地excel.xlsx'
    df = pd.read_excel(excel_path)
    # 假设表格有 'date', 'data1', 'data2' 列
    row_data = df[df['date'] == '今天日期']
    data1 = row_data['data1'].values[0]
    data2 = row_data['data2'].values[0]

    2、初始化 Selenium:

    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.common.keys import Keys
    driver = webdriver.Chrome()
    driver.get('your_login_url')

    2、自动填写账号、密码、验证码:

    # 找到并填写账号、密码
    driver.find_element(By.ID, 'username_field').send_keys('your_username')
    driver.find_element(By.ID, 'password_field').send_keys('your_password')
    # 获取验证码图片并识别(需要验证码不复杂的情况)
    captcha_image = driver.find_element(By.ID, 'captcha_image')
    captcha_image.screenshot('captcha.png')
    # 使用 OCR 识别验证码
    from pytesseract import image_to_string
    import cv2
    captcha_text = image_to_string(cv2.imread('captcha.png'))
    driver.find_element(By.ID, 'captcha_field').send_keys(captcha_text.strip())
    # 提交表单
    driver.find_element(By.ID, 'login_button').click()

    3、进入填报页面并填入 Excel 数据:

    # 进入对应页面
    driver.get('form_page_url')
    # 填写数据
    driver.find_element(By.ID, 'data1_field').send_keys(data1)
    driver.find_element(By.ID, 'data2_field').send_keys(data2)
    # 提交数据
    driver.find_element(By.ID, 'submit_button').click()

    4、关闭浏览器:

    driver.quit()

    这样可以完成基本的自动登录和填报数据流程。

  • 0 赞同
    1 帖子
    2k 浏览
    尚无回复
  • 0 赞同
    4 帖子
    1k 浏览

    @k1995 非常感谢大佬,可以了!

  • UE5安卓打包问题求助

    综合交流
    0 赞同
    1 帖子
    1k 浏览
    尚无回复
  • 用 NodeBB 建了一个开发者社区

    NodeBB
    0 赞同
    1 帖子
    2k 浏览
    尚无回复
  • 来个熟练工程师 做副业 定制单

    招聘
    0 赞同
    1 帖子
    2k 浏览
    尚无回复
  • 0 赞同
    1 帖子
    2k 浏览
    尚无回复
  • GitHub App支持中文了

    综合交流
  • 0 赞同
    1 帖子
    3k 浏览
    尚无回复
  • 爬虫下载图片报错怎么解决

    技术交流
    0 赞同
    2 帖子
    6k 浏览

    10054一般是对端sock关闭了,上位机连接PLC一般PLC需要重启,你这是不是访问太频繁了,要不换成匿名IP

  • 0 赞同
    1 帖子
    5k 浏览
    尚无回复
  • 0 赞同
    1 帖子
    4k 浏览
    尚无回复
  • vcpkg 下载慢问题

    综合交流
    0 赞同
    1 帖子
    4k 浏览
    尚无回复
  • Server-side request forgery (SSRF) attacks

    技术交流
    0 赞同
    1 帖子
    4k 浏览
    尚无回复
  • 0 赞同
    10 帖子
    5k 浏览

    文件内容的验证存在缺陷
    Flawed validation of the file's contents

    更安全的服务器不会隐式信任请求中指定的Content-Type内容,而是尝试验证文件的内容是否确实与预期内容匹配。
    Instead of implicitly trusting the Content-Type specified in a request, more secure servers try to verify that the contents of the file actually match what is expected.

    在图像上传功能的情况下,服务器可能会尝试验证图像的某些固有属性,例如其尺寸。例如,如果您尝试上传 PHP 脚本,它根本不会有任何维度。因此,服务器可以推断出它不可能是图像,并相应地拒绝上传。
    In the case of an image upload function, the server might try to verify certain intrinsic properties of an image, such as its dimensions. If you try uploading a PHP script, for example, it won't have any dimensions at all. Therefore, the server can deduce that it can't possibly be an image, and reject the upload accordingly.

    同样,某些文件类型的页眉或页脚可能始终包含特定的字节序列。这些可以像指纹或签名一样使用,以确定内容是否与预期的类型匹配。例如,JPEG 文件始终以字节 FF D8 FF开头。
    Similarly, certain file types may always contain a specific sequence of bytes in their header or footer. These can be used like a fingerprint or signature to determine whether the contents match the expected type. For example, JPEG files always begin with the bytes FF D8 FF.

    这是一种更可靠的验证文件类型的方法,但即使这样也不是万无一失的。使用特殊工具(例如 ExifTool),在其元数据中创建包含恶意代码的多语言 JPEG 文件可能很简单。
    This is a much more robust way of validating the file type, but even this isn't foolproof. Using special tools, such as ExifTool, it can be trivial to create a polyglot JPEG file containing malicious code within its metadata.

  • 路径穿越(Path traversal)

    技术交流
    0 赞同
    6 帖子
    5k 浏览

    利用路径遍历漏洞的常见障碍
    Common obstacles to exploiting path traversal vulnerabilities

    应用程序可能要求用户提供的文件名以预期的文件扩展名结尾,例如.png .在这种情况下,可以使用 null 字节在所需扩展名之前有效地终止文件路径。例如:filename=../../../etc/passwd%00.png。

    An application may require the user-supplied filename to end with an expected file extension, such as .png. In this case, it might be possible to use a null byte to effectively terminate the file path before the required extension. For example: filename=../../../etc/passwd%00.png.

    Lab: File path traversal, validation of file extension with null byte bypass

    This lab contains a path traversal vulnerability in the display of product images.

    The application validates that the supplied filename ends with the expected file extension.

    To solve the lab, retrieve the contents of the /etc/passwd file.

    实验步骤

    5a30fc5e-9f40-4f10-87c2-077b12e90764-image.png

    如何防止路径遍历攻击
    How to prevent a path traversal attack

    防止路径遍历漏洞的最有效方法是完全避免将用户提供的输入传递给文件系统 API。许多执行此操作的应用程序函数可以重写,以更安全的方式提供相同的行为。
    The most effective way to prevent path traversal vulnerabilities is to avoid passing user-supplied input to filesystem APIs altogether. Many application functions that do this can be rewritten to deliver the same behavior in a safer way.

    如果您无法避免将用户提供的输入传递给文件系统 API,我们建议使用两层防御来防止攻击:
    If you can't avoid passing user-supplied input to filesystem APIs, we recommend using two layers of defense to prevent attacks:

    *在处理用户输入之前对其进行验证。理想情况下,将用户输入与允许值的白名单进行比较。如果无法做到这一点,请验证输入是否仅包含允许的内容,例如仅包含字母数字字符。 (Validate the user input before processing it. Ideally, compare the user input with a whitelist of permitted values. If that isn't possible, verify that the input contains only permitted content, such as alphanumeric characters only.)

    验证提供的输入后,将输入附加到基目录,并使用平台文件系统 API 对路径进行规范化。验证规范化路径是否以预期的基目录开头。(After validating the supplied input, append the input to the base directory and use a platform filesystem API to canonicalize the path. Verify that the canonicalized path starts with the expected base directory.)

    下面是一个简单的 Java 代码示例,用于根据用户输入验证文件的规范路径:
    (Below is an example of some simple Java code to validate the canonical path of a file based on user input:)

    File file = new File(BASE_DIRECTORY, userInput); if (file.getCanonicalPath().startsWith(BASE_DIRECTORY)) { // process file }