Skip to content

Commit 2fe8c05

Browse files
committed
Use correct package path & Refactor readme
1 parent 5579e92 commit 2fe8c05

File tree

5 files changed

+53
-31
lines changed

5 files changed

+53
-31
lines changed

Readme.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,53 @@ For more details, check out the blog post: [Phishing despite FIDO, leveraging th
2828
5. The victim completes the authentication
2929
6. The attacker is authenticated
3030

31-
## Run with Docker
32-
By default, it runs with tenant set to `common` and with the AuthenticationBroker ClientId `29d9ed98-a469-4536-ade2-f981bc1d605e`
31+
A demo video of the flow can be seen [here](#demo)
32+
33+
## Install
34+
Download appropriate binary from [Releases](https://github.com/denniskniep/DeviceCodePhishing/releases)
35+
or install via go using following command:
3336
```shell
34-
docker run -p 8080:8080 ghcr.io/denniskniep/device-code-phishing:v1.0.0
37+
go install github.com/denniskniep/DeviceCodePhishing@v1.0.0
3538
```
3639

40+
## Start the phishing server
41+
42+
By default, it runs with tenant set to `common` and with the AuthenticationBroker ClientId `29d9ed98-a469-4536-ade2-f981bc1d605e`
43+
```shell
44+
DeviceCodePhishing server
45+
```
3746
Use the args if one want to define a specific tenant, a different clientId or a custom userAgent
3847
```shell
39-
docker run -p 8080:8080 ghcr.io/denniskniep/device-code-phishing:v1.0.0 --tenant <tenantId> --client-id <clientId> --user-agent <userAgent> --verbose
48+
DeviceCodePhishing server --tenant <tenantId> --client-id <clientId> --user-agent <userAgent>
49+
```
50+
For further help on syntax or how to use arguments execute:
51+
```shell
52+
DeviceCodePhishing server --help
4053
```
4154

4255
## Use
43-
Open Url:
56+
Open Url:
4457
http://localhost:8080/lure
4558

59+
## Demo
60+
https://gist.github.com/user-attachments/assets/bf6d1c2d-7199-4394-824d-e6f57e8136a2
61+
62+
## Azure Entra ClientIds
63+
64+
| ClientId | Description |
65+
|--------------------------------------|---------------------------------|
66+
| 29d9ed98-a469-4536-ade2-f981bc1d605e | Microsoft Authentication Broker |
67+
| 9ba1a5c7-f17a-4de9-a1f1-6178c8d51223 | Microsoft Intune Company Portal |
68+
69+
Hint: Use Microsoft Intune Company Portal for bypassing Intune compliant device Conditional Access Policy ([More Details](https://i.blackhat.com/EU-24/Presentations/EU-24-Chudo-Unveiling-the-Power-of-Intune-Leveraging-Intune-for-Breaking-Into-Your-Cloud-and-On-Premise.pdf))
70+
71+
## Next steps with obtained tokens
72+
Once you have successfully obtained tokens, you can use them with other attack tools, such as:
73+
* https://github.com/dafthack/GraphRunner
74+
* https://github.com/f-bader/TokenTacticsV2?tab=readme-ov-file#azure-json-web-token-jwt-manipulation-toolset
75+
* https://github.com/secureworks/family-of-client-ids-research
76+
77+
4678
## Build it yourself
4779
```shell
4880
go build main.go
@@ -52,6 +84,11 @@ go build main.go
5284
./main server
5385
```
5486

87+
## Run with Docker
88+
```shell
89+
docker run -p 8080:8080 ghcr.io/denniskniep/device-code-phishing:v1.0.0
90+
```
91+
5592

5693
## Build & Run it yourself with Docker
5794
```shell
@@ -62,20 +99,5 @@ docker build . -t device-code-phishing
6299
docker run -p 8080:8080 device-code-phishing
63100
```
64101

65-
## Entra ClientIds
66-
67-
| ClientId | Description |
68-
|--------------------------------------|---------------------------------|
69-
| 29d9ed98-a469-4536-ade2-f981bc1d605e | Microsoft Authentication Broker |
70-
| 9ba1a5c7-f17a-4de9-a1f1-6178c8d51223 | Microsoft Intune Company Portal |
71-
72-
Hint: Use Microsoft Intune Company Portal for bypassing Intune compliant device Conditional Access Policy ([More Details](https://i.blackhat.com/EU-24/Presentations/EU-24-Chudo-Unveiling-the-Power-of-Intune-Leveraging-Intune-for-Breaking-Into-Your-Cloud-and-On-Premise.pdf))
73-
74-
## Next steps with obtained tokens
75-
Once you have obtained tokens successfully, you can use them with other attack tools like:
76-
* https://github.com/dafthack/GraphRunner
77-
* https://github.com/f-bader/TokenTacticsV2?tab=readme-ov-file#azure-json-web-token-jwt-manipulation-toolset
78-
* https://github.com/secureworks/family-of-client-ids-research
79-
80102
## Disclaimer
81103
Provided as educational content only!

cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package cmd
22

33
import (
44
"fmt"
5+
"github.com/denniskniep/DeviceCodePhishing/pkg/utils"
56
"log/slog"
6-
"main/pkg/utils"
77
"os"
88
"strings"
99

@@ -17,7 +17,7 @@ var (
1717
)
1818

1919
var rootCmd = &cobra.Command{
20-
Use: "devicecodephishing",
20+
Use: "DeviceCodePhishing",
2121
Short: "Phishing access-tokens with the Device Code Flow",
2222
Long: `DeviceCodePhishing is an advanced phishing tool. It can be used for phishing access-tokens with the Device Code Flow.`,
2323
Version: version,

cmd/server.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package cmd
22

33
import (
4+
"github.com/denniskniep/DeviceCodePhishing/pkg/entra"
5+
"github.com/denniskniep/DeviceCodePhishing/pkg/utils"
46
"github.com/spf13/cobra"
57
"log"
68
"log/slog"
7-
"main/pkg/entra"
8-
"main/pkg/utils"
99
"net/http"
1010
"time"
1111
)
@@ -23,16 +23,16 @@ var (
2323

2424
func init() {
2525
rootCmd.AddCommand(runCmd)
26-
runCmd.Flags().StringVarP(&address, "address", "a", ":8080", "Provide the listening address (Default ':8080').")
27-
runCmd.Flags().StringVarP(&userAgent, "user-agent", "u", EdgeOnWindows, "User-Agent string sent in HTTP requests (Default Edge on Windows).")
28-
runCmd.Flags().StringVarP(&clientId, "client-id", "c", MsAuthenticationBroker, "ClientId to request token for. (Default Microsoft Authentication Broker)")
29-
runCmd.Flags().StringVarP(&tenant, "tenant", "t", DefaultTenant, "Tenant to request token for. (Default 'common')")
26+
runCmd.Flags().StringVarP(&address, "address", "a", ":8080", "Provide the servers listening address")
27+
runCmd.Flags().StringVarP(&userAgent, "user-agent", "u", EdgeOnWindows, "User-Agent used by HeadlessBrowser & API calls")
28+
runCmd.Flags().StringVarP(&clientId, "client-id", "c", MsAuthenticationBroker, "ClientId for requesting token")
29+
runCmd.Flags().StringVarP(&tenant, "tenant", "t", DefaultTenant, "Tenant for requesting token")
3030
}
3131

3232
var runCmd = &cobra.Command{
3333
Use: "server",
3434
Short: "Starts the phishing server",
35-
Long: "Starts the phishing server by default on http://localhost:8080/lure",
35+
Long: "Starts the phishing server. Listens by default on http://localhost:8080/lure",
3636
Run: func(cmd *cobra.Command, args []string) {
3737
// Set up a resource handler
3838
http.HandleFunc("/lure", lureHandler)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module main
1+
module github.com/denniskniep/DeviceCodePhishing
22

33
go 1.23.4
44

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"main/cmd"
4+
"github.com/denniskniep/DeviceCodePhishing/cmd"
55
)
66

77
func main() {

0 commit comments

Comments
 (0)