Alfie Mellor

Alfie Mellor

1672888461

Learn Ethical Hacking - Full Course in 12 Hours

This video on "Ethical Hacking Full Course" will help you learn Ethical Hacking and Cyber Security concepts from scratch. You will learn about different kind of Cyber attacks and ethical hacking tools used to prevent such attacks. There are lot of demos on several ethical hacking tools in this Ethical Hacking Tutorial for Beginners video. You will also learn how to become an Ethical Hacker. 

Ethical Hacking Full Course - Learn Ethical Hacking in 12 Hours | Ethical Hacking Tutorial

Below are the topics covered in this Ethical Hacking tutorial:

  • What is Ethical Hacking ?
  • History of Ethical Hacking
  • Phases of Ethical Hacking
  • Cyber Threats
  • Fundamental of networking
  • Ethical HAcking using KAli Linux
  • What is Phishing ?
  • What is Brute Force Attack ?
  • Cross Site Scripting 
  • DDOS
  • SQL Injection
  • Ethical Hacking using Python 
  • Penetration Testing
  • Steganography
  • Nmap and DVWA
  • Installing DVWA
  • Kali linux vs ParrotOS
  • Ethical Hacking Roadmap 
  • How to become an Ethical Hacking?
  • Cybersecuirty interview questions and answers

#ethicalhacking #cybersecuirty #security #hacking #hacker 

Learn Ethical Hacking - Full Course in 12 Hours
Monty  Boehm

Monty Boehm

1670480220

Best Programming Languages for Ethical Hacking

The Most Effective Programming Languages for Ethical Hacking

Ethical or “white hat” hacking is the process of identifying vulnerabilities in computer systems and networks and then using that information to secure them. As new technologies are developed, so too are new ways to exploit them; and with the ubiquity of technology in our everyday lives (think the Internet of Things), it’s no surprise that ethical hacking has become a popular way to make a living.

To stay ahead of the curve, ethical hackers need to be able to adapt and learn new programming languages quickly. But what are the most effective programming languages for ethical hacking? In this article, we’ll take a look at the top three languages that are most commonly used by ethical hackers. We’ll also provide some resources to help you get started with each language.

  1. What Is a Programming Language?
  2. Why Do Hackers Need Programming Skills?
  3. Top Programming Languages for Hackers
  4. Best Programming Language for Beginners
  5. FAQs
    • Is C++ better than Python for hacking?
    • Do hackers use Python?
    • Do hackers use JavaScript?
    • Do ethical hackers need to know the C language in depth?
    • What other skills do you need to be a great ethical hacker?
    • How can ethical hackers make a living?
    • How much income can an ethical hacker make?
  6. Conclusion

What Is a Programming Language?

A programming language is a set of instructions that a computer can understand and execute. There are many different programming languages, each with their own syntax and semantics. Some programming languages are designed for specific tasks (such as SQL for databases), while others are more general-purpose (such as C or Python).

The three most common types of programming languages are:

Machine code. This is the native code that a computer can understand and execute. It’s usually specific to a certain type of processor or hardware architecture.

Assembly code. This is a low-level code that’s specific to a certain type of processor or hardware architecture. It’s usually written in mnemonic form, which makes it easier for humans to read and write.

High-level languages. These are more abstract than machine code or assembly code, and they aren’t tied to any particular hardware architecture. This makes them more portable and easier to write and read.

Why Do Hackers Need Programming Skills?

Programming skills are essential for ethical hacking, because they allow hackers to automate tasks, create their own tools to test systems for vulnerabilities, and understand how systems work. Without these skills, hackers would be limited to using only the tools that are available to them.

In addition, programming languages provide a common language that ethical hackers can use to communicate with each other. By learning a few common languages, ethical hackers can quickly share information and ideas with each other, which helps them stay ahead of the curve.

So if you’re interested in becoming an ethical hacker, or if you’re already one and you want to stay ahead of the curve, then learning a few programming languages is a good place to start.

Top Programming Languages for Hackers

The best language for you will depend on your level of experience, the type of hacking you’re interested in, and the operating system you’re using.

That said, there are some languages that are more popular among ethical hackers than others. Here are five of the most popular programming languages for hacking, along with a brief description of each.

C and C++

C and C++ are two of the most popular programming languages among ethical hackers. They’re both powerful languages that can be used to create a wide range of hacking tools.

C (ISO standard, Wikipedia) is a low-level language, which means it’s closer to machine code than high-level languages like Python. This makes C a good choice for writing system-level software, such as operating systems and network drivers. It’s also relatively easy to learn if you have a background in another programming language.

C++ (official site, Wikipedia) is an extension of the C programming language. It was designed to provide object-oriented programming features, such as classes and inheritance. C++ is a complex language, but it can be used to write very efficient code.

C and C++ are thus two fundamental languages that every hacker should learn. They will give you a good understanding of how computers work and provide a solid foundation on which to build more specific hacking tools.

Assembly

Assembly (Wikipedia) is a low-level programming language that’s used to write code for a specific type of processor. Assembly code is converted into machine code, which can be run on any computer that has a compatible processor.

Different processors have their own specific assembly languages, which makes it difficult to write code that can be run on multiple processors.

Assembly is a difficult language to learn, but it’s very powerful. It’s often used to write exploits, reverse engineering tools, and low-level system software.

If you’re interested in learning assembly, we recommend checking out the book The Art of Assembly Language Programming by Randall Hyde, considered to be one of the best resources for learning this complex language.

Python

Python (official site, Wikipedia, SitePoint) is a high-level programming language that’s widely used in the hacking community. It’s easy to learn, and it has a wide range of libraries that can be used for tasks such as network analysis, web scraping, and database manipulation.

Python is also a good choice for writing tools that need to be automated. For example, you can write a script that will automatically log in to a website and fill out a form.

Unlike C or Assembly, Python is also portable, which means you can write code on one platform and then run it on another without having to recompile it. This makes Python a good choice for writing cross-platform tools.

In short, Python is a versatile language that can be used for a wide range of tasks, making it a good choice for ethical hackers who are just starting out.

It’s worth checking out the book The Python Apprentice, by Austin Bingham and Robert Smallshire.

Bash

Bash (official site, Wikipedia) is a Unix shell, which is a type of program that provides an interface for running other programs. Bash is commonly used as a command-line interpreter (CLI), which means it can be used to execute commands entered by the user.

Similar to Window’s PowerShell, Bash can be used to launch programs, such as shell commands, and it can also be used to execute other Bash scripts.

It also has a programming language built-in — with features such as loops and conditionals — which can be used to write scripts. These scripts can automate tasks, such as setting up a development environment or deploying a web application.

Since Bash is available on all Unix-based systems — such as Linux and macOS — it’s a good choice for writing cross-platform tools. It’s also quite easy to learn and a fundamental part of many ethical hackers’ toolkits.

Check out the book Learn Bash the Hard Way, by Ian Miell, to learn both core principles and advanced shell scripting. Also take a look at Linux Bible, 10th Edition, by Christopher Negus, to further delve into Unix-based systems.

SQL

SQL, or Structured Query Language (ISO standard, Wikipedia), is a database query language that’s used to manipulate data stored in databases. SQL can be used to add, remove, and update data in a database. It can also be used to query data from a database, which is useful for tasks such as data analysis.

While it might not be the first language that comes to mind when you think of hacking, SQL can be used to launch attacks against web and mobile applications. For example, an attacker could use SQL injection to insert malicious code into a database, which would then be executed by the application when it retrieves data from the database.

SQL is also useful for ethical hacking tasks such as database security testing and performance testing. For example, an ethical hacker could use SQL to generate a large number of queries to a database in order to test its performance under load.

SQL is thus a powerful tool that every ethical hacker should learn, and it’s not as difficult to learn as some of the other languages on this list.

A great place to start learning SQL is through Simply SQL, by Rudy Limeback.

Summary Table

LanguageUsefulnessLevel of Difficulty
C/C++Fundamental languages that every hacker should learn. Useful for writing system-level software and hacking tools.Relatively easy (C), Hard (C++)
AssemblyA difficult language that’s useful for writing exploits, reverse engineering tools, and low-level system software. Assembly code is specific to a certain type of processor, which limits its portability.Very hard
PythonAn easy-to-learn, versatile language that’s useful for a wide range of tasks. Python has a wide range of libraries available for tasks such as network analysis, web scraping, and database manipulation. It’s also portable, which makes it a good choice for writing cross-platform tools.Easy
BashBash is a Unix shell that can be used to launch programs and execute other Bash scripts. It also has a programming language built in, which can be used to write scripts that automate tasks. Since Bash is available on all Unix-based systems, it’s a good choice for writing cross-platform tools.Very easy
SQLSQL is a database query language that’s used to manipulate data stored in databases. SQL can also be used to query data from a database, which is useful for tasks such as data analysis. While it might not be the first language that comes to mind when you think of hacking, SQL can be used to launch attacks against web applications and it’s also useful for ethical hacking tasks such as database security testing and performance testing.Easy

