secdev / scapy

Scapy: the Python-based interactive packet manipulation program & library.
https://scapy.net
GNU General Public License v2.0
10.71k stars 2.02k forks source link

TypeError: not all arguments converted during string formatting. Logged from file error.py, line 76 #835

Closed Kash-A closed 7 years ago

Kash-A commented 7 years ago

I installed the new fixed version and now I am into another trouble. I can't get the scapy readable. see the error below.

C:\Users\ahm2sgm\Downloads\scapy-master>scapy WARNING: Crypto-related methods disabled for IPsec, Dot11 and TLS layers (needs python-cryptography v1.7+). Traceback (most recent call last): File "C:\Python27\lib\logginginit.py", line 861, in emit msg = self.format(record) File "C:\Python27\lib\logginginit.py", line 734, in format return fmt.format(record) File "C:\Python27\lib\logginginit.py", line 465, in format record.message = record.getMessage() File "C:\Python27\lib\logginginit.py", line 329, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Logged from file error.py, line 76 WARNING: No route found for IPv6 destination :: (no default route?) INFO: Can't import python-cryptography v1.7+. Disabled WEP decryption/encryption. INFO: Could not import python-cryptography.Computations for the "authenticator" field (RADIUS packets) and"Message-Authenticator" attribute value field are disabled. INFO: Can't import python-cryptography v1.7+. Disabled IPsec encryption/authentication. WARNING: IPython not available. Using standard Python shell instead. AutoCompletion, History are disabled. �[32m�[1m �[0m�[34m�[1m�[0m �[32m�[1m aSPY//YASa �[0m�[34m�[1m�[0m �[32m�[1m apyyyyCY//////////YCa �[0m�[34m�[1m |�[0m �[32m�[1m sY//////YSpcs scpCY//Pp �[0m�[34m�[1m | Welcome to Scapy�[0m �[32m�[1m ayp ayyyyyyySCP//Pp syY//C �[0m�[34m�[1m | Version 1343360�[0m �[32m�[1m AYAsAYYYYYYYY///Ps cY//S�[0m�[34m�[1m |�[0m �[32m�[1m pCCCCY//p cSSps y//Y�[0m�[34m�[1m | https://github.com/secdev/scapy�[0m �[32m�[1m SPPPP///a pP///AC//Y�[0m�[34m�[1m |�[0m �[32m�[1m A//A cyP////C�[0m�[34m�[1m | Have fun!�[0m �[32m�[1m p///Ac sC///a�[0m�[34m�[1m |�[0m �[32m�[1m P////YCpc A//A�[0m�[34m�[1m | Craft packets like I craft my beer.�[0m �[32m�[1m scccccp///pSP///p p//Y�[0m�[34m�[1m | -- Jean De Clerck�[0m �[32m�[1m sY/////////y caa S//P�[0m�[34m�[1m |�[0m �[32m�[1m cayCyayP//Ya pY/Ya�[0m �[32m�[1m sY/PsY////YCc aC//Yp �[0m �[32m�[1m sc sccaCY//PCypaapyCP//YSs �[0m �[32m�[1m spCPY//////YPSps �[0m �[32m�[1m ccaacs �[0m �[32m�[1m �[0m �[34m�[1m>>> �[0m

p-l- commented 7 years ago

I cannot reproduce.

@gpotter2 do you have a Windows machine without iPython to see if you get the same issue?

@Kash-A can you install iPython and tell us if that changes something?

Kash-A commented 7 years ago

After installation of iPython, the problem is solved for timestamp floating point measurement but error is persistent. Output is:

C:\Users\ahm2sgm\Downloads\scapy-master>scapy WARNING: Crypto-related methods disabled for IPsec, Dot11 and TLS layers (needs python-cryptography v1.7+). Traceback (most recent call last): File "C:\Python27\lib\logging__init.py", line 861, in emit msg = self.format(record) File "C:\Python27\lib\logging\init.py", line 734, in format return fmt.format(record) File "C:\Python27\lib\logging\init.py", line 465, in format record.message = record.getMessage() File "C:\Python27\lib\logging\init__.py", line 329, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Logged from file error.py, line 76 WARNING: No route found for IPv6 destination :: (no default route?) INFO: Can't import python-cryptography v1.7+. Disabled WEP decryption/encryption. INFO: Could not import python-cryptography.Computations for the "authenticator" field (RADIUS packets) and"Message-Authenticator" attribute value field are disabled. INFO: Can't import python-cryptography v1.7+. Disabled IPsec encryption/authentication.

                     aSPY//YASa
             apyyyyCY//////////YCa       |
            sY//////YSpcs  scpCY//Pp     | Welcome to Scapy
 ayp ayyyyyyySCP//Pp           syY//C    | Version 134336054
 AYAsAYYYYYYYY///Ps              cY//S   |
         pCCCCY//p          cSSps y//Y   | https://github.com/secdev/scapy
         SPPPP///a          pP///AC//Y   |
              A//A            cyP////C   | Have fun!
              p///Ac            sC///a   |
              P////YCpc           A//A   | Craft packets like I craft my beer.
       scccccp///pSP///p          p//Y   |               -- Jean De Clerck
      sY/////////y  caa           S//P   |
       cayCyayP//Ya              pY/Ya
        sY/PsY////YCc          aC//Yp
         sc  sccaCY//PCypaapyCP//YSs
                  spCPY//////YPSps
                       ccaacs
                                       using IPython 5.5.0

sniff()

a = sniff() a a[1].time 1506352339.787295
gpotter2 commented 7 years ago

Hmm, I cannot reproduce :/ I tried without IPython and without cryptography :/ Could you

Kash-A commented 7 years ago

Exact version. U:>python Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32

gpotter2 commented 7 years ago

@Kash-A Hi, Could you retry using this branch: https://github.com/gpotter2/scapy/tree/fix-warning-params This should fix the bug :/

Kash-A commented 7 years ago

@gpotter2 Unfortunately its still not working. With the branch you mentioned I got the following result. Before installation, I deleted all the traces of scapy from my computer and then reinstalled from the said branch.

C:\Users\ahm2sgm\Downloads\scapy-fix-warning-params>scapy Traceback (most recent call last): File "C:\Python27\lib\logging__init.py", line 861, in emit msg = self.format(record) File "C:\Python27\lib\logging\init.py", line 734, in format return fmt.format(record) File "C:\Python27\lib\logging\init.py", line 465, in format record.message = record.getMessage() File "C:\Python27\lib\logging\init__.py", line 329, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Logged from file error.py, line 76 WARNING: No route found for IPv6 destination :: (no default route?)

                     aSPY//YASa
             apyyyyCY//////////YCa       |
            sY//////YSpcs  scpCY//Pp     | Welcome to Scapy
 ayp ayyyyyyySCP//Pp           syY//C    | Version 93d915cff
 AYAsAYYYYYYYY///Ps              cY//S   |
         pCCCCY//p          cSSps y//Y   | https://github.com/secdev/scapy
         SPPPP///a          pP///AC//Y   |
              A//A            cyP////C   | Have fun!
              p///Ac            sC///a   |
              P////YCpc           A//A   | Craft me if you can.
       scccccp///pSP///p          p//Y   |                   -- IPv6 layer
      sY/////////y  caa           S//P   |
       cayCyayP//Ya              pY/Ya
        sY/PsY////YCc          aC//Yp
         sc  sccaCY//PCypaapyCP//YSs
                  spCPY//////YPSps
                       ccaacs
                                       using IPython 5.5.0

or may be I am doing some mistake which I have no idea about.

gpotter2 commented 7 years ago

You're sure that you are calling the latest scapy version ? (you've updated python setup.py install each time ?) hmmm....

gpotter2 commented 7 years ago

I've updated https://github.com/gpotter2/scapy/tree/fix-warning-params with debug codes, could you give us the output of scapy when you are starting it ? There will be debug logs with it

Kash-A commented 7 years ago

This is the output with the file you mentioned in you latest comment. In reply of your second last comment, In each of the output I have posted, version is different and I too make sure before running the file that it is the latest one.

C:\Users\ahm2sgm\Downloads\scapy-fix-warning-params>scapy WinPcap is now deprecated (not maintened). Please use Npcap instead (True,) Traceback (most recent call last): File "C:\Python27\lib\logging__init.py", line 861, in emit msg = self.format(record) File "C:\Python27\lib\logging\init.py", line 734, in format return fmt.format(record) File "C:\Python27\lib\logging\init.py", line 465, in format record.message = record.getMessage() File "C:\Python27\lib\logging\init__.py", line 329, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Logged from file error.py, line 78 No route found for IPv6 destination %s (no default route?) ('::',) WARNING: No route found for IPv6 destination :: (no default route?)

                     aSPY//YASa
             apyyyyCY//////////YCa       |
            sY//////YSpcs  scpCY//Pp     | Welcome to Scapy
 ayp ayyyyyyySCP//Pp           syY//C    | Version 67b0f217c
 AYAsAYYYYYYYY///Ps              cY//S   |
         pCCCCY//p          cSSps y//Y   | https://github.com/secdev/scapy
         SPPPP///a          pP///AC//Y   |
              A//A            cyP////C   | Have fun!
              p///Ac            sC///a   |
              P////YCpc           A//A   | To craft a packet, you have to be a
       scccccp///pSP///p          p//Y   | packet, and learn how to swim in
      sY/////////y  caa           S//P   | the wires and in the waves.
       cayCyayP//Ya              pY/Ya   |        -- Jean-Claude Van Damme
        sY/PsY////YCc          aC//Yp    |
         sc  sccaCY//PCypaapyCP//YSs
                  spCPY//////YPSps
                       ccaacs
                                       using IPython 5.5.0
gpotter2 commented 7 years ago

OK this is indeed a scapy-related bug. Could you retry using https://github.com/gpotter2/scapy/tree/fix-warning-params I've updated the logs.

Kash-A commented 7 years ago

Finally you got rid of the bug :)

C:\Users\ahm2sgm\Downloads\scapy-fix-warning-params>scapy WinPcap is now deprecated (not maintened). Please use Npcap instead () WARNING: WinPcap is now deprecated (not maintened). Please use Npcap instead No route found for IPv6 destination %s (no default route?) ('::',) WARNING: No route found for IPv6 destination :: (no default route?)

                     aSPY//YASa
             apyyyyCY//////////YCa       |
            sY//////YSpcs  scpCY//Pp     | Welcome to Scapy
 ayp ayyyyyyySCP//Pp           syY//C    | Version e7042f67a
 AYAsAYYYYYYYY///Ps              cY//S   |
         pCCCCY//p          cSSps y//Y   | https://github.com/secdev/scapy
         SPPPP///a          pP///AC//Y   |
              A//A            cyP////C   | Have fun!
              p///Ac            sC///a   |
              P////YCpc           A//A   | Craft packets like I craft my beer.
       scccccp///pSP///p          p//Y   |               -- Jean De Clerck
      sY/////////y  caa           S//P   |
       cayCyayP//Ya              pY/Ya
        sY/PsY////YCc          aC//Yp
         sc  sccaCY//PCypaapyCP//YSs
                  spCPY//////YPSps
                       ccaacs
                                       using IPython 5.5.0