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
66bfc810
Commit
66bfc810
authored
May 24, 2019
by
aneesh
Browse files
Options
Downloads
Patches
Plain Diff
final
parent
172cd909
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
crack.c
+48
-2
48 additions, 2 deletions
crack.c
crack.exe
+0
-0
0 additions, 0 deletions
crack.exe
with
48 additions
and
2 deletions
crack.c
+
48
−
2
View file @
66bfc810
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
int
exist
[
30
];
int
exist
[
30
];
BYTE
old
[
6
];
BYTE
old
[
6
];
int
count
=
0
;
int
count
=
0
;
void
make
guess
(
char
*
word_list
,
int
hashes
[][
32
],
int
a
);
void
guess
(
char
*
word_list
,
int
hashes
[][
32
],
int
a
);
//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
void
printRandomString
(
int
hashes
[
30
][
32
])
{
void
printRandomString
(
int
hashes
[
30
][
32
])
{
...
@@ -281,8 +281,54 @@ int main(int argc, char * argv[]) {
...
@@ -281,8 +281,54 @@ int main(int argc, char * argv[]) {
b
++
;
b
++
;
}
}
guess
(
argv
[
2
],
hashes
,
a
);
}
}
return
0
;
return
0
;
}
}
void
guess
(
char
*
word_list
,
int
hashes
[][
32
],
int
a
)
{
BYTE
buffer
[
SHA256_BLOCK_SIZE
];
SHA256_CTX
ctx
;
BYTE
password
[
10
];
bool
cracked
=
true
;
for
(
int
c1
=
32
;
c1
<
127
;
c1
++
)
{
password
[
0
]
=
c1
;
if
(
count
==
10
)
break
;
for
(
int
c2
=
32
;
c2
<
127
;
c2
++
)
{
password
[
1
]
=
c2
;
if
(
count
==
10
)
break
;
for
(
int
c3
=
32
;
c3
<
127
;
c3
++
)
{
password
[
2
]
=
c3
;
if
(
count
==
10
)
break
;
for
(
int
c4
=
32
;
c4
<
127
;
c4
++
)
{
if
(
count
==
10
)
break
;
password
[
3
]
=
c4
;
password
[
4
]
=
'\0'
;
sha256_init
(
&
ctx
);
sha256_update
(
&
ctx
,
password
,
sizeof
(
password
));
sha256_final
(
&
ctx
,
buffer
);
for
(
int
i
=
1
;
i
<
11
;
i
++
)
{
cracked
=
true
;
for
(
int
j
=
0
;
j
<
32
;
j
++
)
{
if
(
buffer
[
j
]
!=
hashes
[
i
][
j
])
{
cracked
=
false
;
break
;
}
}
if
(
cracked
==
true
)
{
count
++
;
ctx
.
data
[
4
]
=
'\0'
;
printf
(
"%s %d
\n
"
,
ctx
.
data
,
i
);
}
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
crack.exe
+
0
−
0
View file @
66bfc810
No preview for this file type
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