Best Programming Language for Beginners

As you may have guessed if you’ve read this far, the best programming language for beginning in ethical hacking is Python.

  • It’s a versatile scripting language.
  • It’s widely used in the security community.
  • It’s easy to learn.
  • It has a wide range of libraries and tools that can be used for security purposes.

If you’re new to ethical hacking, we recommend starting with Python. It’s the most popular language among ethical hackers, and will give you a good foundation on which to build your skills.

Later on, as you up your hacking game, you’ll probably learn C and C++ to get closer to the metal and understand how systems work under the hood. You might even tackle Assembly language to really grasp what’s going on at the lowest level.

And of course, as you progress in your ethical hacking career, you’ll want to learn different languages depending on the specific tasks you want to accomplish.

Check out the books Hacking For Dummies and Hacking the Hacker as a good starters on the topic.

FAQs

Alright, it’s time to get opinionated and quickly answer some common questions!

Is C++ better than Python for hacking?

C++ isn’t necessarily better than Python for hacking. But while Python is generally considered to be more user-friendly and easier to learn, C++ will give you more control over memory management and low-level operations.

At the end of the day, if you’re looking to get into hacking, you’ll likely want to learn both languages.

Do hackers use Python?

Yes, many hackers use Python. From the languages we’ve reviewed here, Python is definitely the most versatile, because it can be used for a wide range of tasks from web development to data analysis.

Do hackers use JavaScript?

This is a good one! And yes, hackers do use JavaScript. While it’s not as widely used as Python or C++, it can still be a helpful tool for ethical hacking, especially when it comes to web application security.

Do ethical hackers need to know the C language in depth?

No, ethical hackers don’t need to know the C language in depth. However, a basic understanding of C will be helpful, especially when it comes to exploit development and reverse engineering.

Furthermore, many of the tools and frameworks used in ethical hacking are written in C, so knowing the language will make it easier to understand how they work and adapt them to your needs. After all, you want to be a hacker, right?

What other skills do you need to be a great ethical hacker?

In addition to being proficient in one or more programming languages, ethical hackers need to have a strong understanding of computer systems and networks. They also need to be able to think like an attacker, which means being creative and resourceful.

Lastly, ethical hacking doesn’t need to be a solo activity. It’s important to be able to work well with others, as many times you’ll need to collaborate with others in order to find and exploit vulnerabilities, and to help to secure systems.

How can ethical hackers make a living?

Ethical hackers can make a living in many ways. Some work as consultants, helping companies to secure their systems. Others work as part of a security team for a company or organization. And still others work independently, contracting their services to whoever needs them.

Some ethical hackers make their living by participating in bug bounty programs like those hosted by HackerOne. These are programs run by companies that want to improve their security, and that are willing to pay for discovering bugs in their systems.

How much income can an ethical hacker make?

This is a difficult question to answer, as it depends on many factors, such as experience, skillset, location, and whether you’re working independently or for a company.

That being said, ethical hackers can make quite a decent living. Some make six figures or more. A good place to start researching salaries is Glassdoor.

Conclusion

Ethical hacking can be a fun and rewarding way to make a living. It’s also a great way to learn new programming languages and hone your skills.

But beware: what you may think is “ethical” hacking may not actually even be legal. Always get permission before hacking systems, whether they belong to you or someone else. And even when you do get permission, check the local jurisdiction and be sure you’re on the right side of the law. (Hint: DDoS attacks can be illegal even when performed for testing purposes.)

The best language for you will depend on your level of experience, the type of hacking you’re interested in, and the operating system you’re using. That said, Python might be a good starting point for a beginner, while C and Assembly just a natural next step.

Original article source at: https://www.sitepoint.com/

#programminglanguages #hacking #cpluplus 

Best Programming Languages for Ethical Hacking
Rachel Cole

Rachel Cole

1668041190

Improve Your Cybersecurity and Linux Skills with the Bandit Wargame

Command Line Hacking – Over The Wire Bandit Walkthrough (CTF Wargame)

Improve your cybersecurity and Linux skills by solving challenges in the Bandit Wargame from OverTheWire. This video is a walk through of how to solve the challenges—but make sure to try each on your own before watching the solution!

🔗 Start the game here: https://overthewire.org/wargames/bandit/ 


#linux #hacking #cybersecurity 

Improve Your Cybersecurity and Linux Skills with the Bandit Wargame
Charles Cooper

Charles Cooper

1667459010

Kali Linux 101 Tutorial for Beginners

In this tutorial will help you to getting started with Kali Linux 101 and the exciting world of penetration testing!

Kali is a penetration testing Linux distribution created by the Offensive Security. It holds a repository of multiple tools for security related engineers including hacking wireless networks, web applications, databases, Reverse engineering, password crackers, and much more! So as you can see, Kali is a versatile and powerful tool for anyone looking to do any cyber security related work.

As indicated by the ‘101’ in the course title, this course is a beginner’s guide to getting started in Kali…to get your feet wet. The course is broken down into 3 sections; Getting started, Basic Configuration, and Tools overview. We first give you an overview of Kali and its use cases then offer a step-by-step walkthrough of installing Kali using VMware. Next we teach you some important configuration setting in the distribution including configuring your network and managing services in Kali. Knowing these procedures will help you setup the proper environments when using Kali and its tools. Finally we go over the top available in Kali and describe their top features and best use cases.

By the end of this course you will be able to have a fully functioning distribution Kali running on your machine. You will also have an understanding of the Linux environment and how to manage network and system services. Lastly you will have a basic overview of the top tools available in Kali.

What you’ll learn:

  •        Setting up Kali Linux
  •        Managing Services in Kali
  •        Configuring Network Adapters in Kali
  •        Overview of tools in Kali

Are there any course requirements or prerequisites?

  •        Download and install VMware virtual machine which will be covered in a lecture
  •        Basic Linux command prompts

Who this course is for:

  •        This course is intended for newbies who are interested in learning more about penetration testing. This course isn't intended for learning advanced Kali tools lessons

#kalilinux #linux #security #hacking 

Kali Linux 101 Tutorial for Beginners

Osmedeus: A Workflow Engine for Offensive Security

Osmedeus

A Workflow Engine for Offensive Security

🔥 What is Osmedeus?

Osmedeus is a Workflow Engine for Offensive Security. It was designed to build a foundation with the capability and flexibility that allows you to build your own reconnaissance system and run it on a large number of targets.

📦 Installation

NOTE that you need some essential tools like curl, wget, git, zip and login as root to start

