This repository has been archived by the owner on Dec 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
1110 lines (933 loc) · 71.7 KB
/
bot.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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from asyncio import tasks
import datetime
from inspect import EndOfBlock
from logging import fatal, log
from typing import Any
from attr import astuple
import discord
import json
import sys
import os
import platform
import time
from discord import channel
from discord.ext.commands.core import group
from discord.member import flatten_user
from discord.utils import valid_icon_size
import faker
import requests
from discord.ext import commands, tasks
import re
import ipaddress
import random
from discord.ext.commands import Bot
import timeit
import redis
from modules.password_analyzer import Analyze
from faker import Faker
#redis database
redis_connect = redis.Redis(host='176.9.158.158', port=29992, charset="utf-8", decode_responses=True, db=0, password='$kW9oZ5WmGnXge2DA&HD6UVw')
BotStartTime = str(datetime.datetime.now())
def uptime():
execution_time = datetime.datetime.now().replace(microsecond=0) - BotStartTime.replace(microsecond=0)
# Helper vars:
MINUTE = 60
HOUR = MINUTE * 60
DAY = HOUR * 24
# Get the days, hours, etc:
days = int( execution_time.seconds / DAY )
hours = int( ( execution_time.seconds % DAY ) / HOUR )
minutes = int( ( execution_time.seconds % HOUR ) / MINUTE )
seconds = int( execution_time.seconds % MINUTE )
# Build up the pretty string (like this: "N days, N hours, N minutes, N seconds")
string = ""
if days > 0:
string += str(days) + " " + (days == 1 and "day" or "days" )
if len(string) > 0 or hours > 0:
string += str(hours) + " " + (hours == 1 and "hour\n" or "hours\n" )
if len(string) > 0 or minutes > 0:
string += str(minutes) + " " + (minutes == 1 and "minute\n" or "minutes\n" )
string += str(seconds) + " " + (seconds == 1 and "second\n" or "seconds\n" )
return string;
# #load config
# if not os.path.isfile("config.json"):
# sys.exit("'config.json' not found!.")
# else:
# with open("config.json") as file:
# confige = json.load(file)
# print("loaded config")
bot = commands.Bot(command_prefix=redis_connect.hget("bot config", "Bot_prefix"))
BotStartTime = datetime.datetime.now()
#variables
headers = {
'apikey': redis_connect.hget("API keys", "promptapi_api_key"),
}
@bot.event
async def on_ready():
print(f"Logged in as {bot.user.name}")
print(f"Discord.py API version: {discord.__version__}")
print(f"Python version: {platform.python_version()}")
print(f"Running on: {platform.system()} {platform.release()} ({os.name})")
print("-------------------")
await bot.change_presence(activity=discord.Game(redis_connect.hget("bot config", "Bot_prefix") + "help"))
bot.remove_command("help")
#please wait presets
please_wait=discord.Embed(title=redis_connect.hget("embed please wait", "title"), description=redis_connect.hget("embed please wait", "description"), color=0xff9029)
please_wait.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
please_wait.set_thumbnail(url=redis_connect.hget("embed please wait", "thumbnail"))
please_wait.set_footer(text=redis_connect.hget("embed template", "footer"))
@bot.command(aliases=['h'])
async def help (message):
embed=discord.Embed(title="How to use Pencord Discord bot", description="All the commands", color=0x0088ff)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.add_field(name="Website discovering", value=redis_connect.hget("bot config", "Bot_prefix") + "**whois** - Display whois data for a domain or IP.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**domainlist** - Display related domains about the target domain.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**webping** - Ping a website.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**wpscan** - Scans a wordpress site and tells you details about it.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**dns** - Displays the DNS records and its IP's.\n", inline=False)
embed.add_field(name="Miscellaneous", value=redis_connect.hget("bot config", "Bot_prefix") + "**usersearch** - Search the interwebs for valid target usernames.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**bincheck** - Display the status of a Bank Identification Number.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**face** - Generate a fake face.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**bincheck** - Display the status of a Bank Identification Number.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**password** - Test the strength of a password.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**fakeinfo** - Generate fake info.\n", inline=False)
embed.add_field(name="Pencord default commands", value=redis_connect.hget("bot config", "Bot_prefix") + "**help** - Display all of the commands and what they do.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**ping** - Test the Discord API connection\n" + redis_connect.hget("bot config", "Bot_prefix") + "**changelog** - View the changelog of Pencord.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**status** - View the status of Pencord.\n" + redis_connect.hget("bot config", "Bot_prefix") + "**credits** - View the projects that made Pencord possible.\n", inline=False)
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?help command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?help", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value="help", inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command(aliases=['hs'])
async def whois(message, whois_domain):
#send "please wait message"
please_wait_message = await message.channel.send(embed=please_wait)
#get the message ID of the "please wait message"
message_id = please_wait_message.id
#get the channel ID
channel_id = message.channel.id
#sanitize the user input
user_input_sanitize_domain = re.search('([0-9a-z-]{2,}\.[0-9a-z-]{2,3}\.[0-9a-z-]{2,3}|[0-9a-z-]{2,}\.[0-9a-z-]{2,7})$', whois_domain)
user_input_sanitize_IP = re.search('^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$', whois_domain)
#checks to see if the domain is in the blacklist
if user_input_sanitize_domain!=None:
if user_input_sanitize_domain.group() in redis_connect.hget("blacklist", "domain"):
embed=discord.Embed(title="Sorry, " + user_input_sanitize_domain.group() + " is blacklisted from Pencord.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id, message_id)
#send log data
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?whois command on a blacklisted domain!", color=0xf40101)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?whois", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(whois_domain), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
return
elif user_input_sanitize_IP!=None:
if user_input_sanitize_IP.group() in redis_connect.hget("blacklist", "ip"):
embed=discord.Embed(title="Sorry, " + user_input_sanitize_IP.group() + " is blacklisted from Pencord.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id, message_id)
#send log data to Discord
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?whois command on a blacklisted IP!", color=0xf40101)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?whois", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(whois_domain), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
return
#------------------------------------------------
if user_input_sanitize_IP!=None:
whois_output = os.popen("whois -H " + user_input_sanitize_IP.group())
embed=discord.Embed(title="Whois for " + user_input_sanitize_IP.group(), description=whois_output.read()[:4095].replace("\n\n", "\n").replace("\n\n\n", "\n").replace("\n\n\n\n", "\n").replace("\n\n\n\n\n", "\n").replace("\n\n\n\n\n\n", "\n").replace("#", ""), color=0x83ff61)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://media.discordapp.net/attachments/866002022464487444/866410785936506880/1200px-VisualEditor_-_Icon_-_Open-book-2.svg.png?width=580&height=580")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.send(embed=embed)
elif user_input_sanitize_domain!=None:
whois_output = os.popen("whois -H " + user_input_sanitize_domain.group())
embed=discord.Embed(title="Whois for " + user_input_sanitize_domain.group(), description=whois_output.read()[:4095].replace("\n\n", "\n").replace("\n\n\n", "\n").replace("\n\n\n\n", "\n").replace("\n\n\n\n\n", "\n").replace("\n\n\n\n\n\n", "\n").replace("#", ""), color=0x83ff61)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://media.discordapp.net/attachments/866002022464487444/866410785936506880/1200px-VisualEditor_-_Icon_-_Open-book-2.svg.png?width=580&height=580")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.send(embed=embed)
else:
embed=discord.Embed(title="Looks like you did not enter a domain or IP address, please also don't include the '/' after your domain.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://img.icons8.com/fluent/100/000000/ping-pong.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
#delete the "please wait" messasurfshark vpnge
await bot.http.delete_message(channel_id, message_id)
#logging to Discord
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?whois command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?whois", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(whois_domain), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command(aliases=['cl'])
async def changelog (message):
#send changelog embed
embed=discord.Embed(title="Changelog (Bot version: " + "V" + redis_connect.hget("bot config", "Version") + ")", color=0x0088ff)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://img.icons8.com/plasticine/100/000000/approve-and-update.png")
embed.add_field(name="V2.7.2", value="- Added a fake info generator\n - fixed minor bugs", inline=False)
embed.add_field(name="V2.6.2", value="- Added a face generator\n - fixed minor bugs", inline=False)
embed.add_field(name="V2.5.2", value="- fixed minor bugs", inline=False)
embed.add_field(name="V2.5.0", value="- More bug fixes.\n - Added credits command.", inline=False)
embed.add_field(name="V2.4.0", value="- More stuff fixed.", inline=False)
embed.add_field(name="V2.3.1", value="- backend improvement, Pencord now uses a Redis database \n- Improved Regex filtering\n- Fullwhois and whois is now the same command.\n- Improved Whois\n- Major/minor bug fixes.", inline=False)
embed.add_field(name="V2.2.7", value="- fixed minor & major bugs \n - bot now runs faster\n - Bot won't crash when inputting invalid queries\n - Added a domain blacklist", inline=False)
embed.add_field(name="V2.2.5", value="- fixed minor bugs \n - added new error messages \n", inline=False)
embed.add_field(name="V2.2.2", value="- Added a status section \n- Code Optimisations.", inline=False)
embed.add_field(name="V2.2.0", value="- Added user friendly error messages. \n - Minor bug fixes \n - RegEx integration", inline=False)
embed.add_field(name="V2.1.0", value="- Added DNS lookup", inline=False)
embed.add_field(name="V2.0.0", value="- Bot backend has been rewritten for stability, reliability, security and making it much more faster. Thanks to <@608636292301062184> for the help. \n \n - added **Please Wait** messages when performing a command.", inline=False)
embed.add_field(name="V1.2.2", value="- Added more whois information.\n \n" + "- Whois is more user friendly to read.", inline=False)
embed.add_field(name="V1.1.2", value="- Fixed an vulnerability that allows users to add extra arguments to commands. Thanks to <@180006576428417024> for reporting this.", inline=False)
embed.add_field(name="V1.1.1", value="- Big update to whois! Added new whois elements data.", inline=False)
embed.add_field(name="V1.0.1", value="- Added a changelog \n \n - Fixed formatting on cloudflare scan. \n \n - Optimized the code", inline=False)
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?changelog command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?changelog", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value="changelog", inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command(aliases=['bc'])
async def bincheck (message, bincheck_input):
#send "please wait message"
please_wait_message = await message.channel.send(embed=please_wait)
#get message id
message_id_bincheck = please_wait_message.id
#get channel id
channel_id_bincheck = message.channel.id
#make api request
bincheck_output = requests.get("https://api.promptapi.com/bincheck/" + bincheck_input, headers=headers)
ready_output_bincheck = str(bincheck_output.json()).replace('"', "").replace(",", "\n").replace("{", "").replace("}", "").replace("'", "")
if "message" in ready_output_bincheck:
embed=discord.Embed(title="Incorrect BIN number", description="```" + bincheck_output.json()["message"] + "```", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.discordapp.com/attachments/866002022464487444/866427540738801705/credit-card-icon-png-4424.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
else:
#send responce
embed=discord.Embed(title="Status for bank identification number", description=bincheck_input, color=0x83ff61)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.discordapp.com/attachments/866002022464487444/866427540738801705/credit-card-icon-png-4424.png")
embed.add_field(name="BIN Status:", value=ready_output_bincheck, inline=True)
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_bincheck, message_id_bincheck)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?bincheck command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?bincheck", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(bincheck_input), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command(aliases=['dl'])
async def domainlist (message, sublist_responce):
#send "please wait message"
please_wait_message = await message.channel.send(embed=please_wait)
#get message id
message_id_domainlist = please_wait_message.id
#get channel id
channel_id_domainlist = message.channel.id
#sanitize the user input
user_input_sanitize_domain = re.search('([0-9a-z-]{2,}\.[0-9a-z-]{2,3}\.[0-9a-z-]{2,3}|[0-9a-z-]{2,}\.[0-9a-z-]{2,7})$', sublist_responce)
user_input_sanitize_IP = re.search('^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$', sublist_responce)
#checks to see if the domain is in the blacklist
if user_input_sanitize_domain!=None:
if user_input_sanitize_domain.group() in redis_connect.hget("blacklist", "domain"):
embed=discord.Embed(title="Sorry, " + user_input_sanitize_domain.group() + " is blacklisted from Pencord.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_domainlist, message_id_domainlist)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?domainlist command on a blacklisted domain!", color=0xf40101)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?domainlist", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(sublist_responce), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
return
elif user_input_sanitize_IP!=None:
if user_input_sanitize_IP.group() in redis_connect.hget("blacklist", "ip"):
embed=discord.Embed(title="Sorry, " + user_input_sanitize_IP.group() + " is blacklisted from Pencord.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_domainlist, message_id_domainlist)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?domainlist command on a blacklisted IP!", color=0xf40101)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?domainlist", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(sublist_responce), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
return
#-----------------------------------------------
try:
if user_input_sanitize_domain!=None:
sublist_output = os.popen("pdlist " + user_input_sanitize_domain.group())
embed=discord.Embed(title="related domains for " + user_input_sanitize_domain.group(), description=sublist_output.read()[564:], color=0x83ff61)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://image.flaticon.com/icons/png/512/1490/1490342.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
elif user_input_sanitize_IP!=None:
embed=discord.Embed(title="OOPS!", description="```This command only works with a domain name```", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
else:
embed=discord.Embed(title="Looks like you did not enter a domain, please also don't include the '/' after your domain.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://img.icons8.com/fluent/100/000000/ping-pong.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_domainlist, message_id_domainlist)
return
except:
embed=discord.Embed(title="OOPS!", description="```" + "Sorry, there was an error. It could be that " + sublist_responce + " has too many related domains to be listed here." + "```", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_domainlist, message_id_domainlist)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?domainlist command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?domainlist", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(sublist_responce), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command(aliases=['p'])
async def ping (message):
before = time.monotonic()
message = await message.channel.send("Pong")
ping = (time.monotonic() - before) * 1000
await message.channel.send(content=f"That took {int(ping)}ms")
@bot.command()
async def fullwhois (message):
await message.channel.send(redis_connect.hget("bot config", "Bot_prefix") + "fullwhois is depreciated, please use the ?whois command.")
@bot.command(aliases=['wp'])
async def webping (message, webping_responce):
#send "please wait message"
please_wait_message = await message.channel.send(embed=please_wait)
#get message id
message_id_webping = please_wait_message.id
#get channel id
channel_id_webping = message.channel.id
sanitized_word_output_webping_ip = re.search('^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$', webping_responce)
sanitized_word_output_webping_domain = re.search('([0-9a-z-]{2,}\.[0-9a-z-]{2,3}\.[0-9a-z-]{2,3}|[0-9a-z-]{2,}\.[0-9a-z-]{2,4})$', webping_responce)
#checks to see if the domain is in the blacklist
if sanitized_word_output_webping_domain!=None:
if sanitized_word_output_webping_domain.group() in redis_connect.hget("blacklist", "domain"):
embed=discord.Embed(title="Sorry, " + sanitized_word_output_webping_domain.group() + " is blacklisted from Pencord.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_webping, message_id_webping)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?webping command on a blacklisted domain!", color=0xf40101)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?webping", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(webping_responce), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
return
if sanitized_word_output_webping_ip!=None:
if sanitized_word_output_webping_ip.group() in redis_connect.hget("blacklist", "ip"):
embed=discord.Embed(title="Sorry, " + sanitized_word_output_webping_ip.group() + " is blacklisted from Pencord.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_webping, message_id_webping)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?webping command on a blacklisted IP!", color=0xf40101)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?webping", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(webping_responce), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
return
#-----------------------------------------------
try:
if sanitized_word_output_webping_domain!=None:
output_ping = os.popen("ping -c 3 " + sanitized_word_output_webping_domain.group())
embed=discord.Embed(title="Output for " + sanitized_word_output_webping_domain.group(), description=output_ping.read(), color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://img.icons8.com/fluent/100/000000/ping-pong.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
elif sanitized_word_output_webping_ip!=None:
output_ping = os.popen("ping -c 3 " + sanitized_word_output_webping_ip.group())
embed=discord.Embed(title="Output for " + sanitized_word_output_webping_ip.group(), description=output_ping.read(), color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://img.icons8.com/fluent/100/000000/ping-pong.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
else:
embed=discord.Embed(title="Looks like you did not enter a domain or IP address, please also don't include the '/' after your domain.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_webping, message_id_webping)
return
except:
embed=discord.Embed(title="Output for " + sanitized_word_output_webping_ip.group(), description="I don't seem to know this domain. Is it a valid domain?", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://img.icons8.com/fluent/100/000000/ping-pong.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_webping, message_id_webping)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?webping command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?webping", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(webping_responce), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command(aliases=['d'])
async def dns (message, dns_input):
#send "please wait message"
please_wait_message = await message.channel.send(embed=please_wait)
#get message id
message_id_dnslookup = please_wait_message.id
#get channel id
channel_id_dnslookup = message.channel.id
sanitized_word_output_dnsenum_ip = re.match("^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$",dns_input)
sanitized_word_output_dnsenum_domain = re.match('([0-9a-z-]{2,}\.[0-9a-z-]{2,3}\.[0-9a-z-]{2,3}|[0-9a-z-]{2,}\.[0-9a-z-]{2,4})$', dns_input)
#checks to see if the domain is in the blacklist
if sanitized_word_output_dnsenum_domain!=None:
if sanitized_word_output_dnsenum_domain.group() in redis_connect.hget("blacklist", "domain"):
embed=discord.Embed(title="Sorry, " + sanitized_word_output_dnsenum_domain.group() + " is blacklisted from Pencord.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_dnslookup, message_id_dnslookup)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?dns command on a blacklisted domain!", color=0xf40101)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?dns", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(dns_input), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
return
if sanitized_word_output_dnsenum_ip!=None:
if sanitized_word_output_dnsenum_ip.group() in redis_connect.hget("blacklist", "ip"):
embed=discord.Embed(title="Sorry, " + sanitized_word_output_dnsenum_ip.group() + " is blacklisted from Pencord.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_dnslookup, message_id_dnslookup)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?dns command on a blacklisted IP!", color=0xf40101)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?dns", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(dns_input), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
return
#-----------------------------------------------
if sanitized_word_output_dnsenum_domain!=None:
output_dns = os.popen("dnsenum " + str(sanitized_word_output_dnsenum_domain.group()))
remove_odd_shit = str(output_dns.read().replace("[1;34m", "").replace("[0m", "")).replace("[1;31m", "")[50:]
embed=discord.Embed(title="Grabbing DNS records for " + sanitized_word_output_dnsenum_domain.group(), description=remove_odd_shit + "\n**Note: You should not rely on this feature and conduct your own test as this feature may not display all DNS records do to Discord limitations.**", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://img.icons8.com/fluent/100/000000/ping-pong.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
elif sanitized_word_output_dnsenum_ip!=None:
embed=discord.Embed(title="OOPS!", description="```This command only works with a domain name```", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_dnslookup, message_id_dnslookup)
return
else:
embed=discord.Embed(title="Please enter a valid domain", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_dnslookup, message_id_dnslookup)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?dns command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?dns", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(dns_input), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command(aliases=['pwd'])
async def password(ctx, *args):
try:
if len(args) == 0:
message = '&password'
else:
message = '&password ' + ' '.join(args)
result = Analyze.check_password(message)
if isinstance(result, discord.Embed):
await ctx.send(embed=result)
else:
await ctx.send(result)
except:
embed = discord.Embed(title='ERROR: Could not connect. Please try again', color=0xff0000)
await ctx.send(embed=embed)
@bot.command(aliases=['us'])
async def usersearch(message, *, user_input):
#send "please wait message"
please_wait_message = await message.channel.send(embed=please_wait)
#get message id
message_id_usersearch = please_wait_message.id
#get channel id
channel_id_usersearch = message.channel.id
#sanitize
user_sanitize = str(user_input).replace(" ", "-")
usersearch_output = os.popen("python3 sherlock/sherlock/sherlock.py " + user_sanitize + " --timeout 5")
await message.channel.send("Hey! just a heads up this command may take some time to complete so please be patient.")
embed=discord.Embed(title="Here is what I found for " + user_input, description=usersearch_output.read()[:4096], color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://media.discordapp.net/attachments/866002022464487444/872960098165727252/user-1648810-1401302.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_usersearch, message_id_usersearch)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?usersearch command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?webping", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(user_input), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command(aliases=['wps'])
async def wpscan(message, wpscan_input, wpscan_argument=""):
#send "please wait message"
please_wait_message = await message.channel.send(embed=please_wait)
#get message id
message_id_wpscan = please_wait_message.id
#get channel id
channel_id_wpscan = message.channel.id
user_input_sanitize_domain = re.search('([0-9a-z-]{2,}\.[0-9a-z-]{2,3}\.[0-9a-z-]{2,3}|[0-9a-z-]{2,}\.[0-9a-z-]{2,7})$', wpscan_input)
user_input_sanitize_IP = re.search('^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$', wpscan_input)
#checks to see if the domain is in the blacklist
if user_input_sanitize_domain!=None:
if user_input_sanitize_domain.group() in redis_connect.hget("blacklist", "domain"):
embed=discord.Embed(title="Sorry, " + user_input_sanitize_domain.group() + " is blacklisted from Pencord.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_wpscan, message_id_wpscan)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?wpscan command on a blacklisted domain!", color=0xf40101)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?wpscan", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(wpscan_input), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
return
if user_input_sanitize_IP!=None:
if user_input_sanitize_IP.group() in redis_connect.hget("blacklist", "ip"):
embed=discord.Embed(title="Sorry, " + user_input_sanitize_IP.group() + " is blacklisted from Pencord.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_wpscan, message_id_wpscan)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?webping command on a blacklisted IP!", color=0xf40101)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?webping", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(wpscan_input), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
return
#-----------------------------------------------
if user_input_sanitize_IP!=None:
embed=discord.Embed(title="Oops", description="please enter a website domain.", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.send(embed=embed)
elif user_input_sanitize_domain!=None:
print("test1 " + user_input_sanitize_domain.group())
wpscan_output = os.popen("wpscan --url " + "https://" + user_input_sanitize_domain.group() + " " + wpscan_argument)
embed=discord.Embed(title="Wordpress scan for " + user_input_sanitize_domain.group(), description=wpscan_output.read()[566:4096].replace("[32m[+][0m", "").replace("[34m[i][0m", "").replace("[33m[!][0m", "").replace("|===========================================================================================================================================================================", "|=====================================================").replace("|=============================================================================================================================================================================|", "==============================================================================================================|").replace("No WPScan API Token given, as a result vulnerability data has not been output.", "").replace("You can get a free API token with 25 daily requests by registering at https://wpscan.com/register", "").replace("\n\n\n", "").replace("___", "").replace("--url", "url").replace("--ignore-main-redirect", "```--ignore-main-redirect```"), color=0x83ff61)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.send(embed=embed)
else:
embed=discord.Embed(title="Oops", description="That's not a valid domain.", color=0xf40101)
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.send(embed=embed)
await bot.http.delete_message(channel_id_wpscan, message_id_wpscan)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?wpscan command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?wpscan", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(wpscan_input), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command(aliases=['c'])
async def credits(message):
embed=discord.Embed(title="Tools that was made to use Pencord", description="-------------------------------------------------------------------------", color=0x83ff61)
embed.add_field(name="Discord embed generator", value="[Link](https://cog-creators.github.io/discord-embed-sandbox/)", inline=False)
embed.add_field(name="Face generator", value="[Link](https://hankhank10.github.io/fakeface/)", inline=False)
embed.add_field(name="Pdlist", value="[Link](https://github.com/gnebbia/pdlist)", inline=False)
embed.add_field(name="Dnsenum", value="[Link](https://github.com/fwaeytens/dnsenum)", inline=False)
embed.add_field(name="Password checker", value="[Link](https://github.com/plasticuproject/clevercord)", inline=False)
embed.add_field(name="WPscan", value="[Link](https://wpscan.com/)", inline=False)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
#need to do!!!!!!
@bot.command(aliases=['ps'])
async def portscan(message, portscan_input):
portscan_output = os.popen("nmap -F " + portscan_input)
sanitize_output = re.search("/(\d{1,5})\/(tcp|udp|http|https|ssh)", portscan_output.read())
print(sanitize_output.group())
@bot.command()
async def face(message):
#send "please wait message"
please_wait_message = await message.channel.send(embed=please_wait)
#get message id
message_id_cloudflare = please_wait_message.id
#get channel id
channel_id_cloudflare = message.channel.id
faceoutput = requests.get("https://fakeface.rest/face/json")
embed=discord.Embed(title="Here is your generated face", color=0x83ff61)
embed.set_image(url=faceoutput.json()["image_url"])
embed.add_field(name="Gender", value=faceoutput.json()["gender"], inline=False)
embed.add_field(name="Age", value=faceoutput.json()["age"], inline=False)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
await bot.http.delete_message(channel_id_cloudflare, message_id_cloudflare)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?face command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?face", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value="face", inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command()
async def fakeinfo(message):
fake = Faker()
embed=discord.Embed(title="Fake info", color=0x83ff61)
embed.add_field(name=fake.name(), value=fake.address(), inline=False)
embed.add_field(name="Birthday", value=f"{random.randint(1940, 2007)}-{random.randint(1, 12)}-{random.randint(1, 30)}", inline=True)
embed.add_field(name="SSN", value=fake.ssn(), inline=True)
embed.add_field(name="Phone", value="Phone: " + str(fake.phone_number()).split("x")[0] + "\nCountry Code : " + fake.country_calling_code(), inline=True)
embed.add_field(name="Online", value="**Email:** " + fake.email() + "\n**Username:** " + fake.profile()["username"] + "\n**Password:** " + str(fake.password()) + "\n**Website:** " + str(fake.profile()["website"][0]) + "\n**Browser user Agent:** " + str(fake.user_agent()), inline=False)
embed.add_field(name="Finance", value=fake.credit_card_full(), inline=False)
embed.add_field(name="Employment", value="**Company:** " + fake.company() + "\n**Company Email:** " + fake.company_email() + "\n**Company suffix:** " + fake.company_suffix(), inline=False)
embed.add_field(name="Technology", value="**IPv4:** " + fake.ipv4() + " (Private: " + fake.ipv4_private() + ")" + "\n**IPv6:** " + fake.ipv6() + "\n**Mac address:** " + fake.mac_address() + "\n**Linux processor:** " + fake.linux_processor() + "\n**Mac Processor:** " + fake.mac_processor() + "\n**Linux platform token:** " + fake.linux_platform_token() + "\n**Mac platform token:** " + fake.mac_platform_token(), inline=False)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?fakeinfo command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?fakeinfo", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value=str(message), inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command(aliases=['s'])
async def status (message):
#health status
if redis_connect.get("health status") == "":
status_no_error_output = "No Errors"
system_health_icon = ":white_check_mark:"
else:
status_no_error_output = redis_connect.get("health status")
system_health_icon = ":warning:"
#annoucements
if redis_connect.get("announcement") == "":
annoucement_output = "No announcements"
else:
annoucement_output = redis_connect.get("announcement")
embed=discord.Embed(title="Announcements", description=annoucement_output, color=0x0088ff)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.add_field(name="servers", value=len(bot.guilds), inline=True)
embed.add_field(name="Uptime", value=uptime(), inline=True)
embed.add_field(name="Version", value=redis_connect.hget("bot config", "Version"), inline=True)
embed.add_field(name="System Health", value=system_health_icon, inline=True)
embed.add_field(name="Errors", value=status_no_error_output, inline=False)
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.send(embed=embed)
channel = bot.get_channel(864566639323906078)
logoutput=discord.Embed(title=str(message.author.name) + " used the ?status command!", color=0x83ff61)
logoutput.set_author(name=message.author.name, icon_url=str(message.author.avatar_url))
logoutput.set_thumbnail(url=str(message.author.avatar_url))
logoutput.add_field(name="Command", value="?status", inline=False)
logoutput.add_field(name="User", value=str(message.author), inline=True)
logoutput.add_field(name="User ID", value=str(message.author.id), inline=True)
logoutput.add_field(name="User Input", value="status", inline=True)
logoutput.add_field(name="Server name", value=str(message.guild), inline=False)
logoutput.add_field(name="Server ID", value=str(message.guild.id), inline=False)
logoutput.add_field(name="Channel Name", value=str(message.channel), inline=False)
logoutput.add_field(name="Channel ID", value=str(message.channel.id), inline=False)
await channel.send(embed=logoutput)
@bot.command()
async def block (message, domain_IP_input_unblock):
#send "please wait message"
please_wait_message = await message.channel.send(embed=please_wait)
#get message id
message_id_block = please_wait_message.id
#get channel id
channel_id_block = message.channel.id
sanitized_word_output_block_ip = re.match("^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$",domain_IP_input_unblock)
sanitized_word_output_block_domain = re.match('([0-9a-z-]{2,}\.[0-9a-z-]{2,3}\.[0-9a-z-]{2,3}|[0-9a-z-]{2,}\.[0-9a-z-]{2,4})$', domain_IP_input_unblock)
if sanitized_word_output_block_domain!=None:
if str(message.author.id) in redis_connect.hget("permissions", "mod") + redis_connect.hget("permissions", "admin"):
if sanitized_word_output_block_domain.group() in redis_connect.hget("blacklist", "domain"):
await message.channel.send("That domain is already blocked :warning:")
else:
redis_connect.hset("blacklist", "domain", redis_connect.hget("blacklist", "domain") + ", " + sanitized_word_output_block_domain.group())
await message.channel.send(sanitized_word_output_block_domain.group() + " has been blocked :white_check_mark:")
else:
await message.channel.send(":red_circle: **You do not have permission!**")
elif sanitized_word_output_block_ip!=None:
if str(message.author.id) in redis_connect.hget("permissions", "mod") + redis_connect.hget("permissions", "admin"):
if sanitized_word_output_block_ip.group() in redis_connect.hget("blacklist", "ip"):
await message.channel.send("That IP is already blocked :warning:")
else:
redis_connect.hset("blacklist", "ip", redis_connect.hget("blacklist", "ip") + ", " + sanitized_word_output_block_ip.group())
await message.channel.send(sanitized_word_output_block_ip.group() + " has been blocked")
else:
await message.channel.send(":red_circle: **You do not have permission!** :warning:")
else:
embed=discord.Embed(title="Please enter a valid domain or IP", color=0xf40101)
embed.set_author(name=redis_connect.hget("embed template", "author"), icon_url=redis_connect.hget("embed template", "icon_url"))
embed.set_thumbnail(url="https://cdn.icon-icons.com/icons2/1380/PNG/512/vcsconflicting_93497.png")
embed.set_footer(text=redis_connect.hget("embed template", "footer"))
await message.channel.send(embed=embed)