-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscan.py
163 lines (155 loc) · 5.56 KB
/
scan.py
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
import json
import requests
import html
import schedule
import time
import smtplib
from email.mime.text import MIMEText
#---------------Fill in your data---------------
send_mail=True
'''
2729: AKTION .de-Domain 14 Cent OST21
2730: AKTION .ch-Domain OST21
2731: AKTION .li-Domain OST21
2732: AKTION .eu-Domain OST21
2733: AKTION .at-Domain OST21
2734: VPS Ostern S OST21
2735: VPS Ostern M OST21
2736: VPS Ostern L OST21
2737: VPS Ostern XL OST21
2738: VPS Funny Bunny OST21
2739: Webhosting 1000 SE OST21
2740: Webhosting 2000 SE OST21
2741: Webhosting 4000 SE OST21
2742: Webhosting Power Egg OST21
2743: RS Ostern S OST21
2744: RS Ostern M OST21
2745: RS Ostern L OST21
2746: RS Ostern XL OST21
2747: RS Ostern XXL OST21
2749: Cloud vLAN Giga OST21
2750: Cloud vLAN 2,5 Gbit/s OST21
2751: Reseller Level B OST21
2752: Zusätzliche IPv4 OST21
2753: Failover IPv4-Adresse OST21
2754: netcup Twinbook OST21
'''
ids=[2744,2738] # fill in the desired Product ids
me="[email protected]"
you="[email protected]"
mail_user="user"
mail_pw="pw"
smtp_ssl_server="email.de"
#----------------------------------
urls = ["/",
"/ausbildung/",
"/ausbildung/bachelor-of-engineering-studiengang-informationstechnik-mwd",
"/ausbildung/fachinformatik-anwendungsentwicklung-mwd",
"/ausbildung/fachinformatik-systemintegration-mwd",
"/bestellen/agb.php",
"/bestellen/domainangebote.php",
"/bestellen/softwareangebote.php",
"/bestellen/warenkorb.php",
"/groupware/",
"/hosting/",
"/hosting/qualitaetsgarantien.php",
"/hosting/webhosting-application-hosting.php",
"/hosting/webhosting-testaccount.php",
"/jobs/",
"/jobs/junior-php-developer-mwd",
"/jobs/software-engineer-mwd-faoer-rd-go-python",
"/jobs/supportmitarbeiter-mwd",
"/jobs/systemadministrator-mit-fokus-auf-linux-und-3rd-level-support-mwd",
"/kontakt/",
"/kontakt/datenschutzerklaerung.php",
"/kontakt/impressum.php",
"/kontakt/postanschrift.php",
"/kontakt/telefonsupport.php",
"/professional/",
"/professional/dedizierte-server/",
"/professional/dedizierte-server/perc_raid_controller.php",
"/professional/dedizierte-server/remote_management.php",
"/professional/individuelle-loesungen/",
"/professional/individuelle-loesungen/penetrationtesting.php",
"/professional/individuelle-loesungen/preise.php",
"/professional/individuelle-loesungen/servermanagement.php",
"/professional/individuelle-loesungen/software-installationen.php",
"/professional/managed-server/managed-cloud-cluster.php",
"/professional/managed-server/managed-privateserver.php",
"/professional/managed-server/managed-server.php",
"/ssl-zertifikate/",
"/ssl-zertifikate/geotrust.php",
"/ssl-zertifikate/globe.php",
"/ssl-zertifikate/rapid.php",
"/ssl-zertifikate/thawte.php",
"/support/",
"/ueber-netcup/",
"/ueber-netcup/auszeichnungen.php",
"/ueber-netcup/ddos-schutz-filter.php",
"/ueber-netcup/hardware-infrastruktur.php",
"/ueber-netcup/kundenmeinungen-netcup.php",
"/ueber-netcup/merchandising.php",
"/ueber-netcup/oekostrom.php",
"/ueber-netcup/partner.php",
"/ueber-netcup/public-relations.php",
"/ueber-netcup/rechenzentrum.php",
"/ueber-netcup/referenzen.php",
"/vserver/",
"/vserver/reseller_angebote_vserver.php",
"/vserver/root-server-erweiterungen.php",
"/vserver/storagespace.php",
"/vserver/uebersicht_vserver_angebote.php",
"/vserver/vergleich-linux-vserver-kvm.php",
"/vserver/vergleich-root-server-vps.php",
"/vserver/vps.php",
"/vserver/vserver_guenstig_qualitaet.php",
"/vserver/vserver_images.php",
"/vserver/vstorage.php"
]
def scan():
eggs=[]
for u in urls:
api = "https://www.netcup.de/api/eggs"
data = {"requrl": u}
response = requests.post(api, data).text
response_json = json.loads(response)
if response_json["eggs"] != False:
if int(response_json["eggs"][0]["product_id"]) in ids:
eggs.append([html.unescape(response_json["eggs"][0]["title"]),"https://www.netcup.de/bestellen/produkt.php?produkt=" + str(response_json["eggs"][0]["product_id"]) + "&hiddenkey="+ str(response_json["eggs"][0]["product_key"])],"https://netcup.de" + u)
print("Gefunden auf:", "https://netcup.de" + u)
print(html.unescape(response_json["eggs"][0]["title"]), "( Produkt ", str(response_json["eggs"][0]["product_id"]) ,") für", html.unescape(response_json["eggs"][0]["price"]))
#Geht nur lokal:
print("https://www.netcup.de/bestellen/produkt.php?produkt=" + str(response_json["eggs"][0]["product_id"]) + "&hiddenkey="+ str(response_json["eggs"][0]["product_key"]))
print("----------")
print("DONE!")
if len(eggs) > 0:
print("\007") #play notification sound
if (send_mail):
print("SENDING MAIL")
msg="Found {} Netcup Eggs:\n".format(len(eggs))
for egg in eggs:
msg+="{}: {} on {}\n".format(*egg)
msg = MIMEText(msg)
# me == the sender's email address
# you == the recipient's email address
msg['Subject'] = 'Found Netcup Eggs'
msg['From'] = me
msg['To'] = you
# Send the message via our own SMTP server, but don't include the
# envelope header.
s = smtplib.SMTP_SSL(smtp_ssl_server)
s.login(mail_user,mail_pw)
s.sendmail(me, [you], msg.as_string())
s.quit()
print("MAIL SENT!")
print("===========================")
schedule.every().hour.at("00:10").do(scan)
schedule.every().hour.at("10:10").do(scan)
schedule.every().hour.at("20:10").do(scan)
schedule.every().hour.at("30:10").do(scan)
schedule.every().hour.at("40:10").do(scan)
schedule.every().hour.at("50:10").do(scan)
scan()
while True:
schedule.run_pending()
time.sleep(1)