Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pwntools Demo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pwn-la-Chapelle
Pwntools Demo
Commits
36e3ecdf
Commit
36e3ecdf
authored
Jun 7, 2024
by
Daniel Petri
Browse files
Options
Downloads
Patches
Plain Diff
Add pwn series
parent
3ef16dea
No related branches found
No related tags found
No related merge requests found
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
pwn/pwn3/pwn3
+0
-0
0 additions, 0 deletions
pwn/pwn3/pwn3
pwn/pwn3/pwn3.c
+105
-0
105 additions, 0 deletions
pwn/pwn3/pwn3.c
pwn/pwn3/ynetd
+0
-0
0 additions, 0 deletions
pwn/pwn3/ynetd
with
105 additions
and
0 deletions
pwn/pwn3/pwn3
0 → 100755
+
0
−
0
View file @
36e3ecdf
File added
This diff is collapsed.
Click to expand it.
pwn/pwn3/pwn3.c
0 → 100644
+
105
−
0
View file @
36e3ecdf
#include
<stdio.h>
#include
<stdlib.h>
#include
<unistd.h>
#include
<signal.h>
#include
<string.h>
#ifndef PASSWORD
#define PASSWORD "CSCG{XXXXXXXXXXXXXXXXXXXX}"
#endif
// pwn3: gcc pwn3.c -o pwn3
// --------------------------------------------------- SETUP
void
ignore_me_init_buffering
()
{
setvbuf
(
stdout
,
NULL
,
_IONBF
,
0
);
setvbuf
(
stdin
,
NULL
,
_IONBF
,
0
);
setvbuf
(
stderr
,
NULL
,
_IONBF
,
0
);
}
void
kill_on_timeout
(
int
sig
)
{
if
(
sig
==
SIGALRM
)
{
printf
(
"[!] Anti DoS Signal. Patch me out for testing."
);
_exit
(
0
);
}
}
void
ignore_me_init_signal
()
{
signal
(
SIGALRM
,
kill_on_timeout
);
alarm
(
60
);
}
// just a safe alternative to gets()
size_t
read_input
(
int
fd
,
char
*
buf
,
size_t
size
)
{
size_t
i
;
for
(
i
=
0
;
i
<
size
-
1
;
++
i
)
{
char
c
;
if
(
read
(
fd
,
&
c
,
1
)
<=
0
)
{
_exit
(
0
);
}
if
(
c
==
'\n'
)
{
break
;
}
buf
[
i
]
=
c
;
}
buf
[
i
]
=
'\0'
;
return
i
;
}
// --------------------------------------------------- MENU
void
WINgardium_leviosa
()
{
printf
(
"They has discovered our secret, Nagini.
\n
"
);
printf
(
"It makes us vulnerable.
\n
"
);
printf
(
"We must deploy all our forces now to find them.
\n
"
);
// system("/bin/sh") it's not that easy anymore.
}
void
check_password_stage2
()
{
char
read_buf
[
0xff
];
printf
(
"Enter the password of stage 2:
\n
"
);
memset
(
read_buf
,
0
,
sizeof
(
read_buf
));
read_input
(
0
,
read_buf
,
sizeof
(
read_buf
));
if
(
strcmp
(
read_buf
,
PASSWORD
)
!=
0
)
{
printf
(
"-10 Points for Gryffindor!
\n
"
);
_exit
(
0
);
}
else
{
printf
(
"+10 Points for Gryffindor!"
);
}
}
void
welcome
()
{
char
read_buf
[
0xff
];
printf
(
"Enter your witch name:
\n
"
);
gets
(
read_buf
);
printf
(
"┌───────────────────────┐
\n
"
);
printf
(
"│ You are a Gryffindor! │
\n
"
);
printf
(
"└───────────────────────┘
\n
"
);
printf
(
read_buf
);
}
void
AAAAAAAA
()
{
char
read_buf
[
0xff
];
printf
(
" enter your magic spell:
\n
"
);
gets
(
read_buf
);
if
(
strcmp
(
read_buf
,
"Expelliarmus"
)
==
0
)
{
printf
(
"~ Protego!
\n
"
);
}
else
{
printf
(
"-10 Points for Gryffindor!
\n
"
);
_exit
(
0
);
}
}
// --------------------------------------------------- MAIN
void
main
(
int
argc
,
char
*
argv
[])
{
ignore_me_init_buffering
();
ignore_me_init_signal
();
check_password_stage2
();
welcome
();
AAAAAAAA
();
}
This diff is collapsed.
Click to expand it.
pwn/pwn3/ynetd
0 → 100644
+
0
−
0
View file @
36e3ecdf
File added
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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