-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathfind-ips.sh.html
81 lines (71 loc) · 2.1 KB
/
find-ips.sh.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<title>find-ips.sh Information</title>
</head>
<body background="concret.jpg">
<center>
<h1>find-ips.sh Information</h1>
<img src="bluebar.gif" width="576" height="14" alt="Blue Bar separator">
</center>
<p>
This macro uses egrep to search a file and list out all the strings that match [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}. This will hopefully just be IPv4 addresses. It does not try to validate the strings to confirm that they are addresses. It then pipes the list to "sort -u" to get a list of unique addresses.
<p>
<b><h3>Usage</h3></b>
find-ips.sh FILE-NAME
<br><br>
<b>FILE-NAME</b>
<br>
The file name (or path to the file)
<br><br>
<b><h3>Examples</h3></b>
Example 1 - Search the syslog file for IP addresses
<center>
<table border=5>
<tr><td align=left>
<pre>
$ sudo ./find-ips.sh /var/log/syslog
192.168.1.1
192.168.1.12
192.168.122.1
192.168.122.27
255.255.255.0
</pre>
</td></tr>
</table>
Figure 1
</center>
<p>
Example 2 - Search the secure file for IP addresses
<center>
<table border=5>
<tr><td align=left>
<pre>
$ sudo ./find-ips.sh /var/log/secure
192.168.68.76
192.168.2.22
192.168.40.34
192.168.50.15
172.16.22.3
</pre>
</td></tr>
</table>
Figure 2
</center>
<p>
You can find this script at <a href="https://github.com/noahdavids/packet-analysis/blob/master/find-ips.sh">find-ips.sh</a>
<br /><br />
<h5><center>
<img src="bluebar.gif" width="576" height="14" alt="Blue Bar separator">
<br />
This page was last modified on 18-04-25</h5>
</center>
<a href="mailto:noah@noahdavids.org"><img src="mailbox.gif" width="32" height="32" alt="mailbox" align="left" hspace=3>
Send comments and suggestions
<br />
to noah@noahdavids.org
</a>
</body>
</html>