Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Леонид Мелентьев
user input project
Commits
8c09e9a6
Commit
8c09e9a6
authored
3 years ago
by
Леонид Мелентьев
Browse files
Options
Download
Patches
Plain Diff
v1.1 есть всё точно
parent
ca719b04
master
No related merge requests found
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
curl2.sh
+1
-1
curl2.sh
curl3.sh
+1
-1
curl3.sh
curl4.sh
+1
-1
curl4.sh
curl5.sh
+1
-1
curl5.sh
curl6.sh
+1
-1
curl6.sh
curl7.sh
+1
-1
curl7.sh
curl8.sh
+1
-1
curl8.sh
user_input.php
+12
-12
user_input.php
Отчёт по заданию 1.1.docx
+0
-0
Отчёт по заданию 1.1.docx
with
19 additions
and
19 deletions
+19
-19
curl2.sh
+
1
−
1
View file @
8c09e9a6
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
curl3.sh
+
1
−
1
View file @
8c09e9a6
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
curl4.sh
+
1
−
1
View file @
8c09e9a6
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
curl
-v
--request
GET
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
curl5.sh
+
1
−
1
View file @
8c09e9a6
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
curl6.sh
+
1
−
1
View file @
8c09e9a6
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=<script>alert('hack!')</script>"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
curl7.sh
+
1
−
1
View file @
8c09e9a6
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: x-form"
--header
"X-Access-Token: SECRET_TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
curl8.sh
+
1
−
1
View file @
8c09e9a6
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
--cookie
test
=
hello
--data
pagepost
=
1
--data
pagejost
=
2
curl
-v
--request
POST
--url
"http://localhost:8005/user_input.php?page=page1"
--header
"Content-Type: application/x-www-form-urlencoded"
--header
"X-Access-Token: SECRET_TOKEN"
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
user_input.php
+
12
−
12
View file @
8c09e9a6
...
@@ -16,6 +16,17 @@ if ($_SERVER['REQUEST_METHOD'] != 'POST') {
...
@@ -16,6 +16,17 @@ if ($_SERVER['REQUEST_METHOD'] != 'POST') {
die
();
die
();
}
}
if
(
array_key_exists
(
'CONTENT_TYPE'
,
$_SERVER
))
{
if
(
$_SERVER
[
'CONTENT_TYPE'
]
!=
'application/x-www-form-urlencoded'
)
{
echo
'Ошибка, неверный тип данных<br>'
.
PHP_EOL
;
die
();
}
}
else
{
echo
'Ошибка, неверный тип данных<br>'
.
PHP_EOL
;
die
();
}
$page
=
null
;
$page
=
null
;
if
(
array_key_exists
(
'page'
,
$_GET
))
{
if
(
array_key_exists
(
'page'
,
$_GET
))
{
$page
=
$_GET
[
'page'
];
$page
=
$_GET
[
'page'
];
...
@@ -33,24 +44,13 @@ else {
...
@@ -33,24 +44,13 @@ else {
die
();
die
();
}
}
if
(
array_key_exists
(
'CONTENT_TYPE'
,
$_SERVER
))
{
if
(
$_SERVER
[
'CONTENT_TYPE'
]
!=
'application/x-www-form-urlencoded'
)
{
echo
'Ошибка, неверный тип данных<br>'
.
PHP_EOL
;
die
();
}
}
else
{
echo
'Ошибка, неверный тип данных<br>'
.
PHP_EOL
;
die
();
}
$pwalue
=
null
;
$pwalue
=
null
;
if
(
empty
(
$_POST
))
{
if
(
empty
(
$_POST
))
{
echo
'Ошибка, данные не заданы<br>'
.
PHP_EOL
;
echo
'Ошибка, данные не заданы<br>'
.
PHP_EOL
;
die
();
die
();
}
}
else
{
else
{
echo
'Через POST передано '
.
count
(
$_POST
)
.
'переменных<br>'
.
PHP_EOL
;
echo
'Через POST передано '
.
count
(
$_POST
)
.
'
переменных<br>'
.
PHP_EOL
;
while
(
$pwalue
=
current
(
$_POST
))
{
while
(
$pwalue
=
current
(
$_POST
))
{
echo
htmlentities
(
'Значение ['
.
key
(
$_POST
)
.
'] : '
.
$pwalue
);
echo
htmlentities
(
'Значение ['
.
key
(
$_POST
)
.
'] : '
.
$pwalue
);
echo
'<br>'
.
PHP_EOL
;
echo
'<br>'
.
PHP_EOL
;
...
...
This diff is collapsed.
Click to expand it.
Отчёт по заданию 1.1.docx
0 → 100644
+
0
−
0
View file @
8c09e9a6
File added
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets