1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
import os import pyautogui as pag import pyperclip import win32clipboard as w import win32con import time
address_bar=(1322,107) test_result=(142,365)
api_addr="https://www.virustotal.com/gui/file/"
samples_addr="E:\Linux_sh\malware\Linux-Malware-Samples" report_addr="E:/Linux_sh/report_"+samples_addr+".txt" test_str="00ae07c9fe63b080181b8a6d59c6b3b6f9913938858829e5a42ab90fb72edf7a" url=api_addr+test_str flag=1
def get_text(): w.OpenClipboard() d = w.GetClipboardData(win32con.CF_TEXT) w.CloseClipboard() return d.decode('utf-8')
def examine(file): url=api_addr+file pag.click(address_bar[0],address_bar[1],1) pag.hotkey('alt','d') pyperclip.copy(url) pag.hotkey('ctrl','v') pag.keyDown('enter') pag.keyUp('enter') time.sleep(2) pag.click(test_result[0],test_result[1],2) pag.hotkey('ctrl','c') result=get_text() if result=='0': flag=0 else: flag=1 print('%s:%d\n'%(test_str,flag))
if __name__ == "__main__": path=samples_addr samples=os.listdir(samples_addr) for file in samples: examine(file)
|