Click here to Skip to main content
15,890,438 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx26-Feb-15 1:23
professionalmanchanx26-Feb-15 1:23 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
Pete O'Hanlon26-Feb-15 2:06
mvePete O'Hanlon26-Feb-15 2:06 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx26-Feb-15 2:32
professionalmanchanx26-Feb-15 2:32 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
Pete O'Hanlon26-Feb-15 4:25
mvePete O'Hanlon26-Feb-15 4:25 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx26-Feb-15 4:56
professionalmanchanx26-Feb-15 4:56 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
jschell26-Feb-15 10:11
jschell26-Feb-15 10:11 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
Pete O'Hanlon26-Feb-15 10:16
mvePete O'Hanlon26-Feb-15 10:16 
Questionwriting an IDS in python Pin
orphansec21-Feb-15 15:09
orphansec21-Feb-15 15:09 
Hello all first time here
Python

Smile | :)

I am trying to increase my cyber sec knowledge by creating a small IDS. I was hoping someone could review the code and give me some feed back and maybe point me in the right direction. Currently I am needing intrusion sig's for filters.txt if anyone knows a database of some sort. I also am not too sure where to go next. My current thought is to just check for in/out bin/sh, if bin/sh were to come across the network tap then disconnect and block all future connection attemtps.

Please note that this is basically running Pseudo code.
I am well aware of the pythonic programming, for now I am just trying ideas

Any and all advice would be awesome
Thanks

Python
import pcap,dpkt
import socket
import os
 
def capture():
    dev= pcap.lookupdev()
    for ts, pkt in pcap.pcap(name=dev, snaplen=65535, promisc=True, immediate=False):
        eth = dpkt.ethernet.Ethernet(pkt)
        if eth.type!=2048: #! if ipv6
            ip = eth.data
            typepack = eth.type
            try:
                dst_ip_6= socket.inet_ntop(socket.AF_INET6, ip.dst )  #! Dont judge my huge exception block, it will be fixed after testing
            except AttributeError:
                continue
        else:
            ip = eth.data
            tcp = ip.data
            typepack = eth.type
            try:
                src_ip = socket.inet_ntoa(ip.src)
                dst_ip = socket.inet_ntoa(ip.dst)
                if dst_ip == '192.168.1.2':
                    with open('//usr//home//mrfree//Desktop//Scripts//ipLog.txt','a') as log:
                        log.write('Session:%s:%s,%s\n'%(src_ip,tcp.dport,ts))
                        print('Session:%s:%s,%s\n'%(src_ip,tcp.dport,ts))
                        if tcp.dport < 1028:
                            log.write('Out of bounds connection attempt, Blocking %s \n'%(src_ip))
                            print('Out of bounds connection attempt, Blocking %s \n'%(src_ip))
                    with open('//usr//home//mrfree//Desktop//Scripts//filters.txt','r') as filters:
                        filters = filters.read()
                        if filters in tcp.data:
                                  log.write('Attempted Shell connection, Blocking %s \n'%(src_ip))
                                  subprocess.call('pfctl -k {0}'.format(src_ip))
                                  print('Attempted Shell connection, Blocking %s \n'%(src_ip))
                           
            except AttributeError,TypeError:
                continue
 
if __name__ == "__main__":
    capture()

AnswerRe: writing an IDS in python Pin
jschell23-Feb-15 10:15
jschell23-Feb-15 10:15 
GeneralRe: writing an IDS in python Pin
orphansec23-Feb-15 11:28
orphansec23-Feb-15 11:28 
GeneralRe: writing an IDS in python Pin
jschell26-Feb-15 9:37
jschell26-Feb-15 9:37 
AnswerRe: writing an IDS in python Pin
Richard MacCutchan23-Feb-15 21:39
mveRichard MacCutchan23-Feb-15 21:39 
Questionthe "right place" for data-binding in Model-View paradigms (MVC, MVP, MVVM) ? Pin
BillWoodruff16-Feb-15 1:24
professionalBillWoodruff16-Feb-15 1:24 
AnswerRe: the "right place" for data-binding in Model-View paradigms (MVC, MVP, MVVM) ? Pin
manchanx18-Feb-15 2:53
professionalmanchanx18-Feb-15 2:53 
GeneralRe: the "right place" for data-binding in Model-View paradigms (MVC, MVP, MVVM) ? Pin
BillWoodruff20-Feb-15 12:40
professionalBillWoodruff20-Feb-15 12:40 
AnswerRe: the "right place" for data-binding in Model-View paradigms (MVC, MVP, MVVM) ? Pin
Mycroft Holmes23-Feb-15 13:36
professionalMycroft Holmes23-Feb-15 13:36 
QuestionLooking for the best way to setting user Profile Pin
yetrus13-Feb-15 5:48
yetrus13-Feb-15 5:48 
AnswerRe: Looking for the best way to setting user Profile Pin
BillWoodruff15-Feb-15 22:35
professionalBillWoodruff15-Feb-15 22:35 
Questiongeneral advice on starting to work with DB programming ? Pin
BillWoodruff11-Feb-15 1:11
professionalBillWoodruff11-Feb-15 1:11 
AnswerRe: general advice on starting to work with DB programming ? Pin
cjb11011-Feb-15 6:59
cjb11011-Feb-15 6:59 
GeneralRe: general advice on starting to work with DB programming ? Pin
BillWoodruff14-Feb-15 11:26
professionalBillWoodruff14-Feb-15 11:26 
AnswerRe: general advice on starting to work with DB programming ? Pin
jschell12-Feb-15 11:17
jschell12-Feb-15 11:17 
GeneralRe: general advice on starting to work with DB programming ? Pin
BillWoodruff14-Feb-15 11:27
professionalBillWoodruff14-Feb-15 11:27 
GeneralRe: general advice on starting to work with DB programming ? Pin
jschell20-Feb-15 13:36
jschell20-Feb-15 13:36 
AnswerRe: general advice on starting to work with DB programming ? Pin
manchanx12-Feb-15 13:19
professionalmanchanx12-Feb-15 13:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.