• Telnet Basics Guides & Tutorials

    A tutorial on telnet for beginners. Explains what telnet is and how to use it.

    here are sites that will allow you to play with telnet and try the things you have learned:

    http://www.chem.ox.ac.uk/it/telnet.html
    http://www.westwords.com/guffey/nettel.html



    First of all what is telnet?Telnet is a protocol which is part of the TCP/IP suite. It is quite similar to the UNIX rlogin program. Telnet allows you to control a remote computer from your own one. It is terminal emulation software. In the old days harddrives were humonguous and expensive (i am talking waY back here) and there were no personal computers. To make use of existing computers you had to lease hardrive space and use terminals to operate the system. For developers this was great because computing became lots cheaper. You needed a server and many connections could be made. With telnet u can emulate this type of distributed computing and for example operate a supercomputer from a distance.

    TCP/IP works with ports and telnet has one also. It's nr 23. It's has several rfc's. Nr 854 dates back to 1983 and is named telnet protocol specification.
    With telnet you can do various things like send mail, log in to irc or proxy and even (though hardly anymore) view and modify websites. There are telnet services available allowing you to search through large databases using telnet. With this you use the remote computer's power so it won't presure your precious resources. Usually help or remotehelp are the commands to use to find out what you can and cannot do. If you can't see what you type in then set echo. Once you made a connection you can use the computer as if it was your own. You use command lines for this.
    Telnet knows different emulation types. VT-100 is most used. This emulation was used on the video terminals of DEC. There are still VT-100 servers running out there. Scientists use these.

    To use telnet you need a client. Windows has telnet built in by default (as does UNIX but that's a different story), but there are third party clients available on the net. You start a telnet session by typing in the command 'telnet server.net 23' where the port number is optional. Since Telnet was based on UNIX (as it is part of TCP/IP which also was based on UNIX) it uses UNIX commands. Basic knowledge would help you here. The port number specifies what services you will use. 23 is the default one. You can log into various services. 80 is the HTTP server for that.
    So say you wanted to modify your site from a distance on a leased line. You don't have your fav progs and hardly any time.
    /* telnet server.net 80 (leave the /*)
    /* GET http://www.server.net/YOURSITE.HTM HTTP/1.1
    You can use this method to get the output of a cgi-script as well. The simple request doesn't use the HTTP/1.1 (this is the HTTP version running on the server). If you perform a bad request you usually get some info on the server. Use this to find a the correct versions of services running.
    To put files to the server u use the PUT command. Telnet is pretty simillar to FTP which is also part of TCP/IP. There are other commands available like POST, which is used to put larger data files to the server, HEAD to get the sites header and DELETE. This one is obvious isn't it.
    You can also use telnet to send raw imails. The port to login to is 25.
    First you have to identify your self. This geos like this:
    /* telnet mail.server.net 25
    /* HELO www.you.net
    When you typed this command you'll get some feedback telling you who and what you logged on to. When you login u may get also some feedback telling you things. :`;
    After this you tell the server where the mail is from like this:
    /* MAIL FROM:you@youradress.net
    The server will give you feedback again telling you
    /* ...Sender OK
    You are accepted. Now for the receipant
    /* RCPT TO:yourroommate@hisadress.net
    again feedback
    /* ...Receptient OK
    The server stil does it's duty.....
    /* DATA
    After typing this command you'll get the instructions on the proper way to send the mail. Type your mail using the instructions. After you're done sending your mail close the connection using
    /* QUIT (or END, EXIT, LOGOFF LOGOUT)
    You can use this to receive your mail as well (if your provider allows you). The POP port is 110. Telnet to the server on this port. Once there use the following commands.
    /* USER you@THE_SERVER_GOES_HERE.net
    /* PASS ;type in your password (simple huh.).
    Once you are accepted as a valid user use the following to list your mail.
    /* LIST
    Ports can be configured so they may be different on some systems. Many admins use the default ones though.

    Two things come in handy when completly understanding telnet and how it works. They are a basic understanding of TCP/IP and a basic understanding of UNIX commands.

    You could use telnet to connect to a proxy and from there on continue your quest. Find a good proxy (use a search engine to locate one) and create an account. Now telnet to the server on the port specified on the website and hang loose. Using a proxy to use the web keeps your identity better hidden. Proxies often use port 8080 or 3128. If you use IE or Netscape you configure them to use a proxy. If you have computer friends maybe they could help you locate one nearby. To learn more about proxies read a tutorial about them. Telnet is part of TCP/IP and with this comes specific built in connection security. This basicly comes down to the three-way-handshake which i will not furtherly discuss in this tut. Terminal emulation was embraced by developers because it is a quick and secure way for remote computing.

    Bcause telnet is developed to be quick and reliable you could use it to connect yourself to an irc-server and chat with your buddies without a resource consuming GUI. You may even want to use a proxy to keep the (f)lamers from finding out your ip. To do this you have to know that the irc protocol has it's ports dedicated to 6666:6669. Ports can be configured so you have to know to what port you should connect. The identd runs on port 113. Better use a shell account to connect to IRC servers or a GUI client. Once you are there u can use the usual irc commands. If you have got a good shell (command.com) you can use scripts to automate procedures. To learn more about irc: Request for Comments: 1459 Internet Relay Chat Protocol. mIrc is a pretty good irc-client for nowadays high resource conputers if you want to learn this to. Since linux was built on UNIX and linux is free, you should have by now installed this operating system. OK
    U can also post to newsgroups if the server allows this. Newsgroups use nntp (rfc 977) over port 119. Use your skills. If you want to get information on a particular system you can use a technique known as port scanning. There are pretty fancy port scanners on the net but to become a guru you will have to know how hits take place. So use port surfing instead. Telnet to the server on various ports to get info on services. This is much more rewarding then using someone else's portscanner. If you want to become a good hacker learn a programming language and write your own. Because TCP/IP is not designed for a specific platform it works much the same on any. TCP/IP uses ports that have certain services.
    There are severel interresting ports for trying telnet like 7:echo. This one replies whatever you type in.
    13 daytime
    15 netstat
    37 time time
    39 rlp
    53 domain
    119 nntp
    443 https

    Use your commands to get the requested info. By connecting to different services you get a clear look at the system in use. If you want to exploit a system use the info and go to exploiters.net. If you come across a system you don't know read the ALT.2600.FAQ.
    There are also a lot of trojans circulating (like back orifice or netbus). If you know how to use these you can do some rad things but mostly the use if trojans is considered lame. Learn the commands and setup your private backdoor. When you want to attack a system prepare yourself for this. There has been some discussion on the legality of port-scanning/surfing. Many servers log every attempt to connect to it. Be warned.
    The expansion of free software towards the windows market gives great tools to set up your own hackerlab. For this you use your computer and one other. Set up a simple network with a server.
    Configure the server and start hacking.
    If you have a root account on a telnet server you can use this to remotely administer the server. There are many wats to get a root account. Remember that if an administrator finds a new root account on his system he will know it has been tampered with. Covering your tracks is fatal if you want to stay uncaught. Telnetting from a PDA is a pretty fancy way to read your mail or post to newsgroups from a distance. Because GSM phones can only transmit upto 9600 bps you might not want to load up the web.

    U can use telnet to create a shell account. This allows you to use a good shell even though u use Microsoft OS. Shell accounts vary in the services they have available. To find a good shell account search the net or try freeshell.org. Look for a shell that offers the progs you'dd like to use.

    more
  • Developing for the Windows 7 Taskbar – Application ID I assume that by now you are familiar with the basic functionality that Windows 7 Taskbar offers and the reasons behind the change we made from previous taskbar versions. If you are not familiar with and haven’t seen any demonstrations of the Windows 7 Taskbar, please watch the Windows 7 Taskbar Overview webcast on Channel 9. There are also great posts on the E7 blog like The Windows 7 Taskbar about some of the reasons we introduced the new Taskbar and desktop experience in Windows 7. I do encourage you to read these posts and watch the video so that you have some context for the technical material we are going to cover here.

    The new Taskbar is probably the most noticeable change to Windows 7 when you first log on. The Windows 7 Taskbar is an application-launching and window-switching mechanism that consolidates the functions of previous Windows Desktop mechanisms, such as Quick Launch, Recent Documents, Notification Area icons, desktop shortcuts, and running application windows. Windows 7 Taskbar offers features like Jump Lists, Preview Handler, and Overlay Icons. But before we start diving into the various Windows 7 Taskbar features, let’s lay the basic foundation to our discussion and define some Windows 7 taskbar terminology.

    for example, the Media Player button has no frame or border, but simply sits directly on the Taskbar. This indicates that Media Player is not running. But it is pinned to the Taskbar, and will stay on the Taskbar unless we unpin it. A transparent frame that lets most of the color of the underlying Taskbar through the Windows Explorer button. This indicates that the app is running but is not the active application. The Visual Studio icon has a more opaque rectangular frame underlying its icon indicating that the user is actively using this app. You will also notice that Word has a “stack” of icons representing that multiple instances of Word or multiple Windows are grouped under the same Taskbar button. It is very important to understand the logic that underlies the creation, assignment, and grouping of Taskbar buttons.

    A very large number of applications that run on Windows 7 (for example, Office Word 2007 and Visual Studio 2008), were not designed to work with the Windows 7 Taskbar, so how is it that they can play ball with the Taskbar, group multiple instances, and even take advantage of Word Jump Lists? Basically, a behind-the-scenes Application ID (AppID) is automatically computed and assigned to an application once you launch it. Every running application has an AppID assigned to it, either automatically computed for the app by Windows, or set by the app itself. Guess what? It is not a GUID; it is just a string (with a maximum of 128 characters), that either you provide or is being computed by the OS. All windows and applications, including Jump Lists, which have the same AppID are grouped under the same Taskbar button. Therefore, it is important to understand that every component (process, shortcut, window, Taskbar button, and document type – that is, registered file type handler) of your application has the AppID associated with it.

    You may ask, "Where do AppIDs come from?" As mentioned before, the OS generates Application IDs for your application using a very simple, yet important to understand heuristic. Since in Windows 7 you can assign AppIDs to individual windows, the OS tries to extrapolate the AppID from a window. Applications usually display at least one window that the OS can query for its AppID. However, most existing apps do not have an AppID attached to each window (or, for that matter, any AppID at all), and therefore the OS falls back to the process to which the window belongs for the AppID. Each process has several properties that the OS can check, like the executable of the process. But even then, the process may not provide a granular enough separation. Different shortcuts may provide different start up command line parameters to the same executable and launch different applications (imagine a “launcher” application) that will be grouped under the same Taskbar button. In such cases, the OS has the ability to look into the specific shortcut that launched the application, to find the executable, the command line parameters, and so on. Note that if you have a register file, this registration points to an application that gets launched once you double click that file. Again, this is another way to calculate the AppID. The following image illustrates this automatic computation process.

    While the OS can compute AppIDs for you, you may want to have greater control over the AppID for a given application or even an individual window in your application. Assume that you have an application that hosts (runs) another application (like what happens when you debug an application using Visual Studio). Or you have several different applications or processes that you wish to group under the same Taskbar button. The Taskbar API offers you ways to control the Application ID per application or per window. IN ANY CASE, if you are writing a new application that targets Windows 7, we highly recommend that you provide your own application ID, as we will describe below.

    OK, let’s examine the API that allows you to control the AppID associations of your application.

    If you want to have a separate Taskbar button for each process (including all windows owned by that process), you can set an explicit AppID for the entire process that affects all windows within the process that do not have their own explicit AppID. Setting the explicit process AppID is very easy. All it takes is a single call to the SetCurrentProcessExplicitAppUserModelID function as shown in the following code snippet:

    SetCurrentProcessExplicitAppUserModelID(c_rgszAppID[0]);

    Where c_rgszAppID[0] is a pointer to a string. You should note that according to the SDK documentation, “This method must be called during an application's initial startup routine before the application presents any user interface (UI) or makes any manipulation of its Jump Lists.”

    In managed code, from the latest Windows API Code Pack Library, you can use the AppID property that is part of the Taskbar object, which you can find in the Microsoft.WindowsAPICodePack.Shell.Taskbar namespace. Using that property you can set and get the application ID of a given application.

    Setting the AppID for a window is a bit more complicated (but only a bit). It requires calling the SHGetPropertyStoreForWindow function and then manipulating the resulting IPropertyStore object to retrieve the requested property as shown in the following code snippet:

    void SetAppID(HWND hWnd, int iAppID)
    {
    IPropertyStore *pps;
    HRESULT hr = SHGetPropertyStoreForWindow(hWnd, IID_PPV_ARGS(&pps));
    if (SUCCEEDED(hr))
    {
    PROPVARIANT pv;
    if (iAppID >= 0)
    {
    hr = InitPropVariantFromString(c_rgszAppID[iAppID], &pv);
    }
    else
    {
    PropVariantInit(&pv);
    }
    if (SUCCEEDED(hr))
    {
    hr = pps->SetValue(PKEY_AppUserModel_ID, pv);
    PropVariantClear(&pv);
    }
    pps->Release();
    }
    }

    Here you can see how we extract the current windows property store by calling SHGetPropertyStoreForWindow, passing hWnd as refrence to the window. Next we initiate, InitPropVariantFromString(c_rgszAppID[iAppID], &pv), a property variant with a string that represents the AppID for that window. Finally, we set the value of the new property store to the window.

    Unfortunately, the current Windows API Code pack doesn’t support setting specific application IDs per window, although all you need to do is add the following function to the Taskbar.cs file:

    private static void SetWindowAppId(string appId)
    {
    Microsoft.WindowsAPICodePack.Shell.ShellNativeMethods.SetWindowAppId
    (OwnerHandle, "name here");
    }

    Since the Windows API Code Pack provides the source code, you can actually check the specific implementation of SetWindowAppId function and see for yourself that it is very similar to the SetAppID example above. Note you don’t have to use the full qualified assembly name “Microsoft.WindowsAPICodePack.Shell’, but I did to help you navigate the Windows API Code Pack hierarchy.

    By the way, the window AppID is dynamic, so it’s entirely possible for a window to show up as part of one Taskbar button and then change its AppID so that it appears on an entirely different Taskbar button. This has interesting effects. For example, the Jump List is attached to a Taskbar button (with a specific AppID), so the same window might show a different Jump List when it is reattached to an entirely different Taskbar button. This potentially can confuse users, so the recommended practice is to set the window AppID and stick to it, using the same process for determining the AppID every time the window displays.

    more