Skip to content

Commit

Permalink
Changes in api
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaeem20 committed Oct 15, 2021
1 parent eb99700 commit 04d33c9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
__pycache__
build
*.egg-info
dist
dist
.vscode
3 changes: 3 additions & 0 deletions tests/test_asyncwebeye.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ async def test_is_cloudflare(self):
async def test_is_honeypot(self):
self.assertIsInstance(await a.is_honeypot('google.com'), str)

async def test_whois(self):
self.assertIsInstance(await a.whois('google.com'), str)

if __name__ == '__main__':
unittest.main()
3 changes: 3 additions & 0 deletions tests/test_webeye.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ def test_is_cloudflare(self):
def test_is_honeypot(self):
self.assertIsInstance(is_honeypot('google.com'), str)

def test_whois(self):
self.assertIsInstance(whois('google.com'), str)

if __name__ == '__main__':
unittest.main()
6 changes: 3 additions & 3 deletions webeye/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def scan(target: str, port: Union[int, Iterable], start: int=0, dev_mode: bool=F
'''
try:
realip = socket.gethostbyname(target)
lists = [f'\nPyPort started at {datetime.utcnow().strftime("%d-%b-%Y %I:%M %p")}<br/>']
lists = [f'\nPyPort started at {datetime.utcnow().strftime("%d-%b-%Y %I:%M %p")}<br/>','PORTS | SERVICE']
on = time.time()
def scan_port(port) -> Union[str,list]:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Expand All @@ -75,7 +75,7 @@ def scan_port(port) -> Union[str,list]:
if dev_mode:
lists.append(f'{port}/{socket.getservbyport(port)}')
elif api:
lists.append(f'OPEN_PORTS: {port}/{socket.getservbyport(port)}')
lists.append(f'{port}/tcp | {socket.getservbyport(port)}')
else:
print(f'{port}/tcp\t | {socket.getservbyport(port)}\t| open |')
sock.close()
Expand All @@ -94,7 +94,7 @@ def execute():
runner = execute()

if dev_mode:
return runner,lists[1:]
return runner,lists[2:]
elif api:
return runner, lists
else:
Expand Down

0 comments on commit 04d33c9

Please sign in to comment.