What Do These Commands Do (Part - II)?

Discussion in 'macOS' started by EDLIU, Jul 31, 2016.

  1. EDLIU, Jul 31, 2016
    Last edited by a moderator: Jul 31, 2016

    EDLIU macrumors member

    Joined:
    Oct 20, 2015
    #1
    Hi,

    I found these commands on my Mac. Do not know what they do either.

    Thanks.

    Code:
       1  sudo nano /private/etc/hosts
    
        2  exit
    
        3  sudo nano /private/etc/hosts
    
        4  exit
    
        5  sudo whoami
    
        6  sudo networksetup -setwebproxy 'Bluetooth DUN' 127.0.0.1 21218
    
        7  sudo networksetup -setsecurewebproxy 'Bluetooth DUN' 127.0.0.1 21218
    
        8  sudo networksetup -setproxyautodiscovery 'Bluetooth DUN' off
    
        9  sudo networksetup -setautoproxystate 'Bluetooth DUN' off
    
      10  sudo networksetup -setwebproxy 'Ethernet' 127.0.0.1 21218
    
      11  sudo networksetup -setsecurewebproxy 'Ethernet' 127.0.0.1 21218
    
      12  sudo networksetup -setproxyautodiscovery 'Ethernet' off
    
      13  sudo networksetup -setautoproxystate 'Ethernet' off
    
      14  sudo networksetup -setwebproxy 'FireWire' 127.0.0.1 21218
    
      15  sudo networksetup -setsecurewebproxy 'FireWire' 127.0.0.1 21218
    
      16  sudo networksetup -setproxyautodiscovery 'FireWire' off
    
      17  sudo networksetup -setautoproxystate 'FireWire' off
    
      18  sudo networksetup -setwebproxy 'Wi-Fi' 127.0.0.1 21218
    
      19  sudo networksetup -setsecurewebproxy 'Wi-Fi' 127.0.0.1 21218
    
      20  sudo networksetup -setproxyautodiscovery 'Wi-Fi' off
    
      21  sudo networksetup -setautoproxystate 'Wi-Fi' off
    
      22  sudo networksetup -setwebproxy 'Bluetooth PAN' 127.0.0.1 21218
    
      23  sudo networksetup -setsecurewebproxy 'Bluetooth PAN' 127.0.0.1 21218
    
      24  sudo networksetup -setproxyautodiscovery 'Bluetooth PAN' off
    
      25  sudo networksetup -setautoproxystate 'Bluetooth PAN' off
    
      26  exit
    
      27  sudo whoami
    
      28  sudo networksetup -setwebproxy 'Bluetooth DUN' 127.0.0.1 21218
    
      29  sudo networksetup -setsecurewebproxy 'Bluetooth DUN' 127.0.0.1 21218
    
      30  sudo networksetup -setproxyautodiscovery 'Bluetooth DUN' off
    
      31  sudo networksetup -setautoproxystate 'Bluetooth DUN' off
    
      32  sudo networksetup -setwebproxy 'Ethernet' 127.0.0.1 21218
    
      33  sudo networksetup -setsecurewebproxy 'Ethernet' 127.0.0.1 21218
    
      34  sudo networksetup -setproxyautodiscovery 'Ethernet' off
    
      35  sudo networksetup -setautoproxystate 'Ethernet' off
    
      36  sudo networksetup -setwebproxy 'FireWire' 127.0.0.1 21218
    
      37  sudo networksetup -setsecurewebproxy 'FireWire' 127.0.0.1 21218
    
      38  sudo networksetup -setproxyautodiscovery 'FireWire' off
    
      39  sudo networksetup -setautoproxystate 'FireWire' off
    
      40  sudo networksetup -setwebproxy 'Wi-Fi' 127.0.0.1 21218
    
      41  sudo networksetup -setsecurewebproxy 'Wi-Fi' 127.0.0.1 21218
    
      42  sudo networksetup -setproxyautodiscovery 'Wi-Fi' off
    
      43  sudo networksetup -setautoproxystate 'Wi-Fi' off
    
      44  sudo networksetup -setwebproxy 'Bluetooth PAN' 127.0.0.1 21218
    
      45  sudo networksetup -setsecurewebproxy 'Bluetooth PAN' 127.0.0.1 21218
    
      46  sudo networksetup -setproxyautodiscovery 'Bluetooth PAN' off
    
      47  sudo networksetup -setautoproxystate 'Bluetooth PAN' off
    
      48  exit
    
      49  sudo whoami
    
      50  sudo networksetup -setwebproxy 'Bluetooth DUN' 127.0.0.1 21218
    
      51  sudo networksetup -setsecurewebproxy 'Bluetooth DUN' 127.0.0.1 21218
    
      52  sudo networksetup -setproxyautodiscovery 'Bluetooth DUN' off
    
      53  sudo networksetup -setautoproxystate 'Bluetooth DUN' off
    
      54  sudo networksetup -setwebproxy 'Ethernet' 127.0.0.1 21218
    
      55  sudo networksetup -setsecurewebproxy 'Ethernet' 127.0.0.1 21218
    
      56  sudo networksetup -setproxyautodiscovery 'Ethernet' off
    
      57  sudo networksetup -setautoproxystate 'Ethernet' off
    
      58  sudo networksetup -setwebproxy 'FireWire' 127.0.0.1 21218
    
      59  sudo networksetup -setsecurewebproxy 'FireWire' 127.0.0.1 21218
    
      60  sudo networksetup -setproxyautodiscovery 'FireWire' off
    
      61  sudo networksetup -setautoproxystate 'FireWire' off
    
      62  sudo networksetup -setwebproxy 'Wi-Fi' 127.0.0.1 21218
    
      63  sudo networksetup -setsecurewebproxy 'Wi-Fi' 127.0.0.1 21218
    
      64  sudo networksetup -setproxyautodiscovery 'Wi-Fi' off
    
      65  sudo networksetup -setautoproxystate 'Wi-Fi' off
    
      66  sudo networksetup -setwebproxy 'Bluetooth PAN' 127.0.0.1 21218
    
      67  sudo networksetup -setsecurewebproxy 'Bluetooth PAN' 127.0.0.1 21218
    
      68  sudo networksetup -setproxyautodiscovery 'Bluetooth PAN' off
    
      69  sudo networksetup -setautoproxystate 'Bluetooth PAN' off
    
      70  exit
    
      71  sudo whoami
    
      72  sudo networksetup -setsecurewebproxystate 'Bluetooth DUN' off
    
      73  sudo networksetup -setwebproxystate 'Bluetooth DUN' off
    
      74  sudo networksetup -setsecurewebproxystate 'Ethernet' off
    
      75  sudo networksetup -setwebproxystate 'Ethernet' off
    
      76  sudo networksetup -setsecurewebproxystate 'FireWire' off
    
      77  sudo networksetup -setwebproxystate 'FireWire' off
    
      78  sudo networksetup -setsecurewebproxystate 'Wi-Fi' off
    
      79  sudo networksetup -setwebproxystate 'Wi-Fi' off
    
      80  sudo networksetup -setsecurewebproxystate 'Bluetooth PAN' off
    
      81  sudo networksetup -setwebproxystate 'Bluetooth PAN' off
    
      82  exit
    
      83  sudo whoami
    
      84  sudo networksetup -setwebproxy 'Bluetooth DUN' 127.0.0.1 21218
    
      85  sudo networksetup -setsecurewebproxy 'Bluetooth DUN' 127.0.0.1 21218
    
      86  sudo networksetup -setproxyautodiscovery 'Bluetooth DUN' off
    
      87  sudo networksetup -setautoproxystate 'Bluetooth DUN' off
    
      88  sudo networksetup -setwebproxy 'Ethernet' 127.0.0.1 21218
    
      89  sudo networksetup -setsecurewebproxy 'Ethernet' 127.0.0.1 21218
    
      90  sudo networksetup -setproxyautodiscovery 'Ethernet' off
    
      91  sudo networksetup -setautoproxystate 'Ethernet' off
    
      92  sudo networksetup -setwebproxy 'FireWire' 127.0.0.1 21218
    
      93  sudo networksetup -setsecurewebproxy 'FireWire' 127.0.0.1 21218
    
      94  sudo networksetup -setproxyautodiscovery 'FireWire' off
    
      95  sudo networksetup -setautoproxystate 'FireWire' off
    
      96  sudo networksetup -setwebproxy 'Wi-Fi' 127.0.0.1 21218
    
      97  sudo networksetup -setsecurewebproxy 'Wi-Fi' 127.0.0.1 21218
    
      98  sudo networksetup -setproxyautodiscovery 'Wi-Fi' off
    
      99  sudo networksetup -setautoproxystate 'Wi-Fi' off
    
      100  sudo networksetup -setwebproxy 'Bluetooth PAN' 127.0.0.1 21218
    
      101  sudo networksetup -setsecurewebproxy 'Bluetooth PAN' 127.0.0.1 21218
    
      102  sudo networksetup -setproxyautodiscovery 'Bluetooth PAN' off
    
      103  sudo networksetup -setautoproxystate 'Bluetooth PAN' off
    
      104  exit
    
      105  sudo whoami
    
      106  sudo networksetup -setsecurewebproxystate 'Bluetooth DUN' off
    
      107  sudo networksetup -setwebproxystate 'Bluetooth DUN' off
    
      108  sudo networksetup -setsecurewebproxystate 'Ethernet' off
    
      109  sudo networksetup -setwebproxystate 'Ethernet' off
    
      110  sudo networksetup -setsecurewebproxystate 'FireWire' off
    
      111  sudo networksetup -setwebproxystate 'FireWire' off
    
      112  sudo networksetup -setsecurewebproxystate 'Wi-Fi' off
    
      113  sudo networksetup -setwebproxystate 'Wi-Fi' off
    
      114  sudo networksetup -setsecurewebproxystate 'Bluetooth PAN' off
    
      115  sudo networksetup -setwebproxystate 'Bluetooth PAN' off
    
      116  exit
    
      117  sudo whoami
    
      118  sudo networksetup -setwebproxy 'Bluetooth DUN' 127.0.0.1 21218
    
      119  sudo networksetup -setsecurewebproxy 'Bluetooth DUN' 127.0.0.1 21218
    
      120  sudo networksetup -setproxyautodiscovery 'Bluetooth DUN' off
    
      121  sudo networksetup -setautoproxystate 'Bluetooth DUN' off
    
      122  sudo networksetup -setwebproxy 'Ethernet' 127.0.0.1 21218
    
      123  sudo networksetup -setsecurewebproxy 'Ethernet' 127.0.0.1 21218
    
      124  sudo networksetup -setproxyautodiscovery 'Ethernet' off
    
      125  sudo networksetup -setautoproxystate 'Ethernet' off
    
      126  sudo networksetup -setwebproxy 'FireWire' 127.0.0.1 21218
    
      127  sudo networksetup -setsecurewebproxy 'FireWire' 127.0.0.1 21218
    
      128  sudo networksetup -setproxyautodiscovery 'FireWire' off
    
      129  sudo networksetup -setautoproxystate 'FireWire' off
    
      130  sudo networksetup -setwebproxy 'Wi-Fi' 127.0.0.1 21218
    
      131  sudo networksetup -setsecurewebproxy 'Wi-Fi' 127.0.0.1 21218
    
      132  sudo networksetup -setproxyautodiscovery 'Wi-Fi' off
    
      133  sudo networksetup -setautoproxystate 'Wi-Fi' off
    
      134  sudo networksetup -setwebproxy 'Bluetooth PAN' 127.0.0.1 21218
    
      135  sudo networksetup -setsecurewebproxy 'Bluetooth PAN' 127.0.0.1 21218
    
      136  sudo networksetup -setproxyautodiscovery 'Bluetooth PAN' off
    
      137  sudo networksetup -setautoproxystate 'Bluetooth PAN' off
    
      138  exit
    
      139  sudo whoami
    
      140  sudo networksetup -setsecurewebproxystate 'Bluetooth DUN' off
    
      141  sudo networksetup -setwebproxystate 'Bluetooth DUN' off
    
      142  sudo networksetup -setsecurewebproxystate 'Ethernet' off
    
      143  sudo networksetup -setwebproxystate 'Ethernet' off
    
      144  sudo networksetup -setsecurewebproxystate 'FireWire' off
    
      145  sudo networksetup -setwebproxystate 'FireWire' off
    
      146  sudo networksetup -setsecurewebproxystate 'Wi-Fi' off
    
      147  sudo networksetup -setwebproxystate 'Wi-Fi' off
    
      148  sudo networksetup -setsecurewebproxystate 'Bluetooth PAN' off
    
      149  sudo networksetup -setwebproxystate 'Bluetooth PAN' off
     
  2. Jessica Lares macrumors G3

    Jessica Lares

    Joined:
    Oct 31, 2009
    Location:
    Near Dallas, Texas, USA
    #2
    sudo - Indicating that it needs to do the command as administrator
    nano - One of the many command line text editors (in the example, it just opens it to your hosts file)
    whoami - Indicates the login name of the user currently logged in
    networksetup - Your network settings
     
  3. EDLIU thread starter macrumors member

    Joined:
    Oct 20, 2015
    #3
    Hi,

    So what did these commands do?

    I did not enter these commands.

    Is my Mac hacked?

    Thanks.

    Ed
     
  4. JohnDS macrumors 65816

    Joined:
    Oct 25, 2015
    #4
    Where did you find these commands?
    --- Post Merged, Jul 31, 2016 ---
    Please answer the question above as to where you found the commands. Does anyone else have access to your computer?

    I would also suggest that you download and run the freeware MalwareBytes for Mac:

    https://www.malwarebytes.com/antimalware/mac/

    Then download the free EtreCheck: https://etrecheck.com/#download

    Run EtreCheck and post the result back here.
     
  5. Jessica Lares, Jul 31, 2016
    Last edited: Jul 31, 2016

    Jessica Lares macrumors G3

    Jessica Lares

    Joined:
    Oct 31, 2009
    Location:
    Near Dallas, Texas, USA
    #5
    sudo nano /private/etc/hosts opened your hosts file and then exited. You can't tell if something was written into it by just those lines.

    In the lines after that, it set the proxy to the localhost and then turned all the options off, meaning it's not using it. If you need to check (I don't see anything going wrong in the ones you listed though), you can go to System Preferences > Network, click on Wi-Fi, Ethernet, etc, and then Advanced. Then Proxies.

    These are the settings those commands refer to:

    Screen Shot 2016-07-31 at 2.28.16 PM.png

    Yeah, it would be useful to know where you're getting these.
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    One can also use 'networksetup' to read the current settings. Example:
    Code:
    networksetup -getsecurewebproxy 'Ethernet'
    The man page for 'networksetup' has a gazillion options. The ones that get state don't have to be run with 'sudo'; the ones that change state do.

    Man page for 10.9's command:
    https://developer.apple.com/legacy/...n/Reference/ManPages/man8/networksetup.8.html

    I'll also note that port 21218 is not an assigned IANA port, so it's unclear what the intent of setting that port is.
     
  7. EDLIU thread starter macrumors member

    Joined:
    Oct 20, 2015
    #7
    Hi,

    I found the commands in the Terminal on my iMac.

    BTW, why would anyone want to change(or know) my Network settings?

    Thanks.

    Ed
     
  8. JohnDS macrumors 65816

    Joined:
    Oct 25, 2015
    #8
    They could be redirecting your browsers to malicious sites. Does anyone else have physical access to your computer? If so, you should ask them. If your computer is not password protected, you should password protect it.

    Also, you need to download MalWareBytes and EtreCheck and follow the instructions in my earlier post.
    --- Post Merged, Jul 31, 2016 ---
    Also, you want to know if any changes were made to your Hosts file as that can be used to redirect your growers.

    To find out, in Finder pull down the GO menu to Go to Folder and type in

    /etc

    and hit return.

    Scroll through the /etc window and look for a file called "hosts". Right-click on it and choose Open With the Text Edit.

    Type Command-A to select all, then Command-C to copy. Then paste the result into a message here.
     
  9. EDLIU thread starter macrumors member

    Joined:
    Oct 20, 2015
    #9
    Hi,

    What do you mean "set the proxy to the localhost and then turned all the options off"?

    Thanks.

    Ed
     
  10. EDLIU thread starter macrumors member

    Joined:
    Oct 20, 2015
    #10
    Hi,

    What did the "sudo networksetup" commands do to my Mac?

    I had problems with my Safari browser. It opens tabs and leads me to other pages when I click on a link. And shows Adobe Flash commercials also. The system also ran very slow.

    Are the problems above caused by the commands ran on my iMac? Can some kind of "programs form the Internet" do that?

    Thanks.

    Ed

    ps. The "sudo nano /private/etc/hosts" command is okay. I checked my hosts file and it's not modified.
     

Share This Page