• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > python批量提交沙箱问题实例

python批量提交沙箱问题实例

作者:shichen2014 字体:[增加 减小] 来源:互联网

shichen2014 通过本文主要向大家介绍了安全沙箱问题,python开发实例,python脚本编写实例,python项目实例,python开发网站实例等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

本文实例讲述了python批量提交沙箱问题,分享给大家供大家参考。具体方法如下:

出现的问题如下:

1. Popen的使用,在linux下参数用列表传,不要用字符串传   否则可能会有“OSErrorror: [Errno 2] No such file or directory”错误

2. 列表要拷贝用 shutil模块中  不然会连续append..提交完第一个样本后,后面的提交参数就错了。

代码如下:

import os 
from subprocess import Popen 
 
class SubmitCuckoo: 
  """""" 
 
  def __init__(self, dirctory): 
    """Constructor""" 
    self._dirctory = dirctory 
    self._pargs = ["/usr/bin/python", "/home/xxx/xxx/submit.py"] 
   
  def _file_callback(self, file_path): 
    args = ["/usr/bin/python", "/home/xx/xxx/submit.py"] 
    args.append(file_path) 
    print "args:",args 
    Popen(args) 
     
  def submit_cuckoo(self, file_callback=_file_callback): 
    """ 
     
    """ 
    dir = self._dirctory 
    for root, dirs, files in os.walk(dir):  
      for f in files:  
        file_path = os.path.join(root, f)  
        if file_callback:  
          file_callback(self, file_path) 
 
if __name__ == "__main__": 
  submit_cuckoo = SubmitCuckoo(r"/home/xxx/xxx/samples") 
  submit_cuckoo.submit_cuckoo() 

</div>

希望本文所述对大家的Python程序设计有所帮助。

</div>

您可能想查找下面的文章:

  • python批量提交沙箱问题实例
  • python批量提交沙箱问题实例

相关文章

  • Python语言的12个基础知识点小结
  • 在Python的Django框架中使用通用视图的方法
  • Python脚本实现网卡流量监控
  • python读写ini文件示例(python读写文件)
  • Python简单实现enum功能的方法
  • Python模拟登录12306的方法
  • 详解Python程序与服务器连接的WSGI接口
  • wxPython中listbox用法实例详解
  • Python3连接MySQL(pymysql)模拟转账实现代码
  • python基础教程之popen函数操作其它程序的输入和输出示例

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Python中replace方法实例分析
    • 浅谈Python生成器generator之next和send的运行流程(详解)
    • python正则表达式match和search用法实例
    • 详解Django中的权限和组以及消息
    • Python入门篇之字典
    • Python语言的面相对象编程方式初步学习
    • 总结网络IO模型与select模型的Python实例讲解
    • python开发的小球完全弹性碰撞游戏代码
    • 基python实现多线程网页爬虫
    • python实现的系统实用log类实例

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有