Posts

Image
Creating my First GUI Application using Python We will learn • Creating GUI Window in python: Tkinter • Using nested loops • Playing sound in python How this program works ( General Logic )–––– Problems Faced––– I wanted a GUI program, so I used Tkinter, but the timer variable(stime) was not updating causing no output in the GUI window. So, I used the update() function in Tkinter to update ‘stime’, every time I set the value to stime in the loop. Program: –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– from tkinter import * import time import playsound self = Tk() # setting the title for our window self.title("Excercise Timer") #configuring background colour for our window self.configure(bg="black") #creating a variable basically this is our timer label stime = StringVar() #setting the initial value of the variable stime.set("00") #function def func():     nsets = int(setsVar.get()) #getting values from the sets entry     wt ...
Image
 PLAYING WITH PYTHON Learning Outcomes: Defining functions Recursive function using Graphics Using if else statements and for loops Aim of the program Creating a program to represent Fibonacci sequence graphically (Fibonacci spiral) . #Febonacci sequence  The Fibonacci sequence, also known as Fibonacci numbers, is defined as the sequence of numbers in which each number in the sequence is equal to the sum of two numbers before it. The Fibonacci Sequence is given as: Fibonacci Sequence = 0, 1, 1, 2, 3, 5, 8, 13, 21, …. This is the graphical representation of Fibonacci sequence   If you sum the squares of any series of Fibonacci numbers, they will equal the last Fibonacci number used in the series times the next Fibonacci number.  This property results in the Fibonacci spiral, based on the following progression and properties of the Fibonacci series: 12 + 12 + 22 + 32 + 52 = 5 x 8 Let’s start simulating.. STEP-1 : writing the program ***Import turtle (graphics module in...
Image
 EXPLOITING VULNERABILITIES LEARNING : It is always important to update the software we are using, since every update of a software may not have major changes but have some minor patches which may fix these vulnerabilities and reduce the cyber risk. As a system admin it is always recommended to harden operating system as per the standard operating architecture. example of IRCD  running on unix machine with out a proper patch can give a back door to hacker.  following lab simulates how a vulnerability in unrealIRCD can be exploited by an attacker. steps involved:: step one:::                    - using metasploit framework -search unrealircd (to check if any exploit is present)                      step 2::                   -use the exploit                         ...
Image
 MT FIRST BASH SHELL SCRIPT .. This  script pings every ip address in a subnet and outputs the status of that ip whether that  particular ip is assigned to a device or not. STEPS::::::: step 1------- open a new file(here i am using nano )  Now write the first line as : #!bin/bash This helps the shell to recognise the file as a script. Now you can add  comments just by putting "#" symbol before your comment . step 2----- Write your script  Here i am  using For loop since, i have to ping multiple times  here i also used exit status. Exit status tells whether the previous command was successfull or failled with any error. 0 means the command was succesfull and 1-255 any number in this range means an error(command failed to execute or unsuccessfull) In ping command 0 means there was a reply from ip address and 1 means no reply, rest may be for other network errors. Here to minimize time i used -c and -w options in ping command. -c is used to terminate...
Image
Setting up an sftp server.. Establishing a sftp server with only access to sftp(no access to shell) QuickGo step1--Enable ssh step2--turn firewall of on the port 22(or any static port you set for ssh) step3--create users/groups and setting up passwords for created users step4--create folders for the users to upload and download files( land on)(set permissions accordingly) step5--Edit the sshd_config file to set the users permissions step6--restart the sshd service step7--login with your user.. Step by step procedures are as follows::::::  (note:::here i am using ubuntu as my server) --Step1 First install ssh (ignore if already installed) use command:- "apt-get install openssh-server" --Step 2 Disable blocking by firewall on port 22 .(since it is the default port for ssh) use command: "ufw allow ssh" --Step3 Now comes the main part, Create users  (here i created 5 users two in one group and two in other the 5th one in both) now check whether they are created now crea...
Image
Advanced uses of ssh Advance usage of SSH SSH -LOCAL PORTFORWARDING Usually Ssh is used for connecting remote servers only, but it can be more complex by tweeking tools. for example, local and dynamic port forwarding. Using Local portforwarding to create a private tunnel between client and a secondary server in the network of primary server. General understanding--- Step 1 First connect the client and primary server(mentioned in prev blog..) follow the step provided in the image below: connection succesfull!! Step 2 Once connected, open any browser and mention the listening port of client it will redirect to the destination port and IP.
Image
Advanced uses of ssh Advance usage of SSH What is Authentication? Authentication is the process of taking an identity and using some form of verification, the identity can be verified as being legitimate. Privacy and Confidentiality. Why Authentication? it is used for users.. Privacy security Confidentiality Popular Types of ssh Authentication these types are the most general and used by many users Password Public key Eshtablishing a passwordless connection with the remote host using ssh here's the image explaining the working of Public key authentication mechanism in ssh- What generally happens? When the user first connects to the server via ssh,the client asks the user whether to trust the server or not , if the user says yes, then it saves the server hash into a folder called known_hosts. Hence, the next time the user connects to the same se...