Skip to content

Commit 89e65e9

Browse files
committed
updating
1 parent 3aaf700 commit 89e65e9

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

_posts/2024-02-18-bash-scripting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Bash Scripting
33
description: >-
44
In this article, we'll explore Bash scripting together, where I'll share what I've learned. While I'm not an expert, I can help guide you through everything you need to know about Bash scripting by sharing my insights.
5-
date: 2019-08-09 20:55:00 +0800
5+
date: 2024-02-18 20:55:00 +0800
66
categories: [Scripting]
77
tags: [Linux, Bash, Command Line]
88
pin: false
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Simple Nmap Scripts
3+
description: >-
4+
Nmap is like a detective tool for computer networks. It helps you discover which devices are connected to a network, what services they're running, and how secure they are.
5+
date: 2024-02-18 20:55:00 +0800
6+
categories: [Scripting]
7+
tags: [Linux, nmap, Command Line]
8+
image:
9+
path: https://github.com/T3chnocr4t/Linux/assets/115868619/7e6451c2-b47b-4ffd-ae5c-3076ffc2a7f5
10+
alt: namp
11+
pin: false
12+
---
13+
14+
15+
## Simple Nmap Scripts
16+
***
17+
18+
Hola! :wave: Let's begin writing a simple Nmap script. Nmap is like a detective tool for computer networks. It helps you discover which devices are connected to a network, what services they're running, and how secure they are.
19+
20+
## Why Nmap🤔?
21+
22+
Nmap is used for network exploration and security auditing. It helps users discover devices on a network, identify open ports, and analyze network security.
23+
24+
![4289732-middle](https://github.com/T3chnocr4t/Linux/assets/115868619/7e6451c2-b47b-4ffd-ae5c-3076ffc2a7f5)
25+
26+
## Scripts
27+
28+
Let's proceed 🚀 to explain how the script works. This script is based on Nmap's TCP Connect Scan. I'll also be creating scripts for different types of scans in the future.
29+
30+
- First of all, I create a script by opening a text editor and naming the file with the extension ".sh" in this Nmap script. I also give it permission so that I can run it. Additionally, I was able to run it, but in this case, I'm not specifying any IP addresses or port numbers. Now, let me explain how the script works 😄.
31+
32+
![Screenshot_2024-01-30_05-55-55](https://github.com/T3chnocr4t/Linux/assets/115868619/042e971e-3461-4dfa-b220-3943fb99918c)
33+
34+
## Explanation of the Scripts:
35+
***
36+
37+
![Screenshot_2024-01-30_05-48-18](https://github.com/T3chnocr4t/Linux/assets/115868619/a81fff38-d023-4712-ae6e-dd1eeb98ded3)
38+
39+
So, I started the script with the shebang 👉( #! /bin/bash) so that the interpreter will understand it is a Bash script.
40+
In the second and third lines, I specify a comment, i.e., #, which doesn't execute. The comment serves as a guide; it doesn't execute any commands. It's simply a way for anyone editing the script to understand how it works and make corrections if necessary.
41+
42+
## command use:
43+
44+
- The echo command displays text on the terminal,to printing a message. For instance, echo "Hello, world!" prints "Hello, world!" to the screen.
45+
- The sleep command temporarily stops script execution for a set duration. For instance, sleep 5 pauses the script for 5 seconds before continuing to the next instruction.
46+
- The read command is used to take input from the user while the script is running. It prompts the user to enter some text, which is then stored in a variable for the script to use.
47+
- The Nmap command, in this case, is used specifically for conducting a TCP connect scan, focusing on a specific port and IP address. in the i use nmap -sT ip addr port
48+
So in this : The command "nmap -sT" instructs Nmap to perform a TCP connect scan. In a TCP connect scan, Nmap attempts to establish a full TCP connection with the target ports to determine whether they are open, closed, or filtered by a firewall. This method is more reliable but also more detectable than other scan types.
49+
50+
51+
52+
Yeah, that's all. Feel free to ask questions or share feedback. Here is my [Twitter handle](https://twitter.com/T3chnocr4t).
53+
54+
[Go back home](https://T3chnocr4t.github.io)

0 commit comments

Comments
 (0)