-
Notifications
You must be signed in to change notification settings - Fork 1
/
removeteam.php
executable file
·64 lines (60 loc) · 2.3 KB
/
removeteam.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
<?php
function check($str)
{
if (!strstr($str,'!')&&!strstr($str,'@')&&!strstr($str,'#')&&!strstr($str,'$')&&!strstr($str,'%')&&!strstr($str,'^')&&!strstr($str,'&')&&!strstr($str,'*')&&!strstr($str,'(')&&!strstr($str,')')&&!strstr($str,'-')&&!strstr($str,'_')&&!strstr($str,'=')&&!strstr($str,'+')&&!strstr($str,'[')&&!strstr($str,']')&&!strstr($str,'"')&&!strstr($str,'\'')&&!strstr($str,';')&&!strstr($str,'<')&&!strstr($str,'>')&&!strstr($str,'?')&&!strstr($str,'`')&&!strstr($str,'~')&&!strstr($str,'\\')&&!strstr($str,'/')&&!strstr($str,'|')) {
return TRUE;
}
else{
return FALSE;
}
}
$user = "ezbabyctf";
$passwd = "ezbabyctf";
$db = "ezbabyctf";
$tb = "teams";
$conn = new mysqli("localhost",$user,$passwd,$db);
if($conn->connect_error){
die("Connection faild.".$conn->connect_error);
}
else{
if(isset($_GET["tname"])&&isset($_GET["id"])){
$tname = $_GET["tname"];
$captain = $_GET["id"];
mysqli_query($conn,"SET NAMES UTF8");
$s1 = "select * from ".$tb." where tname=\"".$tname."\" and captain=\"".$captain."\" active=\"1\"";
$conn->query($s1);
if(mysqli_affected_rows($conn)!=0){
$s2 = "delete from teams where tname=\"".$tname."\"";
$conn->query($s2);
if(mysqli_affected_rows($conn)!=-1){
$score = 0;
$s3="delete from scoreboard where tname=\"".$tname."\"";
$conn->query($s3);
if(mysqli_affected_rows($conn)!=-1){
$s4="update users set team=\"__NONE__\" where team=\"".$tname."\"";
$conn->query($s4);
if(mysqli_affected_rows($conn)!=-1){
exit("done");
}
else{
die("Tamper with the package is invalid!");
}
}
else{
die("Tamper with the package is invalid!");
}
}
else{
die("Tamper with the package is invalid!");
}
}
else{
die("Invalid call.");
}
}
else{
die("Invalid call.");
}
}
//http://192.168.64.129/removeteam.php?tname=1&name=1
?>