给定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覆盖Django allauth登录表单(Overriding Django allauth login form with ACCOUNT_FORMS)

根据我的理解,您可以使用ACCOUNT_FORMS覆盖默认的LoginForm,但您需要提供一个包含原始类中提供的所有方法的类。 你的班级缺少login方法。 我会在您的settings.py文件中设置ACCOUNT_FORMS = {'login': 'yourapp.forms.YourLoginForm'} ,其中YourLoginForm继承自原始类。 # yourapp/forms.py from allauth.account.forms import LoginForm clas...

Django AJAX登录表单验证(Django AJAX login form validation)

首先,您不应该编写自己的注册/认证系统。 那里有很多经过试验和测试的解决方案。 Django Allauth浮现在脑海中。 其次,如果您在ajax中发送登录数据,则希望视图返回ajax响应 if user is not None and user.is_active: login(request, user) return JsonResponse({'status': 'ok'}); else: return JsonRespons...

在每个页面上放置一个django登录表单(Putting a django login form on every page)

好的,我最终找到了一个这样做的方法,虽然我确定有更好的方法。 我创建了一个名为LoginFormMiddleware的新的中间件类。 在process_request方法中,或多或少处理形式的auth登录视图: class LoginFormMiddleware(object): def process_request(self, request): # if the top login form has been posted if request.m...

为自定义Django用户创建登录页面?(Creating a login page for custom Django users?)

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. :-)

如何使用django登录表单(how to put a login form using django)

我的猜测是因为命名而得到了这个问题。 您将以下内容传递给上下文: form = AuthenticationForm() postform = PostForm(request.POST or None) ... context = { "object_list": queryset, "title": "List", "form": postform, "form2": form }...

如何在Django的整个站点上提供登录表单(How to make the login form available on whole site on Django)

您可以使用包含模板标记来构建自定义标记,如下所示: {% login_form %} 您可能希望将此标记传递给request.get_absolute_uri以便它可以在登录视图的?next={{ request.get_absolute_uri }}参数中使用它,以便用户在登录后可以重定向到当前页面。 这样,您可以在任何模板的任何位置放入登录表单,而不违反DRY原则。 你甚至可以使用类似下面的内容将它嵌入到你的基本模板中: {% if not user.is_authenticated %} ...

使用formwizard-django创建用户后登录(Login after creating a user with formwizard-django)

您的请求不会通过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 = "g...

创建我自己的登录表单django(creating my own login form django)

所以你想要做的就是将输入的电子邮件地址转换为小写。 您可以通过继承auth公司并为该字段添加一个干净的方法来完成此操作: class EmailAuthForm(AuthenticationForm): def clean_username(self): return self.cleaned_data["username"].lower() 现在通过urls.py在视图中使用它。 url(r'^login/$', auth_views.LoginView.as_view...

无法在Django中创建登录表单(Trouble creating login form in Django)

您需要在模板中的<form>标记内的某处{% csrf_token %} 。 有关更多信息,请参阅有关跨站点请求伪造的Django文档 。 You need {% csrf_token %} somewhere inside your <form> tag in the template. See the Django docs on Cross-site request forgery for more information.

Django登录部分(Django login part)

请使用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 stri...

相关文章

更多

收藏的几个国内国外MD5在线解密网站

转自:http://www.cnblogs.com/dyygtfx/archive/2013/06/0 ...

移动MM failed to find resource file{mmiap.xml}

原地址:http://blog.csdn.net/alking_sun/article/details ...

Redis 哈希(Hash)详解

Redis hash 是一个string类型的field和value的映射表,hash特别适合用于存储 ...

could not find system property or JNDI

Thanks everyone!! Finally got a solution for this p ...

把一个对象数组映射成hash?

问题是这样的 我有一个表 option ,有两个字段 key value 我在rails里 ...

用‘button’跟‘text’组合代替‘file’,选择文件后点‘submit’,‘file’的值被清空

各位大虾晚上好,我有个问题想请教你们,我想美化html的file外观,但貌似现在还不能用css直接设计 ...

Java 流(Stream)、文件(File)和IO

Java 流(Stream)、文件(File)和IO Java.io包几乎包含了所有操作输入、输 ...

xxx is not in the sudoers file解决方法

用sudo时提示&quot;xxx is not in the sudoers file. This ...

PHP 中dirname(_file_)

PHP 中dirname(_file_) 2007-5-3 16:00|查看: 19256|评论: ...

【HDFS】HADOOP DISTRIBUTED FILE SYSTEM

【HDFS】Hadoop DISTRIBUTED FILE SYSTEM THE CAST CLIEN ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本