• 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利用datetime模块计算时间差
  • Python实现计算两个时间之间相差天数的方法
  • Python Socket编程详细介绍
  • Python实现代码统计工具(终极篇)
  • jupyter安装小结
  • python使用win32com库播放mp3文件的方法
  • 独特的python循环语句
  • Python中尝试多线程编程的一个简明例子
  • Pycharm学习教程(2) 代码风格
  • python 生成目录树及显示文件大小的代码

文章分类

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

最近更新的内容

    • python模拟登录百度代码分享(获取百度贴吧等级)
    • 使用Python的判断语句模拟三目运算
    • Python中使用logging模块代替print(logging简明指南)
    • 在Python的框架中为MySQL实现restful接口的教程
    • win7安装python生成随机数代码分享
    • Python运算符重载用法实例分析
    • python爬取本站电子书信息并入库的实现代码
    • Python求解平方根的方法
    • python通过get,post方式发送http请求和接收http响应的方法
    • python处理json数据中的中文

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

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