• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Unable to access to the aplication

Instructions
2
18
3.8k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    gabi92a
    last edited by Russ Jul 25, 2019, 11:26 PM Jul 25, 2019, 3:01 PM

    No token exists. Login to request one.
    Attempting to log in with token
    (token removed)
    Token login failed.

    Im a software developer, so i know the importance of communicate correctly the bug.

    I did the step 1 and 2, but i dont think that this is the problem. Try it on a different computer is not a option, and i have a good one.

    I'm using the token of here: https://www.triggercmd.com/user/computer/create

    Any ideas?

    Regards.

    1 Reply Last reply Reply Quote 0
    • G
      gabi92a
      last edited by Jul 25, 2019, 6:19 PM

      Is happening the same here: https://www.triggercmd.com/forum/topic/420/agente-de-windows-en-el-sign-in-no-funciona

      R 1 Reply Last reply Jul 25, 2019, 11:26 PM Reply Quote 0
      • R
        Russ @gabi92a
        last edited by Jul 25, 2019, 11:26 PM

        @gabi92a, what country are you in?

        I wonder if there's some sort of firewall or proxy server between your computer and the TRIGGERcmd servers that's preventing the token login.

        It's strange though because I looked at the code and it's a pretty straight forward request:

        function tokenLogin(token,callback) {
          // Configure the request
          headers.Authorization = 'Bearer ' + token;
          options.headers = headers;
          options.url = urlprefix + '/api/command/list';
          options.method = 'GET';
        
          // Start the request
          request(options, function (error, response, body) {
            if (!error && response.statusCode == 200) {
              writeNewTokenToFile(token);
              callback(token);
            } else {
              console.log('Token login failed.');
            }
          })
        }
        

        I tried your token and it worked for me - it created a computer in your account. I deleted it afterward.

        Also, I removed your token from your post so other people can't create computers in your account, or trigger your commands once you get this working.

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • G
          gabi92a
          last edited by Jul 26, 2019, 12:03 PM

          Im in Spain, Barcelona. I added the application to the firewall rules, but is making the connection in port 80 right?

          1 Reply Last reply Reply Quote 0
          • G
            gabi92a
            last edited by Jul 26, 2019, 12:07 PM

            I will try to using a vpn or something like that, and lets see if i have differences with another range of ip

            R 1 Reply Last reply Jul 26, 2019, 11:26 PM Reply Quote 0
            • R
              Russ @gabi92a
              last edited by Jul 26, 2019, 11:26 PM

              @gabi92a, good luck. Do you know if Spain has some sort of country wide firewall? Like China? I doubt it, but I thought I'd ask.

              Also, the agent connects to https://www.triggercmd.com over port 443.

              Russell VanderMey

              1 Reply Last reply Reply Quote 0
              • G
                gabi92a
                last edited by Jul 28, 2019, 5:52 PM

                Is a bug in the application. I used fiddler for see what is happening in the call, and the application is sending nothing.
                I have the ports unlocked, because if not i cant use the https protocol, and my country dont block anything.

                I think that is something about the language of the computer, that is making a error in the application. You are losing money because that.

                Regards.

                R 2 Replies Last reply Jul 29, 2019, 10:26 PM Reply Quote 0
                • R
                  Russ @gabi92a
                  last edited by Russ Jul 29, 2019, 11:47 PM Jul 29, 2019, 10:26 PM

                  @gabi92a, that's a good idea. It could be the Spanish language on the computer. If so I'm sure I can solve that because I should be able to reproduce it by switching my computer to Spanish. Thanks for that idea.

                  EDIT: I tried it - I installed Spanish language on my Windows 10 box and set my region to Spain. Unfortunately it still works for me.
                  Are you using Windows 10?

                  BTW, I appreciate you not giving up. I really want to solve this. Like you said, I'm loosing money.

                  Russell VanderMey

                  1 Reply Last reply Reply Quote 0
                  • R
                    Russ @gabi92a
                    last edited by Russ Jul 31, 2019, 1:25 AM Jul 31, 2019, 1:23 AM

                    @gabi92a, would you be willing to try this? This will run the agent without the GUI. I suspect the bug is in the GUI.

                    1. Install NodeJS
                    2. Open a cmd prompt
                    3. Run this: node %userprofile%\AppData\Local\TRIGGERcmdAgent\app-1.0.21\resources\app\src\agent.js --console

                    Russell VanderMey

                    G 1 Reply Last reply Jul 31, 2019, 10:58 PM Reply Quote 0
                    • G
                      gabi92a @Russ
                      last edited by Jul 31, 2019, 10:58 PM

                      @russ Token login failed using the console 😞

                      R 1 Reply Last reply Aug 4, 2019, 12:19 AM Reply Quote 0
                      • R
                        Russ @gabi92a
                        last edited by Russ Aug 4, 2019, 1:04 AM Aug 4, 2019, 12:19 AM

                        @gabi92a, thank you for testing. That narrows it down. I created a branch with updated dependencies for you to test (if you're willing). I'm hoping this solves the problem.

                        • Create a folder on your 😄 drive
                        • Open a cmd window, and cd to that folder.
                        • Install git if you don't already have it.
                        • Run this:
                          git clone -b spain https://github.com/rvmey/TRIGGERcmd-Agent.git
                        • cd into the TRIGGERcmd-Agent subfolder.
                        • Run this:
                          npm install
                        • Run this:
                          node src\agent.js --console
                        • Paste in your token

                        If that works, then I believe I can produce a new version that will work on spanish Windows computers.

                        Russell VanderMey

                        1 Reply Last reply Reply Quote 0
                        • G
                          gabi92a
                          last edited by Aug 4, 2019, 4:37 PM

                          @russ said in Unable to access to the aplication:

                          node src\agent.js --console

                          Weird error installing: https://gyazo.com/e769546f7621fda85951352a2223a47b

                          Result failed inserting the token: https://gyazo.com/8dfc9f27f419c3a100a7078a7cb843eb

                          Regards.

                          R 1 Reply Last reply Aug 4, 2019, 8:05 PM Reply Quote 0
                          • R
                            Russ @gabi92a
                            last edited by Russ Aug 4, 2019, 8:18 PM Aug 4, 2019, 8:05 PM

                            Thanks @gabi92a, that's helpful, but I should have added some debugging output.

                            I added these lines:

                              console.log("Response from server:");
                              console.log(response);
                              console.log("Error from request:");
                              console.log(error);
                            

                            Please try this updated code with these steps:

                            • Open a cmd window, and cd to that c:\TRIGGERcmd\TRIGGERcmd-Agent folder.
                            • Run this:
                              git pull
                            • Run this:
                              node src\agent.js --console
                            • Paste in your token

                            Also, it looks like you ran node install.js instead of npm install. What does that do?

                            Russell VanderMey

                            G 1 Reply Last reply Aug 5, 2019, 5:11 PM Reply Quote 0
                            • G
                              gabi92a @Russ
                              last edited by Aug 5, 2019, 5:11 PM

                              @russ said in Unable to access to the aplication:

                              node src\agent.js --console

                              Result: https://gyazo.com/afe127ffd8783f80a4f1e11b09bb4da5

                              No, i ran the npm install.

                              Regards.

                              1 Reply Last reply Reply Quote 0
                              • G
                                gabi92a
                                last edited by Aug 5, 2019, 5:15 PM

                                Is an error 400, but im not seeing nothing in fiddler, there is no call???? 😞

                                R 1 Reply Last reply Aug 5, 2019, 10:36 PM Reply Quote 0
                                • R
                                  Russ @gabi92a
                                  last edited by Russ Aug 6, 2019, 12:30 AM Aug 5, 2019, 10:36 PM

                                  @gabi92a, I found out why Fiddler wasn't working. For NodeJS apps like the TRIGGERcmd agent, you have to set these environment variables before you run the node src\agent.js --console command:

                                  set https_proxy=http://127.0.0.1:8888
                                  set http_proxy=http://127.0.0.1:8888
                                  set NODE_TLS_REJECT_UNAUTHORIZED=0
                                  

                                  That tells the NodeJS app to use Fiddler as a proxy server.
                                  I found that here: https://weblogs.asp.net/dixin/use-fiddler-with-node-js

                                  Can you try that? Maybe that will give us a clue.

                                  Also, you could try running it after setting this variable to get a bunch of debug output:

                                  set NODE_DEBUG=*
                                  

                                  One thing you should know - the agent uses a websocket to connect to the server, and that connection doesn't use the https_proxy variable so Fiddler won't pick that up. The request that's giving us this error doesn't use websockets though, so that shouldn't matter for this troubleshooting.

                                  Russell VanderMey

                                  1 Reply Last reply Reply Quote 0
                                  12 out of 18
                                  • First post
                                    12/18
                                    Last post