-
Notifications
You must be signed in to change notification settings - Fork 328
/
emagnet
executable file
·126 lines (101 loc) · 3.49 KB
/
emagnet
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
#!/bin/bash
####
#### Copyright (C) 2018 wuseman <wuseman@nr1.nu> - All Rights Reserved
#### Ascii made by TISSUE.
#### Created: 12/12/2018
#### Usage: ./emagnet -option
####
#########################################
############# SOURCE CODE ###############
#########################################
##### EMAGNET WAS FOUNDED BY WUSEMAN ####
#########################################
################ 2o18 ###################
#########################################
#### ####
#### EMAGNET SOURCE CODE BEGINS HERE ####
#### FEEL FREE TO USE AND PLAY WITH ####
#### EMAGNET AS YOU WISH ASLONG AS ####
#### ORIGIN AUTHOR WILL BE MENTIONED ####
#### ####
#########################################
#########################################
set -e
if [[ $EUID -gt "0" ]]; then printf "Root privileges is required for this tool.\n"; exit 0;fi
if [[ ! -f /etc/emagnet.conf ]]; then printf "Error: /etc/emagnet.conf is required, run emagnet-setup.sh for generate emagnet.conf\n"; exit 0;fi
source .scripts/emagnet-banner.sh
source /etc/emagnet.conf
if [[ ! -d $EMAGNETHOME ]]; then mkdir -p $EMAGNETHOME &> /dev/null; fi
if [[ ! -d $EMAGNETDB ]]; then mkdir -p $EMAGNETDB &> /dev/null; fi
if [[ ! -d $EMAGNETTEMP ]]; then mkdir -p $EMAGNETTEMP &> /dev/null;fi
if [[ ! -d $EMAGNETCRAP ]]; then mkdir -p $EMAGNETCRAP &> /dev/null;fi
if [[ ! -d $EMAGNETALL ]]; then mkdir -p $EMAGNETALL &> /dev/null;fi
if [[ ! -d $EMAGNETCLONE ]]; then mkdir -p $EMAGNETCLONE &> /dev/null;fi
if [[ ! -d $EMAGNETMIRROR ]]; then mkdir -p $EMAGNETMIRROR &> /dev/null;fi
if [[ ! -d $EMAGNETSPIDER ]]; then mkdir -p $EMAGNETSPIDER &> /dev/null;fi
if [[ ! -d $EMAGNETLOGS ]]; then mkdir -p $EMAGNETLOGS &> /dev/null; fi
if [[ -z $MYIP ]]; then
echo -e "Add your IP to settings to be safe since we do not want to use our own ip..\n"
echo "\[$(date +%d/%m/%Y\ -\ %H:%M)\]: $(whoami) - Aborted for safety, don't use your own IP!!" >> $LOGS2/emagnet.log
exit
fi
if [[ "$(curl -s https://nr1.nu/ip/ | sed -n '27p')" = "$MYIP" ]]; then
echo "Use TOR or a VPN for your own safety. Aborted."; echo ""
exit 1
fi
source .scripts/emagnet-requirements.sh
checkwget
checklynx
checkcurl
help() {
banner;
source .scripts/emagnet-help.sh;
help
}
countdown() {
wait_time=$TIME
temp_cnt=${wait_time}
while [[ ${temp_cnt} -gt 0 ]]; do
printf "\r I'll will find you <-%2d -> It's a matter of time" ${temp_cnt}
sleep 1
((temp_cnt--))
done;
echo ""
}
emagnet() {
source .scripts/emagnet-main.sh;emagnet
}
spider() {
source .scripts/emagnet-spider.sh;spider
}
mirrorwww() {
source .scripts/emagnet-mirror.sh;mirrorwww
}
stopwhenfound() {
for (( ; ; )); do
clear;banner;countdown;clear;banner
echo " Gathering Data.";
sleep 1
echo " Please Wait"
clear;banner;emagnet;sleep 2;done;emagnet
}
clonegit() {
source .scripts/emagnet-clone.sh; clonegit
}
if [[ -z $1 ]]; then help; exit 0; fi
while getopts ":bcfmnehHpsvu" getopt; do
case $getopt in
b) bash $(pwd)/.scripts/emagnet-backup.sh ;;
c) clonegit ;;
e) stopwhenfound ;;
f) bash /var/git/emagnet/.scripts/emagnet-f.sh ;;
n) checknetcat; nc nr1.nu 81 ;;
H) bash /var/git/emagnet/.scripts/emagnet-h.sh & ;;
m) mirrorwww ;;
h) help ;;
u) bash $(dirname -- "$0")/.scripts/emagnet-upordown.sh ;;
s) spider ;;
v) banner; printf " Emagnet Version: $VERSION\n\n" ;;
\?) echo "No such option, try ./emagnet -h" ;;
esac
done