MCPcopy Index your code

hub / github.com/cowrie/cowrie / functions

Functions2,302 in github.com/cowrie/cowrie

↓ 484 callersMethodget
(self, section: str, option: str, *, raw: bool = False, **kwargs)
src/cowrie/core/config.py:39
↓ 429 callersMethodwrite
Handle a general event within the output plugin
src/cowrie/core/output.py:121
↓ 323 callersMethodlineReceived
(self, line: str)
src/cowrie/commands/wc.py:127
↓ 238 callersMethoderrorWrite
Write errors to the user on stderr
src/cowrie/shell/command.py:95
↓ 198 callersMethodexit
(self, code: int | None = None)
src/cowrie/commands/curl.py:349
↓ 85 callersMethodexists
Return True if path refers to an existing path. Returns False for broken symbolic links.
src/cowrie/shell/fs.py:244
↓ 73 callersMethodclear
(self)
src/cowrie/test/fake_transport.py:158
↓ 50 callersMethodresolve_path
This function does not need to be in this class, it has no dependencies
src/cowrie/shell/fs.py:153
↓ 49 callersMethodwriteBytes
Like write() but input is bytes
src/cowrie/shell/command.py:89
↓ 47 callersMethodmakeConnection
(self, transport: object)
src/cowrie/test/test_telnet_transport.py:128
↓ 43 callersMethodgetfile
This returns the Cowrie file system object for a path
src/cowrie/shell/fs.py:274
↓ 42 callersMethodextract_string
note: this actually returns bytes!
src/cowrie/ssh_proxy/protocols/base_protocol.py:44
↓ 37 callersMethodremove
(self, path: str)
src/cowrie/shell/fs.py:565
↓ 35 callersMethodread
(self, fd: int, n: int)
src/cowrie/shell/fs.py:480
↓ 35 callersMethodrun_line
(self, line: bytes)
src/cowrie/test/test_exit_status.py:37
↓ 32 callersMethodconnectionLost
(self, reason)
src/cowrie/test/test_ssh_teardown.py:24
↓ 29 callersMethodnext
(self)
src/cowrie/shell/bashparse.py:358
↓ 29 callersMethodparse
Parse ``line`` into ordered statements. Raises nothing for input the grammar rejects: it returns a single :class:`SyntaxError_` with
src/cowrie/shell/bashparse.py:372
↓ 28 callersMethod_run
(self, line: str)
src/cowrie/test/test_flow_control.py:36
↓ 28 callersMethodextract_int
(self, length: int)
src/cowrie/ssh_proxy/protocols/base_protocol.py:35
↓ 28 callersMethodwrite
(self, fd: int, string: bytes)
src/cowrie/shell/fs.py:484
↓ 27 callersFunctionescape_nonprintable
Return a log-safe printable representation of arbitrary bytes. Bytes outside printable US-ASCII (0x20-0x7e) are rendered as ``\\xNN`` so cont
src/cowrie/core/utils.py:18
↓ 27 callersMethodisdir
Return True if path is an existing directory. This follows symbolic links, so both islink() and isdir() can be true for the same path
src/cowrie/shell/fs.py:421
↓ 27 callersMethodloseConnection
(self)
src/cowrie/shell/session.py:39
↓ 26 callersMethodcallback
(data)
src/cowrie/test/proxy_compare.py:91
↓ 26 callersMethodexit
Sometimes client is disconnected and command exits after. So cmdstack is gone ``code`` sets this command's exit status (``$?`` for t
src/cowrie/shell/command.py:123
↓ 26 callersMethodpeek
(self, ahead: int = 0)
src/cowrie/shell/bashparse.py:354
↓ 26 callersMethodwrite
(self, data: bytes)
src/cowrie/test/test_insults.py:26
↓ 25 callersMethodclose
(self, keepEmpty: bool = False)
src/cowrie/core/artifact.py:73
↓ 24 callersMethod_status
Run ``line`` then return what ``echo $?`` prints (without the prompt).
src/cowrie/test/test_test_builtin.py:36
↓ 24 callersMethodmkdir
( self, path: str, uid: int, gid: int, size: int, mode: int,
src/cowrie/shell/fs.py:367
↓ 23 callersMethod_advance
Run the next queued command, or finish when the queue is drained. This is a trampoline. A command that completes synchronously calls
src/cowrie/shell/honeypot.py:263
↓ 22 callersFunctionformatOCSF
Take a Cowrie logentry and turn it into an OCSF event (a dict ready to be json.dumps'd by the output plugin). OCSF is a JSON schema, not
src/cowrie/core/ocsf.py:338
↓ 22 callersMethodget_path
This returns the Cowrie file system objects for a directory
src/cowrie/shell/fs.py:215
↓ 20 callersFunctiongetpath
(fs, path)
src/cowrie/scripts/fsctl.py:61
↓ 20 callersMethodparse_redirections
Parse arguments for redirections and return cleaned args and ordered redirection operations.
src/cowrie/shell/parser.py:23
↓ 20 callersMethodrun_line
Send one line, return only the bytes it produced (prompt stripped).
src/cowrie/test/test_shell_variables.py:36
↓ 19 callersFunctionexists
(fs, path)
src/cowrie/scripts/fsctl.py:77
↓ 19 callersMethodexit
(self, code: int | None = None)
src/cowrie/commands/wget.py:442
↓ 18 callersMethodfile_contents
Retrieve the content of a file in the honeyfs It follows links. It retrieves the content in this order 1) if there's
src/cowrie/shell/fs.py:313
↓ 17 callersMethodsimpleQuery
(self, sql, args)
src/cowrie/output/postgresql.py:78
↓ 17 callersMethodsimpleQuery
Just run a deferred sql query, only care about errors
src/cowrie/output/mysql.py:103
↓ 16 callersFunctionresolve_reference
Used to resolve a current working directory and a relative reference into an absolute file reference.
src/cowrie/scripts/fsctl.py:101
↓ 16 callersMethodwrite
Called when we send data to the user @type data: L{bytes} @param data: Data sent to the client from the server
src/cowrie/ssh/channel.py:100
↓ 15 callersFunction_dir_entry
Build a T_DIR entry.
src/cowrie/test/test_honeyfs.py:28
↓ 15 callersMethodhas_option
( # type: ignore[override,unused-ignore] self, section: str, option: str )
src/cowrie/core/config.py:32
↓ 15 callersMethodsimpleQuery
Just run a deferred sql query, only care about errors
src/cowrie/output/sqlite.py:51
↓ 15 callersMethodsleep
(self, time: float, time2: float | None = None)
src/cowrie/commands/yum.py:63
↓ 14 callersFunction_root
Build the root pickle entry (a T_DIR named '/').
src/cowrie/test/test_honeyfs.py:38
↓ 14 callersFunctioncommunication_allowed
Return True if communication to this address is allowed, False if blocked (for both IPs and DNS names).
src/cowrie/core/network.py:99
↓ 14 callersMethodisfile
Return True if path is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same
src/cowrie/shell/fs.py:391
↓ 14 callersMethodloseConnection
(self)
src/cowrie/telnet/session.py:167
↓ 14 callersMethodmkfile
args must be a list of arguments
src/cowrie/scripts/fsctl.py:458
↓ 13 callersMethod_absPath
(self, path)
src/cowrie/shell/filetransfer.py:188
↓ 13 callersMethod_tokens
(self, line: str)
src/cowrie/test/test_bashparse.py:93
↓ 13 callersMethodcheck
Check if a request for the given key is allowed. Args: key: The key to check (e.g., hostname, IP address) Retur
src/cowrie/core/rate_limiter.py:43
↓ 13 callersMethodgetPeer
Fake function for mockup.
src/cowrie/test/fake_transport.py:38
↓ 12 callersMethod_keyword
(self, node: Tree | Token | None)
src/cowrie/shell/bashparse.py:420
↓ 12 callersMethod_token_type
(node: Tree | Token | None)
src/cowrie/shell/bashparse.py:393
↓ 12 callersMethodexit
(self, status: int = 0, msg: str | None = None)
src/cowrie/commands/iptables.py:33
↓ 12 callersFunctionget_endpoints_from_section
( cfg: configparser.ConfigParser, section: str, default_port: int )
src/cowrie/core/utils.py:124
↓ 11 callersMethod_eval
(self, statement: object)
src/cowrie/test/test_bashparse.py:190
↓ 11 callersMethod_one
(self, line: str)
src/cowrie/test/test_bashparse.py:314
↓ 11 callersMethodconnect
(self, host, port, username, password)
src/backend_pool/telnet_exec.py:138
↓ 10 callersMethod_base_event
(self, eventid: str)
src/cowrie/test/test_signal.py:27
↓ 10 callersMethodgetHost
Return the host from my session's transport.
src/cowrie/telnet/session.py:149
↓ 10 callersMethodgetPeer
Return the peer from my session's transport.
src/cowrie/telnet/session.py:155
↓ 10 callersMethodinsert_one
(self, collection, event)
src/cowrie/output/mongodb.py:20
↓ 10 callersMethodlistdir
(self, path: str)
src/cowrie/shell/fs.py:594
↓ 10 callersMethodrename
(self, oldpath: str, newpath: str)
src/cowrie/shell/fs.py:582
↓ 10 callersMethodsave_pickle
saves the current file system to the pickle :return:
src/cowrie/scripts/fsctl.py:179
↓ 10 callersMethodupdate_realfile
(self, f: Any, realfile: str)
src/cowrie/shell/fs.py:264
↓ 9 callersFunction_find_child
(parent_contents, name)
src/cowrie/test/test_createfs.py:19
↓ 9 callersMethod_parse_list
Parse statements separated by ``;`` / newline / ``&&`` / ``||`` until a reserved stop word, a ``)`` / ``;;`` token, or the end of input.
src/cowrie/shell/bashparse.py:424
↓ 9 callersMethod_parse_new_environ_data
Parse NEW-ENVIRON subnegotiation data into a dictionary. Format: [VAR|USERVAR name VALUE value]* with ESC for escaping.
src/cowrie/telnet/userauth.py:253
↓ 9 callersMethod_patch_tree
(self, root: list)
src/cowrie/test/test_honeyfs.py:61
↓ 9 callersMethodevaluate
Expand a command's words against the live context, now. Operator strings pass through; each word tree is evaluated against the curren
src/cowrie/shell/bashparse.py:777
↓ 9 callersFunctionis_executable_binary
Return True if ``contents`` looks like a binary executable, not a script. A shell script is text: ASCII, or otherwise valid UTF-8. So anything wi
src/cowrie/shell/script.py:55
↓ 9 callersMethodprocessEnded
(self, reason: failure.Failure)
src/cowrie/shell/pipe.py:318
↓ 9 callersMethodwrite
(self, data)
src/cowrie/llm/telnet.py:124
↓ 8 callersMethod_build_headers
Build common HTTP headers for VT API requests
src/cowrie/output/virustotal.py:148
↓ 8 callersFunction_file_entry
Build a T_FILE pickle entry: [name, T_FILE, uid, gid, size, mode, ctime, contents, target, realfile].
src/cowrie/test/test_honeyfs.py:22
↓ 8 callersMethod_make_request
Make an HTTP request with standard error handling Args: method: HTTP method (GET, POST, etc) url: Full URL t
src/cowrie/output/virustotal.py:162
↓ 8 callersMethod_tokens
(self, line: str)
src/cowrie/test/test_bashparse.py:53
↓ 8 callersMethodflush
Mark rules as flushed
src/cowrie/commands/iptables.py:420
↓ 8 callersMethodgetHost
(self)
src/cowrie/llm/telnet.py:118
↓ 8 callersFunctionget_config
Create ConfigParser from a config_string.
src/cowrie/test/test_utils.py:22
↓ 8 callersMethodget_guest_states
(self, states: list[str])
src/backend_pool/pool_service.py:218
↓ 8 callersMethodload
Load /etc/group
src/cowrie/shell/pwd.py:141
↓ 8 callersMethodlogDispatch
Use logDispatch when the HoneypotTransport prefix is not available. Here you can explicitly set the sessionIds to tie the sessions to
src/cowrie/core/output.py:97
↓ 8 callersMethodlstat
(self, path: str)
src/cowrie/shell/fs.py:598
↓ 8 callersMethodrun
(self, application, jidstr, password, muc, server)
src/cowrie/output/xmpp.py:79
↓ 8 callersMethodsendPacket
Override because OpenSSH pads with 0 on KEXINIT
src/cowrie/ssh_proxy/server_transport.py:276
↓ 8 callersMethodtelnet_NEW_ENVIRON
Handle NEW-ENVIRON (RFC 1572) subnegotiation. Parses environment variables sent by the client and logs them. Also detects CV
src/cowrie/telnet/userauth.py:178
↓ 8 callersMethodwillChain
(self, option)
src/cowrie/telnet/transport.py:139
↓ 7 callersFunction_dir_entry
Build a T_DIR entry.
src/cowrie/test/test_fsctl.py:23
↓ 7 callersMethod_expect
(self, cursor: _Cursor, keyword: str)
src/cowrie/shell/bashparse.py:743
↓ 7 callersMethod_state
(self, session: str)
src/cowrie/output/dshield.py:79
↓ 7 callersMethod_tokens
(self, line: str)
src/cowrie/test/test_bashparse.py:143
↓ 7 callersMethod_unexpected
(self, line: str, cursor: _Cursor)
src/cowrie/shell/bashparse.py:749
next →1–100 of 2,302, ranked by callers