Skip to content

Commit 8bb5597

Browse files
committed
Update makefile and readme
1 parent f99bae7 commit 8bb5597

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
CC = gcc
2-
RM = rm -f
3-
CP = cp
42

5-
CFLAGS += -I/usr/local/opt/openssl/include -O3
3+
OPENSSL = /usr/include/openssl
4+
5+
CFLAGS += -I $(OPENSSL) -O3
66
LDFLAGS += -lssl -lcrypto
77

88
NAME = jwtcrack
9-
SRCS = main.c \
10-
base64.c
9+
SRCS = main.c base64.c
1110
OBJS = $(SRCS:.c=.o)
1211

1312
all: $(NAME)
13+
@echo $(OPENSSL)
1414

1515
$(NAME): $(OBJS)
1616
$(CC) -o $(NAME) $(OBJS) $(LDFLAGS)
1717

1818
clean:
19-
$(RM) $(OBJS)
19+
rm $(OBJS)
2020

2121
fclean: clean
22-
$(RM) $(NAME)
22+
rm $(NAME)
2323

2424
re: fclean all

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,29 @@ I used the [Apple Base64 implementation](https://opensource.apple.com/source/Qui
77
## Compile
88

99
Make sure you have openssl's headers installed.
10+
On Ubuntu youcan install them with `apt-get install libssl-dev`
1011

1112
```
1213
make
13-
./jwtcrack eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.cAOIAifu3fykvhkHpbuhbvtH807-Z2rI1FS3vX1XMjE
14+
```
15+
16+
If you use a Mac, you can install OpenSSL with `brew install openssl`, but the headers will be stored in a
17+
different location:
18+
19+
```
20+
make OPENSSL=/usr/local/opt/openssl/include
21+
```
22+
23+
## Run
24+
25+
```
26+
$ > ./jwtcrack eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.cAOIAifu3fykvhkHpbuhbvtH807-Z2rI1FS3vX1XMjE
1427
```
1528

1629
In the above example, the key is `Sn1f`. It takes approximately 23 seconds to crack on my Macbook.
1730

1831
## Caveats
1932

2033
* Not multi-threaded :((
21-
* Letters permutation generator could be a bit faster :|
22-
* No progress status :(
23-
* If you stop the program, you cannot start back where you were :((
34+
* No progress status
35+
* If you stop the program, you cannot start back where you were

0 commit comments

Comments
 (0)