JP Vossen on 29 Jan 2019 13:03:51 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] raw GET requests


On 1/29/19 1:35 PM, Soren Harward wrote:
On Tue, Jan 29, 2019 at 12:54 PM Michael Lazin <microlaser@gmail.com> wrote:
I think the site is just hanging because wget, lynx-dump and my script hangs, but I was wondering how to make a raw GET request in bash?  what is the syntax?

#3: if you really, really, really have to do it with nothing but bash,
you can create a named redirect to a tcp port:

$ exec 5<>/dev/tcp/[hostname]/80
$ echo -e 'GET / HTTP/1.0\r\n\r\n' >&5
$ cat <&5

Note that Bash stuff requires that Bash be compiled with support for net redirection. Some Bash, on Debian & Ubuntu in particular, was not. It might be now, I haven't looked in a long time. So this may or may not work depending on your bash version, distro and distro age.

Later,
JP
--  -------------------------------------------------------------------
JP Vossen, CISSP | http://www.jpsdomain.org/ | http://bashcookbook.com/
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug