Comments (3)
There's a fundamental issue with doing this: if a host does not have bash installed or some error is encountered, it's going to print the IP address of the host because that's all the calling host knows (A->B, if B fails for some reason, A will print the ip address used to connect to B) -- see all of the "exceptional" errors here: https://github.com/MegaManSec/SSH-Snake/blob/main/OUTPUT.md
However, if you do really want to do this, you can either:
- Change https://github.com/MegaManSec/SSH-Snake/blob/main/Snake.sh#L732 to
hostnames_chain="$hostnames_chain${hostnames_chain:+->}$user@("$(hostname"))"
- Use custom_cmds to print the values.
custom_cmds=('echo "$hostnames_chain${hostnames_chain:+->}$user@("$(hostname)")"')
may work (untested, but if it does work, please let me know). You'd then have to filter out these values from the output and run the python script with just those values.
from ssh-snake.
custom_cmds=('echo "$hostnames_chain${hostnames_chain:+->}$user@("$(hostname)")"')
works, but then you need to modify the python script:
diff --git a/tools/generate-graph.py b/tools/generate-graph.py
index 48d4480..c969ff5 100755
--- a/tools/generate-graph.py
+++ b/tools/generate-graph.py
@@ -19,10 +19,10 @@ def build_lookup_table(input_lines, ignore_dest_user, dot):
line = line.strip()
line = re.sub(r"^\[?\d+\]?\s*", "", line)
- if ": " in line or "]->" not in line or not line[-2].isdigit() or not line[-1] == ')':
+ if ": " in line or "]->" not in line or not line[-1] == ')':
continue
- pattern = re.compile(r"(\w+)@\(([\d\.:]+)\)(\[[^\]]+\])->(?=(\w+)@\(([\d\.:]+)\))")
+ pattern = re.compile(r"(\w+)@\(([a-zA-Z0-9_-]+)\)(\[[^\]]+\])->(?=(\w+)@\(([a-zA-Z0-9_-]+)\))")
matches = re.finditer(pattern, line)
previous_dest_host = None
from ssh-snake.
Closing since I think this is answered.
from ssh-snake.
Related Issues (13)
- Syntax Error in No-Comments Version HOT 2
- SSH Snake
- Consider implementing support for GSSAPI (Kerberos) auth
- Sud-ouest
- Syntax error HOT 3
- Find Symlinked Keys HOT 1
- Bash'ism: This script is particularly bash specific. HOT 1
- Linux machine specifics. HOT 1
- Error with pydot in generate-graph.py HOT 1
- Issues on older systems HOT 12
- this is awesome HOT 1
- License Conflict or Dual License? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssh-snake.