File tree Expand file tree Collapse file tree 2 files changed +23
-11
lines changed Expand file tree Collapse file tree 2 files changed +23
-11
lines changed Original file line number Diff line number Diff line change 1
1
CC = gcc
2
- RM = rm -f
3
- CP = cp
4
2
5
- CFLAGS += -I/usr/local/opt/openssl/include -O3
3
+ OPENSSL = /usr/include/openssl
4
+
5
+ CFLAGS += -I $(OPENSSL ) -O3
6
6
LDFLAGS += -lssl -lcrypto
7
7
8
8
NAME = jwtcrack
9
- SRCS = main.c \
10
- base64.c
9
+ SRCS = main.c base64.c
11
10
OBJS = $(SRCS:.c=.o )
12
11
13
12
all : $(NAME )
13
+ @echo $(OPENSSL )
14
14
15
15
$(NAME ) : $(OBJS )
16
16
$(CC ) -o $(NAME ) $(OBJS ) $(LDFLAGS )
17
17
18
18
clean :
19
- $( RM ) $(OBJS )
19
+ rm $(OBJS )
20
20
21
21
fclean : clean
22
- $( RM ) $(NAME )
22
+ rm $(NAME )
23
23
24
24
re : fclean all
Original file line number Diff line number Diff line change @@ -7,17 +7,29 @@ I used the [Apple Base64 implementation](https://opensource.apple.com/source/Qui
7
7
## Compile
8
8
9
9
Make sure you have openssl's headers installed.
10
+ On Ubuntu youcan install them with ` apt-get install libssl-dev `
10
11
11
12
```
12
13
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
14
27
```
15
28
16
29
In the above example, the key is ` Sn1f ` . It takes approximately 23 seconds to crack on my Macbook.
17
30
18
31
## Caveats
19
32
20
33
* 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
You can’t perform that action at this time.
0 commit comments