bash <(curl -fsSL https://raw.githubusercontent.com/osmedeus/osmedeus-base/master/install.sh)

Build the engine from the source

Make sure you installed golang >= v1.17

go install -v github.com/j3ssie/osmedeus@latest

Check out this page for more the install on other platforms

🚀 Key Features of Osmedeus

  •  Significantly speed up your recon process
  •  Organize your scan results
  •  Efficiently to customize and optimize your recon process
  •  Seamlessly integrate with new public and private tools
  •  Easy to scale across large number of targets
  •  Easy to synchronize the results across many places

💡 Usage

# Scan Usage:
  osmedeus scan -f [flowName] -t [target]
  osmedeus scan -m [modulePath] -T [targetsFile]
  osmedeus scan -f /path/to/flow.yaml -t [target]
  osmedeus scan -m /path/to/module.yaml -t [target] --params 'port=9200'
  osmedeus scan -m /path/to/module.yaml -t [target] -l /tmp/log.log
  cat targets | osmedeus scan -f sample

# Practical Scan Usage:
  osmedeus scan -T list_of_targets.txt -W custom_workspaces
  osmedeus scan -t target.com -w workspace_name --debug
  osmedeus scan -f general -t www.sample.com
  osmedeus scan -f gdirb -T list_of_target.txt
  osmedeus scan -m ~/.osmedeus/core/workflow/test/dirbscan.yaml -t list_of_urls.txt
  osmedeus scan --wfFolder ~/custom-workflow/ -f your-custom-workflow -t list_of_urls.txt

# Queue Usage:
  osmedeus queue -Q /tmp/queue-file.txt -c 2
  osmedeus queue --add -t example.com -Q /tmp/queue-file.txt

# Provider Usage:
  osmedeus provider build
  osmedeus provider build --token xxx --rebuild --ic
  osmedeus provider create --name 'sample'
  osmedeus provider health --debug

# Cloud Usage:
  osmedeus cloud -f [flowName] -t [target]
  osmedeus cloud -m [modulePath] -t [target]
  osmedeus cloud -c 10 -f [flowName] -T [targetsFile]
  osmedeus cloud --token xxx -G -c 10 -f [flowName] -T [targetsFile]
  osmedeus cloud --chunk -c 10 -f [flowName] -t [targetsFile]

# Utilities Usage:
  osmedeus health
  osmedeus version --json
  osmedeus utils tmux ls
  osmedeus utils tmux logs -A -l 10
  osmedeus utils ps
  osmedeus utils ps --proc 'jaeles'
  osmedeus utils cron --cmd 'osmdeus scan -t example.com' --sch 60
  osmedeus utils cron --for --cmd 'osmedeus scan -t example.com'

Check out this page for full usage and the Practical Usage to see how to use Osmedeus in a practical way.

📖 Documentation & FAQ

You can check out the documentation at docs.osmedeus.org and the Frequently Asked Questions at here for more information.

💬 Community & Discussion

Join Our Discord server here

Download Details:

Author: j3ssie
Source Code: https://github.com/j3ssie/osmedeus 
License: MIT license

#go #golang #security #hacking 

Osmedeus: A Workflow Engine for Offensive Security

DVWA: Damn Vulnerable Web Application (DVWA)

DAMN VULNERABLE WEB APPLICATION

Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is damn vulnerable. Its main goal is to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and to aid both students & teachers to learn about web application security in a controlled class room environment.

The aim of DVWA is to practice some of the most common web vulnerabilities, with various levels of difficulty, with a simple straightforward interface. Please note, there are both documented and undocumented vulnerabilities with this software. This is intentional. You are encouraged to try and discover as many issues as possible.


Internationalisation

This file is available in multiple languages:

If you would like to contribute a translation, please submit a PR. Note though, this does not mean just run it through Google Translate and send that in, those will be rejected.


Download

While there are various versions of DVWA around, the only supported version is the latest source from the official GitHub repository. You can either clone it from the repo:

git clone https://github.com/digininja/DVWA.git

Or download a ZIP of the files.


Installation

Installation Videos

Windows + XAMPP

The easiest way to install DVWA is to download and install XAMPP if you do not already have a web server setup.

XAMPP is a very easy to install Apache Distribution for Linux, Solaris, Windows and Mac OS X. The package includes the Apache web server, MySQL, PHP, Perl, a FTP server and phpMyAdmin.

XAMPP can be downloaded from: https://www.apachefriends.org/

Simply unzip dvwa.zip, place the unzipped files in your public html folder, then point your browser to: http://127.0.0.1/dvwa/setup.php

Config File

DVWA ships with a dummy copy of its config file which you will need to copy into place and then make the appropriate changes. On Linux, assuming you are in the DVWA directory, this can be done as follows:

cp config/config.inc.php.dist config/config.inc.php

On Windows, this can be a bit harder if you are hiding file extensions, if you are unsure about this, this blog post explains more about it:

How to Make Windows Show File Extensions

Linux Packages

If you are using a Debian based Linux distribution, you will need to install the following packages (or their equivalent):

  • apache2
  • libapache2-mod-php
  • mariadb-server
  • mariadb-client
  • php php-mysqli
  • php-gd

I would recommend doing an update before this, just so you make sure you are going to get the latest version of everything.

apt update
apt install -y apache2 mariadb-server mariadb-client php php-mysqli php-gd libapache2-mod-php

The site will work with MySQL instead of MariaDB but we strongly recommend MariaDB as it works out of the box whereas you have to make changes to get MySQL to work correctly.

Database Setup

To set up the database, simply click on the Setup DVWA button in the main menu, then click on the Create / Reset Database button. This will create / reset the database for you with some data in.

If you receive an error while trying to create your database, make sure your database credentials are correct within ./config/config.inc.php. This differs from config.inc.php.dist, which is an example file.

The variables are set to the following by default:

$_DVWA[ 'db_server'] = '127.0.0.1';
$_DVWA[ 'db_port'] = '3306';
$_DVWA[ 'db_user' ] = 'dvwa';
$_DVWA[ 'db_password' ] = 'p@ssw0rd';
$_DVWA[ 'db_database' ] = 'dvwa';

Note, if you are using MariaDB rather than MySQL (MariaDB is default in Kali), then you can't use the database root user, you must create a new database user. To do this, connect to the database as the root user then use the following commands:

mysql> create database dvwa;
Query OK, 1 row affected (0.00 sec)

mysql> create user dvwa@localhost identified by 'p@ssw0rd';
Query OK, 0 rows affected (0.01 sec)

mysql> grant all on dvwa.* to dvwa@localhost;
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Other Configuration

Depending on your Operating System, as well as version of PHP, you may wish to alter the default configuration. The location of the files will be different on a per-machine basis.

Folder Permissions:

  • ./hackable/uploads/ - Needs to be writeable by the web service (for File Upload).
  • ./external/phpids/0.6/lib/IDS/tmp/phpids_log.txt - Needs to be writable by the web service (if you wish to use PHPIDS).

PHP configuration:

  • allow_url_include = on - Allows for Remote File Inclusions (RFI) [allow_url_include]
  • allow_url_fopen = on - Allows for Remote File Inclusions (RFI) [allow_url_fopen]
  • safe_mode = off - (If PHP <= v5.4) Allows for SQL Injection (SQLi) [safe_mode]
  • magic_quotes_gpc = off - (If PHP <= v5.4) Allows for SQL Injection (SQLi) [magic_quotes_gpc]
  • display_errors = off - (Optional) Hides PHP warning messages to make it less verbose [display_errors]

File: config/config.inc.php:

Default Credentials

Default username = admin

Default password = password

...can easily be brute forced ;)

Login URL: http://127.0.0.1/login.php

Note: This will be different if you installed DVWA into a different directory.


Docker Container

This section of the readme was added by @thegrims, for support on Docker issues, please contact them or @opsxcq who is the maintainer of the Docker image and repo. Any issue tickets will probably be pointed at this and closed.

Please ensure you are using aufs due to previous MySQL issues. Run docker info to check your storage driver. If it isn't aufs, please change it as such. There are guides for each operating system on how to do that, but they're quite different so we won't cover that here.


Troubleshooting

These assume you are on a Debian based distro, such as Debian, Ubuntu and Kali. For other distros, follow along, but update the command where appropriate.

I browsed to the site and got a 404

If you are having this problem you need to understand file locations. By default, the Apache document root (the place it starts looking for web content) is /var/www/html. If you put the file hello.txt in this directory, to access it you would browse to http://localhost/hello.txt.

If you created a directory and put the file in there - /var/www/html/mydir/hello.txt - you would then need to browse to http://localhost/mydir/hello.txt.

Linux is by default case sensitive and so in the example above, if you tried to browse to any of these, you would get a 404 Not Found:

  • http://localhost/MyDir/hello.txt
  • http://localhost/mydir/Hello.txt
  • http://localhost/MYDIR/hello.txt

How does this affect DVWA? Most people use git to checkout DVWA into /var/www/html, this gives them the directory /var/www/html/DVWA/ with all the DVWA files inside it. They then browse to http://localhost/ and get either a 404 or the default Apache welcome page. As the files are in DVWA, you must browse to http://localhost/DVWA.

The other common mistake is to browse to http://localhost/dvwa which will give a 404 because dvwa is not DVWA as far as Linux directory matching is concerned.

So after setup, if you try to visit the site and get a 404, think about where you installed the files to, where they are relative to the document root, and what the case of the directory you used is.

"Access denied" running setup

If you see the following when running the setup script it means the username or password in the config file do not match those configured on the database:

Database Error #1045: Access denied for user 'notdvwa'@'localhost' (using password: YES).

The error is telling you that you are using the username notdvwa.

The following error says you have pointed the config file at the wrong database.

SQL: Access denied for user 'dvwa'@'localhost' to database 'notdvwa'

It is saying that you are using the user dvwa and trying to connect to the database notdvwa.

The first thing to do is to double check what you think you put in the config file is what is actually there.

If it matches what you expect, the next thing to do is to check you can log in as the user on the command line. Assuming you have a database user of dvwa and a password of p@ssw0rd, run the following command:

mysql -u dvwa -pp@ssw0rd -D dvwa

Note: There is no space after the -p

If you see the following, the password is correct:

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.3.22-MariaDB-0ubuntu0.19.10.1 Ubuntu 19.10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [dvwa]>

As you can connect on the command line, it is likely something wrong in the config file, double check that and then raise an issue if you still can't get things working.

If you see the following, the username or password you are using is wrong. Repeat the Database Setup steps and make sure you use the same username and password throughout the process.

ERROR 1045 (28000): Access denied for user 'dvwa'@'localhost' (using password: YES)

