Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option - requires an argument. #18

Closed
GoogleCodeExporter opened this issue Mar 15, 2015 · 16 comments
Closed

Option - requires an argument. #18

GoogleCodeExporter opened this issue Mar 15, 2015 · 16 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
After installation just enter "slowhttptest -u https://www.google.at or 
anything of the Wiki tutorials. 

What is the expected output? What do you see instead?
root@xfs:~# slowhttptest -u https://www.google.at
Option - requires an argument.
Try 'slowhttptest -h' for more information


What version of the product are you using? On what operating system?
newest version. clean Xubuntu




Original issue reported on code.google.com by insidiou...@gmail.com on 26 Nov 2013 at 2:36

@GoogleCodeExporter
Copy link
Author

Please check the charset/lang you are using in the terminal... Cannot reproduce 
this completely on OSX. Will try on clean Ubuntu in about an hour. 

Original comment by shek...@gmail.com on 26 Nov 2013 at 4:15

@GoogleCodeExporter
Copy link
Author

[deleted comment]

1 similar comment
@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

This is probably related to getopt version on your system. Is it different from 
2.20.1? 
I noticed that if you use long dash, e.g. 
src/slowhttptest —u http://www.google.at/ 
instead of
src/slowhttptest -u http://www.google.at/
you will get wrong results. But with my current version of getopt, I have no 
idea how to get an error message like "Option - requires an argument.". Please 
try both variants and also type getopt --version to the system version of 
getopt that you have. 
Thanks!

Original comment by shek...@gmail.com on 26 Nov 2013 at 9:48

@GoogleCodeExporter
Copy link
Author

I am sorry, I made a mistake.
The system is on a cubieboard either a debian Wheezy or a Kali linux ARM.
on both systems on the cubieboard this happenes.

getopt is 2.20.1.

I am accessing the cubieboard with putty via ssh.
I cannot write a long dash, even copy paste is not working. The short dash is 
working but bringing the error message.

Original comment by insidiou...@gmail.com on 27 Nov 2013 at 4:09

@GoogleCodeExporter
Copy link
Author

One more thing - have you tried older versions on the same system?

Original comment by shek...@gmail.com on 27 Nov 2013 at 4:10

@GoogleCodeExporter
Copy link
Author

Tried 1.5 (without prefix) same error:

root@kali:~/slowhttptest-1.5# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for SSL_library_init in -lssl... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking for vprintf... yes
checking for _doprnt... no
checking for atexit... yes
checking for gettimeofday... yes
checking for poll... yes
checking for select... yes
checking for socket... yes
checking for strerror... yes
checking for strstr... yes
checking for strtol... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating config.h
config.status: executing depfiles commands
root@kali:~/slowhttptest-1.5# make
make  all-recursive
make[1]: Entering directory `/root/slowhttptest-1.5'
Making all in src
make[2]: Entering directory `/root/slowhttptest-1.5/src'
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowhttptestmain.o -MD -MP -MF 
.deps                                                                           
  /slowhttptestmain.Tpo -c -o slowhttptestmain.o slowhttptestmain.cc
mv -f .deps/slowhttptestmain.Tpo .deps/slowhttptestmain.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowhttptest.o -MD -MP -MF 
.deps/slo                                                                       
      whttptest.Tpo -c -o slowhttptest.o slowhttptest.cc
mv -f .deps/slowhttptest.Tpo .deps/slowhttptest.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowsocket.o -MD -MP -MF 
.deps/slows                                                                     
        ocket.Tpo -c -o slowsocket.o slowsocket.cc
mv -f .deps/slowsocket.Tpo .deps/slowsocket.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowstats.o -MD -MP -MF 
.deps/slowstats.Tpo -c -o slowstats.o slowstats.cc
mv -f .deps/slowstats.Tpo .deps/slowstats.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowurl.o -MD -MP -MF 
.deps/slowurl.Tpo -c -o slowurl.o slowurl.cc
mv -f .deps/slowurl.Tpo .deps/slowurl.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowlog.o -MD -MP -MF 
.deps/slowlog.Tpo -c -o slowlog.o slowlog.cc
mv -f .deps/slowlog.Tpo .deps/slowlog.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT text-generator.o -MD -MP -MF 
.deps/text-generator.Tpo -c -o text-generator.o text-generator.cc
mv -f .deps/text-generator.Tpo .deps/text-generator.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT range-generator.o -MD -MP -MF 
.deps/range-generator.Tpo -c -o range-generator.o range-generator.cc
mv -f .deps/range-generator.Tpo .deps/range-generator.Po
g++  -g -O2  -L/usr/local/lib -lssl -o slowhttptest slowhttptestmain.o 
slowhttptest.o slowsocket.o slowstats.o slowurl.o slowlog.o text-generator.o 
range-generator.o  -lssl
make[2]: Leaving directory `/root/slowhttptest-1.5/src'
Making all in man
make[2]: Entering directory `/root/slowhttptest-1.5/man'
make[2]: Für das Ziel »all« ist nichts zu tun.
make[2]: Leaving directory `/root/slowhttptest-1.5/man'
make[2]: Entering directory `/root/slowhttptest-1.5'
make[2]: Leaving directory `/root/slowhttptest-1.5'
make[1]: Leaving directory `/root/slowhttptest-1.5'



root@kali:~/slowhttptest-1.5/src# ./slowhttptest -u www.google.at
Option - requires an argument.
Try 'slowhttptest -h' for more information

Original comment by insidiou...@gmail.com on 27 Nov 2013 at 7:38

@GoogleCodeExporter
Copy link
Author

and 1.3:

