Posts

Showing posts with the label Codes and tips

Scheduled Skype Message in Python

To send a message on Skype at a scheduled time, you can use the schedule library in Python along with the skype4py library to interact with the Skype API. Here is an example of how you can schedule a message to be sent on Skype: import schedule import time import skype4py def send_message (): # Create a new Skype object skype = skype4py.Skype() # Connect to the Skype API skype.Attach() # Send the message to the desired recipient skype.SendMessage( "skype_username" , "Hello, this is a scheduled message." ) # Schedule the send_message function to run at a specific time schedule.every().day.at( "22:30" ).do(send_message) while True : schedule.run_pending() time.sleep( 1 ) This code will send a message "Hello, this is a scheduled message." to the skype user 'skype_username' every day at 22:30. You can change the schedule time and message as per your requirements. Note: In order to use this code,...

Python Scapy and its uses.

Python Scapy is a powerful packet manipulation tool that allows users to send, sniff, dissect, and forge network packets. It is written in Python and can be used for a wide range of purposes, including network security and testing, packet capture and analysis, and network protocol development. One of the primary uses of Scapy is network security testing. It allows users to create and send custom packets over the network, sniff and analyze packets, and perform various types of scans and tests to identify vulnerabilities and potential security threats. Scapy can be used to perform tasks such as port scanning, network discovery, and vulnerability assessment, as well as more advanced tasks such as packet injection and spoofing. In addition to security testing, Scapy is also commonly used for packet capture and analysis. It provides a rich set of functions and classes that allow users to dissect packets and extract specific fields and payloads. This can be useful for tasks such as analyzing...

Beginner Java Programmer.

  A Basic Java Program to print "Hello World".

Decode Base64 and ROT13 in Linux Terminal

Below are the commands , to Decode and Encoded text from Base64 and Rot13. It is a handy and easy technique required in CTFs. Alternatively we can also google and use any website offering decoding of text from these two types. But in terminal we can decode it quickly and save our precious time. From Base64 we use the function base64 and option -d (for decode). $ base64 -d data.txt From ROT13 (also called as rotated 13 times) we use the function tr (for translation). the text must be echo first and piped into tr with two strings as arguments. $ echo " GUR CNFFJBEQ VF 5GR8L4QETPESPK8HTQJHRK8XSP6X2RHH" |tr '[A-Za-z]' '[N-ZA-Mn-za-m]' -574r570rm

Creating a Keyboard shortcut to Terminal

In Kali linux , the keyboard shortcut to Terminal is missing by default, that was a convenience that pentesters miss the most. We had this available by default in backtrack. One way to open terminal with keyboard is to press Alt + F2 , a command window will open , and write " gnome-terminal " and press Enter. Second way is to create a keyboard shortcut permanently to the terminal. For this, we will goto Settings > Devices > Keyboard. In the shortcuts section, scroll down to the end of the list , we will find a " + " sign, that is for adding a new shortcut. We have three text boxes here to fill. 1- Name : Enter the Name for the Shortcut e.g. "Terminal". 2- Command :Enter the command for the program. In our case its terminal. The command for terminal is " gnome-terminal". 3- Shortcut :  press the buttons you want to use as a keyboard shortcut for the above command. Here it can be "Ctrl+T" or " Super+T" or y...

VLC Player not working or opening in Kali 2.0

Hello Kali fans, I installed the famous vlc player on my kali 2.0 but unfortunately it was not executing properly and was not opening at all. So, here is a fix for that if you find yourself in the same situation. open terminal window and type hexeditor /usr/bin/vlc It will open a hexeditor of vlc file, be careful not to change anything here that you don't know of, because it can make vlc crash completely. Press ctrl+w to open the search dialog box,  Press enter for the option, to search for a string  Type geteuid in the search bar and press enter. Press tab and the cursor is now on the g of geteuid, Start writing getppid ,as it will overwrite the text, make sure to not press any other key. Dont worry if you can't see what you are writing, just make sure when you type g it is overwritten on the already written g of geteuid. Press ctrl+x to save and exit. Open VLC player it will work now. CYB3RTR0N , 574r570rm

Missing "New Document" in Right-Click Menu in Kali

Having a new document /text file in right menu is very convenient. In Kali rolling i found it missing. Below is the method of how to add a new text file/ New Document to the right click menu. In Root Folder search for Templates folder. Inside Templates folder , if you are in GUI , right click and open In terminal , Now you are in Terminal , type leafpad "New Document". I am using leafpad , you can use any text editor of your choice  that is installed in your system. Save that New Document empty text file in templates folder. and thats it, you have New document / Text file in your right menu. 574r570rm

How to install Virtual box in Kali linux rollling

I made Kali linux (rolling) as the primary OS for one of my systems.The problem i faced was in installation of virtual box. Regular method i.e. apt-get install virtualbox , was not working. After doing my research ,i found this method working for me... S Sharing here so that someone in a similar situation as mine can use it. Add the following line to /etc/apt/sources.list deb http://mirror.nus.edu.sg/kali/kali kali-rolling main non-free contrib do the following, second command might take some time, let it finish completely. apt-get update apt-get dist-upgrade Once the upgrade is completed , run apt-get install virtualbox CYB3RTR0N

Basic python program in linux to see if a port is open

Below is a simple python program in linux to see if a port is open or close. #!/usr/bin/python import socket ip = raw_input("Enter the IP Address: ") port = input("Enter the Port Number: ") sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if sock.connect_ex((ip,port)):         print "Port",port, "is closed" else:         print "Port",port, "is open" We will use which python.py to know about the location of python, so we can use it in hash bang. next we are importing the socket library. taking as input and port are self explanatory. SOCKET constants and functions are used to get socket connected to sock variable. connect_ex will throw an exception if the port is closed , and we are utilizing it to display "the port is closed" else it will be open. make it executable and run,... I am not going into details, as there are many tutorials out there to learn the basics. CYB3RTR0N

Bash program to find active ips

I am learning Ethical hacking and penetration testing these days, and thought to write something in blog so that it can be helpful for others. So today i learned how to write a bash program to find active ips on your network. here is the program, i will explain it below. #!/bin/bash if [ "$1" == "" ] then echo "Usage: ./ping.sh [network]" echo "Example: ./ping.sh 192.168.1" else for x in {1..254} ; do ping -c 1 $1.$x |grep "64 bytes"|cut -d" " -f4|sed 's/.$//' done fi I won't go into the complete details , instead i am writing out only the problems i faced. first is the if command syntax , there is a space after if [ , it will give error if you write without space if[  The seq command somehow didn't worked for me, (i am using ubuntu 17), so i used {1..254}, this command will let the variable take one value at a time from 1 to 254 semi colon after the range is defined. must use a space after sed...