LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback
User Name
Password
LQ Suggestions & Feedback Do you have a suggestion for this site or an idea that will make the site better? This forum is for you.
PLEASE READ THIS FORUM - Information and status updates will also be posted here.

Notices


Reply
  Search this Thread
Old 01-04-2017, 10:10 PM   #31
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Original Poster
Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694

Newest version up https://github.com/boardstretcher/ldebug

Added networking and firewall sections.

What I would like is a bash obfuscator function (maybe sed based) for networking information. If the IP address is private (e.g 10.x, 172.x, 192.x) then leave it alone. No problem. If the IP address is non-private then obfuscate with an identifier (IP-ADDRESS-01, IP-ADDRESS-02) so if we had to read the routes/interfaces, it would make sense while not damaging privacy.

Ideas?

Last edited by szboardstretcher; 01-04-2017 at 10:14 PM.
 
Old 01-05-2017, 04:54 AM   #32
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
*LOVE* your idea of contributing LQdebug, for posters to collect 'essential' info.
Trying it on Void7.1 VBox (XP netbook host). cf myBlog VBox Networking

sh ldebug.sh (skipped chmod; thinking -vx). Oh I see: (make EXAMPLE -n [?])


-n Works great! A bit overly-verbose. *Does it work if no `ip` cmd eg Vector?
-s Ditto. Summary?: lsblk -fp;df -Th `mount|grep ^/|cut -f1 -d' '` ; -l ok/none
-f OOOPS! I don't have: systemctl service firewall-cmd iptables! I need -f! ufw?
-g ok but I'd suggest more: maybe: #procs; top; ...TBD. inxi? No: +X11=+100MB!
-H ok. I don't have lsusb; rare issue. Is lsmod 'that' useful? lspci -k ?

AntiX-16core wget wouldn't work without: --no-check-certificate
2nd IPTABLES ### worked, but 1st said: iptables: unrecognized service
-l: all 4 cmds not found.

-p pkg mgr TBD! -i? info on which type of init 'system'? &configs/services? (runlevel n/a?)

I can try other distros if you PM me. I'll *edit*in updates to this post, so as not to clutter thread. (suse; Manjaro=arch? Mandriva? bsd? puppy? android? tc/dsl? gentoo? 4M? LFS?

Again, a zillion 'kudos' for this work!!!

Last edited by Jjanel; 01-13-2017 at 02:37 AM.
 
1 members found this post helpful.
Old 01-05-2017, 05:20 AM   #33
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
If the IP address is non-private then obfuscate with an identifier (IP-ADDRESS-01, IP-ADDRESS-02) so if we had to read the routes/interfaces, it would make sense while not damaging privacy.

Ideas?
firewall output may be "sensitive"?
firewalld required for iptables-type 'dump'?
"systemctl: not found", so systemd?
Code:
cat /proc/1/comm
Lemme spin up another "recent" VM and dork around.
Most of my assets are Virtual and very few actual systems. Well, that is what I 'do'.
#IhazVariants

Good work.

Subscribed...

Last edited by Habitual; 01-05-2017 at 05:22 AM.
 
1 members found this post helpful.
Old 01-05-2017, 08:15 AM   #34
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Original Poster
Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
As I've been writing this, in Centos 7, I've wondered often if it would be best to stick to /proc/ directory output rather than relying on tools that might or might not be available in non-Rhel/Debian distributions.
 
Old 01-05-2017, 11:50 AM   #35
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Line 52 in your code should be changed from
Code:
ouput LSBLK
to
Code:
output LSBLK
On a side note, love this script!!
 
1 members found this post helpful.
Old 01-05-2017, 12:49 PM   #36
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Original Poster
Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Thanks for that lazydog. Fixed.

I have written an obfuscation function for ip related information:

Code:
obfuscate(){
        local tmp=$(mktemp /tmp/ldebug-obf.XXXXX)
        local ips
        local uniqips
        local count=0

        printf "%s" "$1" > $tmp

        ips=$(printf "%s" "$1" | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*')
        uniqips=$(printf "%s \n" "$ips" | sort | uniq)

        printf "%s" "$uniqips" | while IFS=" " read -r ip; do
                sed -i "s/$ip/IP-ADD-0$count/g" $tmp
                ((count++))
        done

        cat "$tmp"
        rm -f "$tmp"
}
If you want to see it work without using the ldebug.sh script, copy and paste the function into (centos 7) bash and run:

Code:
output=$(ip a); obfuscate "$output"
Any suggestions?

Last edited by szboardstretcher; 01-05-2017 at 12:51 PM.
 
Old 01-05-2017, 06:10 PM   #37
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
I just run this script on my gentoo system and everything worked except the firewall calls as i'm not running systemctl or firewalld on this system.

Code:
# ./ldebug -fZ
./ldebug: line 97: systemctl: command not found
./ldebug: line 100: systemctl: command not found
./ldebug: line 101: firewall-cmd: command not found
./ldebug: line 105: firewall-cmd: command not found
Maybe if you could run some sort of check for this before looking for the firewall setup so that the correct commands are run.
 
Old 01-05-2017, 06:55 PM   #38
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,360
Blog Entries: 28

Rep: Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148
I've been knocked a loop by something's that going 'round in these parts.

I hope to be sentient soon.
 
Old 01-05-2017, 07:30 PM   #39
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,144
Blog Entries: 21

Rep: Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482Reputation: 3482
Copy and pasted and shared at http://sprunge.us/USWd

.

Last edited by rokytnji; 01-05-2017 at 07:32 PM.
 
Old 01-06-2017, 12:05 PM   #40
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Original Poster
Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Lazydog:

1) Not going to check for commands. You can infer a lot from missing commands. Its good information.
2) I mentioned that I am writing this in Centos. Not gentoo. If you want a command added that you think would help, offer it up, or create a pull request on github.
 
1 members found this post helpful.
Old 01-06-2017, 01:39 PM   #41
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Original Poster
Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Requesting specific help with the script here: http://www.linuxquestions.org/questi...49#post5651349

Since this thread has grown beyond the original question. Thank you for your interest in this pet project. PLEASE think about contributing your expertise to the script on Github. It would be great to have a few LQ members that are interested in the project actually team up on Github to help.

I've got to a great start, anyone can contribute via pull requests. Look forward to your input.

https://github.com/boardstretcher/ldebug

Last edited by szboardstretcher; 01-06-2017 at 01:52 PM.
 
Old 01-07-2017, 12:37 AM   #42
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
Change IPTABLES STATUS to IPTABLES_STATUS (4 of these), because output takes only 1 (1st) %s.

I just realized how this can be used by someone with no internet working
and/or minimal experience (no wget), wondering 'what debug-info to post?':
simply the link to the source can be given, as a research suggestion!
"Spend a few minutes looking at the get_...() functions here; web-search: man <cmd>"

Last edited by Jjanel; 01-07-2017 at 12:44 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Basic troubleshooting AIO RDO Havana Instance on CentOS 6.5 LXer Syndicated Linux News 0 04-29-2014 09:41 AM
Performance troubleshooting tool amoralejo Linux - Server 4 02-01-2009 12:26 PM
LXer: Basic Veritas Cluster Server Troubleshooting http LXer Syndicated Linux News 0 11-14-2008 11:20 AM
LXer: traceroute - a very useful troubleshooting tool which reveals the bottlenecks on the Internet LXer Syndicated Linux News 0 01-18-2007 12:33 PM
Basic Sound troubleshooting steps? penguinlnx Linux - Software 3 03-16-2005 12:49 AM

LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback

All times are GMT -5. The time now is 08:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration