-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzmap.py
More file actions
188 lines (140 loc) Β· 4.3 KB
/
zmap.py
File metadata and controls
188 lines (140 loc) Β· 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
"""
Practical 3: Using Nmap / Zenmap to Analyze a Remote Machine (Ubuntu Linux)
Objective:
To perform network scanning and analysis of a remote machine using Nmap (CLI)
and optionally Zenmap (GUI), and understand open ports, services, and security exposure.
------------------------------------------------------------
π§ PART 1: INSTALLATION (Ubuntu Linux)
------------------------------------------------------------
Step 1: Update system packages
Command:
sudo apt update
Explanation:
- 'sudo' β run as administrator
- 'apt update' β refresh package list
Step 2: Install Nmap
Command:
sudo apt install nmap
Step 3 (Optional): Install Zenmap (GUI version)
Command:
sudo apt install zenmap
Note:
- Zenmap may not be available in latest Ubuntu repos.
- If not available, download from official site:
https://nmap.org/download.html
------------------------------------------------------------
π PART 2: BASIC NMAP USAGE
------------------------------------------------------------
Step 1: Check installation
Command:
nmap --version
Step 2: Scan a target website or IP
Example:
nmap scanme.nmap.org
OR:
nmap <IP_ADDRESS>
What happens:
- Nmap scans the target
- Finds open ports
- Identifies services running
------------------------------------------------------------
π PART 3: IMPORTANT SCAN TYPES
------------------------------------------------------------
1. Basic Scan:
nmap <target>
2. Verbose Scan:
nmap -v <target>
Explanation:
- '-v' β shows detailed output
3. Service Version Detection:
nmap -sV <target>
Explanation:
- '-sV' β detects software/service versions
4. OS Detection:
sudo nmap -O <target>
Explanation:
- '-O' β guesses operating system
5. Aggressive Scan:
sudo nmap -A <target>
Includes:
- OS detection
- Version detection
- Script scanning
6. Scan Specific Ports:
nmap -p 80,443 <target>
7. Full Port Scan:
nmap -p- <target>
------------------------------------------------------------
π₯οΈ PART 4: USING ZENMAP (GUI)
------------------------------------------------------------
Step 1: Open Zenmap
Command:
zenmap
Step 2:
- Enter target (IP or domain)
- Choose profile (e.g., "Intense Scan")
- Click "Scan"
Zenmap provides:
- Visual output
- Topology view
- Easy interpretation
------------------------------------------------------------
π PART 5: SAMPLE OUTPUT INTERPRETATION
------------------------------------------------------------
Example Output:
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
Meaning:
- PORT β communication endpoint
- STATE β open/closed/filtered
- SERVICE β application running
Example:
- 22 β SSH (remote login)
- 80 β HTTP (web server)
- 443 β HTTPS (secure web)
------------------------------------------------------------
β οΈ ETHICAL CONSIDERATION
------------------------------------------------------------
- Only scan systems you own OR have permission to test
- Unauthorized scanning may be illegal
------------------------------------------------------------
π PART 6: HOW TO PRESENT TO TEACHER
------------------------------------------------------------
1. Write Aim:
"To analyze a remote machine using Nmap."
2. Include Commands Used:
Example:
- nmap scanme.nmap.org
- nmap -sV scanme.nmap.org
3. Attach Screenshots:
- Terminal output
- Zenmap GUI (optional)
4. Explain Results:
- List open ports
- Explain services
5. Conclusion:
Example:
"Nmap helps identify open ports and services, which is useful
for network security and vulnerability assessment."
------------------------------------------------------------
π― BONUS TIPS (FOR EXTRA MARKS)
------------------------------------------------------------
- Use:
nmap -oN output.txt <target>
β saves output in file
- Explain TCP vs UDP briefly
- Mention cybersecurity relevance
------------------------------------------------------------
β
FINAL SUMMARY
------------------------------------------------------------
Nmap is a powerful network scanning tool used for:
- Port scanning
- Service detection
- Security analysis
Zenmap provides a graphical interface for easier understanding.
------------------------------------------------------------
END OF PRACTICAL
------------------------------------------------------------
"""