Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
achattaraj_comp30023_2019_project-2
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aneesh Chattaraj
achattaraj_comp30023_2019_project-2
Commits
f429dbd6
Commit
f429dbd6
authored
May 25, 2019
by
aneesh
Browse files
Options
Downloads
Patches
Plain Diff
yo
parent
51888b13
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
crack.c
+31
-2
31 additions, 2 deletions
crack.c
with
31 additions
and
2 deletions
crack.c
+
31
−
2
View file @
f429dbd6
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
int
exist
[
30
];
int
exist
[
30
];
BYTE
old
[
6
];
BYTE
old
[
6
];
int
count
=
0
;
int
count
=
0
;
int
exist3
[
10000
];
//function to generate lower character strings of length 6 for random brute force: Got 8 passwords
//function to generate lower character strings of length 6 for random brute force: Got 8 passwords
...
@@ -265,13 +266,13 @@ int main(int argc, char * argv[]) {
...
@@ -265,13 +266,13 @@ int main(int argc, char * argv[]) {
int
i
,
a
=
0
,
b
=
0
;
int
i
,
a
=
0
,
b
=
0
;
fseek
(
password_file
,
0L
,
SEEK_END
);
fseek
(
password_file
,
0L
,
SEEK_END
);
int
sz
=
ftell
(
password_file
);
int
sz
=
ftell
(
password_file
);
rewind
(
password_file
);
rewind
(
password_file
);
int
hashes
[
sz
/
32
][
32
];
int
hashes
[
sz
/
32
][
32
];
unsigned
char
buff
[
sz
];
unsigned
char
buff
[
sz
];
fread
(
buff
,
sizeof
(
buff
),
1
,
password_file
);
fread
(
buff
,
sizeof
(
buff
),
1
,
password_file
);
for
(
i
=
0
;
i
<
sz
;
i
++
)
{
for
(
i
=
0
;
i
<
sz
;
i
++
)
{
if
(
i
%
32
==
0
)
{
if
(
i
%
32
==
0
&&
i
>
0
)
{
a
++
;
a
++
;
b
=
0
;
b
=
0
;
...
@@ -281,6 +282,34 @@ int main(int argc, char * argv[]) {
...
@@ -281,6 +282,34 @@ int main(int argc, char * argv[]) {
b
++
;
b
++
;
}
}
bool
cracked
=
true
;
FILE
*
word_list
;
SHA256_CTX
ctx
;
BYTE
buffer
[
SHA256_BLOCK_SIZE
];
word_list
=
fopen
(
argv
[
2
],
"rb"
);
while
(
fscanf
(
word_list
,
"%s"
,
word
)
!=
EOF
){
sha256_init
(
&
ctx
);
sha256_update
(
&
ctx
,
word
,
strlen
(
word
));
sha256_final
(
&
ctx
,
buffer
);
for
(
int
i
=
0
;
i
<
sz
/
32
;
i
++
)
{
cracked
=
true
;
for
(
int
j
=
0
;
j
<
32
;
j
++
)
{
if
(
buffer
[
j
]
!=
hashes
[
i
][
j
])
{
cracked
=
false
;
break
;
}
}
if
(
cracked
==
true
&&
exist3
[
i
+
1
]
!=
1
)
{
count
++
;
ctx
.
data
[
strlen
(
word
)]
=
'\0'
;
exist3
[
i
+
1
]
=
1
;
printf
(
"%s %d
\n
"
,
ctx
.
data
,
i
+
1
);
}
}
}
}
}
return
0
;
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