Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Support (to close) #8

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Conversation

ecthros
Copy link
Collaborator

@ecthros ecthros commented Dec 13, 2019

Now uses ABC and allows for indexing into strategy array.

We will want to change this once we move over to the actual library.

@codecov-io
Copy link

codecov-io commented Dec 16, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@7b98367). Click here to learn what that means.
The diff coverage is 89.14%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master       #8   +/-   ##
=========================================
  Coverage          ?   84.02%           
=========================================
  Files             ?       15           
  Lines             ?     1527           
  Branches          ?      303           
=========================================
  Hits              ?     1283           
  Misses            ?      195           
  Partials          ?       49
Impacted Files Coverage Δ
actions/duplicate.py 100% <ø> (ø)
actions/tree.py 97.21% <ø> (ø)
actions/trigger.py 98.63% <ø> (ø)
engine.py 37.13% <ø> (ø)
actions/sleep.py 69.56% <100%> (ø)
actions/trace.py 75% <100%> (ø)
actions/utils.py 86.11% <100%> (ø)
actions/tamper.py 92.18% <75%> (ø)
actions/packet.py 94.44% <84%> (ø)
actions/fragment.py 95.16% <88%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b98367...337f916. Read the comment docs.

@Kkevsterrr
Copy link
Owner

Is this windows support or HTTP support?

"%HTTPRequest.Http_Version%"
)

# TODO: decide to keep or not
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we determine that now

Initializes the HTTP layer.
"""
Layer.__init__(self, layer)
self.request = HTTPRequest(bytes(layer)) # TODO: I dont like this
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do you want to change it?

"""
Override get, since the HTTPRequest doesn't immediately make its fields known
"""
print('entering set, but I dont like this')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we clean this up if it's done

@@ -131,7 +142,7 @@ def setup_layers(self):
"""
layers = {}
for layer in self.read_layers():
layers[layer.name.upper()] = layer
layers[layer.name] = layer
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does removing the .upper break other layers?

return self.layers[str_protocol].set(self.packet, field, value)
lay = self.layers[str_protocol].set(self.packet, field, value)

print(lay)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove?

return None

if index > len(packet["HTTPRequest"].fields[header]):
# TODO: throw some sort of error, this index is too large
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, assert

return None

if index+len(content) > len(packet["HTTPRequest"].fields[header]):
# TODO: throw some sort of error, this index is too large
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments for these TODOs

return None

if end_index+1 > len(packet["HTTPRequest"].fields[header]):
# TODO: throw some sort of error, this index is too large
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and these

"""
Helper method to remove the characters at header[start_index] to header[end_index]
"""
print("in cor")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

# Filter for IPv4 addresses
if netifaces.AF_INET in info:
return iface
if os.name == 'nt':
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your branching is funky - see my comments on the windows code review (#14) for the rest of this

@ecthros
Copy link
Collaborator Author

ecthros commented Feb 18, 2020

HTTP support will come in a different branch (soonish). Changing name, but need to merge Windows code first and make some additional changes to HTTP.

@ecthros ecthros changed the title Windows Support HTTP Support Feb 18, 2020
@ecthros ecthros changed the title HTTP Support HTTP Support (to close) Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants