mirror of https://github.com/n1nj4sec/pupy.git
Socket and family numbers are differs from OS to OS
This commit is contained in:
parent
decb45f52b
commit
4cd1825690
|
@ -23,16 +23,12 @@ class IPModule(PupyModule):
|
|||
|
||||
def run(self, args):
|
||||
try:
|
||||
data = obtain(self.client.conn.modules.pupyps.interfaces())
|
||||
rpupyps = self.client.conn.modules.pupyps
|
||||
data = obtain(rpupyps.interfaces())
|
||||
families = { int(x):y for x,y in obtain(rpupyps.families).iteritems() }
|
||||
|
||||
addrlen = max([len(x) for x in data['addrs']])+1
|
||||
|
||||
families = {
|
||||
v:k[3:] for k,v in socket.__dict__.iteritems() if k.startswith('AF_')
|
||||
}
|
||||
|
||||
families.update({-1: 'LINK'})
|
||||
|
||||
familylen = max([len(v)-3 for v in families.itervalues()])+1
|
||||
|
||||
for addr, addresses in data['addrs'].iteritems():
|
||||
|
|
|
@ -29,15 +29,10 @@ class NetStatModule(PupyModule):
|
|||
|
||||
def run(self, args):
|
||||
try:
|
||||
data = obtain(self.client.conn.modules.pupyps.connections())
|
||||
|
||||
families = {
|
||||
v:k for k,v in socket.__dict__.iteritems() if k.startswith('AF_')
|
||||
}
|
||||
|
||||
sock = {
|
||||
v:k for k,v in socket.__dict__.iteritems() if k.startswith('SOCK_')
|
||||
}
|
||||
rpupyps = self.client.conn.modules.pupyps
|
||||
data = obtain(rpupyps.connections())
|
||||
sock = { int(x):y for x,y in obtain(rpupyps.socktypes).iteritems() }
|
||||
families = { int(x):y for x,y in obtain(rpupyps.families).iteritems() }
|
||||
|
||||
limit = []
|
||||
|
||||
|
@ -55,8 +50,8 @@ class NetStatModule(PupyModule):
|
|||
continue
|
||||
|
||||
color = ""
|
||||
family = families[connection['family']][3:]
|
||||
stype = sock[connection['type']][5:]
|
||||
family = families[connection['family']]
|
||||
stype = sock[connection['type']]
|
||||
|
||||
if limit and not stype in limit:
|
||||
continue
|
||||
|
|
|
@ -6,6 +6,17 @@ import collections
|
|||
import sys
|
||||
import os
|
||||
import time
|
||||
import socket
|
||||
|
||||
families = {
|
||||
v:k[3:] for k,v in socket.__dict__.iteritems() if k.startswith('AF_')
|
||||
}
|
||||
families.update({-1: 'LINK'})
|
||||
|
||||
socktypes = {
|
||||
v:k[5:] for k,v in socket.__dict__.iteritems() if k.startswith('SOCK_')
|
||||
}
|
||||
|
||||
|
||||
def pstree():
|
||||
data = {}
|
||||
|
|
Loading…
Reference in New Issue