If you get the following, the user credentials are correct but the user does not have access to the database. Again, repeat the setup steps and check the database name you are using.

ERROR 1044 (42000): Access denied for user 'dvwa'@'localhost' to database 'dvwa'

The final error you could get is this:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

This is not an authentication issue but tells you that the database server is not running. Start it with the following

sudo service mysql start

Unknown authentication method

With the most recent versions of MySQL, PHP can no longer talk to the database in its default configuration. If you try to run the setup script and get the following message it means you have configuration.

Database Error #2054: The server requested authentication method unknown to the client.

You have two options, the easiest is to uninstall MySQL and install MariaDB. The following is the official guide from the MariaDB project:

https://mariadb.com/resources/blog/how-to-migrate-from-mysql-to-mariadb-on-linux-in-five-steps/

Alternatively, follow these steps:

As root, edit the following file: /etc/mysql/mysql.conf.d/mysqld.cnf

Under the line [mysqld], add the following: default-authentication-plugin=mysql_native_password

Restart the database: sudo service mysql restart

Check the authentication method for your database user:

mysql> select Host,User, plugin from mysql.user where mysql.user.User = 'dvwa';
+-----------+------------------+-----------------------+
| Host      | User             | plugin                |
+-----------+------------------+-----------------------+
| localhost | dvwa             | caching_sha2_password |
+-----------+------------------+-----------------------+
1 rows in set (0.00 sec)

You'll likely see caching_sha2_password. If you do, run the following command:

mysql> ALTER USER dvwa@localhost IDENTIFIED WITH mysql_native_password BY 'p@ssw0rd';

Re-running the check, you should now see mysql_native_password.

mysql> select Host,User, plugin from mysql.user where mysql.user.User = 'dvwa';
+-----------+------+-----------------------+
| Host      | User | plugin                |
+-----------+------+-----------------------+
| localhost | dvwa | mysql_native_password |
+-----------+------+-----------------------+
1 row in set (0.00 sec)

After all that, the setup process should now work as normal.

If you want more information see the following page: https://www.php.net/manual/en/mysqli.requirements.php.

Database Error #2002: No such file or directory.

The database server is not running. In a Debian based distro this can be done with:

sudo service mysql start

Errors "MySQL server has gone away" and "Packets out of order"

There are a few reasons you could be getting these errors, but the most likely is the version of database server you are running is not compatible with the version of PHP.

This is most commonly found when you are running the latest version of MySQL as PHP and it do not get on well. Best advice, ditch MySQL and install MariaDB as this is not something we can support.

For more information, see:

https://www.ryadel.com/en/fix-mysql-server-gone-away-packets-order-similar-mysql-related-errors/

Command Injection won't work

Apache may not have high enough privileges to run commands on the web server. If you are running DVWA under Linux make sure you are logged in as root. Under Windows log in as Administrator.

Why can't the database connect on CentOS?

You may be running into problems with SELinux. Either disable SELinux or run this command to allow the web server to talk to the database:

setsebool -P httpd_can_network_connect_db 1

Anything else

For the latest troubleshooting information please read both open and closed tickets in the git repo:

https://github.com/digininja/DVWA/issues

Before submitting a ticket, please make sure you are running the latest version of the code from the repo. This is not the latest release, this is the latest code from the master branch.

If raising a ticket, please submit at least the following information:

  • Operating System
  • The last 5 lines from the web server error log directly after whatever error you are reporting occurs
  • If it is a database authentication problem, go through the steps above and screenshot each step. Submit these along with a screenshot of the section of the config file showing the database user and password.
  • A full description of what is going wrong, what you expect to happen, and what you have tried to do to fix it. "login broken" is no enough for us to understand your problem and to help fix it.

SQLite3 SQL Injection

Support for this is limited, before raising issues, please ensure you are prepared to work on debugging, do not simply claim "it does not work".

By default, SQLi and Blind SQLi are done against the MariaDB/MySQL server used by the site but it is possible to switch to do the SQLi testing against SQLite3 instead.

I am not going to cover how to get SQLite3 working with PHP, but it should be a simple case of installing the php-sqlite3 package and making sure it is enabled.

To make the switch, simply edit the config file and add or edit these lines:

$_DVWA["SQLI_DB"] = "sqlite";
$_DVWA["SQLITE_DB"] = "sqli.db";

By default it uses the file database/sqli.db, if you mess it up, simply copy database/sqli.db.dist over the top.

The challenges are exactly the same as for MySQL, they just run against SQLite3 instead.


Links

Project Home: https://github.com/digininja/DVWA

Created by the DVWA team


WARNING!

Damn Vulnerable Web Application is damn vulnerable! Do not upload it to your hosting provider's public html folder or any Internet facing servers, as they will be compromised. It is recommended using a virtual machine (such as VirtualBox or VMware), which is set to NAT networking mode. Inside a guest machine, you can download and install XAMPP for the web server and database.

Disclaimer

We do not take responsibility for the way in which any one uses this application (DVWA). We have made the purposes of the application clear and it should not be used maliciously. We have given warnings and taken measures to prevent users from installing DVWA on to live web servers. If your web server is compromised via an installation of DVWA, it is not our responsibility, it is the responsibility of the person/s who uploaded and installed it.


Download Details:

Author: Digininja
Source Code: https://github.com/digininja/DVWA 
License: GPL-3.0 license

#php #security #hacking 

DVWA: Damn Vulnerable Web Application (DVWA)

Learn Ethical Hacking from Scratch

Learn Ethical Hacking from scratch and become a professional Cyber Security analyst. You'll have a strong foundation in most hacking or penetration testing fields and you'll also learn how to detect, prevent and secure systems and yourself from the discussed attacks.
 

You'll learn:

  • Helping to prepare for a cyber attack
  • How to become a cyber security analyst
  • Student will be able to know about footprinting techniques
  • Student will be able to know about different scanning techniques

Welcome to this Ethical Hacking course from scratch! To start this course there is no specific prerequisite, something like that you have strong knowledge about ethical hacking before that. We are going to start from scratch. And by the end of it you'll be able to hack systems like white-hat hackers and secure them like security experts!

The course is divided into a number of section!

During this course our main focus will be on practical work but we will not neglect the theory as well;we'll start from basics, we will move to different penetration testing fields and install the needed software (on Windows, Linux ), then we'll dive and start hacking straight away.

The course is divided into a number of sections, in each of these sections you'll first learn how the target system works, the weaknesses of this system, and how to practically exploit theses weaknesses to hack this system.

By the end of the course you will have a strong foundation in most hacking or penetration testing fields and you'll also learn how to detect, prevent and secure systems and yourself from the discussed attacks.


Course Content!

  • Footprinting
  • Network Scanning
  • Enumeration
  • Vulnerability Analysis
  • System Hacking
  • DOS/DDOS Atatck
  • SQL Injection
  • Malware Analysis
  • Cross Site Scripting


Who this course is for:

  •    Security Officers
  •    Network Administrators
  •    Firewall Administrators
  •    Information Security Professionals
  •    System Administrator

#ethicalhacking #hacking #cybersecurity #security 

Learn Ethical Hacking from Scratch
Billy Chandler

Billy Chandler

1663601444

SQL Injection Tutorial: Perform Penetration Testing Step by Step

Learn how to perform penetration testing step by step. Learn SQL Injection by doing complete project including Detection, Exploiting, and uploading shell
 

You'll learn:

  • How to install Penetration Testing Labs in Virtual Machines
  • How to Detect SQL Injection Vulnerability
  • How to Exploit SQL Injection Just By Using Browsers
  • Uploading Shell and Bypassing Restrictions
  • Working With CMD Shell and Running Commands

SQL injection vulnerability is one of the OWASP Top 10. In this course, we are teaching you how to perform penetration testing step by step. We are going to focus on SQL injection vulnerability.  We start from scratch, so everyone who has no prior knowledge should not be worried about understanding the course. We present the concepts in a simple way. This course is divided into three main sections.

Section 1: How to set up your own hacking lab

  •    Introduction to virtual machines
  •    Introduction to Hacking Labs Resources
  •    Installing SQLI to shell Lab
  •    Network Adapter Troubleshooting

Section 2: SQL Injection Workshops

  •    Break and fix the query
  •    Finding number of columns
  •    Finding vulnerable columns
  •    Union Select Attacks
  •    Database information
  •    Finding the databases
  •    Finding the tables
  •    Finding the columns
  •    Dump the data
  •    Decrypting Hashed Password

Section 3: How To Upload Shells And Bypass Upload Restrictions

  •    Uploading CMD shell
  •    Bypassing Upload Restrictions
  •    Working with CMD Shell

At the end of the course, you will be able to perform information gathering, crawl the web application, detect SQL injection vulnerability, work with developer tools in browser, run query to dump the data, upload a shell, and run some commands to get information about the server and web application.