root@kali:~/slowhttptest-1.3# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for SSL_library_init in -lssl... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking for vprintf... yes
checking for _doprnt... no
checking for atexit... yes
checking for gettimeofday... yes
checking for select... yes
checking for socket... yes
checking for strerror... yes
checking for strstr... yes
checking for strtol... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
root@kali:~/slowhttptest-1.3# make
make  all-recursive
make[1]: Entering directory `/root/slowhttptest-1.3'
Making all in src
make[2]: Entering directory `/root/slowhttptest-1.3/src'
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowhttptestmain.o -MD -MP -MF 
.deps/slowhttptestmain.Tpo -c -o slowhttptestmain.o slowhttptestmain.cc
mv -f .deps/slowhttptestmain.Tpo .deps/slowhttptestmain.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowhttptest.o -MD -MP -MF 
.deps/slowhttptest.Tpo -c -o slowhttptest.o slowhttptest.cc
mv -f .deps/slowhttptest.Tpo .deps/slowhttptest.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowsocket.o -MD -MP -MF 
.deps/slowsocket.Tpo -c -o slowsocket.o slowsocket.cc
mv -f .deps/slowsocket.Tpo .deps/slowsocket.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowstats.o -MD -MP -MF 
.deps/slowstats.Tpo -c -o slowstats.o slowstats.cc
mv -f .deps/slowstats.Tpo .deps/slowstats.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowurl.o -MD -MP -MF 
.deps/slowurl.Tpo -c -o slowurl.o slowurl.cc
mv -f .deps/slowurl.Tpo .deps/slowurl.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT slowlog.o -MD -MP -MF 
.deps/slowlog.Tpo -c -o slowlog.o slowlog.cc
mv -f .deps/slowlog.Tpo .deps/slowlog.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT text-generator.o -MD -MP -MF 
.deps/text-generator.Tpo -c -o text-generator.o text-generator.cc
mv -f .deps/text-generator.Tpo .deps/text-generator.Po
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT range-generator.o -MD -MP -MF 
.deps/range-generator.Tpo -c -o range-generator.o range-generator.cc
mv -f .deps/range-generator.Tpo .deps/range-generator.Po
g++  -g -O2  -L/usr/local/lib -lssl -o slowhttptest slowhttptestmain.o 
slowhttptest.o slowsocket.o slowstats.o slowurl.o slowlog.o text-generator.o 
range-generator.o  -lssl
make[2]: Leaving directory `/root/slowhttptest-1.3/src'
make[2]: Entering directory `/root/slowhttptest-1.3'
make[2]: Leaving directory `/root/slowhttptest-1.3'
make[1]: Leaving directory `/root/slowhttptest-1.3'
root@kali:~/slowhttptest-1.3# cd src/
root@kali:~/slowhttptest-1.3/src# ./slowhttptest -u www.google.at
Option - requires an argument.
Try 'slowhttptest -h' for more information

Original comment by insidiou...@gmail.com on 27 Nov 2013 at 7:41

@GoogleCodeExporter
Copy link
Author

--- slowhttptestmain.cc.orig    2014-06-02 17:46:55.097248033 +0900
+++ slowhttptestmain.cc 2014-06-02 17:47:11.177248040 +0900
@@ -158,7 +158,7 @@
   SlowTestType type = slowhttptest::eHeader;
   ProxyType proxy_type = slowhttptest::eNoProxy;
   long tmp;
-  char o;
+  int o;
   while((o = getopt(argc, argv, ":HBRXgha:b:c:d:e:i:k:l:n:o:p:r:s:t:u:v:w:x:y:z:")) != -1) {
     switch (o) {
       case 'a':

Original comment by g41...@gmail.com on 2 Jun 2014 at 8:59

@da13m
Copy link

da13m commented Apr 8, 2016

I have a similar issue running on Nexus 9 Nethunter 3.0. Using the latest version of slowhttptest and cut and paste command in terminal any command but -h results in the Option - requires an argument

@da13m
Copy link

da13m commented Apr 8, 2016

Was there a fix posted for it?

@shekyan
Copy link
Owner

shekyan commented Apr 9, 2016

have you tried putting arguments inside double-quotes? Like slowhttptest "-u www.google.at"

@da13m
Copy link

da13m commented Apr 9, 2016

Yes tried a few combinations of syntax but no go but the strange part is only -h works

root@kali:~# slowhttptest "-u www.google.at"
Option - requires an argument.
Try 'slowhttptest -h' for more information

root@kali:~# slowhttptest -h

slowhttptest, a tool to test for slow HTTP DoS vulnerabilities - version 1.6

@shekyan
Copy link
Owner

shekyan commented Apr 9, 2016

Can you please give me the exact environment where this is happening, will try to reproduce

@da13m
Copy link

da13m commented Apr 12, 2016

Thanks Shekyan,
I'm running Nethunter on a Nexus 9 let me know if this is what your looking for (1.6 version for slowhttptest)

Android version 6.0.1
Kernel version 3.10.40-g6857980-dirty
Build MMB29V
root@kali:~# cat /etc/lsb-release
DISTRIB_ID=Kali
DISTRIB_RELEASE=2.0
DISTRIB_CODENAME=sana
DISTRIB_DESCRIPTION="Kali GNU/Linux 2.0"

@shekyan shekyan closed this as completed in d199a3d May 3, 2016
shekyan added a commit that referenced this issue May 3, 2016
getopt() returns int, not char.
@albinowax
Copy link

This issue is still present in the package supplied by Raspbian. Building the tool from source works fine, though.

@shekyan shekyan mentioned this issue Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants