#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <time.h>
#include <rpc/types.h>
#include "bounds.h"
#include "decode.h"
#include "event.h"
#include "debug.h"
#include "util.h"
#include "plugbase.h"
#include "parser.h"
#include "mstring.h"
#include "checksum.h"
#include "log.h"
#include "generators.h"
#include "detect.h"
#include "perf.h"
#include "timersub.h"
#include "ubi_SplayTree.h"
#include "snort.h"
#include "stream.h"
#include "spp_stream4.h"
#include "snort_packet_header.h"
#include "event_queue.h"
#include "inline.h"
#include "sfghash.h"
#include "snort_stream4_session.h"
Go to the source code of this file.
|
Definition at line 159 of file spp_stream4.c. Referenced by TcpAction(), TcpActionAsync(), and UpdateState2(). |
|
Definition at line 158 of file spp_stream4.c. Referenced by TcpAction(), TcpActionAsync(), and UpdateState2(). |
|
Definition at line 163 of file spp_stream4.c. Referenced by TcpAction(), and TcpActionAsync(). |
|
Definition at line 162 of file spp_stream4.c. Referenced by TcpAction(), TcpActionAsync(), UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 160 of file spp_stream4.c. Referenced by TcpAction(), TcpActionAsync(), and UpdateState2(). |
|
Definition at line 157 of file spp_stream4.c. Referenced by TcpAction(), TcpActionAsync(), UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 156 of file spp_stream4.c. Referenced by ReassembleStream4(), TcpAction(), TcpActionAsync(), UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 155 of file spp_stream4.c. Referenced by ReassembleStream4(), TcpAction(), TcpActionAsync(), UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 164 of file spp_stream4.c. Referenced by TcpAction(), and TcpActionAsync(). |
|
Definition at line 154 of file spp_stream4.c. Referenced by TcpAction(), TcpActionAsync(), and UpdateStateAsync(). |
|
Definition at line 161 of file spp_stream4.c. Referenced by TcpAction(), TcpActionAsync(), and UpdateState2(). |
|
Definition at line 203 of file spp_stream4.c. Referenced by UpdateState2(). |
|
Definition at line 141 of file spp_stream4.c. Referenced by UpdateState2(). |
|
Definition at line 136 of file spp_stream4.c. Referenced by UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 144 of file spp_stream4.c. |
|
Definition at line 175 of file spp_stream4.c. |
|
Definition at line 140 of file spp_stream4.c. Referenced by CreateNewSession(), parse_one_v1(), ReassembleStream4(), StoreStreamPkt(), UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 241 of file spp_stream4.c. Referenced by CreateNewSession(), parse_one_v1(), and Stream4InitReassembler(). |
|
Definition at line 143 of file spp_stream4.c. Referenced by UpdateState2(). |
|
Definition at line 145 of file spp_stream4.c. Referenced by UpdateState2(). |
|
Definition at line 246 of file spp_stream4.c. Referenced by ParseStream4Args(), and Stream4InitReassembler(). |
|
Definition at line 247 of file spp_stream4.c. Referenced by Stream4InitReassembler(). |
|
Definition at line 245 of file spp_stream4.c. Referenced by Stream4InitReassembler(). |
|
Definition at line 167 of file spp_stream4.c. Referenced by GetDirection(), StoreStreamPkt(), TcpAction(), TcpActionAsync(), UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 166 of file spp_stream4.c. Referenced by AlertFlushStream(), CheckRst(), GetDirection(), ReassembleStream4(), SetFinSent(), TcpAction(), TcpActionAsync(), UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 82 of file spp_stream4.c. |
|
Definition at line 142 of file spp_stream4.c. Referenced by UpdateState2(). |
|
Definition at line 137 of file spp_stream4.c. Referenced by CreateNewSession(), and UpdateState2(). |
|
Definition at line 193 of file spp_stream4.c. Referenced by BuildPacket(), FlushStream(), ReassembleStream4(), TcpAction(), TraverseFunc(), and WithinSessionLimits(). |
|
Definition at line 236 of file spp_stream4.c. |
|
Definition at line 235 of file spp_stream4.c. |
|
Definition at line 186 of file spp_stream4.c. Referenced by StoreStreamPkt(), and Stream4InitReassembler(). |
|
Definition at line 187 of file spp_stream4.c. Referenced by BuildPacket(), LogStream(), and Stream4InitReassembler(). |
|
Definition at line 149 of file spp_stream4.c. Referenced by CreateNewSession(). |
|
Definition at line 150 of file spp_stream4.c. |
|
Definition at line 151 of file spp_stream4.c. |
|
Definition at line 152 of file spp_stream4.c. |
|
Definition at line 202 of file spp_stream4.c. Referenced by UpdateState2(). |
|
Definition at line 184 of file spp_stream4.c. Referenced by AlertFlushStream(), FlushDeletedStream(), ReassembleStream4(), TcpAction(), and TcpActionAsync(). |
|
Definition at line 231 of file spp_stream4.c. |
|
Definition at line 232 of file spp_stream4.c. |
|
Definition at line 233 of file spp_stream4.c. |
|
Definition at line 169 of file spp_stream4.c. Referenced by ParseStream4Args(). |
|
Definition at line 183 of file spp_stream4.c. Referenced by BuildPacket(), TcpAction(), and TcpActionAsync(). |
|
Definition at line 205 of file spp_stream4.c. |
|
Definition at line 226 of file spp_stream4.c. |
|
Definition at line 225 of file spp_stream4.c. |
|
Definition at line 200 of file spp_stream4.c. Referenced by CheckRst(), and TraverseFunc(). |
|
Definition at line 199 of file spp_stream4.c. Referenced by EvalStateQueue(), SegmentCleanTraverse(), and TraverseFunc(). |
|
Definition at line 198 of file spp_stream4.c. Referenced by TraverseFunc(). |
|
Definition at line 197 of file spp_stream4.c. Referenced by TraverseFunc(). |
|
Definition at line 196 of file spp_stream4.c. Referenced by CheckRst(), TcpAction(), and TraverseFunc(). |
|
Definition at line 221 of file spp_stream4.c. |
|
Definition at line 179 of file spp_stream4.c. Referenced by DeleteSession(), ParseStream4Args(), Stream4CleanExitFunction(), and Stream4RestartFunction(). |
|
Definition at line 177 of file spp_stream4.c. Referenced by DeleteSession(), and ParseStream4Args(). |
|
Definition at line 178 of file spp_stream4.c. Referenced by DeleteSession(), and ParseStream4Args(). |
|
Definition at line 181 of file spp_stream4.c. Referenced by OpenStatsFile(). |
|
Definition at line 173 of file spp_stream4.c. Referenced by ParseStream4Args(). |
|
Definition at line 172 of file spp_stream4.c. Referenced by ParseStream4Args(). |
|
Definition at line 242 of file spp_stream4.c. Referenced by ParseStream4Args(). |
|
Definition at line 243 of file spp_stream4.c. Referenced by ParseStream4Args(). |
|
Definition at line 171 of file spp_stream4.c. Referenced by ParseStream4Args(), and Stream4Init(). |
|
Definition at line 170 of file spp_stream4.c. Referenced by ParseStream4Args(), and Stream4Init(). |
|
Definition at line 174 of file spp_stream4.c. Referenced by ParseStream4Args(). |
|
Definition at line 229 of file spp_stream4.c. |
|
Definition at line 228 of file spp_stream4.c. |
|
Definition at line 138 of file spp_stream4.c. Referenced by CreateNewSession(), UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 139 of file spp_stream4.c. Referenced by CreateNewSession(), UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 146 of file spp_stream4.c. Referenced by UpdateState2(). |
|
Definition at line 190 of file spp_stream4.c. |
|
|
|
|
|
|
|
|
|
Definition at line 355 of file spp_stream4.c. |
|
|
|
|
|
|
|
|
|
|
|
Flush the side of the TCP stream that just caused an alert. This function is exported for the detection engine. This routine takes a packet, logs out the stream packets ( so that we have original payloads around ), and then updates the stream tracking sequence numbers so that
Definition at line 5624 of file spp_stream4.c. References _Stream::base_seq, _Stream::bytes_tracked, _Session::client, _Stream::data, DEBUG_STREAM, DEBUG_WRAP, DeleteSession(), DeleteSpd(), _Packet::dsize, _Stream4Data::enforce_state, _Stream4Data::flush_on_alert, FlushStream(), FROM_SERVER, GetDirection(), _Stream::last_ack, NO_REVERSE, NotForStream4(), NULL, _Stream::overlap_pkts, _Packet::pkth, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, _Session::server, _Packet::ssnptr, _Packet::tcph, _TCPHdr::th_seq, and pcap_pkthdr::ts. Referenced by Preprocess(). |
|
|
Definition at line 6060 of file spp_stream4.c. References _Stream4Data::assemble_ports, _Stream4Data::emergency_ports, OPS_NORMAL, OPS_SELF_PRESERVATION, and _S4Emergency::status. |
|
Definition at line 4498 of file spp_stream4.c. References _Stream::base_seq, _Stream::bytes_sent, _Stream::bytes_tracked, _Session::client, _Stream::data, DEBUG_STREAM, DEBUG_WRAP, _Stream4Data::evasion_alerts, FROM_SERVER, GENERATOR_SPP_STREAM4, _Stream::ip, _Stream::last_ack, _Stream::next_seq, SEQ_EQ, SEQ_LT, _StreamPacketData::seq_num, _Session::server, SnortEventqAdd(), _Stream4Data::stateful_inspection_flag, STREAM4_EVASIVE_RST, STREAM4_EVASIVE_RST_STR, ubi_sptFind(), and _Stream::win_size. Referenced by UpdateState2(). |
|
Definition at line 3937 of file spp_stream4.c. References _Stream::base_seq, _Session::client, _Stream::data, DataCompareFunc(), DEBUG_STREAM, DEBUG_WRAP, _Packet::dp, ESTABLISHED, FCOUNT, _Session::flush_point, flush_points, GENERATOR_SPP_STREAM4, GetNewSession(), _Stream::ip, _IPHdr::ip_dst, _IPHdr::ip_src, _IPHdr::ip_tos, _Packet::iph, _Stream::isn, _Stream::last_ack, _Session::last_session_time, LISTEN, NMAP_FINGERPRINT_2S, NULL, _Packet::packet_flags, pc, PKT_ECN, _Packet::pkth, _Stream::port, _Stream4Data::ps_alerts, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, RootPtr, SafeAlloc(), _Session::server, _Session::session_flags, SnortEventqAdd(), _Packet::sp, SSNFLAG_ECN_CLIENT_QUERY, SSNFLAG_NMAP, SSNFLAG_SEEN_CLIENT, SSNFLAG_SEEN_SERVER, _Session::start_time, _Stream::state, stream4_memory_usage, STREAM4_STEALTH_ACTIVITY, STREAM4_STEALTH_ACTIVITY_STR, STREAM4_STEALTH_FIN_SCAN, STREAM4_STEALTH_FIN_SCAN_STR, STREAM4_STEALTH_FULL_XMAS, STREAM4_STEALTH_FULL_XMAS_STR, STREAM4_STEALTH_NMAP_XMAS_SCAN, STREAM4_STEALTH_NMAP_XMAS_SCAN_STR, STREAM4_STEALTH_NULL_SCAN, STREAM4_STEALTH_NULL_SCAN_STR, STREAM4_STEALTH_SAPU, STREAM4_STEALTH_SAPU_STR, STREAM4_STEALTH_SYN_FIN_SCAN, STREAM4_STEALTH_SYN_FIN_SCAN_STR, STREAM4_STEALTH_VECNA_SCAN, STREAM4_STEALTH_VECNA_SCAN_STR, SYN_RCVD, SYN_SENT, _PacketCount::tcp_streams, _Packet::tcph, TH_ACK, TH_FIN, _TCPHdr::th_flags, TH_PUSH, TH_RES1, TH_RES2, TH_RST, TH_SYN, TH_URG, _TCPHdr::th_win, pcap_pkthdr::ts, ubi_sptInsert(), ubi_trDUPKEY, ubi_trFALSE, ubi_trInitTree, and _Stream::win_size. Referenced by ReassembleStream4(). |
|
Definition at line 531 of file spp_stream4.c. References _StreamPacketData::seq_num. Referenced by CreateNewSession(), and parse_one_v1(). |
|
|
|
Definition at line 4670 of file spp_stream4.c. References KillSpd(), and ubi_trKillTree. Referenced by AlertFlushStream(), DropSession(), and FlushStream(). |
|
|
|
Definition at line 1554 of file spp_stream4.c. References _Stream4Data::asynchronous_link, _Stream4Data::cache_clean_percent, _Stream4Data::cache_clean_sessions, _Stream4Data::enforce_state, _Stream4Data::evasion_alerts, _Stream4Data::log_flushed_streams, LogMessage(), _Stream4Data::max_sessions, _Stream4Data::memcap, _Stream4Data::min_ttl, _Stream4Data::ms_inline_alerts, _Stream4Data::ps_alerts, _Stream4Data::server_inspect_limit, _Stream4Data::sp_period, _Stream4Data::sp_threshold, _Stream4Data::state_alerts, _Stream4Data::state_protection, _Stream4Data::stateful_inspection_flag, _Stream4Data::suspend_period, _Stream4Data::suspend_threshold, _Stream4Data::timeout, _Stream4Data::track_stats_flag, and _Stream4Data::ttl_limit. Referenced by ParseStream4Args(). |
|
Definition at line 4627 of file spp_stream4.c. References _Session::client, _Stream::data, DEBUG_STREAM, DEBUG_WRAP, DeleteSpd(), FlushDeletedStream(), NULL, _Session::preproc_data, _Session::preproc_free, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, _Session::server, stream4_memory_usage, and ubi_trRootPtr. Referenced by DeleteSession(). |
|
Evaluate queued state transitions for completion criteria
Definition at line 3465 of file spp_stream4.c. References DEBUG_STREAM_STATE, DEBUG_WRAP, _Stream::expected_flags, SEQ_GEQ, _Stream::state, _Stream::state_queue, _Stream::stq_chk_seq, and _Stream::trans_seq. Referenced by UpdateState2(). |
|
Definition at line 4601 of file spp_stream4.c. References _Stream::data, DEBUG_STREAM, DEBUG_WRAP, FlushStream(), NO_REVERSE, _StreamPacketData::pkt, _StreamPacketData::pkth, ubi_btRoot::root, RootPtr, ubi_trCount, and ubi_trLast. Referenced by DropSession(). |
|
Definition at line 5482 of file spp_stream4.c. References _Session::alert_count, _Stream::base_seq, BuildPacket(), _Stream::bytes_tracked, bzero, _Packet::data, _Stream::data, DEBUG_STREAM, DEBUG_WRAP, DeleteSpd(), _Packet::dsize, _SFBASE::iStreamFlushes, _Stream::last_ack, LogStream(), MAX_STREAM_SIZE, _Stream::overlap_pkts, Preprocess(), SegmentCleanTraverse(), _SFPERF::sfBase, sfPerf, _Packet::ssnptr, ubi_trCount, and _Stream4Data::zero_flushed_packets. Referenced by AlertFlushStream(), FlushDeletedStream(), TcpAction(), and TcpActionAsync(). |
|
Definition at line 4676 of file spp_stream4.c. References _Session::client, _Packet::dp, FROM_CLIENT, FROM_SERVER, _Stream::ip, _IPHdr::ip_dst, _IPHdr::ip_src, _Packet::iph, _Stream::port, _Session::server, _Session::session_flags, _Packet::sp, SSNFLAG_ESTABLISHED, _Packet::tcph, _TCPHdr::th_flags, TH_NORESERVED, and TH_SYN. Referenced by AlertFlushStream(), ReassembleStream4(), StoreStreamPkt(), UpdateState2(), and UpdateStateAsync(). |
|
Definition at line 4791 of file spp_stream4.c. References _Options::code, _Options::data, DEBUG_STREAM_STATE, DEBUG_WRAP, EXTRACT_32BITS, _Packet::tcp_option_count, _Packet::tcp_options, and TCPOPT_TIMESTAMP. Referenced by StoreStreamPkt(). |
|
Definition at line 6879 of file spp_stream4.c. References _Packet::data, _Packet::eh, _EtherHdr::ether_type, ETHERNET_HEADER_LEN, IP_HEADER_LEN, _IPHdr::ip_len, IP_MAXPACKET, _IPHdr::ip_proto, _IPHdr::ip_tos, _IPHdr::ip_ttl, _Packet::iph, _Packet::pkt, _Packet::pkth, SET_IP_HLEN, SET_IP_VER, SET_TCP_OFFSET, SPARC_TWIDDLE, TCP_HEADER_LEN, _Packet::tcph, TH_ACK, _TCPHdr::th_flags, and TH_PUSH. Referenced by LoadStateTable(). |
|
Definition at line 5773 of file spp_stream4.c. References _Packet::data, _Packet::eh, _EtherHdr::ether_type, ETHERNET_HEADER_LEN, IP_HEADER_LEN, _IPHdr::ip_len, IP_MAXPACKET, _IPHdr::ip_proto, _IPHdr::ip_tos, _IPHdr::ip_ttl, _Packet::iph, _Packet::pkt, _Packet::pkth, SET_IP_HLEN, SET_IP_VER, SET_TCP_OFFSET, SPARC_TWIDDLE, TCP_HEADER_LEN, _Packet::tcph, TH_ACK, _TCPHdr::th_flags, and TH_PUSH. Referenced by Stream4Init(). |
|
See if a sequence number is in range.
Definition at line 469 of file spp_stream4.c. References DEBUG_STREAM, and DEBUG_WRAP. Referenced by TraverseFunc(). |
|
Definition at line 558 of file spp_stream4.c. References _StreamPacketData::pkt_size, _StreamPacketData::pktOrig, and stream4_memory_usage. Referenced by DeleteSpd(). |
|
Definition at line 7037 of file spp_stream4.c. References DEBUG_STREAM, DEBUG_WRAP, errno, InitFakePkt(), LogMessage(), memset, NULL, parse_one_v1(), pc, and _PacketCount::tcp_streams. Referenced by Stream4InitReassembler(). |
|
Log out the Stream if possible only works with pcap currently
Definition at line 5751 of file spp_stream4.c. References _Stream::data, _progvars::log_bitmap, _Stream4Data::log_flushed_streams, LOG_TCPDUMP, LogTraverse(), METHOD_FAVOR_OLD, pv, _Stream4Data::reassy_method, ubi_trCount, ubi_trTraverse, and ubi_trTraverseReverse. Referenced by FlushStream(). |
|
Definition at line 1413 of file spp_stream4.c. References DirectLogTcpdump(), _StreamPacketData::pkt, and _StreamPacketData::pkth. Referenced by LogStream(). |
|
See if we can get ignore this packet The Emergency Status stuff is taken care of here.
Definition at line 2616 of file spp_stream4.c. References _progvars::assurance_mode, CSE_IP, CSE_TCP, _Packet::csum_flags, DEBUG_STREAM, DEBUG_WRAP, _S4Emergency::end_time, _S4Emergency::new_session_count, NULL, _S4Emergency::old_assurance_mode, _S4Emergency::old_reassemble_client, _S4Emergency::old_reassemble_server, _S4Emergency::old_reassembly_alerts, _S4Emergency::old_stateful_mode, OPS_NORMAL, OPS_SUSPEND, _Packet::packet_flags, PKT_REBUILT_STREAM, PKT_STREAM_UNEST_UNI, _Packet::pkth, PP_STREAM4, _Packet::preprocessors, pv, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, _Stream4Data::reassembly_alerts, _progvars::stateful, _S4Emergency::status, _Packet::tcph, and pcap_pkthdr::ts. Referenced by AlertFlushStream(), and ReassembleStream4(). |
|
Definition at line 6083 of file spp_stream4.c. References bzero, errno, FatalError(), _StatsLog::filename, _StatsLog::fp, _progvars::log_dir, _StatsLogHeader::magic, NULL, pv, snprintf, STATS_MAGIC, STD_BUF, _StatsLogHeader::timezone, _StatsLogHeader::version_major, and _StatsLogHeader::version_minor. Referenced by ParseStream4Args(). |
|
Definition at line 545 of file spp_stream4.c. References _OverlapData::seq_hi, _OverlapData::seq_low, and _StreamPacketData::seq_num. Referenced by StoreStreamPkt(). |
|
Definition at line 6917 of file spp_stream4.c. References _Stream::base_seq, _Stream::bytes_sent, parse_v1_file::c_base_seq, parse_v1_file::c_bytes_sent, parse_v1_file::c_ip, parse_v1_file::c_isn, parse_v1_file::c_last_ack, parse_v1_file::c_pkts_sent, parse_v1_file::c_port, parse_v1_file::c_win_size, _Session::client, _Stream::data, DataCompareFunc(), DEBUG_STREAM, DEBUG_WRAP, ESTABLISHED, FCOUNT, _Session::flush_point, flush_points, GetNewSession(), _Stream::ip, _IPHdr::ip_dst, _IPHdr::ip_src, _Packet::iph, _Stream::isn, _Stream::last_ack, _Session::last_session_time, parse_v1_file::last_session_time, NULL, _Packet::pkth, _Stream::pkts_sent, _Stream::port, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, parse_v1_file::s_base_seq, parse_v1_file::s_bytes_sent, parse_v1_file::s_ip, parse_v1_file::s_isn, parse_v1_file::s_last_ack, parse_v1_file::s_pkts_sent, parse_v1_file::s_port, parse_v1_file::s_win_size, _Session::server, _Session::session_flags, parse_v1_file::session_flags, SSNFLAG_ESTABLISHED, SSNFLAG_MIDSTREAM, SSNFLAG_SEEN_CLIENT, SSNFLAG_SEEN_SERVER, _Session::start_time, parse_v1_file::start_time, _Stream::state, parse_v1_file::statestr, _Packet::tcph, _TCPHdr::th_dport, _TCPHdr::th_sport, _Stream4Data::timeout, pcap_pkthdr::ts, ubi_trDUPKEY, ubi_trInitTree, and _Stream::win_size. Referenced by LoadStateTable(). |
|
Definition at line 1624 of file spp_stream4.c. References _Stream4Data::asynchronous_link, _Stream4Data::cache_clean_percent, _Stream4Data::cache_clean_sessions, DEBUG_INIT, DEBUG_WRAP, DisplayStream4Config(), _Stream4Data::enforce_state, ErrorMessage(), _Stream4Data::evasion_alerts, FatalError(), file_line, file_name, _StatsLog::filename, _Stream4Data::flush_base, _Stream4Data::flush_behavior, FLUSH_BEHAVIOR_DEFAULT, _Stream4Data::flush_data_diff_size, _Stream4Data::flush_on_alert, _Stream4Data::flush_range, _Stream4Data::flush_seed, index, _Stream4Data::log_flushed_streams, LogMessage(), _Stream4Data::max_sessions, _Stream4Data::memcap, memset, _Stream4Data::min_ttl, _Stream4Data::ms_inline_alerts, mSplit(), mSplitFree(), NULL, OpenStatsFile(), _Stream4Data::overlap_limit, _Stream4Data::path_mtu, PRUNE_QUANTA, _Stream4Data::ps_alerts, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, SELF_PRES_PERIOD, SELF_PRES_THRESHOLD, _Stream4Data::server_inspect_limit, _Stream4Data::sp_period, _Stream4Data::sp_threshold, _Stream4Data::state_alerts, _Stream4Data::state_protection, _Stream4Data::stateful_inspection_flag, STATS_BINARY, STATS_HUMAN_READABLE, STATS_MACHINE_READABLE, strcasecmp, STREAM4_CACHE_PERCENT, STREAM4_CLEANUP, STREAM4_FLUSH_BASE, STREAM4_FLUSH_RANGE, STREAM4_MAX_SESSIONS, STREAM4_MEMORY_CAP, STREAM4_TTL_LIMIT, strlcpy, strncasecmp, SUSPEND_PERIOD, _Stream4Data::suspend_period, SUSPEND_THRESHOLD, _Stream4Data::suspend_threshold, _Stream4Data::timeout, _Stream4Data::track_stats_flag, _Stream4Data::ttl_limit, and _Stream4Data::zero_flushed_packets. Referenced by Stream4Init(). |
|
|
|
|
|
Referenced by TemplateInit(). |
|
Definition at line 171 of file spp_template.c. Referenced by TemplateInit(). |
|
Referenced by TemplateInit(). |
|
Definition at line 496 of file snort_stream4_session.c. References DEBUG_STREAM, DEBUG_WRAP, RootPtr, sfxhash_count(), stream4_memory_usage, and ubi_trCount. Referenced by ReassembleStream4(). |
|
Prune The state machine if we need to Also updates all variables related to pruning that only have to happen at initialization For want of packet time at plugin initialization. (It only happens once.) It wood be nice to get the first packet and do a little extra before getting into the main snort processing loop. -- cpw
Definition at line 2793 of file spp_stream4.c. References DEBUG_STREAM, DEBUG_WRAP, GetSessionCount(), _SFBASE::iStreamTimeouts, _Stream4Data::last_prune_time, NULL, _Packet::pkth, PruneSessionCache(), safe_alloc_faults, _SFPERF::sfBase, sfPerf, stream4_memory_usage, _Stream4Data::timeout, and pcap_pkthdr::ts. Referenced by ReassembleStream4(). |
|
Definition at line 508 of file snort_stream4_session.c. References _Stream4Data::cache_clean_percent, _Stream4Data::cache_clean_sessions, CleanHashTable(), DEBUG_STREAM, DEBUG_WRAP, DeleteSession(), _Session::last_session_time, _Stream4Data::memcap, NULL, RootPtr, Rotate(), stream4_memory_usage, _Stream4Data::timeout, ubi_btLast(), ubi_btLeafNode(), ubi_btPrev(), and ubi_trCount. Referenced by PruneCheck(), and SafeAlloc(). |
|
Queues a state transition for UpdateState2
Definition at line 3442 of file spp_stream4.c. References DEBUG_STREAM_STATE, DEBUG_WRAP, _Stream::expected_flags, _Stream::state_queue, _Stream::stq_chk_seq, and _Stream::trans_seq. Referenced by UpdateState2(). |
|
Definition at line 2833 of file spp_stream4.c. References ACTION_FLUSH_CLIENT_STREAM, ACTION_FLUSH_SERVER_STREAM, AddStreamSession(), _progvars::assurance_mode, ASSURE_ALL, _Stream4Data::asynchronous_link, _Stream::base_seq, BuildPacket(), _Stream::bytes_inspected, _Stream::bytes_sent, _Packet::bytes_to_inspect, _Stream::bytes_tracked, CheckPorts(), _Session::client, CreateNewSession(), CreateTCPFlagString(), _Packet::data, _Stream::data, DEBUG_STREAM, DEBUG_STREAM_STATE, DEBUG_WRAP, DisableDetect(), do_detect, _Packet::dp, _Packet::dsize, DumpStateTable(), _S4Emergency::end_time, _Stream4Data::enforce_state, ESTABLISHED, _Stream4Data::evasion_alerts, FROM_SERVER, GENERATOR_SPP_STREAM4, GetDirection(), GetSession(), InlineDrop(), InlineMode(), _IPHdr::ip_dst, _IPHdr::ip_src, _Packet::iph, _Stream::last_ack, _Session::last_session_time, MAX_STREAM_SIZE, _S4Emergency::new_session_count, NO_REVERSE, NotForStream4(), NULL, _S4Emergency::old_assurance_mode, _S4Emergency::old_reassemble_client, _S4Emergency::old_reassemble_server, _S4Emergency::old_reassembly_alerts, _S4Emergency::old_stateful_mode, opdsize, OPS_NORMAL, OPS_SELF_PRESERVATION, OPS_SUSPEND, _Stream4Data::overlap_limit, _Stream::overlap_pkts, _Packet::packet_flags, pc, PKT_FROM_CLIENT, PKT_FROM_SERVER, PKT_STREAM_EST, PKT_STREAM_UNEST_BI, PKT_STREAM_UNEST_UNI, _Packet::pkth, _Stream::pkts_sent, _Packet::preprocessors, PrintSessionCache(), PruneCheck(), pv, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, _Stream4Data::reassembly_alerts, _Session::server, _Stream4Data::server_inspect_limit, _Session::session_flags, _SFPERF::sfBase, sfPerf, SnortEventqAdd(), _Packet::sp, _Stream4Data::sp_period, _Stream4Data::sp_threshold, SSNFLAG_ESTABLISHED, SSNFLAG_MIDSTREAM, SSNFLAG_SEEN_CLIENT, SSNFLAG_SEEN_SERVER, _Packet::ssnptr, _Stream::state, _Stream4Data::state_protection, _progvars::stateful, _Stream4Data::stateful_inspection_flag, _S4Emergency::status, StoreStreamPkt(), STREAM4_EMERGENCY, STREAM4_EMERGENCY_STR, STREAM4_OVERLAP_LIMIT, STREAM4_OVERLAP_LIMIT_STR, STREAM4_SUSPEND, STREAM4_SUSPEND_STR, _Packet::streamptr, StreamSegmentSub(), _Stream4Data::suspend_period, _Stream4Data::suspend_threshold, _PacketCount::tcp_stream_pkts, TcpAction(), TcpActionAsync(), _Packet::tcph, TH_ACK, _TCPHdr::th_ack, _TCPHdr::th_dport, TH_FIN, _TCPHdr::th_flags, TH_NORESERVED, TH_PUSH, TH_RST, _TCPHdr::th_seq, _TCPHdr::th_sport, TH_SYN, _TCPHdr::th_win, pcap_pkthdr::ts, ubi_trCount, UpdateState2(), UpdateStateAsync(), and _Stream::win_size. Referenced by Stream4Init(). |
|
Check to if retransmissions are occuring too quickly
Definition at line 516 of file spp_stream4.c. References TIMERSUB. Referenced by StoreStreamPkt(). |
|
Definition at line 1422 of file spp_stream4.c. References FatalError(), _SFBASE::iStreamFaults, _Stream4Data::memcap, NULL, pc, PruneSessionCache(), _SFPERF::sfBase, sfPerf, _PacketCount::str_mem_faults, and stream4_memory_usage. Referenced by CreateNewSession(), StoreStreamPkt(), and Stream4Init(). |
|
Definition at line 1368 of file spp_stream4.c. References _StreamPacketData::chuck, _Stream::data, DEBUG_STREAM, _Stream::last_ack, NULL, _StreamPacketData::payload_size, _StreamPacketData::pkt_size, _StreamPacketData::pktOrig, SEG_FULL, SEQ_GEQ, _StreamPacketData::seq_num, stream4_memory_usage, StreamSegmentSub(), ubi_btFirst(), ubi_btNext(), and ubi_sptRemove(). Referenced by FlushStream(). |
|
Set that this side of the session has sent a fin. This overloads the next_seq variable to also be used to tell how far forward we can acknowledge data.
Definition at line 2584 of file spp_stream4.c. References _Session::client, DEBUG_STREAM, DEBUG_WRAP, FROM_SERVER, _Stream::next_seq, _Session::server, _Session::session_flags, SSNFLAG_CLIENT_FIN, SSNFLAG_SERVER_FIN, _Packet::tcph, and _TCPHdr::th_seq. Referenced by UpdateState2(). |
|
Definition at line 1471 of file spp_stream4.c. References DEBUG_STREAM, DEBUG_WRAP, RegisterPreprocessor(), Stream4Init(), and Stream4InitReassembler(). Referenced by InitPreprocessors(). |
|
Definition at line 4834 of file spp_stream4.c. References pcap_pkthdr::caplen, _StreamPacketData::cksum, _Stream::data, _Packet::data, DEBUG_STREAM, DEBUG_WRAP, _Packet::dsize, ESTABLISHED, _Stream4Data::evasion_alerts, FROM_CLIENT, GENERATOR_SPP_STREAM4, GetDirection(), GetTcpTimestamp(), InlineDrop(), _IPHdr::ip_ttl, _Packet::iph, _Stream::last_ack, LogMessage(), memcpy, METHOD_FAVOR_NEW, NULL, _Stream::overlap_pkts, OverlapCompareFunc(), _Packet::packet_flags, _StreamPacketData::payload, _StreamPacketData::payload_size, _Packet::pkt, _StreamPacketData::pkt, _StreamPacketData::pkt_size, PKT_STREAM_INSERT, _StreamPacketData::pkth, _Packet::pkth, _StreamPacketData::pktOrig, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, _Stream4Data::reassy_method, RetransTooFast(), SafeAlloc(), _OverlapData::seq_hi, _OverlapData::seq_low, _StreamPacketData::seq_num, SnortEventqAdd(), SPARC_TWIDDLE, SSNFLAG_ESTABLISHED, _Stream::state, _Stream4Data::state_alerts, STREAM4_EVASIVE_RETRANS, STREAM4_EVASIVE_RETRANS_DATA, STREAM4_EVASIVE_RETRANS_DATA_STR, STREAM4_EVASIVE_RETRANS_DATASPLIT, STREAM4_EVASIVE_RETRANS_DATASPLIT_STR, STREAM4_EVASIVE_RETRANS_STR, STREAM4_FORWARD_OVERLAP, STREAM4_FORWARD_OVERLAP_STR, stream4_memory_usage, STREAM4_TCP_NO_ACK, STREAM4_TCP_NO_ACK_STR, STREAM4_TTL_EVASION, STREAM4_TTL_EVASION_STR, STREAM4_WINDOW_VIOLATION, STREAM4_WINDOW_VIOLATION_STR, STREAM4_ZERO_TIMESTAMP, STREAM4_ZERO_TIMESTAMP_STR, StreamSegmentSub(), _Packet::tcph, TH_ACK, _TCPHdr::th_flags, _TCPHdr::th_sum, TH_SYN, _SnortPktHeader::ts, pcap_pkthdr::ts, _Stream4Data::ttl_limit, ubi_sptFind(), ubi_sptInsert(), ubi_sptRemove(), ubi_trCheck, ubi_trFALSE, _Stream::win_size, and WithinSessionLimits(). Referenced by ReassembleStream4(). |
|
Definition at line 4759 of file spp_stream4.c. References _StatsLog::fp, NULL, session_log, STATS_BINARY, and _Stream4Data::track_stats_flag. Referenced by Stream4Init(). |
|
Definition at line 1492 of file spp_stream4.c. References AddFuncToCleanExitList(), AddFuncToPreprocList(), AddFuncToRestartList(), AddFuncToShutdownList(), _runtime_config::capabilities, DEBUG_STREAM, DEBUG_WRAP, _S4Emergency::end_time, errno, FatalError(), InitSessionCache(), InitStream4Pkt(), _Stream4Data::last_prune_time, _progvars::log_dir, logfile, _Stream4Data::max_sessions, _Stream4Data::memcap, _S4Emergency::new_session_count, NULL, OPS_NORMAL, ParseStream4Args(), pv, ReassembleStream4(), RootPtr, SafeAlloc(), SELF_PRES_PERIOD, SELF_PRES_THRESHOLD, session_log, snort_runtime, snprintf, _Stream4Data::sp_period, _Stream4Data::sp_threshold, _Stream4Data::state_protection, _progvars::stateful, _Capabilities::stateful_inspection, _S4Emergency::status, STD_BUF, _Stream4Data::stream4_active, STREAM4_MAX_SESSIONS, STREAM4_MEMORY_CAP, Stream4CleanExitFunction(), Stream4RestartFunction(), Stream4ShutdownFunction(), SUSPEND_PERIOD, _Stream4Data::suspend_period, SUSPEND_THRESHOLD, _Stream4Data::suspend_threshold, _Stream4Data::track_stats_flag, and ubi_trInitTree. Referenced by SetupStream4(). |
|
Definition at line 2060 of file spp_stream4.c. References _Stream4Data::assemble_ports, DEBUG_STREAM, DEBUG_WRAP, _Stream4Data::emergency_ports, FatalError(), FCOUNT, file_line, file_name, _Stream4Data::flush_base, _Stream4Data::flush_behavior, FLUSH_BEHAVIOR_DEFAULT, FLUSH_BEHAVIOR_LARGE, FLUSH_BEHAVIOR_RANDOM, _Stream4Data::flush_data_diff_size, _Stream4Data::flush_on_alert, flush_points, _Stream4Data::flush_range, _Stream4Data::flush_seed, gettimeofday(), index, LoadStateTable(), LogMessage(), memset, METHOD_FAVOR_NEW, METHOD_FAVOR_OLD, mSplit(), mSplitFree(), new_flush_points, NULL, old_flush_points, _Stream4Data::overlap_limit, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, _Stream4Data::reassembly_alerts, _Stream4Data::reassy_method, sfsnprintfappend(), snprintf, STD_BUF, strcasecmp, _Stream4Data::stream4_active, strncasecmp, and _Stream4Data::zero_flushed_packets. Referenced by SetupStream4(). |
|
Definition at line 4772 of file spp_stream4.c. References DumpStateTable(), _StatsLog::fp, NULL, session_log, STATS_BINARY, and _Stream4Data::track_stats_flag. Referenced by Stream4Init(). |
|
Definition at line 4748 of file spp_stream4.c. References DumpStateTable(), and PurgeSessionCache(). Referenced by Stream4Init(). |
|
Add to the byte counters for the stream session
Definition at line 2716 of file spp_stream4.c. References _Stream::bytes_sent, _Stream::bytes_tracked, DEBUG_STREAM, DEBUG_WRAP, _Stream::pkts_sent, and stream4_memory_usage. Referenced by UpdateState2(), and UpdateStateAsync(). |
|
Subtract from the byte counters for the stream session
Definition at line 2688 of file spp_stream4.c. References _Stream::bytes_tracked, DEBUG_STREAM, and stream4_memory_usage. Referenced by ReassembleStream4(), SegmentCleanTraverse(), StoreStreamPkt(), and WithinSessionLimits(). |
|
Definition at line 6145 of file spp_stream4.c. References ACTION_ACK_CLIENT_DATA, ACTION_ACK_SERVER_DATA, ACTION_ALERT_NMAP_FINGERPRINT, ACTION_COMPLETE_TWH, ACTION_DATA_ON_SYN, ACTION_DROP_SESSION, ACTION_FLUSH_CLIENT_STREAM, ACTION_FLUSH_SERVER_STREAM, ACTION_INC_PORT, ACTION_NOTHING, ACTION_SET_SERVER_ISN, _Stream::base_seq, _Stream::bytes_tracked, _Session::client, _Stream::data, DEBUG_STREAM, DEBUG_WRAP, DeleteSession(), _Packet::dp, _Stream4Data::evasion_alerts, _Session::flush_point, FlushStream(), FROM_CLIENT, FROM_SERVER, GENERATOR_SPP_STREAM4, _IPHdr::ip_dst, _IPHdr::ip_src, _Packet::iph, _Stream::isn, _Stream::last_ack, MAX_STREAM_SIZE, _Stream::next_seq, NO_REVERSE, NULL, _Packet::packet_flags, PKT_STREAM_EST, PKT_STREAM_TWH, _Packet::pkth, _Stream::port, _Stream4Data::ps_alerts, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, REVERSE, SEQ_LT, _Session::server, _Session::session_flags, SnortEventqAdd(), _Packet::sp, SSNFLAG_CLIENT_FIN, SSNFLAG_ESTABLISHED, SSNFLAG_MIDSTREAM, _Packet::ssnptr, STREAM4_DATA_ON_SYN, STREAM4_DATA_ON_SYN_STR, STREAM4_STEALTH_NMAP_FINGERPRINT, STREAM4_STEALTH_NMAP_FINGERPRINT_STR, _Packet::tcph, _TCPHdr::th_flags, TH_RST, TH_SYN, _TCPHdr::th_win, pcap_pkthdr::ts, ubi_trCount, and _Stream::win_size. Referenced by ReassembleStream4(). |
|
Definition at line 6579 of file spp_stream4.c. References ACTION_ACK_CLIENT_DATA, ACTION_ACK_SERVER_DATA, ACTION_ALERT_NMAP_FINGERPRINT, ACTION_COMPLETE_TWH, ACTION_DATA_ON_SYN, ACTION_DROP_SESSION, ACTION_FLUSH_CLIENT_STREAM, ACTION_FLUSH_SERVER_STREAM, ACTION_INC_PORT, ACTION_NOTHING, ACTION_SET_SERVER_ISN, _Stream::base_seq, _Session::client, _Stream::data, DEBUG_STREAM, DEBUG_WRAP, DeleteSession(), _Packet::dp, _Stream4Data::evasion_alerts, _Session::flush_point, FlushStream(), FROM_CLIENT, FROM_SERVER, GENERATOR_SPP_STREAM4, _IPHdr::ip_dst, _IPHdr::ip_src, _Packet::iph, _Stream::isn, _Stream::last_ack, _Stream::next_seq, NO_REVERSE, NULL, _Packet::packet_flags, PKT_STREAM_TWH, _Packet::pkth, _Stream::port, _Stream4Data::ps_alerts, _Stream4Data::reassemble_client, _Stream4Data::reassemble_server, REVERSE, _Session::server, _Session::session_flags, SnortEventqAdd(), _Packet::sp, SSNFLAG_CLIENT_FIN, _Packet::ssnptr, STREAM4_DATA_ON_SYN, STREAM4_DATA_ON_SYN_STR, STREAM4_STEALTH_NMAP_FINGERPRINT, STREAM4_STEALTH_NMAP_FINGERPRINT_STR, _Packet::tcph, _TCPHdr::th_flags, TH_RST, TH_SYN, _TCPHdr::th_win, pcap_pkthdr::ts, ubi_trCount, and _Stream::win_size. Referenced by ReassembleStream4(). |
|
Definition at line 572 of file spp_stream4.c. References _Stream::base_seq, _BuildData::buf, _StreamPacketData::chuck, _Packet::data, DEBUG_STREAM, DEBUG_WRAP, isBetween(), _Stream::last_ack, MAX_STREAM_SIZE, _Stream::next_seq, _StreamPacketData::payload, _StreamPacketData::payload_size, pc, _PacketCount::rebuilt_segs, SafeMemcpy(), SEG_FULL, SEG_PARTIAL, SEQ_EQ, SEQ_GEQ, SEQ_GT, SEQ_LEQ, SEQ_LT, _StreamPacketData::seq_num, _Stream4Data::stop_seq, _Stream4Data::stop_traverse, _BuildData::stream, and _BuildData::total_size. Referenced by BuildPacket(). |
|
|
|
Definition at line 3515 of file spp_stream4.c. References ACTION_ACK_CLIENT_DATA, ACTION_ACK_SERVER_DATA, ACTION_COMPLETE_TWH, ACTION_DATA_ON_SYN, ACTION_DROP_SESSION, ACTION_FLUSH_CLIENT_STREAM, ACTION_FLUSH_SERVER_STREAM, ACTION_SET_SERVER_ISN, CheckRst(), CHK_SEQ, _Session::client, CLOSE_WAIT, CLOSED, DEBUG_STREAM, DEBUG_STREAM_STATE, DEBUG_WRAP, _Packet::dsize, ESTABLISHED, EvalStateQueue(), FIN_WAIT_1, FIN_WAIT_2, FROM_CLIENT, FROM_SERVER, GetDirection(), LAST_ACK, LISTEN, NO_CHK_SEQ, NULL, QueueState(), _Session::server, _Session::session_flags, SetFinSent(), SSNFLAG_ECN_CLIENT_QUERY, SSNFLAG_ECN_SERVER_REPLY, SSNFLAG_SEEN_CLIENT, SSNFLAG_SEEN_SERVER, _Stream::state, StreamSegmentAdd(), SYN_RCVD, SYN_SENT, _Packet::tcph, TH_ACK, _TCPHdr::th_ack, TH_FIN, _TCPHdr::th_flags, TH_RES2, TH_RST, TH_SYN, _TCPHdr::th_win, TIME_WAIT, and _Stream::win_size. Referenced by ReassembleStream4(). |
|
Definition at line 3804 of file spp_stream4.c. References ACTION_COMPLETE_TWH, ACTION_DROP_SESSION, ACTION_FLUSH_CLIENT_STREAM, ACTION_FLUSH_SERVER_STREAM, ACTION_NOTHING, _Session::client, CLOSED, DEBUG_STREAM, DEBUG_WRAP, _Packet::dsize, ESTABLISHED, FROM_CLIENT, FROM_SERVER, GetDirection(), _Session::server, _Session::session_flags, SSNFLAG_ESTABLISHED, SSNFLAG_SEEN_CLIENT, SSNFLAG_SEEN_SERVER, _Stream::state, StreamSegmentAdd(), SYN_RCVD, SYN_SENT, _Packet::tcph, TH_ACK, TH_FIN, _TCPHdr::th_flags, TH_NORESERVED, TH_RST, and TH_SYN. Referenced by ReassembleStream4(). |
|
Make sure that we do not log
Definition at line 2751 of file spp_stream4.c. References _Stream::bytes_tracked, _Packet::dsize, MAX_STREAM_SIZE, SSNFLAG_MIDSTREAM, _Packet::ssnptr, and StreamSegmentSub(). Referenced by StoreStreamPkt(). |
|
Definition at line 6138 of file spp_stream4.c. References _StatsLog::fp. Referenced by DeleteSession(). |
|
Definition at line 98 of file detect.c. Referenced by DisableDetect(), Frag3Defrag(), Preprocess(), ReassembleStream4(), and SnortHttpInspect(). |
|
|
|
external globals from rules.c |
|
Definition at line 385 of file spp_stream4.c. Referenced by CreateNewSession(), parse_one_v1(), and Stream4InitReassembler(). |
|
Initial value: { 1280, 2176, 1895, 1303, 2402, 2211, 1340, 1298, 2500, 2320, 1413, 1313, 1444, 1776, 2015, 1305, 2130, 1190, 1377, 1492, 1380, 2100, 1373, 1029, 750, 444, 874, 551, 401, 390, 1801, 1898, 2260, 2601, 642, 485, 619, 929, 794, 340, 445, 1911, 497, 883, 399, 2201, 2431, 2145, 433, 735, 543, 658, 1174, 2042, 1200, 1800, 2015, 1142, 1530, 487, 673, 899, 743, 2101 } Definition at line 259 of file spp_stream4.c. Referenced by Stream4InitReassembler(). |
|
Initial value: { 128, 217, 189, 130, 240, 221, 134, 129, 250, 232, 141, 131, 144, 177, 201, 130, 230, 190, 177, 142, 130, 200, 173, 129, 250, 244, 174, 151, 201, 190, 180, 198, 220, 201, 142, 185, 219, 129, 194, 140, 145, 191, 197, 183, 199, 220, 231, 245, 233, 135, 143, 158, 174, 194, 200, 180, 201, 142, 153, 187, 173, 199, 143, 201 } Definition at line 250 of file spp_stream4.c. Referenced by Stream4InitReassembler(). |
|
Definition at line 76 of file inline.h. Referenced by ReassembleStream4(). |
|
Definition at line 379 of file spp_stream4.c. |
|
Definition at line 382 of file spp_stream4.c. |
|
Definition at line 377 of file spp_stream4.c. |
|
Definition at line 366 of file spp_stream4.c. Referenced by PruneCheck(). |
|
Definition at line 376 of file spp_stream4.c. Referenced by DeleteSession(), Stream4CleanExitFunction(), Stream4Init(), and Stream4RestartFunction(). |
|
Definition at line 357 of file spp_stream4.c. |
|
Definition at line 378 of file spp_stream4.c. Referenced by CleanHashTable(), CreateNewSession(), DropSession(), KillSpd(), PrintSessionCache(), PruneCheck(), PruneSessionCache(), SafeAlloc(), SegmentCleanTraverse(), StoreStreamPkt(), StreamSegmentAdd(), and StreamSegmentSub(). |
|
Definition at line 369 of file spp_stream4.c. |