Who can benefit from this course?

  •    Everyone who is interested in learning penetration testing as a career.
  •    Everyone who is interested in teaching cyber security
  •    Everyone who is tired of watching useless tutorials

Who this course is for:

  •    Anybody who wants to learn Penetration Testing From Zero To Hero
  •    Anybody who wants to start a Career as a pentester
  •    Anybody who wants to learn and teach ethical hacking

#sql #ethicalhacking #hacking #database 

 

SQL Injection Tutorial: Perform Penetration Testing Step by Step
Blockchain Dev

Blockchain Dev

1660284702

Learn Solidity: DeFi, Flash Loans, Hacking, NFTs & more!

In this ultimate Solidity tutorial, we'll learn about DeFi, Flash Loans, Hacking, NFTs & more! This tutorial demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.

Sample Hardhat Project

Try running some of the following tasks:

npx hardhat help
npx hardhat test
GAS_REPORT=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.js

TABLE OF CONTENTS
00:00 Intro
02:19 First Contract
30:32 Testing Contracts
01:00:59 NFT Real Estate Escrow
02:13:08 Flash Loans
03:06:52 Hacking: Reentrancy

CODE: https://github.com/dappuniversity/solidity_tutorial 

#solidity #defi #flashloans #hacking #nft #blockchain #web3

 

Learn Solidity: DeFi, Flash Loans, Hacking, NFTs & more!

Атаки на веб-безопасность, о которых вы должны знать

Узнайте об атаках на веб-безопасность и о том, как их предотвратить. В этой статье я подробно расскажу о 5 атаках, которые должен знать каждый веб-разработчик.

Как разработчики, мы знаем подводные камни Интернета — шлюзы, которые злоумышленники могут использовать для кражи личных данных, выкачивания денег и вообще сеять хаос. Но если мы собираемся создавать водонепроницаемые приложения, мы должны постоянно обновлять нашу базу знаний и готовиться к любому возможному нападению.

В этом посте мы собираемся обсудить пять наиболее распространенных форм атак. Мы обсудим другие примеры в следующих статьях, но эти «большие пятерки» должны стать основой вашего режима безопасности.

Что такое атака на веб-безопасность?

Атаки на веб-безопасность (или безопасность веб-приложений) — это действия, выполняемые для использования слабых мест и уязвимостей приложения.

Обычно в атаке участвуют две стороны: злоумышленник (преступник) и жертва (пользователь).

Злоумышленник (преступник)

Атакующий.png

Рис. 1. Представление злоумышленника в этой статье

Это люди, которые нацеливаются на систему, пользователя или учетную запись, чтобы получить доступ в незаконных целях. Получив доступ, они крадут данные, деньги, учетные данные и другие важные активы. Злоумышленником может быть человек, программа или бот в любой части мира.

Жертва (Пользователь)

Жертва.png

Рисунок 2: Представление жертвы/пользователя в этой статье

Это человек, на которого злоумышленник оказывает негативное воздействие. Любой может стать жертвой злонамеренной онлайн-активности, если не примет необходимых мер предосторожности; некоторые жертвы не особенно разбираются в Интернете, но другие обладают значительным объемом знаний. Жертвы подвергаются атакам злоумышленников из-за уязвимостей приложений, которые они используют ежедневно.

Пять основных типов атак на веб-безопасность

В этой статье мы сосредоточимся конкретно на следующих атаках:

  • Межсайтовый скриптинг (XSS)
  • Фишинг
  • кликджекинг
  • Подделка межсайтовых запросов (CSRF)
  • Обход пути (или каталога)

Есть и другие атаки, которые следует учитывать, такие как SQL Injection, Brute Force, DoS, DDoS и многие другие... но мы сохраним их для будущих статей.

1. Межсайтовый скриптинг (XSS)

В межсайтовом скриптинге (XSS) злоумышленники внедряют вредоносный скрипт в легитимную ссылку на веб-сайт и отправляют его жертве. Злоумышленник идентифицирует веб-сайт как цель для атаки после оценки его слабости и уязвимости. Жертва обычно получает ссылку, встроенную в сообщение электронной почты.

Многие браузеры не могут обнаружить вредоносный код. Поэтому, когда жертва переходит по ссылке, браузер делает вывод, что ссылка пришла из надежного источника, загружает сайт и выполняет вредоносный скрипт. После выполнения скрипт может собирать конфиденциальную информацию, токены и файлы cookie, хранящиеся в браузере, и отправлять их злоумышленнику. Затем злоумышленник использует эту украденную информацию без ведома жертвы.

На рисунке ниже показано взаимодействие между злоумышленником и жертвой во время XSSатаки.

XSS.png

Рисунок 3: Представление XSS-атаки

Мы разделяем XSS на три основные категории:

  • Хранимая XSS-атака: при хранимой XSS-атаке вредоносные сценарии постоянно хранятся на сервере цели, в их базах данных и хранилищах файлов. Ее также называют постоянной XSS-атакой и обычно считают наиболее опасным типом XSS-атаки. Эта атака обычно выполняется с использованием раздела комментариев на странице/форуме, журналов или любого другого носителя, который принимает вводимые пользователем данные и сохраняется во внутреннем хранилище.
  • Отраженная XSS-атака: отраженная XSS-атака не сохраняет вредоносный скрипт в хранилище. Сценарий выполняется на стороне клиента, когда пользователя обманом заставляют щелкнуть ссылку, содержащую его.
  • Атака XSS на основе DOM: как и в случае с Reflected XSS Attack, злоумышленник использует целевой URL-адрес с вредоносным скриптом. Сценарий выполняет и изменяет объектную модель документа (DOM) браузера.

Вот несколько примеров внедрения скриптов на основе различных событий:

  • <body onload=alert(1)>- Срабатывает при загрузке элемента.
  • <style>@keyframes x{}</style><xss style="animation-name:x" onwebkitanimationstart="alert(1)"></xss>- Срабатывает, когда начинается анимация CSS.

Как предотвратить XSS

Как и при любом другом типе атаки на систему безопасности, злоумышленник может внедрить вредоносный скрипт только тогда, когда веб-сайт или приложение уязвимы. Поэтому лучший способ предотвратить нападение — принять необходимые меры предосторожности. Выполняя следующие действия, вы значительно продвинетесь в предотвращении XSS-атак:

  • Не доверяйте пользовательскому вводу . Любой пользовательский ввод, который выполняется и создает вывод из вашего веб-приложения, может подвергнуть приложение XSS-атаке. Рассматривайте все входные данные как потенциально опасные. Это должно относиться как к внутренним, так и к внешним пользователям приложения.
  • Очистка ввода . Используйте библиотеку HTML для очистки ввода пользователя, чтобы предотвратить или закодировать любую злонамеренную попытку внедрить сценарий через ввод.
  • Выполняйте регулярное сканирование . Существует множество инструментов безопасности, которые создают подробные отчеты на основе сканирования XSS. Burp Suite — отличный инструмент, как и Zap (с открытым исходным кодом).
  • Установите для HttpOnlyфлага значение true — когда вы устанавливаете HttPOnlyфлаг trueдля файлов cookie, клиентский JavaScript не может получить к ним доступ. Стандартной практикой безопасности является защита этого флага от XSS-атак.
  • Настройте брандмауэр веб-приложений — различные инструменты позволяют брандмауэрам веб-приложений обнаруживать и фильтровать вредоносные атаки до того, как они проникнут в ваше приложение. Брандмауэр защищает вас от большинства инъекционных атак.
  • Повышение осведомленности . Вам и вашей команде необходимо повышать осведомленность об атаке XSS и быть в курсе того, что происходит вокруг вас. Поэтому пройдите соответствующее обучение и включите тестовые примеры, связанные с XSS, в свой план тестирования безопасности.

2. Фишинг

Давайте перейдем к следующему типу атаки, Phishing. При фишинговой атаке злоумышленник выдает себя за законную сторону и отправляет жертве электронные письма или текстовые сообщения, содержащие ссылки на фишинговые веб-сайты. Жертва предполагает, что сообщение заслуживает доверия, и открывает ссылку в своем браузере. Как только ссылка открыта, злоумышленник может украсть личные данные жертвы, учетные данные и банковскую информацию, а затем выполнить такие действия, как кража и шантаж.

На рисунке ниже показано взаимодействие между злоумышленником и жертвой во время Phishingатаки.

Фишинг.png

Рисунок 4: Представление фишинговой атаки

Давайте теперь рассмотрим пример фишинговой атаки, инициированной с использованием электронной почты. Электронное письмо предлагает читателю шанс выиграть огромную сумму, приняв участие в конкурсе.

Phishing_Example.png

Рисунок 5: Пример фишингового письма

