Leeon123 / CC-attack

Using Socks4/5 or http proxies to make a multithreading Http-flood/Https-flood (cc) attack.
GNU General Public License v2.0
962 stars 421 forks source link

Exception from random.py when flooding #49

Closed daubac402 closed 3 years ago

daubac402 commented 3 years ago

Hi!

With fresh Python 3 and the latest commit from your repo, It keeps raising this exception when flooding from many threads.

From tags/v3.4 and older version, It works properly! Does anyone run into the same problem as me?

Exception in thread Thread-620:
Traceback (most recent call last):

File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()

File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)

File "cc.py", line 293, in cc
proxy = Choice(proxies).strip().split(":")

File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/random.py", line 261, in choice
raise IndexError('Cannot choose from an empty sequence') from None
IndexError: Cannot choose from an empty sequence
Haseebmalikofficiall commented 3 years ago

yes i have this same problem :(

Leeon123 commented 3 years ago

This is because of the proxies list is empty, you should download the socks4/5 file or check it first. But anyway I'll add a condition checker later. Ps: The latest version is using socks.txt as default proxies file.

daubac402 commented 3 years ago

Actually, the program failed to check all the proxies in the list before. The "checking proxy:" count number raises so fast from 1 to the number of proxies. The result of checking is always 0 proxy is working. Considering there is a problem when creating a new connection with proxy.

From tags/v3.4 and older version, nothing weird!

Leeon123 commented 3 years ago

Try to change the proxy file name to socks.txt

daubac402 commented 3 years ago

Try to change the proxy file name to socks.txt

Sorry but Not worked!

And even it worked, is it weird that the command default saves the proxy list into socks4.txt or socks5.txt then after all it requires socks.txt when running?

Moreover, you can make a try: Just clone then run your repo, simply it could not running :(

Leeon123 commented 3 years ago

I have already tested and it works pretty well. The socks file names are remained socks4/5.txt.

daubac402 commented 3 years ago

This is my output everytime since v3.5

$ python3 cc.py 

       /////    /////    /////////////
      CCCCC/   CCCCC/   | CC-attack |/
     CC/      CC/       |-----------|/ 
     CC/      CC/       |  Layer 7  |/ 
     CC/////  CC/////   | ddos tool |/ 
      CCCCC/   CCCCC/   |___________|/
>--------------------------------------------->
Version 3.6 (2020/12/14)
                            C0d3d by L330n123
┌─────────────────────────────────────────────┐
│        Tos: Don't attack .gov website       │
├─────────────────────────────────────────────┤
│                 New stuff:                  │
│          [+] Optimization                   │
│          [+] Changed Output                 │
│          [+] Added Url Parser               │
├─────────────────────────────────────────────┤
│ Link: https://github.com/Leeon123/CC-attack │
└─────────────────────────────────────────────┘
> Mode: [cc/post/head/slow/check]
> Choose Your Mode (default=cc) :
> Input the target url:test.com
> Customize cookies? (y/n, default=n):
> Choose your socks mode(4/5, default=5):
> Threads(default=400):
> Do you need to get socks list?(y/n,default=y):
> Have already downloaded socks5 list as socks5.txt
> Socks5 Proxy file path(socks5.txt):
> Checking list
> Number Of Socks5 Proxies: 334
> Do u need to check the socks list?(y/n, defualt=y):
> Delay of socks(seconds, default=1):
> Checked 334 proxies
> Checked all proxies, Total Worked:0
> Do u want to save them in a file? (y/n, default=y)
> They are saved in socks5.txt.
> There are no more proxies. Please download a new one.
Leeon123 commented 3 years ago

Try to set the delay limit of the socks to 10 seconds

daubac402 commented 3 years ago

It's not working even I increased the timeout as you said.

The "checking proxy:" count number raises so fast from 1 to the number of proxies. It seems to be not related with the timeout setting. Look like It was failed right after creating new connection to each of the proxy in the list.

Tested with my PC, network, even AWS or Azure, Not working :( I had to back to v3.4

Leeon123 commented 3 years ago

@daubac402 I finally know why did you guys can't work well with it.

This is because after v3.4 I added url parser and change the target format as url. So your input should be:

> Input the target url:https://test.com
daubac402 commented 3 years ago

@Leeon123 Oh, I got it, Thanks! And It will be better if we show the URL validation error right after user finishs the url input step.