File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ import requests
2
+ from bs4 import BeautifulSoup
3
+ import time
4
+ url = "https://www.shodan.io/search?query=webcamxp"
5
+
6
+ response = requests .get (url )
7
+
8
+ if response .status_code == 200 :
9
+ soup = BeautifulSoup (response .text , 'html.parser' )
10
+
11
+ results = soup .find_all ('div' , class_ = 'two columns result-details' )
12
+
13
+ for result in results :
14
+ hostnames = result .find_all ('li' , class_ = 'hostnames text-secondary' )
15
+
16
+ for hostname in hostnames :
17
+ print (f"Host/IP: { hostname .get_text (strip = True )} " )
18
+
19
+ search_links = result .find_all ('a' , href = True )
20
+
21
+ for link in search_links :
22
+ link_url = f"https://www.shodan.io{ link ['href' ]} "
23
+ print (f"Search Link: { link_url } " )
24
+
25
+ print ("-" * 50 )
26
+
27
+ time .sleep (10 )
28
+
29
+ else :
30
+ print (f"Error: { response .status_code } " )
You can’t perform that action at this time.
0 commit comments