Как вы можете видеть на изображении выше, существует множество признаков того, что электронное письмо подозрительно и может привести к фишинговой атаке. Несколько срочных вопросов, которые нужно задать:

  • Вы обычно получаете электронные письма от этого отправителя? Это подозрительный отправитель?
  • Предусмотрено ли какое-либо шифрование для защиты электронной почты?
  • Субъект говорит о выгодном предложении или о чем-то необычном?
  • Контент побуждает вас переходить по ссылкам?
  • Когда вы наводите курсор на ссылки, указывают ли они на что-то необычное или подозрительное?

Лучше всего относиться к такому электронному письму или сообщению с особой осторожностью и следить за тем, чтобы вы не попали в ловушку злоумышленника.

Как предотвратить фишинг

Мы можем попытаться предотвратить фишинговую атаку, выполнив следующие действия:

  • Осознание - В этом мире нет ничего бесплатного. Ни один незнакомец никогда не даст вам деньги, дома или автомобили, не требуя чего-то взамен, поэтому вы можете надежно удалить такие электронные письма и сообщения, которые приходят к вам. Если вы получаете такие электронные письма на свой рабочий адрес, немедленно сообщите о них в соответствующую группу. Вы также можете повысить осведомленность, рассказав своим друзьям и семье.
  • СПАМ-фильтр — настройте спам-фильтр в своем почтовом клиенте. Большинство приложений электронной почты поставляются с мощным спам-фильтром, и вы должны настроить его в соответствии со своими потребностями.
  • Проверьте настройки безопасности электронной почты . Проверьте сведения о полученном электронном письме. Поле securityговорит No encryption? Это веская причина игнорировать электронное письмо.
  • Проверьте HTTPS URL-адресов. Когда вы наводите курсор на ссылку, встроенную в содержимое электронной почты, отображается ли URL-адрес с https? Если нет, не нажимайте.
  • Усильте настройки своего браузера. Вы также можете изменить настройки безопасности своего браузера, чтобы многие такие подозрительные электронные письма могли быть заблокированы и предупреждены.

3. Кликджекинг

Чтобы получить Clickjacking, злоумышленник обманом заставляет жертву щелкнуть элемент страницы, который им не виден. Жертва может быть обманом загружена вредоносным ПО, выполнена нежелательные транзакции и многие другие опасные действия.

Сначала злоумышленник отправляет электронное письмо с предложением, которое содержит ссылку на целевой веб-сайт. В предложении может быть потрясающая поездка в Майами или на Карибы, например. Но злоумышленник внедрил скрытый элемент пользовательского интерфейса (возможно, iFrame), который может инициировать перевод 2000 долларов на их банковский счет. Жертва переходит по ссылке и загружает форму предложения в браузер. Кликджекинг происходит, когда жертва нажимает на скрытый элемент пользовательского интерфейса; перевод осуществляется на банковский счет злоумышленника без ведома жертвы.

На рисунке ниже показано взаимодействие между злоумышленником и жертвой во время Clickjackingатаки.

кликджекинг.png

Рисунок 6: Представление атаки Clickjacking

Как предотвратить кликджекинг?

Большинство clickjackingпопыток выполняются с использованием iFrame, и мы можем защитить наши приложения с помощью X-Frame-Optionsзаголовка ответа. X-Frame-Options указывает, должен ли браузер разрешать отображение страницы внутри <iframe>тега. Существует три возможных значения X-Frame-Optionsзаголовка:

  • DENY: не позволяет отображать страницу внутри iframe.
  • SAMEORIGIN: разрешает загрузку страницы внутри iframe, но только из того же домена.
  • РАЗРЕШЕННЫЙ URL-адрес: разрешает загрузку страницы внутри iframe, но только по определенному URL-адресу.

Принятие этих мер предосторожности на стороне сервера снизит вероятность кликджекинга. На стороне клиента вы можете установить расширения для браузера, чтобы проверить его уязвимость.

4. Подделка межсайтовых запросов (CSRF)

