Ticket #357 (new defect)

Opened 3 years ago

Last modified 16 months ago

throws error when storing output of command prompt when running scapy.

Reported by: anonymous Owned by: pbi
Priority: major Milestone:
Component: Scapy Version:
Keywords: Cc:

Description

When runnning scapy from command prompr (windows XP), the output cannot be stored. When the following command is executed in command prompt: scapy >C:\dir.txt

The following error shows up: C:\automation\atg\GeneralFiles_AC\ScapyExe?>scapy >C:\dir.txt INFO: Can't import python gnuplot wrapper . Won't be able to plot. INFO: Can't import PyX. Won't be able to use psdump() or pdfdump(). INFO: No IPv6 support in kernel WARNING: No route found for IPv6 destination :: (no default route?) C:\Python26\lib\site-packages\scapy\crypto\cert.py:6: DeprecationWarning?: the sh a module is deprecated; use the hashlib module instead

import os, sys, math, socket, struct, sha, hmac, string, time

C:\Python26\lib\site-packages\scapy\crypto\cert.py:7: DeprecationWarning?: The po pen2 module is deprecated. Use the subprocess module.

import random, popen2, tempfile

Traceback (most recent call last):

File "C:\Python26\Scripts
scapy", line 25, in <module>

interact()

File "C:\Python26\lib\site-packages\scapy\main.py", line 293, in interact

readline.read_history_file(conf.histfile)

File "C:\Python26\lib\site-packages\pyreadline\rlmain.py", line 183, in read_h

istory_file

self._history.read_history_file(filename)

File "C:\Python26\lib\site-packages\pyreadline\lineeditor\history.py", line 70

, in read_history_file

self.add_history(lineobj.ReadLineTextBuffer?(ensure_unicode(line.rstrip())))

File "C:\Python26\lib\site-packages\pyreadline\unicode_helper.py", line 20, in

ensure_unicode

return text.decode(pyreadline_codepage, "replace")

TypeError?: decode() argument 1 must be string, not None

C:\automation\atg\GeneralFiles_AC\ScapyExe?>

system specifications: ====================== OS: windows XP scapy version: 2.1.1-dev (using scapy-7a97e2f3db67.zip) Python: 2.6 (PythonWin?)

Change History

comment:1 Changed 3 years ago by amit.barik@…

Also, subprocess.Popen cannot detect the output of scapy.

comment:2 follow-up: ↓ 3 Changed 3 years ago by Dirk Loss

Haven't tried this myself, but I guess this is caused by the ANSI color codes. What happens if you disable color?

conf.color_theme = NoTheme()

or

conf.color_theme = FormatTheme()

You can put this into your ~/.scapy_startup.py file.

comment:3 in reply to: ↑ 2 Changed 3 years ago by anonymous

Replying to Dirk Loss:

Haven't tried this myself, but I guess this is caused by the ANSI color codes. What happens if you disable color?

conf.color_theme = NoTheme()

or

conf.color_theme = FormatTheme()

You can put this into your ~/.scapy_startup.py file.

Hi, Thanks for the reply. But I am not able to find the scapy_startup.py. I searched my whole Windows XP system and couldnt find it. I am also missing scapy.py file. Just so that you know, below I have written down the steps to install scapy in Windows XP running Python Win (Python 2.6)

1st open link - ht!tp:
hg.secdev.org\scapy\archive\tip.zip

2nd ht!tp:
dirk-loss.de\scapy-doc\_sources\installation.txt - install the following from the links:

-ht!tp:
www.secdev.org\projects\scapy\files\dnet-1.12.win32-py2.6.exe

-ht!tp:
www.secdev.org\projects\scapy\files\pcap-1.1-scapy-20090720.win32-py2.6.exe

-ht!tp:
ipython.scipy.org\dist\pyreadline-1.5-win32-setup.exe

3rd - open the folder containing zip from 1st link

4th - unzip. to say 'X Folder' and type the following command in cmd prompt:

5th- python X Folder\setup.py install

NOTE: replace the '\' with '/' in the urls Thanks Amit

comment:4 Changed 18 months ago by anonymous

If you don't believe duplicate content is important, look what google says: "Don't create multiple pages, subdomains, or domains with substantially duplicate content."

So, you really want to avoid the Google duplicate content filter with those PLR articles you recently bought? TDE4GD5  Scratched Bumper Here is one powerful and easy way to easily and quickly improve your PLR article so that Google will quickly index it. MTET98ER

Remember just this one trick: change single words into phrases and phrases into single words.

comment:5 Changed 16 months ago by anonymous

I'm having this same exact issue on XP. Pretty much a show stopper for me.

Note: See TracTickets for help on using tickets.