楼主: nkspark
收起左侧

[技术原创] 《云安全》在线系列讲座之二 --- 人云亦云

  [复制链接]
jefffire
头像被屏蔽
发表于 2011-3-21 15:03:25 | 显示全部楼层
nkspark 发表于 2011-3-21 07:13
讲座一参见:《云安全》在线系列讲座之一 --- 云安全基本概念,http://bbs.kafan.cn/thread-934671-1 ...

如果你有一个样本,能够被某个杀毒软件查出,却没有被本首席的这款全球最强软件查出的话,本首席直接把面前的显示器吃了。

很不幸,这样的样本很多,你需要吃显示器了。
sevenday
发表于 2011-3-21 15:09:43 | 显示全部楼层
很抱歉,吃显示器吧
李白vs苏轼
发表于 2011-3-21 15:09:47 | 显示全部楼层
回复 21楼 jefffire 的帖子

是用vt的API接口吧
李白vs苏轼
发表于 2011-3-21 15:12:26 | 显示全部楼层
What is the VirusTotal API?
The VirusTotal API lets you upload and scan files, submit and scan URLs, access finished scan reports and make automatic comments on URLs or samples without the need of using the HTML website interface. In other words, it allows you to build simple scripts to access the information generated by VirusTotal.

The chosen format for the API is HTTP POST requests with JSON object responses and it is limited to at most 20 requests of any nature in a given 5 minutes time frame. If you run a honeyclient, honeypot or any other automation that is going to provide resources to VirusTotal and not only retrieve reports you are entitled to a special API with a higher request rate quota, ask for it at info@virustotal.com. The public API is a free service, available for any web site or application that is free to consumers.

The API must not be used in commercial products or services, it can not be used as a substitute for antivirus products and it can not be integrated in any project that may harm the antivirus industry directly or indirectly. Noncompliance of these terms will result in inmediate permanent ban of the infractor individual or organization. Please see the terms of use for more information.

How do I start?
The process could not be easier. Sign up to VT Community (using the sign in box at the top left hand side of the page). Once you have a valid VT Community account, you will find your personal API key in the inbox of your account (sign in and drop down the My account menu). This key is all you need to use VirusTotal's API.

So what can I do with the VirusTotal API?
The following examples show how to perform specific tasks with the API, the examples are coded in Python, but take into account that they work with any coding language, you just need to be able to perform HTTP requests and load JSON objects. Some implementations of the API in other languages can be found at the bottom of this page.

Note that the API response format will always be a dictionary containing at least a result field. If the item you searched for was not present this result will be 0, if you exceeded the public API request rate it will be -2, if the API key provided is incorrect it will be -1, any other case is detailed in the following sections.
李白vs苏轼
发表于 2011-3-21 15:14:57 | 显示全部楼层
本帖最后由 李白vs苏轼 于 2011-3-21 15:27 编辑

Using VirusTotal API with Java
  1. JVirusTotal vt = new JVirusTotal(your_API_key);
  2. String url = "http://www.x.x";

  3. // submit an URL
  4. vt.submitScanURL(url);

  5. // retrieve an URL scan report
  6. vt.retrieveURLscan(url);

  7. // retrieve a file scan report
  8. vt.retrieveFilescan(getMD5Sum(new URL(url)));

  9. The following class is used to get the MD5 hash of a file, by giving its URL.
  10. import java.io.IOException;
  11. import java.io.InputStream;
  12. import java.math.BigInteger;
  13. import java.net.MalformedURLException;
  14. import java.net.URL;
  15. import java.security.MessageDigest;
  16. import java.security.NoSuchAlgorithmException;


  17. public class md5 {
  18.         /**
  19.          * it calculates the md5sum
  20.          *
  21.          * @param url file url
  22.          * @return md5sum
  23.          */
  24.         public static String getMD5Sum(URL url) {
  25.                 MessageDigest digest = null;

  26.                 try {
  27.                         digest = MessageDigest.getInstance("MD5");
  28.                 } catch (NoSuchAlgorithmException e) {
  29.                         e.printStackTrace();
  30.                 }

  31.                 byte[] buffer = new byte[8192];
  32.                 int read = 0;
  33.                 String output = "";

  34.                 InputStream is = null;

  35.                 try {
  36.                         is = url.openStream();

  37.                         while( (read = is.read(buffer)) > 0) {
  38.                                 digest.update(buffer, 0, read);
  39.                         }               
  40.                         byte[] md5sum = digest.digest();
  41.                         BigInteger bigInt = new BigInteger(1, md5sum);
  42.                         output = bigInt.toString(16);
  43.                 }
  44.                 catch(IOException e) {
  45.                         e.printStackTrace();
  46.                 } finally {
  47.                         try {
  48.                                 is.close();
  49.                         } catch(IOException e) {
  50.                                 e.printStackTrace();
  51.                         }
  52.                 }

  53.                 return output;
  54.         }

  55.         public static void main (String[] s) throws MalformedURLException{
  56.                 System.out.println(getMD5Sum(new URL("http://www.x.x")));
  57.         }
  58. }
复制代码

jefffire
头像被屏蔽
发表于 2011-3-21 15:23:30 | 显示全部楼层
nkspark 发表于 2011-3-21 07:13
讲座一参见:《云安全》在线系列讲座之一 --- 云安全基本概念,http://bbs.kafan.cn/thread-934671-1 ...

本来以为你是不懂。才发现原来您是混看雪论坛的。对装糊涂的人,我表示遗憾
nkspark
 楼主| 发表于 2011-3-21 15:28:50 | 显示全部楼层
jefffire 发表于 2011-3-21 15:03
如果你有一个样本,能够被某个杀毒软件查出,却没有被本首席的这款全球最强软件查出的话,本首席直接把面 ...


空口无凭啊,上图,上样本...
nkspark
 楼主| 发表于 2011-3-21 15:29:07 | 显示全部楼层
sevenday 发表于 2011-3-21 15:09
很抱歉,吃显示器吧


空口无凭啊,上图,上样本...
李白vs苏轼
发表于 2011-3-21 15:32:12 | 显示全部楼层
本帖最后由 李白vs苏轼 于 2011-3-21 15:47 编辑

首席,为啥在我这里就一闪而过什么也没有呢
你想怎样
头像被屏蔽
发表于 2011-3-21 15:32:29 | 显示全部楼层
楼主看来还是有点低调的,  还没用原创标签.

不过还是得到一个魅力呀
您需要登录后才可以回帖 登录 | 快速注册

本版积分规则

手机版|杀毒软件|软件论坛| 卡饭论坛

Copyright © KaFan  KaFan.cn All Rights Reserved.

Powered by Discuz! X3.4( 沪ICP备2020031077号-2 ) GMT+8, 2025-1-11 14:48 , Processed in 0.092769 second(s), 15 queries .

卡饭网所发布的一切软件、样本、工具、文章等仅限用于学习和研究,不得将上述内容用于商业或者其他非法用途,否则产生的一切后果自负,本站信息来自网络,版权争议问题与本站无关,您必须在下载后的24小时之内从您的电脑中彻底删除上述信息,如有问题请通过邮件与我们联系。

快速回复 客服 返回顶部 返回列表