Cross-Site Request[Forgery](http://forgery.is), или CSRF, является особенно инновационной и сложной формой атаки, с помощью которой злоумышленник обманом заставляет жертву выполнять нежелательные действия в веб-приложении, в котором они в настоящее время аутентифицированы .

Злоумышленник создает поддельный запрос денег (скажем, 2000 долларов) и встраивает его в сообщение, например электронное письмо, а затем отправляет его жертве. Жертва переходит по ссылке и по незнанию отправляет запрос в банк. Банк получает запрос. У банка нет возможности узнать, что запрос является результатом подделки, поэтому они разблокируют деньги, и злоумышленник получит их.

На рисунке ниже показано взаимодействие между злоумышленником и жертвой при атаке CSRF.

CSRF.png

Рисунок 7: Представление атаки CSRF

Как предотвратить CSRF-атаку

  • Смягчение на основе токенов . Для защиты можно использовать встроенную реализацию CSRF. На самом деле многие фреймворки, такие как .NET, имеют встроенные возможности. Вы также можете использовать существующие реализации защиты CSRF для приложений, созданных с использованием Java, Angular, PHP и многих других.
  • Файлы cookie SameSite — файлы cookie SameSiteпомогают браузеру решить, отправлять ли файлы cookie с межсайтовыми запросами. Возможные значения strict, laxи none.
  • Пользовательские заголовки запросов . Большинство современных веб-приложений используют запросы XHR и вызовы конечных точек API. Нам нужно использовать политику того же происхождения (SOP), чтобы ограничить добавление пользовательского заголовка (только с использованием JavaScript). Мы можем добавить собственный заголовок в запрос и проверить его наличие на стороне сервера. Обратите внимание, однако, что для максимальной эффективности этого варианта также требуется надежная конфигурация CORS .
  • Проверка происхождения . Мы можем проверить, откуда поступает запрос и куда направляется запрос. Сервер проверяет исходное и целевое происхождение на соответствие.
  • Защита на основе взаимодействия с пользователем . В качестве дополнительного уровня защиты мы можем использовать повторную аутентификацию и капчу.

Пожалуйста, обратитесь к Шпаргалке по защите от CSRF для более подробной информации.

5. Обход пути (или каталога)

Последняя атака веб-приложений, которую мы обсудим в этой статье, — это атака Path (or Directory) Traversal Attack. Эта форма атаки позволяет злоумышленнику читать любые файлы с сервера, на котором запущено приложение, открывая множество возможностей для обнаружения паролей, банковских реквизитов, секретной информации и различных других данных.

Злоумышленник может получить доступ к разрешенному пути для загрузки изображения и его отображения в браузере. Веб-сайт уязвим для Path (or Directory) Traversalатаки и позволяет злоумышленнику перейти к файлу `/etc/password. В операционной системе на основе Unix специальный файл содержит сведения о зарегистрированных пользователях, чтобы злоумышленник мог украсть важные данные с сервера.

На рисунке ниже показано взаимодействие между злоумышленником и жертвой во время Path(or Directory) Traversalатаки.

Directory_Traversal.png

Рисунок 8: Представление атаки Path Traversal

Как предотвратить атаки обхода пути (каталога)

  • Самый эффективный способ предотвратить такую ​​атаку — отклонить пользовательский ввод в API файловой системы.
  • Если мы не можем запретить пользователям вводить входные данные для API файловой системы, мы должны проверить входные данные перед их дальнейшей обработкой. После проверки приложение должно добавить ввод в файл base directory. Мы должны использовать этот путь к API файловой системы для canonicalizeпути и убедиться, что этот путь начинается с ожидаемого базового каталога. Вот фрагмент кода, который сделает это за нас.
File file = new File(BASE_DIRECTORY, input);
if (file.getCanonicalPath().startsWith(BASE_DIRECTORY)) {
    // do something...
}

 

Кого не волнует безопасность? Но заботиться и осознавать — не одно и то же. Прочтите, чтобы узнать о различных атаках в области веб-безопасности и кибербезопасности.

1. SQL-инъекция

При SQL injectionатаке злоумышленник ищет уязвимости в проверках пользовательского ввода приложения и конфигурации базы данных. Злоумышленник вводит вредоносные запросы, используя пользовательские данные (например, текстовое поле), чтобы выполнить их в базе данных.

После завершения выполнения злоумышленник может выполнить несколько вредоносных действий, в том числе:

  • Кража информации.
  • Удаление таблиц (что может позволить им удалить важные записи).
  • Доступ к данным, которые должны быть запрещены.

На рисунке ниже показано взаимодействие между злоумышленником и жертвой при атаке с внедрением SQL.

SQL-инъекция.png

Рисунок 3: Представление атаки SQL-инъекцией

Теперь давайте рассмотрим пару примеров атак с внедрением SQL:

Атака с использованием 1 = 1доброго вектора, который всегдаTrue

Предположим, приложение извлекает информацию об учетной записи клиента на основе уникального 6-значного PIN-кода. Клиент может ввести PIN-код в текстовое поле и отправить его для получения информации из базы данных.

1==1=true.png

Рисунок 4: Пользователь вводит пин-код и отправляет его

Предположим, что входное значение PIN-кода передается серверной службе, где мы создаем запрос SQL следующим образом:

const sql = "SELECT * FROM Customers WHERE CustPin = " + inputCustPin;

Теперь, если злоумышленник может передать значение вроде 456789 or 1=1, оператор SQL будет выглядеть так:

SELECT * FROM Customers WHERE CustId = 456789 or 1=1;

Таким образом, злоумышленник может получить доступ к информации обо всех учетных записях клиента из базы данных.

Атака с использованием выполнения нескольких запросов

Если злоумышленнику разрешено внедрить весь запрос, результат может быть очень серьезным. Это так же плохо, как удаление таблиц, удаление важной информации или неправильная настройка базы данных. Большинство приложений баз данных поддерживают выполнение нескольких запросов в виде пакета.

Давайте рассмотрим случай, когда злоумышленник отправляет следующую строку в качестве значения идентификатора клиента: 456789; DROP TABLE Dept.

партия.png

Рисунок 5: Использование выполнения пакетного запроса

Оператор SQL будет действительным и будет выглядеть следующим образом:

SELECT * FROM Customers WHERE CustId = 456789 ; DROP TABLE Dept;

К сожалению, приведенный выше запрос удалит всю таблицу Dept из базы данных.

Как предотвратить атаки SQL Injection?

  • Большинство атак с использованием SQL-инъекций происходят из-за отсутствия проверки пользовательского ввода. Поэтому мы должны убедиться, что поле ввода принимает только правильный тип данных. Например, поле электронной почты должно быть ограничено идентификаторами электронной почты. Нам также необходимо убедиться, что обычные ключевые слова SQL (например, DROP) по возможности извлекаются из пользовательского ввода.
  • Вы можете использовать параметры SQL в запросе SQL в качестве механизма предотвращения. Эти параметры оцениваются во время выполнения механизмом SQL, который правильно сопоставляет параметры, а также проверяет, подходит ли параметр для столбца.
  • Важно всегда выполнять сканирование с помощью инструмента веб-безопасности, чтобы вы могли оценить состояние своего приложения и знать, что нужно исправить.

2. Атака «Человек посередине»

В ходе Man in the Middle(MITM)атаки злоумышленник выдает себя за законного пользователя, чтобы украсть важную информацию, такую ​​как учетные данные для входа в систему, данные кредитной карты и даже более конфиденциальные данные.

Жертва никогда не понимает, что кто eavesdropping-то участвует в обмене конфиденциальной информацией. Точно так же конечная система никогда не распознает злоумышленника; он считает, что взаимодействует законная жертва.

На рисунке ниже показано, как злоумышленник выполняет роль посредника в общении между жертвой и целевыми системами.

Человек-в-середине.png

Рисунок 6: Представление атаки MITM

Как правило, MITMзлоумышленники нацелены на пользователей для получения финансовой выгоды и кражи личных данных. Злоумышленник сначала перехватывает связь, используя различные spoofingмеханизмы, такие как спуфинг IP и DNS. После перехвата злоумышленник использует методологии расшифровки, например SSL Hijacking, чтобы понять смысл сообщения. Последний этап атаки — притвориться жертвой и получить преимущество от атаки.

Как предотвратить атаку Человека посередине?

Большинство Man in the MIddleатак происходит из-за недостаточной осведомленности о методах обеспечения безопасности. Вы должны убедиться, что:

  • НЕ заходите на любой незащищенный веб-сайт. Доступ к сайтам только с протоколом HTTPS.
  • НЕ подключайтесь к общедоступному/открытому WIFI, особенно к защищенному паролем.
  • НЕ делитесь своей конфиденциальной информацией с кем-либо.

3. Сломанный контроль доступа

Управление доступом — это то, как вы управляете доступом пользователей к вашим приложениям, активам и ресурсам. Было бы лучше создать правила доступа, чтобы определить, кто и к чему имеет доступ и, что наиболее важно, что не разрешено. A Broken Access Controlпредоставляет злоумышленникам широкие возможности для доступа к тому, что им не положено, а затем использовать это.

На рисунке ниже показано, как злоумышленник получил доступ к базе данных HR, используя привилегии доступа роли HR. Злоумышленник также получил доступ к нескольким действиям ADMIN, используя неправильно настроенные API.

Сломанный-доступ-контроль.png

Рисунок 7: Представление атаки Broken Access Control

Согласно списку OWASP Top 10:2021 :

«94 % приложений были протестированы на предмет нарушения контроля доступа в той или иной форме, при этом средний уровень заболеваемости составил 3,81 %, и [это] имеет наибольшее количество случаев в предоставленном наборе данных — более 318 000».

Как предотвратить атаку Broken Access Control?

Вы можете предотвратить проблему Broken Access Control, убедившись в следующем:

  • Запретите любой доступ, а затем разрешите то, что требуется.
  • Обязательно периодически проверяйте и оценивайте права доступа.
  • Придерживайтесь политик при повышении привилегий.
  • Проверьте и подтвердите конфигурации CORS.
  • Защитите доступ к API с помощью необходимых токенов.

4. Отказ в обслуживании (DoS) и распределенный отказ в обслуживании (DDoS)

В Denial of Service(aka DoS), Злоумышленник нацеливается на компьютер или любые устройства, чтобы сделать их недоступными для доступа и использования. Злоумышленник наводняет целевую систему огромным объемом трафика, поэтому целевая система не может его обработать. Целевая система со временем становится недоступной для любых новых пользователей.

Злоумышленник также может замедлить целевую систему вместо того, чтобы сделать ее недоступной. Злоумышленник может использовать всю память ЦП, чтобы вызвать переполнение буфера памяти.

DoS.png

Рисунок 8: Представление DoS-атаки

Атака типа «отказ в обслуживании» (DoS) имеет еще один известный вариант, называемый «распределенный отказ в обслуживании» (DDoS). При DoS-атаке злоумышленник использует одно соединение с целевой системой, чтобы инициировать атаку. При DDoS-атаке злоумышленник использует несколько соединений, используя ботнет, чтобы инициировать атаку. DDoSдаже более распространен, чем DOS.

DDoS.png

Рисунок 9: Представление DDoS-атаки

Как предотвратить DoS и DDoS атаки?

Чтобы предотвратить DoS- или DDoS-атаку, вы должны сначала устранить любые сомнения и подтвердить, что это действительно атака. Ваше приложение может работать медленно из-за реальной проблемы, или ваш веб-сайт может стать недоступным из-за внезапного всплеска законного трафика, к которому вы не были готовы.

Однако, как только вы обнаружите атаку, вы должны попробовать сделать следующее в качестве механизма предотвращения.

  • Ограничение скорости: это способ ограничения входящих запросов к серверу, который помогает предотвратить отправку большого количества запросов злоумышленниками.
  • Брандмауэр веб-приложений (WAF): помогает отслеживать трафик между веб-приложением и Интернетом. Это помогает защитить от DDoS и многих других атак, таких как XSS и SQL Injection.

5. Вредоносное ПО

Итак, давайте обсудим последний тип атаки, Malware.

Вредоносное ПО или вредоносное программное обеспечение — это программа или код, который злоумышленник пишет и распространяет по сети для заражения любых целевых устройств.

Вредоносное ПО может быть разных форм и типов. Некоторые из известных типов: червь, вирус, шпионское ПО, рекламное ПО, троянский конь, программы-вымогатели, кейлоггеры и бэкдор.

Вредоносное ПО.png

Рисунок 10: Представление вредоносного ПО

Эти атаки предназначены для:

  • Украсть конфиденциальную информацию
  • Спам целевой системы
  • Заразите систему, чтобы остановить основные действия.
  • Шантажировать жертву и требовать деньги.

Как предотвратить атаки вредоносных программ

Для предотвращения вредоносного ПО необходимо:

  • Установите и активируйте антивирусное программное обеспечение. Эти инструменты обеспечивают защиту от различных вредоносных программ.
  • Используйте инструменты, поставляемые с операционной системой (например, Защитник Windows), чтобы снизить риск.

Вывод

Надеюсь, статья была для вас познавательной! Мы рассмотрели основные детали пяти основных атак на веб-безопасность.

Ссылка: https://blog.greenroots.info/web-security-attacks-you-must-know-part-1

#websecuriry #hacking

Атаки на веб-безопасность, о которых вы должны знать
Dylan  Iqbal

Dylan Iqbal

1657510650

Certified Ethical Hacker Exam V11 | Full Cybersecurity for Beginners

Cybersecurity for Beginners | Certified Ethical Hacker CEH v11 Certification Training 

In this Cybersecurity Certified Ethical Hacker for Beginners video, we will take you through all the important concepts required for the Certified Ethical Hacker Exam V11. This Cybersecurity Full course is for a complete beginner.

#cybersecurity #security #hacking #hacker 
 

Certified Ethical Hacker Exam V11 | Full Cybersecurity for Beginners

OpenStack Hacking Style Checks

Introduction

hacking is a set of flake8 plugins that test and enforce the OpenStack StyleGuide

Hacking pins its dependencies, as a new release of some dependency can break hacking based gating jobs. This is because new versions of dependencies can introduce new rules, or make existing rules stricter.

Installation

hacking is available from pypi, so just run:

pip install hacking

This will install specific versions of flake8 with the hacking, pep8, mccabe and pyflakes plugins.

Origin

Hacking started its life out as a text file in Nova's first commit. It was initially based on the Google Python Style Guide, and over time more OpenStack specific rules were added. Hacking serves several purposes:

  1. Agree on a common style guide so reviews don't get bogged down on style nit picks. (example: docstring guidelines)
  2. Make code written by many different authors easier to read by making the style more uniform. (example: unix vs windows newlines)
  3. Call out dangerous patterns and avoid them. (example: shadowing built-in or reserved words)

Initially the hacking style guide was enforced manually by reviewers, but this was a big waste of time so hacking, the tool, was born to automate the process and remove the extra burden from human reviewers.

Versioning

hacking uses the major.minor.maintenance release notation, where maintenance releases cannot contain new checks. This way projects can gate on hacking by pinning on the major.minor number while accepting maintenance updates without being concerned that a new version will break the gate with a new check.

For example a project can depend on hacking>=0.10.0,<0.11.0, and can know that 0.10.1 will not fail in places where 0.10.0 passed.

Adding additional checks

Each check is a pep8 plugin so read

The focus of new or changed rules should be to do one of the following

  • Substantially increase the reviewability of the code (eg: H301, H303) as they make it easy to understand where symbols come from)
  • Catch a common programming error that may arise in the future (H201)
  • Prevent a situation that would 100% of the time be -1ed by developers (H903)

But, as always, remember that these are Guidelines. Treat them as such. There are always times for exceptions. All new rules should support noqa.

If a check needs to be staged in, or it does not apply to every project or its branch, it can be added as off by default.

Requirements

  • The check must already have community support. We do not want to dictate style, only enforce it.
  • The canonical source of the OpenStack Style Guidelines is StyleGuide, and hacking just enforces them; so when adding a new check, it must be in HACKING.rst
  • False negatives are ok, but false positives are not
  • Cannot be project specific, project specific checks should be Local Checks
  • Include extensive tests
  • Registered as entry_points in setup.cfg
  • Error code must be in the relevant Hxxx group
  • The check should not attempt to import modules from the code being checked. Importing random modules, has caused all kinds of trouble for us in the past.

Enabling off-by-default checks

Some of the available checks are disabled by default. These checks are:

  • [H106] Don't put vim configuration in source files.
  • [H203] Use assertIs(Not)None to check for None.
  • [H204] Use assert(Not)Equal to check for equality.
  • [H205] Use assert(Greater|Less)(Equal) for comparison.
  • [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls
  • [H904] Delay string interpolations at logging calls.

To enable these checks, edit the flake8 section of the tox.ini file. For example to enable H106 and H203:

[flake8]
enable-extensions = H106,H203

Local Checks

hacking supports having local changes in a source tree. They need to be registered individually in tox.ini:

Add to tox.ini a new section flake8:local-plugins and list each plugin with its entry-point. Additionally, you can add the path to the files containing the plugins so that the repository does not need to be installed with the paths directive.

[flake8:local-plugins]
extension =
  N307 = checks:import_no_db_in_virt
  N325 = checks:CheckForStrUnicodeExc
paths =
  ./nova/hacking

The plugins, in the example above they live in nova/hacking/checks.py, need to annotate all functions with @core.flake8ext

from hacking import core
...
@core.flake8ext
def import_no_db_in_virt(logical_line, filename):
    ...

class CheckForStrUnicodeExc(BaseASTChecker):
   name = "check_for_str_unicode_exc"
   version = "1.0"
   ...

Author: openstack
Source Code: https://github.com/openstack/hacking
License: Apache-2.0 license

#openstack #hacking 

OpenStack Hacking Style Checks

✨Scripting With Shodan API✨

Any device connected to the internet must some info...

Today, we shall perform both basic and advanced searches using the freemium Shodan API.

#python #hacking #100Devs

CC: @hashnode #TheHashnodeWriteathon

 

Read More 👇

https://blog.octachart.com/scripting-with-shodan-api

✨Scripting With Shodan API✨

Top 4 Hacking Books For Beginners

In this video I talk about my top 4 books for beginner hackers.


Chapters:
0:00 - Introduction
0:48 - Real-World Bug Hunting
2:43 - RTFM: Red Team Field Manual
4:04 - Advanced Penetration Testing: Hacking the World’s Most Secure Networks
4:59 - Penetration Testing: A Hands-On Introduction to Hacking
6:50 - Outro

--------------------------
Real-World Bug Hunting
by Peter Yaworski

Real-World Web Hacking is a field guide to finding software bugs. Ethical hacker Peter Yaworski breaks down common types of bugs, then contextualizes them with real bug bounty reports released by hackers on companies like Twitter, Facebook, Google, Uber, and Starbucks. As you read each report, you'll gain deeper insight into how the vulnerabilities work and how you might find similar ones.

Each chapter begins with an explanation of a vulnerability type, then moves into a series of real bug bounty reports that show how the bugs were found. You'll learn things like how Cross-Site Request Forgery tricks users into unknowingly submitting information to websites they are logged into; how to pass along unsafe JavaScript to execute Cross-Site Scripting; how to access another user's data via Insecure Direct Object References; how to trick websites into disclosing information with Server Side Request Forgeries; and how bugs in application logic can lead to pretty serious vulnerabilities. Yaworski also shares advice on how to write effective vulnerability reports and develop relationships with bug bounty programs, as well as recommends hacking tools that can make the job a little easier.
--------------------------
RTFM: Red Team Field Manual
by Ben Clark

The Red Team Field Manual (RTFM) is a no fluff, but thorough reference guide for serious Red Team members who routinely find themselves on a mission without Google or the time to scan through a man page. The RTFM contains the basic syntax for commonly used Linux and Windows command line tools, but it also encapsulates unique use cases for powerful tools such as Python and Windows PowerShell. The RTFM will repeatedly save you time looking up the hard to remember Windows nuances such as Windows wmic and dsquery command line tools, key registry values, scheduled tasks syntax, startup locations and Windows scripting. More importantly, it should teach you some new red team techniques.
--------------------------
Advanced Penetration Testing: Hacking the World’s Most Secure Networks
by Will Allsopp

Advanced Penetration Testing: Hacking the World's Most Secure Networks takes hacking far beyond Kali linux and Metasploit to provide a more complex attack simulation. Featuring techniques not taught in any certification prep or covered by common defensive scanners, this book integrates social engineering, programming, and vulnerability exploits into a multidisciplinary approach for targeting and compromising high security environments. 
--------------------------
Penetration Testing: A Hands-On Introduction to Hacking
by Georgia Weidman

In Penetration Testing, security expert, researcher, and trainer Georgia Weidman introduces you to the core skills and techniques that every pentester needs. Using a virtual machine-based lab that includes Kali Linux and vulnerable operating systems, you'll run through a series of practical lessons with tools like Wireshark, Nmap, and Burp Suite. As you follow along with the labs and launch attacks, you'll experience the key stages of an actual assessment--including information gathering, finding exploitable vulnerabilities, gaining access to systems, post exploitation, and more.

Learn how to:
-Cr@ck passwords and wireless network keys with brute-forcing and wordlists
-Test web applications for vulnerabilities
-Use the Metasploit Framework to launch exploits and write your own Metasploit modules
-Automate social-engineering attacks
-Bypass antivlrus software
-Turn access to one machine into total control of the enterprise in the post exploitation phase

#cybersecurity #hacking 

Top 4 Hacking Books For Beginners

⭐Keylogger In Just 10 Lines Of Python⭐

Keystroke-logging is the process of recording (logging) the keys pressed on a keyboard (usually when the user is unaware).

Let's have a Python implementation 👇✨🚀

#python #hacking #codenewbies #networking
 

https://blog.octachart.com/keylogger-in-just-10-lines-of-python

⭐Keylogger In Just 10 Lines Of Python⭐