epsylon / ufonet

UFONet - Denial of Service Toolkit
https://ufonet.03c8.net
2.18k stars 606 forks source link

main.py will cause errors when scraping #405

Closed ghost closed 2 years ago

ghost commented 2 years ago

Because

1

https://checkip.org/ is <h1>Your IP Address: <span style="color: #5d9bD3;">180.4.14.196</span></h1> so main.py:4035 must be self.pub_ip = re.compile(r'(\d+\.\d+\.\d+\.\d+)').search(data).group(1)

2

main.py:4034 and main.py:4039 data = str(urlopen(self.check_ip_service1).read()) # check for public ip must be data = str(urllib.request.urlopen(self.check_ip_service1).read()) # check for public ip


Probabry.

epsylon commented 2 years ago

@darkestscience -> https://github.com/epsylon/ufonet/blob/master/core/main.py#21

ghost commented 2 years ago

I tried those pattern. scs3 scs2 scs Of the three patterns, only the one incorporating the top two improvements was marked as SUCCESS.

epsylon commented 2 years ago

@darkestscience I don't understand where you want to get there. Do not regular expressions work as they are?

epsylon commented 2 years ago

External checker -> https://status.ws/ -> is down... but the tool should try the next one, which is actually working

ghost commented 2 years ago

working services

check_ip_service1 = 'https://checkip.org/'
check_ip_service3 ='https://ip.42.pl/ra'
these are working.
but
check_ip_service2 = 'https://whatismyip.org/'
returns 403
when request from python code.

Sentence error

ERRO: name 'urlopen' is not defined↓

import urllib.request, urllib.error, urllib.parse
str(urlopen(check_ip_service1).read())

fix

import urllib.request, urllib.error, urllib.parse
from urllib.request import urlopen
str(urlopen(check_ip_service1).read())

regular expressions

'NoneType' object has no attribute 'group' error because search result is none ↓

re.compile(r'Address: (\d+\.\d+\.\d+\.\d+)').search(data).group(1)

fix(change)

pub_ip = re.compile(r'(\d+\.\d+\.\d+\.\d+)').search(data).group(1)
epsylon commented 2 years ago

@darkestscience Sorry but I don't see your point... Do not regular expressions work as they are or you are providing another code for other reasons?

ghost commented 2 years ago

oh sorry...

Regular expressions is not working.

epsylon commented 2 years ago

@darkestscience Ok, you're referring to the "--attack-me" option.

It should work after this commit: https://github.com/epsylon/ufonet/commit/753904e3923c9d972997ff7b060acce38c3801f9

Thanks for your time! ;-)