Nikto - A web server scanner that identifies vulnerabilities and misconfigurations in web servers, such as outdated software or exposed directories. https://cirt.net/Nikto2
* '''Nikto Core''': The main script that performs the scanning and reporting. * '''Plugins''': Extend the capabilities of Nikto by adding checks for specific vulnerabilities and issues. * '''Database''': Contains information about known vulnerabilities, outdated software versions, and other potential security issues.
* '''Comprehensive Scanning''': Checks for over 6,700 potentially dangerous files and programs, and more than 1,250 outdated versions. * '''Server Identification''': Determines the server software and its version. * '''Security Checks''': Looks for configuration issues such as HTTP server options, default files and programs, and security-related headers. * '''Reporting''': Generates reports in various formats including plain text, HTML, XML, and CSV. * '''Customization''': Supports custom scripts and plugins to extend functionality.
```bash nikto -h http://example.com ```
```bash nikto -h http://example.com -p 8080 ```
```bash nikto -h http://example.com -o results.html -Format htm ```
```python import subprocess
def run_nikto_scan(target_url):
result = subprocess.run(['nikto', '-h', target_url], capture_output=True, text=True)
print(result.stdout)
if result.stderr:
print(f"Error: {result.stderr}")
# Run Nikto scan on a target URL
run_nikto_scan('http://example.com')
```
```java import java.io.BufferedReader; import java.io.InputStreamReader;
public class NiktoExample {
public static void runNiktoScan(String targetUrl) {
try {
Process process = new ProcessBuilder("nikto", "-h", targetUrl).start();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
reader.close();
int exitCode = process.waitFor();
if (exitCode != 0) {
BufferedReader errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
while ((line = errorReader.readLine()) != null) {
System.err.println("Error: " + line);
}
errorReader.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
// Run Nikto scan on a target URL
runNiktoScan("http://example.com");
}
}
```