首页 \ 问答 \ 给定md5哈希时如何查找特定文件(How to find specific file when given md5 Hash)

给定md5哈希时如何查找特定文件(How to find specific file when given md5 Hash)

我们的服务器已被标记为僵尸网络的一部分,我们已经获得了所谓的坏文件的md5哈希值。

我读过的所有例子和建议都不符合我的要求。 我正在寻找的是如何根据我们给出的md5哈希找到这个特定的文件。

我是否需要为计算机上的每个文件生成md5哈希值然后进行比较,或者是否有更简单的方法来搜索它? 如果没有,我该怎么做呢?


Our server has been flagged as being part of a botnet, and we've been given the md5 hash values of the supposedly bad files.

All the examples and suggestions I've read don't quite match what I need. All I'm looking for is how to find this specific file based on the md5 hash we've been given.

Do I need to generate an md5 hash for each file on the computer and then compare it, or is there some easier way to search for this? If not, how would I go about this?


原文:https://stackoverflow.com/questions/31209647
更新时间:2024-04-25 13:04

最满意答案

所以你想要做的就是将输入的电子邮件地址转换为小写。 您可以通过继承auth公司并为该字段添加一个干净的方法来完成此操作:

class EmailAuthForm(AuthenticationForm):
    def clean_username(self):
        return self.cleaned_data["username"].lower()

现在通过urls.py在视图中使用它。

url(r'^login/$', auth_views.LoginView.as_view(authentication_form=EmailAuthForm), name="login")

So it seems that all you want to do is convert the entered email address to lower case. You can do this by subclassing the auth firm and adding a clean method for the field:

class EmailAuthForm(AuthenticationForm):
    def clean_username(self):
        return self.cleaned_data["username"].lower()

And now use this in the view via urls.py.

url(r'^login/$', auth_views.LoginView.as_view(authentication_form=EmailAuthForm), name="login")

相关问答

更多
  • 根据我的理解,您可以使用ACCOUNT_FORMS覆盖默认的LoginForm,但您需要提供一个包含原始类中提供的所有方法的类。 你的班级缺少login方法。 我会在您的settings.py文件中设置ACCOUNT_FORMS = {'login': 'yourapp.forms.YourLoginForm'} ,其中YourLoginForm继承自原始类。 # yourapp/forms.py from allauth.account.forms import LoginForm class You ...
  • 首先,您不应该编写自己的注册/认证系统。 那里有很多经过试验和测试的解决方案。 Django Allauth浮现在脑海中。 其次,如果您在ajax中发送登录数据,则希望视图返回ajax响应 if user is not None and user.is_active: login(request, user) return JsonResponse({'status': 'ok'}); else: return JsonResponse({'s ...
  • 好的,我最终找到了一个这样做的方法,虽然我确定有更好的方法。 我创建了一个名为LoginFormMiddleware的新的中间件类。 在process_request方法中,或多或少处理形式的auth登录视图: class LoginFormMiddleware(object): def process_request(self, request): # if the top login form has been posted if request.method ...
  • django在创建和维护用户方面一直很有帮助。 看看这个链接。 请评论是否有效。 :-) django have always been helpful with its flexibility in creating & maintaining users. Have a look at this link. Kindly comment if it works or not. :-)
  • 我的猜测是因为命名而得到了这个问题。 您将以下内容传递给上下文: form = AuthenticationForm() postform = PostForm(request.POST or None) ... context = { "object_list": queryset, "title": "List", "form": postform, "form2": form } 因此, ...
  • 您可以使用包含模板标记来构建自定义标记,如下所示: {% login_form %} 您可能希望将此标记传递给request.get_absolute_uri以便它可以在登录视图的?next={{ request.get_absolute_uri }}参数中使用它,以便用户在登录后可以重定向到当前页面。 这样,您可以在任何模板的任何位置放入登录表单,而不违反DRY原则。 你甚至可以使用类似下面的内容将它嵌入到你的基本模板中: {% if not user.is_authenticated %} {% ...
  • 您的请求不会通过process_form_data方法传递。 解决方案1 - 在process_form_data方法中记录用户: form_data = process_form_data(self.request, form_list) def process_form_data(request, form_list) ... 解决方案2 - 使用done方法记录用户: class ProfilWizard(SessionWizardView): template_name = "gestio ...
  • 所以你想要做的就是将输入的电子邮件地址转换为小写。 您可以通过继承auth公司并为该字段添加一个干净的方法来完成此操作: class EmailAuthForm(AuthenticationForm): def clean_username(self): return self.cleaned_data["username"].lower() 现在通过urls.py在视图中使用它。 url(r'^login/$', auth_views.LoginView.as_view(auth ...
  • 您需要在模板中的
    标记内的某处{% csrf_token %} 。 有关更多信息,请参阅有关跨站点请求伪造的Django文档 。 You need {% csrf_token %} somewhere inside your tag in the template. See the Django docs on Cross-site request forgery for more information.
  • 请使用return render(request, template_name, context_dict)来呈现模板。 你特有的方式可能剥夺了它的背景。 另外, 看看这个装饰器 , if request.user != None :语句,请使用它而不是当前的装饰器 。 Please use return render(request, template_name, context_dict) to render templates. Your peculiar way probably strips it ...

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)