-sudo visudo
(Special Editor for sudo)
- Move to the User Privilege specifications
- below root add
kali ALL=(ALL) NOPASSWORD: /bin/ftp
- Move to gtfobins.github.io and search for ftp and use the command to escalate Privilege
sudo ftp !/bin/bash
- We can use nano and mv also to perform a similar privilege escalation
TF = $(mktemp)
echo "sumit' >$TF
sudo mv $TF /etc/name.txt
cat /etc/passwd |grep bash
- and we can find out the username and then use a ssh attack with hydra to login
cat /etc/shadow
- and we can see the hash value of our password
sudo apt-get install htop -y
- The utility tells us about every execution taking place in machine
- 0.0.0.0 -- Accepting any IP for connection
netstat -tuln
##ss command -ss
- used to check if we have any incoming connection
Sockets are endpoints for communication between two machines over a network. They enable data exchange between devices, typically in client-server architecture.
sudo lsof
//used to see all the connection
sudo lsof -i -P -n | grep LISTEN
//used to see any listening connection
The command sudo lsof -i -P -n | grep LISTEN
is used to display information about the network sockets that are currently in a listening state on your system. Let's break it down:
-
sudo: Runs the command with superuser (root) privileges, which is often necessary to view all network connections.
-
lsof: Stands for 'list open files'. It is a command used to display information about files that are currently open by processes. In Unix-like systems, everything is a file, including network connections.
-
-i: Option to list files related to network connections. It can be refined further with specific protocols or port numbers, but here it’s used generally for all network interfaces.
-
-P: Tells
lsof
to display port numbers instead of port names. Without this,lsof
would display port names (e.g., 'http' instead of '80'). -
-n: Prevents
lsof
from attempting to resolve hostnames from IP addresses, which speeds up the command. -
| grep LISTEN: Filters the output to show only lines containing the word 'LISTEN', which indicates that the socket is in a listening state, meaning it is waiting for incoming connections.
Assetfinder Assetfinder is a tool designed for subdomain discovery. It helps security researchers and penetration testers to find subdomains for a given domain. Here are the key points about Assetfinder:
- Subdomain Discovery: Assetfinder is primarily used to find subdomains of a given domain.
- Multiple Data Sources: It aggregates data from various sources, providing a comprehensive list of subdomains.
- Speed: It is designed to be fast and efficient, making it suitable for quick reconnaissance.
You can install Assetfinder using Go, as it is written in the Go programming language.
-
Install Go: If you don't have Go installed, you need to install it first. You can download it from the official Go website.
-
Set up Go Environment: Set the Go environment variables if not already set.
bash
Copy code
export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin
-
Install Assetfinder:
bash
Copy code
go install github.com/tomnomnom/assetfinder@latest
Basic usage of Assetfinder is straightforward. Here are some common commands:
-
Find Subdomains: To find subdomains for a given domain:
bash
Copy code
assetfinder example.com
-
Exclude Subdomains: To exclude certain subdomains, use the
-subs-only
flag:bash
Copy code
assetfinder --subs-only example.com
-
Save Output to File: To save the output to a file, you can redirect the output:
bash
Copy code
assetfinder example.com > subdomains.txt
-
Basic Subdomain Search:
bash
Copy code
assetfinder example.com
This command searches for subdomains of
example.com
. -
Subdomain Search with Only Subdomains:
bash
Copy code
assetfinder --subs-only example.com
This command outputs only the subdomains, excluding the main domain itself.
-
Subdomain Search and Save to File:
bash
Copy code
assetfinder example.com > subdomains.txt
This command saves the list of found subdomains to
subdomains.txt
.
- Combine with Other Tools: Assetfinder is often used in combination with other tools like
amass
,sublist3r
, andsubfinder
for comprehensive subdomain enumeration. - Automate Workflow: Integrate Assetfinder into automated reconnaissance scripts to streamline the information-gathering process.
- Verify Results: Always verify the discovered subdomains, as the tool might generate false positives or miss some subdomains.
- Installation Issues: Ensure Go is correctly installed and configured in your system.
- Empty Output: If no subdomains are found, verify that the domain is correct and that you have an active internet connection.
Assetfinder is a powerful tool for subdomain enumeration, providing quick and comprehensive results. By integrating it into your reconnaissance process, you can effectively identify subdomains and enhance your security assessments.