etherum_rpc_steal icon indicating copy to clipboard operation
etherum_rpc_steal copied to clipboard

Network Session Error

Open 5l1v3r1 opened this issue 6 years ago • 7 comments
trafficstars

Hi, whenever i want to run eth_rpc_scan.py with python3.7 or python3.6, it gives me the same error with all ip ranges i tried.

Network Session Error , Format like : 192.168.1.0/24

Can you tell me how to fix this please?

Regards

5l1v3r1 avatar Jan 23 '19 06:01 5l1v3r1

@eudomoniacc You can try to this for execute scan script.


    python3 ./eth_rpc_scan.py 47.74.0.0/11

47.74.0.0/11 is mean network list .It like nmap scan a ip list : nmap -v -A 10.1.1.0/24

lcatro avatar Jan 23 '19 06:01 lcatro

I have already tried this. Not working with any of the networks i have tried so far. def split_network_session(string) : offset = string.find('/')

if not -1 == offset :
    return False

return string.split('/')

if name == 'main' : if 1 == len(sys.argv) or 3 < len(sys.argv) : get_help()

network_session = split_network_session(sys.argv[1])

if not network_session :
    eth_rpc_output.output_function('Network Session Error , Format like : 192.168.1.0/24')

    exit()

Can be related to string functions in python3 ? As far as i know str.find and str.split are used instead. I tried to modify the code but again had the same error :/

5l1v3r1 avatar Jan 23 '19 07:01 5l1v3r1

By the way which versions of requests and web3 did you use ?

5l1v3r1 avatar Jan 23 '19 07:01 5l1v3r1

@eudomoniacc ./eth_rpc_scan.py no using web3 .Can you show your input command line ? ..

lcatro avatar Jan 23 '19 07:01 lcatro

import json import socket import sys import threading import time

import requests from web3 import Web3

import eth_rpc_output import eth_rpc_cli But the library is imported to it?

Anyways my command line and result is

python3.7 eth_rpc_scan.py 192.168.1.0/24 Network Session Error , Format like : 192.168.1.0/24

If it try with external networks as well it gives me the same error

5l1v3r1 avatar Jan 23 '19 08:01 5l1v3r1

@eudomoniacc Thanks ,i forget that my github code is old version and i rewrite eth_rpc_scan.py .Now i fix this bug .fix code :


def split_network_session(string) :
    offset = string.find('/')
  
-     if not -1 == offset :
+    if -1 == offset :
        return False
    
    return string.split('/')

I'm so sorry for this bug .You can update code in your file or git pull it ..

lcatro avatar Jan 23 '19 10:01 lcatro

Thank you very much. Now it is perfectly working :) Great job ^:^

5l1v3r1 avatar Jan 23 '19 10:01 5l1v3r1